about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorPeter Collingbourne <pcc@google.com>2022-11-23 18:15:50 -0800
committerPeter Collingbourne <pcc@google.com>2022-12-05 15:05:43 -0800
commitf44a0153bc4efbb93933c9859168315883d6edc2 (patch)
tree6acfeac9359739c1f65c722626e632551919eb1d /src/test
parent5873ebeef3a4497c14b4199abba705fe7b530935 (diff)
downloadrust-f44a0153bc4efbb93933c9859168315883d6edc2.tar.gz
rust-f44a0153bc4efbb93933c9859168315883d6edc2.zip
Support Option and similar enums as type of static variable with linkage attribute.
Compiler MCP:
https://github.com/rust-lang/compiler-team/issues/565
Diffstat (limited to 'src/test')
-rw-r--r--src/test/ui/linkage-attr/linkage2.rs2
-rw-r--r--src/test/ui/linkage-attr/linkage2.stderr3
2 files changed, 3 insertions, 2 deletions
diff --git a/src/test/ui/linkage-attr/linkage2.rs b/src/test/ui/linkage-attr/linkage2.rs
index 3bc6634f18a..aa42874f7ba 100644
--- a/src/test/ui/linkage-attr/linkage2.rs
+++ b/src/test/ui/linkage-attr/linkage2.rs
@@ -5,7 +5,7 @@
 extern "C" {
     #[linkage = "extern_weak"]
     static foo: i32;
-//~^ ERROR: must have type `*const T` or `*mut T` due to `#[linkage]` attribute
+//~^ ERROR: invalid type for variable with `#[linkage]` attribute
 }
 
 fn main() {
diff --git a/src/test/ui/linkage-attr/linkage2.stderr b/src/test/ui/linkage-attr/linkage2.stderr
index 44e8eaaef51..7265f711fd0 100644
--- a/src/test/ui/linkage-attr/linkage2.stderr
+++ b/src/test/ui/linkage-attr/linkage2.stderr
@@ -1,4 +1,4 @@
-error: must have type `*const T` or `*mut T` due to `#[linkage]` attribute
+error[E0791]: invalid type for variable with `#[linkage]` attribute
   --> $DIR/linkage2.rs:7:5
    |
 LL |     static foo: i32;
@@ -6,3 +6,4 @@ LL |     static foo: i32;
 
 error: aborting due to previous error
 
+For more information about this error, try `rustc --explain E0791`.