https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107633
Bug ID: 107633 Summary: [13 regression] Bootstrap failure due to -Werror=unused-parameter and -Werror=dangling-reference Product: gcc Version: 13.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: rust Assignee: unassigned at gcc dot gnu.org Reporter: ro at gcc dot gnu.org CC: dkm at gcc dot gnu.org Target Milestone: --- Host: i386-pc-solaris2.11 Target: i386-pc-solaris2.11 Build: i386-pc-solaris2.11 I just tried bootstrapping the current devel/rust/master branch on Solaris/x86, but ran into quite number of failues: * For one, there were hundreds of instances of -Werror=unused-parameter, e.g. /vol/gcc/src/hg/master/rust/gcc/rust/lex/rust-lex.cc: In member function 'std::tuple<Rust::Codepoint, int, bool> Rust::Lexer::parse_utf8_escape(char)': /vol/gcc/src/hg/master/rust/gcc/rust/lex/rust-lex.cc:1326:32: error: unused parameter 'opening_char' [-Werror=unused-parameter] 1326 | Lexer::parse_utf8_escape (char opening_char) | ~~~~~^~~~~~~~~~~~ /vol/gcc/src/hg/master/rust/gcc/rust/ast/rust-ast-dump.cc: In member function 'virtual void Rust::AST::Dump::visit(Rust::AST::AttrInputMetaItemContainer&)': /vol/gcc/src/hg/master/rust/gcc/rust/ast/rust-ast-dump.cc:243:42: error: unused parameter 'input' [-Werror=unused-parameter] 243 | Dump::visit (AttrInputMetaItemContainer &input) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~ * With those worked around (see below), there still a couple of -Werror=dangling-reference errors: /vol/gcc/src/hg/master/rust/gcc/rust/typecheck/rust-hir-type-check-type.cc: In member function 'Rust::TyTy::BaseType* Rust::Resolver::TypeCheckType::resolve_segments(Rust::NodeId, Rust::HirId, std::vector<std::unique_ptr<Rust::HIR::TypePathSegment> >&, std::size_t, Rust::TyTy::BaseType*, const Rust::Analysis::NodeMapping&, Location)': /vol/gcc/src/hg/master/rust/gcc/rust/typecheck/rust-hir-type-check-type.cc:465:13: error: possibly dangling reference to a temporary [-Werror=dangling-reference] 465 | auto &candidate = *candidates.begin (); | ^~~~~~~~~ /vol/gcc/src/hg/master/rust/gcc/rust/typecheck/rust-hir-type-check-type.cc:465:44: note: the temporary was destroyed at the end of the full expression 'candidates.std::set<Rust::Resolver::PathProbeCandidate>::begin().std::_Rb_tree_const_iterator<Rust::Resolver::PathProbeCandidate>::operator*()' 465 | auto &candidate = *candidates.begin (); | I've hacked around both by adding -Wno-error=unused-parameter -Wno-error=dangling-reference to gcc/rust/Make-lang.in (RUST_CXXFLAGS), but this is supposed to work out of the box. The build is in stage 2 now.