about summary refs log tree commit diff
path: root/compiler/rustc_codegen_ssa/messages.ftl
diff options
context:
space:
mode:
authorLeón Orell Valerian Liehr <me@fmease.dev>2025-06-15 23:51:54 +0200
committerGitHub <noreply@github.com>2025-06-15 23:51:54 +0200
commitb79d3b1ec15c64bf00677207287b17e3d6f6e05f (patch)
tree10b4b523937e18bf1aaed71cb86d5916128db66d /compiler/rustc_codegen_ssa/messages.ftl
parentd6dc9656ea43fed1f862b36a68caffd631194654 (diff)
parent2171f89eb223a4f5f3af74df24104d77c1a8a6aa (diff)
downloadrust-b79d3b1ec15c64bf00677207287b17e3d6f6e05f.tar.gz
rust-b79d3b1ec15c64bf00677207287b17e3d6f6e05f.zip
Rollup merge of #134661 - dtolnay:prefixattr, r=fmease
Reduce precedence of expressions that have an outer attr

Previously, `-Zunpretty=expanded` would expand this program as follows:

```rust
#![feature(stmt_expr_attributes)]

macro_rules! repro {
    ($e:expr) => {
        #[allow(deprecated)] $e
    };
}

#[derive(Default)]
struct Thing {
    #[deprecated]
    field: i32,
}

fn main() {
    let thing = Thing::default();
    let _ = repro!(thing).field;
}
```

```rs
#![feature(prelude_import)]
#![feature(stmt_expr_attributes)]
#[prelude_import]
use std::prelude::rust_2021::*;
#[macro_use]
extern crate std;

struct Thing {
    #[deprecated]
    field: i32,
}

#[automatically_derived]
impl ::core::default::Default for Thing {
    #[inline]
    fn default() -> Thing {
        Thing { field: ::core::default::Default::default() }
    }
}

fn main() {
    let thing = Thing::default();
    let _ = #[allow(deprecated)] thing.field;
}
```

This is not the correct expansion. The correct output would have `(#[allow(deprecated)] thing).field` with the attribute applying only to `thing`, not to `thing.field`.
Diffstat (limited to 'compiler/rustc_codegen_ssa/messages.ftl')
0 files changed, 0 insertions, 0 deletions