about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/test/ui/feature-gates/feature-gate-const_let.rs9
-rw-r--r--src/test/ui/feature-gates/feature-gate-const_let.stderr46
2 files changed, 54 insertions, 1 deletions
diff --git a/src/test/ui/feature-gates/feature-gate-const_let.rs b/src/test/ui/feature-gates/feature-gate-const_let.rs
index aad251a205e..9bf957a5f1e 100644
--- a/src/test/ui/feature-gates/feature-gate-const_let.rs
+++ b/src/test/ui/feature-gates/feature-gate-const_let.rs
@@ -19,4 +19,13 @@ const FOO: usize = {
     42
 };
 
+static BAR: usize = {
+    //~^ ERROR statements in statics are unstable
+    //~| ERROR: let bindings in statics are unstable
+    let x = 42;
+    //~^ ERROR statements in statics are unstable
+    //~| ERROR: let bindings in statics are unstable
+    42
+};
+
 fn main() {}
diff --git a/src/test/ui/feature-gates/feature-gate-const_let.stderr b/src/test/ui/feature-gates/feature-gate-const_let.stderr
index 4fab6ec540e..acb5165918e 100644
--- a/src/test/ui/feature-gates/feature-gate-const_let.stderr
+++ b/src/test/ui/feature-gates/feature-gate-const_let.stderr
@@ -42,6 +42,50 @@ LL | | };
    |
    = help: add #![feature(const_let)] to the crate attributes to enable
 
-error: aborting due to 4 previous errors
+error[E0658]: let bindings in statics are unstable (see issue #48821)
+  --> $DIR/feature-gate-const_let.rs:25:13
+   |
+LL |     let x = 42;
+   |             ^^
+   |
+   = help: add #![feature(const_let)] to the crate attributes to enable
+
+error[E0658]: statements in statics are unstable (see issue #48821)
+  --> $DIR/feature-gate-const_let.rs:25:13
+   |
+LL |     let x = 42;
+   |             ^^
+   |
+   = help: add #![feature(const_let)] to the crate attributes to enable
+
+error[E0658]: let bindings in statics are unstable (see issue #48821)
+  --> $DIR/feature-gate-const_let.rs:22:1
+   |
+LL | / static BAR: usize = {
+LL | |     //~^ ERROR statements in statics are unstable
+LL | |     //~| ERROR: let bindings in statics are unstable
+LL | |     let x = 42;
+...  |
+LL | |     42
+LL | | };
+   | |__^
+   |
+   = help: add #![feature(const_let)] to the crate attributes to enable
+
+error[E0658]: statements in statics are unstable (see issue #48821)
+  --> $DIR/feature-gate-const_let.rs:22:1
+   |
+LL | / static BAR: usize = {
+LL | |     //~^ ERROR statements in statics are unstable
+LL | |     //~| ERROR: let bindings in statics are unstable
+LL | |     let x = 42;
+...  |
+LL | |     42
+LL | | };
+   | |__^
+   |
+   = help: add #![feature(const_let)] to the crate attributes to enable
+
+error: aborting due to 8 previous errors
 
 For more information about this error, try `rustc --explain E0658`.