Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #2667 #2670

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions gcc/rust/ast/rust-ast-fragment.cc
Original file line number Diff line number Diff line change
Expand Up @@ -153,14 +153,12 @@ void
Fragment::assert_single_fragment (SingleASTNode::NodeType expected) const
{
static const std::map<SingleASTNode::NodeType, const char *> str_map = {
{SingleASTNode::NodeType::IMPL, "impl"},
{SingleASTNode::NodeType::ASSOC_ITEM, "assoc item"},
{SingleASTNode::NodeType::ITEM, "item"},
{SingleASTNode::NodeType::TYPE, "type"},
{SingleASTNode::NodeType::EXPRESSION, "expr"},
{SingleASTNode::NodeType::STMT, "stmt"},
{SingleASTNode::NodeType::EXTERN, "extern"},
{SingleASTNode::NodeType::TRAIT, "trait"},
{SingleASTNode::NodeType::TRAIT_IMPL, "trait impl"},
};

auto actual = nodes[0].get_kind ();
Expand Down
4 changes: 1 addition & 3 deletions gcc/rust/ast/rust-ast-full-decls.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,7 @@ class Lifetime;
class GenericParam;
class LifetimeParam;
class ConstGenericParam;
class TraitItem;
class InherentImplItem;
class TraitImplItem;
class AssociatedItem;
struct Crate;
class PathExpr;

Expand Down
4 changes: 2 additions & 2 deletions gcc/rust/ast/rust-ast.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3458,14 +3458,14 @@ Module::process_file_path ()
bool no_candidates_found = !file_mod_found && !dir_mod_found;

if (multiple_candidates_found)
rust_error_at (locus,
rust_error_at (get_locus (),
"two candidates found for module %s: %s.rs and %s%smod.rs",
module_name.as_string ().c_str (),
module_name.as_string ().c_str (),
module_name.as_string ().c_str (), file_separator);

if (no_candidates_found)
rust_error_at (locus, "no candidate found for module %s",
rust_error_at (get_locus (), "no candidate found for module %s",
module_name.as_string ().c_str ());

if (no_candidates_found || multiple_candidates_found)
Expand Down
Loading
Loading