Rollup merge of #124099 - voidc:disallow-ambiguous-expr-attrs, r=davidtwco

Disallow ambiguous attributes on expressions

This implements the suggestion in [#15701](https://github.com/rust-lang/rust/issues/15701#issuecomment-2033124217) to disallow ambiguous outer attributes on expressions. This should resolve one of the concerns blocking the stabilization of `stmt_expr_attributes`.
This commit is contained in:
Matthias Krüger 2024-04-23 12:10:26 +02:00 committed by GitHub
commit 9c0e5f2c34
2 changed files with 4 additions and 4 deletions

View File

@ -214,8 +214,8 @@ pub struct Params {
// #3313
fn stmt_expr_attributes() {
let foo ;
#[must_use]
foo = false ;
(#[must_use]
foo) = false ;
}
// #3509

View File

@ -248,8 +248,8 @@ pub struct Params {
// #3313
fn stmt_expr_attributes() {
let foo;
#[must_use]
foo = false;
(#[must_use]
foo) = false;
}
// #3509