diff options
author | Philip Herron <philip.herron@embecosm.com> | 2021-01-08 17:18:00 +0000 |
---|---|---|
committer | Philip Herron <herron.philip@googlemail.com> | 2021-01-10 15:59:22 +0000 |
commit | 9a3ad294e0af5ed45b53c340382a7806fb150bdf (patch) | |
tree | 81458d62a2191b38be775026f2f8583d3ca7c2ee /gcc/rust/backend/rust-compile.cc | |
parent | 0f42a240e53e932de0ae4799d54fe0bd15d06047 (diff) | |
download | gcc-9a3ad294e0af5ed45b53c340382a7806fb150bdf.zip gcc-9a3ad294e0af5ed45b53c340382a7806fb150bdf.tar.gz gcc-9a3ad294e0af5ed45b53c340382a7806fb150bdf.tar.bz2 |
Add in a check for unused decls within ribs.
This lead to cleanup of the name resolver as the usage of mappings means
that in a given rib if there are no references to a decl NodeId that
means it was not used.
To get on par with the offical rust compiler it should be allowed to have
a reference where the name was assigned but not used but this might be a seperate pass.
Diffstat (limited to 'gcc/rust/backend/rust-compile.cc')
-rw-r--r-- | gcc/rust/backend/rust-compile.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/rust/backend/rust-compile.cc b/gcc/rust/backend/rust-compile.cc index a52f183..3f8a962 100644 --- a/gcc/rust/backend/rust-compile.cc +++ b/gcc/rust/backend/rust-compile.cc @@ -64,7 +64,7 @@ CompileBlock::visit (HIR::BlockExpr &expr) } std::vector<Bvariable *> locals; - rib->iterate_decls ([&] (NodeId n) mutable -> bool { + rib->iterate_decls ([&] (NodeId n, Location) mutable -> bool { Resolver::Definition d; bool ok = ctx->get_resolver ()->lookup_definition (n, &d); rust_assert (ok); |