diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2024-04-23 12:10:26 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-04-23 12:10:26 +0200 |
| commit | 57dad1d75e562ff73051c1c43b07eaf65c7dbd74 (patch) | |
| tree | 3d2b11b07ce320566e8160c45635b3c67721d9b7 /src/tools/rustfmt | |
| parent | 36316df9fe6c3e246153fe6e78967643cf08c148 (diff) | |
| parent | 5af861cf7b4a87857ca6aa9dab2ad277ea8c059b (diff) | |
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`.
Diffstat (limited to 'src/tools/rustfmt')
| -rw-r--r-- | src/tools/rustfmt/tests/source/attrib.rs | 4 | ||||
| -rw-r--r-- | src/tools/rustfmt/tests/target/attrib.rs | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/tools/rustfmt/tests/source/attrib.rs b/src/tools/rustfmt/tests/source/attrib.rs index d45fba55224..fc13cd02b03 100644 --- a/src/tools/rustfmt/tests/source/attrib.rs +++ b/src/tools/rustfmt/tests/source/attrib.rs @@ -214,8 +214,8 @@ type Os = NoSource; // #3313 fn stmt_expr_attributes() { let foo ; - #[must_use] - foo = false ; + (#[must_use] + foo) = false ; } // #3509 diff --git a/src/tools/rustfmt/tests/target/attrib.rs b/src/tools/rustfmt/tests/target/attrib.rs index 7e61f68d76a..7b3309676de 100644 --- a/src/tools/rustfmt/tests/target/attrib.rs +++ b/src/tools/rustfmt/tests/target/attrib.rs @@ -248,8 +248,8 @@ type Os = NoSource; // #3313 fn stmt_expr_attributes() { let foo; - #[must_use] - foo = false; + (#[must_use] + foo) = false; } // #3509 |
