Skip to content

Commit

Permalink
Rollup merge of #124099 - voidc:disallow-ambiguous-expr-attrs, r=davi…
Browse files Browse the repository at this point in the history
…dtwco

Disallow ambiguous attributes on expressions

This implements the suggestion in [#15701](rust-lang/rust#15701 (comment)) to disallow ambiguous outer attributes on expressions. This should resolve one of the concerns blocking the stabilization of `stmt_expr_attributes`.
  • Loading branch information
matthiaskrgr authored Apr 23, 2024
2 parents 932f3ab + 966dd60 commit 9c0e5f2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions tests/source/attrib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,8 @@ type Os = NoSource;
// #3313
fn stmt_expr_attributes() {
let foo ;
#[must_use]
foo = false ;
(#[must_use]
foo) = false ;
}

// #3509
Expand Down
4 changes: 2 additions & 2 deletions tests/target/attrib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,8 @@ type Os = NoSource;
// #3313
fn stmt_expr_attributes() {
let foo;
#[must_use]
foo = false;
(#[must_use]
foo) = false;
}

// #3509
Expand Down

0 comments on commit 9c0e5f2

Please sign in to comment.