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:
commit
57dad1d75e
15 changed files with 141 additions and 49 deletions
|
@ -495,6 +495,15 @@ pub(crate) struct OuterAttributeNotAllowedOnIfElse {
|
|||
pub attributes: Span,
|
||||
}
|
||||
|
||||
#[derive(Diagnostic)]
|
||||
#[diag(parse_outer_attr_ambiguous)]
|
||||
pub(crate) struct AmbiguousOuterAttributes {
|
||||
#[primary_span]
|
||||
pub span: Span,
|
||||
#[subdiagnostic]
|
||||
pub sugg: WrapInParentheses,
|
||||
}
|
||||
|
||||
#[derive(Diagnostic)]
|
||||
#[diag(parse_missing_in_in_for_loop)]
|
||||
pub(crate) struct MissingInInForLoop {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue