diff --git a/compiler/rustc_feature/src/unstable.rs b/compiler/rustc_feature/src/unstable.rs index c512ccc90db..371b651f5e8 100644 --- a/compiler/rustc_feature/src/unstable.rs +++ b/compiler/rustc_feature/src/unstable.rs @@ -549,9 +549,9 @@ pub fn internal(&self, feature: Symbol) -> bool { /// casts in safe Rust to `dyn Trait` for such a `Trait` is also forbidden. (unstable, object_safe_for_dispatch, "1.40.0", Some(43561)), /// Allows using enums in offset_of! - (unstable, offset_of_enum, "1.75.0", Some(106655)), + (unstable, offset_of_enum, "1.75.0", Some(120141)), /// Allows using multiple nested field accesses in offset_of! - (unstable, offset_of_nested, "CURRENT_RUSTC_VERSION", Some(106655)), + (unstable, offset_of_nested, "CURRENT_RUSTC_VERSION", Some(120140)), /// Allows using `#[optimize(X)]`. (unstable, optimize_attribute, "1.34.0", Some(54882)), /// Allows macro attributes on expressions, statements and non-inline modules. diff --git a/compiler/rustc_hir_typeck/src/expr.rs b/compiler/rustc_hir_typeck/src/expr.rs index 242e8dc95e2..33d7ba6268a 100644 --- a/compiler/rustc_hir_typeck/src/expr.rs +++ b/compiler/rustc_hir_typeck/src/expr.rs @@ -3250,7 +3250,7 @@ fn check_offset_of( && !self.tcx.features().offset_of_nested { rustc_session::parse::feature_err( - &self.tcx.sess.parse_sess, + &self.tcx.sess, sym::offset_of_nested, ident_2.span, "only a single ident or integer is stable as the field in offset_of", diff --git a/tests/ui/feature-gates/feature-gate-offset-of-enum.stderr b/tests/ui/feature-gates/feature-gate-offset-of-enum.stderr index 02ee54e8607..fc7dd7923f7 100644 --- a/tests/ui/feature-gates/feature-gate-offset-of-enum.stderr +++ b/tests/ui/feature-gates/feature-gate-offset-of-enum.stderr @@ -13,7 +13,7 @@ error[E0658]: using enums in offset_of is experimental LL | offset_of!(Alpha, One); | ^^^ | - = note: see issue #106655 for more information + = note: see issue #120141 for more information = help: add `#![feature(offset_of_enum)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date @@ -29,7 +29,7 @@ error[E0658]: using enums in offset_of is experimental LL | offset_of!(Alpha, Two.0); | ^^^ | - = note: see issue #106655 for more information + = note: see issue #120141 for more information = help: add `#![feature(offset_of_enum)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date diff --git a/tests/ui/feature-gates/feature-gate-offset-of-nested.stderr b/tests/ui/feature-gates/feature-gate-offset-of-nested.stderr index ebc251fd663..f367fc9fa0d 100644 --- a/tests/ui/feature-gates/feature-gate-offset-of-nested.stderr +++ b/tests/ui/feature-gates/feature-gate-offset-of-nested.stderr @@ -4,8 +4,9 @@ error[E0658]: only a single ident or integer is stable as the field in offset_of LL | offset_of!(Alpha, Two.0); | ^ | - = note: see issue #106655 for more information + = note: see issue #120140 for more information = help: add `#![feature(offset_of_nested)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error[E0658]: only a single ident or integer is stable as the field in offset_of --> $DIR/feature-gate-offset-of-nested.rs:24:33 @@ -19,8 +20,9 @@ LL | | offset_of!((S, ()), 0.c); LL | | offset_of!(S, c.t); ... | | - = note: see issue #106655 for more information + = note: see issue #120140 for more information = help: add `#![feature(offset_of_nested)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date = note: this error originates in the macro `offset_of` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0658]: only a single ident or integer is stable as the field in offset_of @@ -29,8 +31,9 @@ error[E0658]: only a single ident or integer is stable as the field in offset_of LL | offset_of!(S, b.0); | ^ | - = note: see issue #106655 for more information + = note: see issue #120140 for more information = help: add `#![feature(offset_of_nested)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error[E0658]: only a single ident or integer is stable as the field in offset_of --> $DIR/feature-gate-offset-of-nested.rs:26:27 @@ -38,8 +41,9 @@ error[E0658]: only a single ident or integer is stable as the field in offset_of LL | offset_of!((S, ()), 0.c); | ^ | - = note: see issue #106655 for more information + = note: see issue #120140 for more information = help: add `#![feature(offset_of_nested)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error[E0658]: only a single ident or integer is stable as the field in offset_of --> $DIR/feature-gate-offset-of-nested.rs:27:21 @@ -47,8 +51,9 @@ error[E0658]: only a single ident or integer is stable as the field in offset_of LL | offset_of!(S, c.t); | ^ | - = note: see issue #106655 for more information + = note: see issue #120140 for more information = help: add `#![feature(offset_of_nested)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error: aborting due to 5 previous errors