Skip to content
Merged
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
2 changes: 2 additions & 0 deletions gcc/rust/ast/rust-ast-visitor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1029,6 +1029,8 @@ void
DefaultASTVisitor::visit (AST::TraitItemType &item)
{
visit_outer_attrs (item);
for (auto &generic : item.get_generic_params ())
visit (generic);
for (auto &bound : item.get_type_param_bounds ())
visit (bound);
}
Expand Down
5 changes: 0 additions & 5 deletions gcc/rust/expand/rust-expand-visitor.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,6 @@

namespace Rust {

/**
* Whether or not an attribute is a derive attribute
*/
bool is_derive (AST::Attribute &attr);

/**
* Whether or not an attribute is builtin
*/
Expand Down
2 changes: 1 addition & 1 deletion gcc/rust/hir/rust-ast-lower-item.cc
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ ASTLoweringItem::visit (AST::Function &function)
continue;
}

auto param = static_cast<AST::FunctionParam &> (*p);
auto &param = static_cast<AST::FunctionParam &> (*p);

auto translated_pattern = std::unique_ptr<HIR::Pattern> (
ASTLoweringPattern::translate (param.get_pattern ()));
Expand Down
4 changes: 1 addition & 3 deletions gcc/rust/resolve/rust-name-resolver.cc
Original file line number Diff line number Diff line change
Expand Up @@ -282,9 +282,7 @@ Resolver::Resolver ()
label_scope (Scope (mappings.get_current_crate ())),
macro_scope (Scope (mappings.get_current_crate ())),
global_type_node_id (UNKNOWN_NODEID), unit_ty_node_id (UNKNOWN_NODEID)
{
generate_builtins ();
}
{}

Resolver *
Resolver::get ()
Expand Down
2 changes: 2 additions & 0 deletions gcc/rust/util/rust-hir-map.cc
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,8 @@ NodeId
Mappings::get_next_node_id ()
{
auto it = nodeIdIter;
if (UNLIKELY (it > MAX_NODEID))
rust_fatal_error (UNKNOWN_LOCATION, "out of node ids");
nodeIdIter++;
return it;
}
Expand Down
1 change: 1 addition & 0 deletions gcc/rust/util/rust-mapping-common.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ struct DefId

#define UNKNOWN_CRATENUM ((uint32_t) (UINT32_MAX))
#define UNKNOWN_NODEID ((uint32_t) (UINT32_MAX))
#define MAX_NODEID (UNKNOWN_NODEID - 1)
#define UNKNOWN_HIRID ((uint32_t) (UINT32_MAX))
#define UNKNOWN_LOCAL_DEFID ((uint32_t) (0))
#define UNKNOWN_DEFID (DefId{0, 0})
Expand Down