Skip to content

Commit edc4a95

Browse files
bors[bot]tschwinge
andauthored
Merge #348
348: Address miscellaneous '-Werror=unused-parameter' diagnostics [#336] r=philberty a=tschwinge #336 In file included from [...]/gcc/rust/ast/rust-ast-full.h:23, from [...]/gcc/rust/parse/rust-parse.h:21, from [...]/gcc/rust/rust-session-manager.cc:34: [...]/gcc/rust/ast/rust-expr.h: In member function ‘virtual void Rust::AST::RangeExpr::set_outer_attrs(std::vector<Rust::AST::Attribute>)’: [...]/gcc/rust/ast/rust-expr.h:3220:48: error: unused parameter ‘new_attrs’ [-Werror=unused-parameter] 3220 | void set_outer_attrs (std::vector<Attribute> new_attrs) override | ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~ [...]/gcc/rust/ast/rust-expr.h: In constructor ‘Rust::AST::IfLetExpr::IfLetExpr(std::vector<std::unique_ptr<Rust::AST::Pattern> >, std::unique_ptr<Rust::AST::Expr>, std::unique_ptr<Rust::AST::BlockExpr>, std::vector<Rust::AST::Attribute>, Location)’: [...]/gcc/rust/ast/rust-expr.h:4380:37: error: unused parameter ‘outer_attrs’ [-Werror=unused-parameter] 4380 | std::vector<Attribute> outer_attrs, Location locus) | ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~ In file included from [...]/gcc/rust/backend/rust-compile-context.h:27, from [...]/gcc/rust/backend/rust-compile.h:24, from [...]/gcc/rust/rust-session-manager.cc:41: [...]/gcc/rust/backend/rust-compile-tyty.h: In member function ‘virtual void Rust::Compile::TyTyCompile::visit(Rust::TyTy::FnPtr&)’: [...]/gcc/rust/backend/rust-compile-tyty.h:67:28: error: unused parameter ‘type’ [-Werror=unused-parameter] 67 | void visit (TyTy::FnPtr &type) override { gcc_unreachable (); } | ~~~~~~~~~~~~~^~~~ [...]/gcc/rust/rust-gcc.cc: In member function ‘virtual Btype* Gcc_backend::function_ptr_type(Btype*, const std::vector<Btype*>&, Location)’: [...]/gcc/rust/rust-gcc.cc:998:42: error: unused parameter ‘locus’ [-Werror=unused-parameter] 998 | Location locus) | ~~~~~~~~~^~~~~ [...]/gcc/rust/rust-lang.cc: In function ‘void grs_langhook_init_options_struct(gcc_options*)’: [...]/gcc/rust/rust-lang.cc:153:55: error: unused parameter ‘opts’ [-Werror=unused-parameter] 153 | grs_langhook_init_options_struct (struct gcc_options *opts) | ~~~~~~~~~~~~~~~~~~~~^~~~ Co-authored-by: Thomas Schwinge <[email protected]>
2 parents 9c97c85 + 114bd7b commit edc4a95

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

gcc/rust/ast/rust-expr.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3214,7 +3214,7 @@ class RangeExpr : public ExprWithoutBlock
32143214
Location get_locus_slow () const final override { return get_locus (); }
32153215

32163216
// should never be called - error if called
3217-
void set_outer_attrs (std::vector<Attribute> new_attrs) override
3217+
void set_outer_attrs (std::vector<Attribute> /* new_attrs */) override
32183218
{
32193219
rust_assert (false);
32203220
}
@@ -4374,7 +4374,7 @@ class IfLetExpr : public ExprWithBlock
43744374

43754375
IfLetExpr (std::vector<std::unique_ptr<Pattern> > match_arm_patterns,
43764376
std::unique_ptr<Expr> value, std::unique_ptr<BlockExpr> if_block,
4377-
std::vector<Attribute> outer_attrs, Location locus)
4377+
std::vector<Attribute> /* outer_attrs */, Location locus)
43784378
: match_arm_patterns (std::move (match_arm_patterns)),
43794379
value (std::move (value)), if_block (std::move (if_block)), locus (locus)
43804380
{}

gcc/rust/backend/rust-compile-tyty.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ class TyTyCompile : public TyTy::TyVisitor
6464

6565
void visit (TyTy::ParamType &) override { gcc_unreachable (); }
6666

67-
void visit (TyTy::FnPtr &type) override { gcc_unreachable (); }
67+
void visit (TyTy::FnPtr &) override { gcc_unreachable (); }
6868

6969
void visit (TyTy::FnType &type) override
7070
{

gcc/rust/rust-gcc.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -995,7 +995,7 @@ Gcc_backend::function_type (const Btyped_identifier &receiver,
995995
Btype *
996996
Gcc_backend::function_ptr_type (Btype *result_type,
997997
const std::vector<Btype *> &parameters,
998-
Location locus)
998+
Location /* locus */)
999999
{
10001000
tree args = NULL_TREE;
10011001
tree *pp = &args;

gcc/rust/rust-lang.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ grs_langhook_option_lang_mask (void)
150150

151151
/* Initialize the options structure. */
152152
static void
153-
grs_langhook_init_options_struct (struct gcc_options *opts)
153+
grs_langhook_init_options_struct (struct gcc_options * /* opts */)
154154
{
155155
// nothing yet - used by frontends to change specific options for the language
156156
session.init_options ();

0 commit comments

Comments
 (0)