]> git.lizzy.rs Git - rust.git/blobdiff - tests/ui/declare_interior_mutable_const/others.stderr
check macro statements in non_copy_const.rs
[rust.git] / tests / ui / declare_interior_mutable_const / others.stderr
index 6153c96edc4f425e254084377242028e490203cb..6cba9491ef4e8d1b6d30b78e1c48e9cea61a01c4 100644 (file)
@@ -31,9 +31,20 @@ LL |         const $name: $ty = $e;
    |         ^^^^^^^^^^^^^^^^^^^^^^
 ...
 LL | declare_const!(_ONCE: Once = Once::new()); //~ ERROR interior mutable
-   | ------------------------------------------ in this macro invocation
+   | ----------------------------------------- in this macro invocation
    |
-   = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
+   = note: this error originates in the macro `declare_const` (in Nightly builds, run with -Z macro-backtrace for more info)
 
-error: aborting due to 4 previous errors
+error: a `const` item should never be interior mutable
+  --> $DIR/others.rs:48:13
+   |
+LL |             const _BAZ: Cell<usize> = Cell::new(0); //~ ERROR interior mutable
+   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+...
+LL |     issue_8493!();
+   |     ------------- in this macro invocation
+   |
+   = note: this error originates in the macro `issue_8493` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error: aborting due to 5 previous errors