From 4def37386c181e9afb0dfc7f6c137f3730e5fca1 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Sat, 10 Feb 2024 11:07:07 +0100 Subject: [PATCH] manually bless an aarch64 test --- tests/ui/asm/aarch64/type-check-4.rs | 6 +++--- tests/ui/asm/aarch64/type-check-4.stderr | 26 +++++++++++++++++------- 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/tests/ui/asm/aarch64/type-check-4.rs b/tests/ui/asm/aarch64/type-check-4.rs index 5dec60a2138..a14010481fc 100644 --- a/tests/ui/asm/aarch64/type-check-4.rs +++ b/tests/ui/asm/aarch64/type-check-4.rs @@ -23,10 +23,10 @@ const fn const_bar(x: T) -> T { x } global_asm!("{}", const S); -//~^ ERROR constants cannot refer to statics +//~^ ERROR referencing statics global_asm!("{}", const const_foo(0)); global_asm!("{}", const const_foo(S)); -//~^ ERROR constants cannot refer to statics +//~^ ERROR referencing statics global_asm!("{}", const const_bar(0)); global_asm!("{}", const const_bar(S)); -//~^ ERROR constants cannot refer to statics +//~^ ERROR referencing statics diff --git a/tests/ui/asm/aarch64/type-check-4.stderr b/tests/ui/asm/aarch64/type-check-4.stderr index 4837e647bea..3e675f69e84 100644 --- a/tests/ui/asm/aarch64/type-check-4.stderr +++ b/tests/ui/asm/aarch64/type-check-4.stderr @@ -1,27 +1,39 @@ -error[E0013]: constants cannot refer to statics +error[E0658]: referencing statics in constants is unstable --> $DIR/type-check-4.rs:25:25 | LL | global_asm!("{}", const S); | ^ | - = help: consider extracting the value of the `static` to a `const`, and referring to that + = note: see issue #119618 for more information + = help: add `#![feature(const_refs_to_static)]` 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: `static` and `const` variables can refer to other `const` variables. A `const` variable, however, cannot refer to a `static` variable. + = help: to fix this, the value can be extracted to a `const` and then used. -error[E0013]: constants cannot refer to statics +error[E0658]: referencing statics in constants is unstable --> $DIR/type-check-4.rs:28:35 | LL | global_asm!("{}", const const_foo(S)); | ^ | - = help: consider extracting the value of the `static` to a `const`, and referring to that + = note: see issue #119618 for more information + = help: add `#![feature(const_refs_to_static)]` 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: `static` and `const` variables can refer to other `const` variables. A `const` variable, however, cannot refer to a `static` variable. + = help: to fix this, the value can be extracted to a `const` and then used. -error[E0013]: constants cannot refer to statics +error[E0658]: referencing statics in constants is unstable --> $DIR/type-check-4.rs:31:35 | LL | global_asm!("{}", const const_bar(S)); | ^ | - = help: consider extracting the value of the `static` to a `const`, and referring to that + = note: see issue #119618 for more information + = help: add `#![feature(const_refs_to_static)]` 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: `static` and `const` variables can refer to other `const` variables. A `const` variable, however, cannot refer to a `static` variable. + = help: to fix this, the value can be extracted to a `const` and then used. error: aborting due to 3 previous errors -For more information about this error, try `rustc --explain E0013`. +For more information about this error, try `rustc --explain E0658`.