]> git.lizzy.rs Git - rust.git/blobdiff - tests/ui/non_copy_const.stderr
Auto merge of #3603 - xfix:random-state-lint, r=phansch
[rust.git] / tests / ui / non_copy_const.stderr
index 7f164595b59971e3bbcf4f8a625ea2f92ef91771..6b592b681c956c7fd5ef53cc92f4ab80cebb72c8 100644 (file)
@@ -1,7 +1,7 @@
 error: a const item should never be interior mutable
-  --> $DIR/non_copy_const.rs:12:1
+  --> $DIR/non_copy_const.rs:19:1
    |
-12 | const ATOMIC: AtomicUsize = AtomicUsize::new(5); //~ ERROR interior mutable
+LL | const ATOMIC: AtomicUsize = AtomicUsize::new(5); //~ ERROR interior mutable
    | -----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    | |
    | help: make this a static item: `static`
@@ -9,267 +9,267 @@ error: a const item should never be interior mutable
    = note: #[deny(clippy::declare_interior_mutable_const)] on by default
 
 error: a const item should never be interior mutable
-  --> $DIR/non_copy_const.rs:13:1
+  --> $DIR/non_copy_const.rs:20:1
    |
-13 | const CELL: Cell<usize> = Cell::new(6); //~ ERROR interior mutable
+LL | const CELL: Cell<usize> = Cell::new(6); //~ ERROR interior mutable
    | -----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    | |
    | help: make this a static item: `static`
 
 error: a const item should never be interior mutable
-  --> $DIR/non_copy_const.rs:14:1
+  --> $DIR/non_copy_const.rs:21:1
    |
-14 | const ATOMIC_TUPLE: ([AtomicUsize; 1], Vec<AtomicUsize>, u8) = ([ATOMIC], Vec::new(), 7);
+LL | const ATOMIC_TUPLE: ([AtomicUsize; 1], Vec<AtomicUsize>, u8) = ([ATOMIC], Vec::new(), 7);
    | -----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    | |
    | help: make this a static item: `static`
 
 error: a const item should never be interior mutable
-  --> $DIR/non_copy_const.rs:18:42
+  --> $DIR/non_copy_const.rs:26:9
    |
-18 |     ($name:ident: $ty:ty = $e:expr) => { const $name: $ty = $e; };
-   |                                          ^^^^^^^^^^^^^^^^^^^^^^
-19 | }
-20 | declare_const!(_ONCE: Once = Once::new()); //~ ERROR interior mutable
+LL |         const $name: $ty = $e;
+   |         ^^^^^^^^^^^^^^^^^^^^^^
+...
+LL | declare_const!(_ONCE: Once = Once::new()); //~ ERROR interior mutable
    | ------------------------------------------ in this macro invocation
 
 error: a const item should never be interior mutable
-  --> $DIR/non_copy_const.rs:41:5
+  --> $DIR/non_copy_const.rs:50:5
    |
-41 |     const ATOMIC: AtomicUsize; //~ ERROR interior mutable
+LL |     const ATOMIC: AtomicUsize; //~ ERROR interior mutable
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: a const item should never be interior mutable
-  --> $DIR/non_copy_const.rs:45:5
+  --> $DIR/non_copy_const.rs:54:5
    |
-45 |     const INPUT: T;
+LL |     const INPUT: T;
    |     ^^^^^^^^^^^^^^^
    |
 help: consider requiring `T` to be `Copy`
-  --> $DIR/non_copy_const.rs:45:18
+  --> $DIR/non_copy_const.rs:54:18
    |
-45 |     const INPUT: T;
+LL |     const INPUT: T;
    |                  ^
 
 error: a const item should never be interior mutable
-  --> $DIR/non_copy_const.rs:48:5
+  --> $DIR/non_copy_const.rs:57:5
    |
-48 |     const ASSOC: Self::NonCopyType;
+LL |     const ASSOC: Self::NonCopyType;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
 help: consider requiring `<Self as Trait<T>>::NonCopyType` to be `Copy`
-  --> $DIR/non_copy_const.rs:48:18
+  --> $DIR/non_copy_const.rs:57:18
    |
-48 |     const ASSOC: Self::NonCopyType;
+LL |     const ASSOC: Self::NonCopyType;
    |                  ^^^^^^^^^^^^^^^^^
 
 error: a const item should never be interior mutable
-  --> $DIR/non_copy_const.rs:52:5
+  --> $DIR/non_copy_const.rs:61:5
    |
-52 |     const AN_INPUT: T = Self::INPUT;
+LL |     const AN_INPUT: T = Self::INPUT;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
 help: consider requiring `T` to be `Copy`
-  --> $DIR/non_copy_const.rs:52:21
+  --> $DIR/non_copy_const.rs:61:21
    |
-52 |     const AN_INPUT: T = Self::INPUT;
+LL |     const AN_INPUT: T = Self::INPUT;
    |                     ^
 
 error: a const item should never be interior mutable
-  --> $DIR/non_copy_const.rs:18:42
+  --> $DIR/non_copy_const.rs:26:9
    |
-18 |     ($name:ident: $ty:ty = $e:expr) => { const $name: $ty = $e; };
-   |                                          ^^^^^^^^^^^^^^^^^^^^^^
+LL |         const $name: $ty = $e;
+   |         ^^^^^^^^^^^^^^^^^^^^^^
 ...
-55 |     declare_const!(ANOTHER_INPUT: T = Self::INPUT); //~ ERROR interior mutable
+LL |     declare_const!(ANOTHER_INPUT: T = Self::INPUT); //~ ERROR interior mutable
    |     ----------------------------------------------- in this macro invocation
 
 error: a const item should never be interior mutable
-  --> $DIR/non_copy_const.rs:61:5
+  --> $DIR/non_copy_const.rs:70:5
    |
-61 |     const SELF_2: Self;
+LL |     const SELF_2: Self;
    |     ^^^^^^^^^^^^^^^^^^^
    |
 help: consider requiring `Self` to be `Copy`
-  --> $DIR/non_copy_const.rs:61:19
+  --> $DIR/non_copy_const.rs:70:19
    |
-61 |     const SELF_2: Self;
+LL |     const SELF_2: Self;
    |                   ^^^^
 
 error: a const item should never be interior mutable
-  --> $DIR/non_copy_const.rs:82:5
+  --> $DIR/non_copy_const.rs:91:5
    |
-82 |     const ASSOC_3: AtomicUsize = AtomicUsize::new(14); //~ ERROR interior mutable
+LL |     const ASSOC_3: AtomicUsize = AtomicUsize::new(14); //~ ERROR interior mutable
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: a const item should never be interior mutable
-  --> $DIR/non_copy_const.rs:85:5
+  --> $DIR/non_copy_const.rs:94:5
    |
-85 |     const U_SELF: U = U::SELF_2;
+LL |     const U_SELF: U = U::SELF_2;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
 help: consider requiring `U` to be `Copy`
-  --> $DIR/non_copy_const.rs:85:19
+  --> $DIR/non_copy_const.rs:94:19
    |
-85 |     const U_SELF: U = U::SELF_2;
+LL |     const U_SELF: U = U::SELF_2;
    |                   ^
 
 error: a const item should never be interior mutable
-  --> $DIR/non_copy_const.rs:88:5
+  --> $DIR/non_copy_const.rs:97:5
    |
-88 |     const T_ASSOC: T::NonCopyType = T::ASSOC;
+LL |     const T_ASSOC: T::NonCopyType = T::ASSOC;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
 help: consider requiring `<T as Trait<u32>>::NonCopyType` to be `Copy`
-  --> $DIR/non_copy_const.rs:88:20
+  --> $DIR/non_copy_const.rs:97:20
    |
-88 |     const T_ASSOC: T::NonCopyType = T::ASSOC;
+LL |     const T_ASSOC: T::NonCopyType = T::ASSOC;
    |                    ^^^^^^^^^^^^^^
 
 error: a const item with interior mutability should not be borrowed
-  --> $DIR/non_copy_const.rs:95:5
+  --> $DIR/non_copy_const.rs:104:5
    |
-95 |     ATOMIC.store(1, Ordering::SeqCst); //~ ERROR interior mutability
+LL |     ATOMIC.store(1, Ordering::SeqCst); //~ ERROR interior mutability
    |     ^^^^^^
    |
    = note: #[deny(clippy::borrow_interior_mutable_const)] on by default
    = help: assign this const to a local or static variable, and use the variable here
 
 error: a const item with interior mutability should not be borrowed
-  --> $DIR/non_copy_const.rs:96:16
+  --> $DIR/non_copy_const.rs:105:16
    |
-96 |     assert_eq!(ATOMIC.load(Ordering::SeqCst), 5); //~ ERROR interior mutability
+LL |     assert_eq!(ATOMIC.load(Ordering::SeqCst), 5); //~ ERROR interior mutability
    |                ^^^^^^
    |
    = help: assign this const to a local or static variable, and use the variable here
 
 error: a const item with interior mutability should not be borrowed
-  --> $DIR/non_copy_const.rs:98:5
+  --> $DIR/non_copy_const.rs:107:5
    |
-98 |     ATOMIC_USIZE_INIT.store(2, Ordering::SeqCst); //~ ERROR interior mutability
+LL |     ATOMIC_USIZE_INIT.store(2, Ordering::SeqCst); //~ ERROR interior mutability
    |     ^^^^^^^^^^^^^^^^^
    |
    = help: assign this const to a local or static variable, and use the variable here
 
 error: a const item with interior mutability should not be borrowed
-  --> $DIR/non_copy_const.rs:99:16
+  --> $DIR/non_copy_const.rs:108:16
    |
-99 |     assert_eq!(ATOMIC_USIZE_INIT.load(Ordering::SeqCst), 0); //~ ERROR interior mutability
+LL |     assert_eq!(ATOMIC_USIZE_INIT.load(Ordering::SeqCst), 0); //~ ERROR interior mutability
    |                ^^^^^^^^^^^^^^^^^
    |
    = help: assign this const to a local or static variable, and use the variable here
 
 error: a const item with interior mutability should not be borrowed
-   --> $DIR/non_copy_const.rs:102:22
-    |
-102 |     let _once_ref = &ONCE_INIT; //~ ERROR interior mutability
-    |                      ^^^^^^^^^
-    |
-    = help: assign this const to a local or static variable, and use the variable here
+  --> $DIR/non_copy_const.rs:111:22
+   |
+LL |     let _once_ref = &ONCE_INIT; //~ ERROR interior mutability
+   |                      ^^^^^^^^^
+   |
+   = help: assign this const to a local or static variable, and use the variable here
 
 error: a const item with interior mutability should not be borrowed
-   --> $DIR/non_copy_const.rs:103:25
-    |
-103 |     let _once_ref_2 = &&ONCE_INIT; //~ ERROR interior mutability
-    |                         ^^^^^^^^^
-    |
-    = help: assign this const to a local or static variable, and use the variable here
+  --> $DIR/non_copy_const.rs:112:25
+   |
+LL |     let _once_ref_2 = &&ONCE_INIT; //~ ERROR interior mutability
+   |                         ^^^^^^^^^
+   |
+   = help: assign this const to a local or static variable, and use the variable here
 
 error: a const item with interior mutability should not be borrowed
-   --> $DIR/non_copy_const.rs:104:27
-    |
-104 |     let _once_ref_4 = &&&&ONCE_INIT; //~ ERROR interior mutability
-    |                           ^^^^^^^^^
-    |
-    = help: assign this const to a local or static variable, and use the variable here
+  --> $DIR/non_copy_const.rs:113:27
+   |
+LL |     let _once_ref_4 = &&&&ONCE_INIT; //~ ERROR interior mutability
+   |                           ^^^^^^^^^
+   |
+   = help: assign this const to a local or static variable, and use the variable here
 
 error: a const item with interior mutability should not be borrowed
-   --> $DIR/non_copy_const.rs:105:26
-    |
-105 |     let _once_mut = &mut ONCE_INIT; //~ ERROR interior mutability
-    |                          ^^^^^^^^^
-    |
-    = help: assign this const to a local or static variable, and use the variable here
+  --> $DIR/non_copy_const.rs:114:26
+   |
+LL |     let _once_mut = &mut ONCE_INIT; //~ ERROR interior mutability
+   |                          ^^^^^^^^^
+   |
+   = help: assign this const to a local or static variable, and use the variable here
 
 error: a const item with interior mutability should not be borrowed
-   --> $DIR/non_copy_const.rs:116:14
-    |
-116 |     let _ = &ATOMIC_TUPLE; //~ ERROR interior mutability
-    |              ^^^^^^^^^^^^
-    |
-    = help: assign this const to a local or static variable, and use the variable here
+  --> $DIR/non_copy_const.rs:125:14
+   |
+LL |     let _ = &ATOMIC_TUPLE; //~ ERROR interior mutability
+   |              ^^^^^^^^^^^^
+   |
+   = help: assign this const to a local or static variable, and use the variable here
 
 error: a const item with interior mutability should not be borrowed
-   --> $DIR/non_copy_const.rs:117:14
-    |
-117 |     let _ = &ATOMIC_TUPLE.0; //~ ERROR interior mutability
-    |              ^^^^^^^^^^^^
-    |
-    = help: assign this const to a local or static variable, and use the variable here
+  --> $DIR/non_copy_const.rs:126:14
+   |
+LL |     let _ = &ATOMIC_TUPLE.0; //~ ERROR interior mutability
+   |              ^^^^^^^^^^^^
+   |
+   = help: assign this const to a local or static variable, and use the variable here
 
 error: a const item with interior mutability should not be borrowed
-   --> $DIR/non_copy_const.rs:118:19
-    |
-118 |     let _ = &(&&&&ATOMIC_TUPLE).0; //~ ERROR interior mutability
-    |                   ^^^^^^^^^^^^
-    |
-    = help: assign this const to a local or static variable, and use the variable here
+  --> $DIR/non_copy_const.rs:127:19
+   |
+LL |     let _ = &(&&&&ATOMIC_TUPLE).0; //~ ERROR interior mutability
+   |                   ^^^^^^^^^^^^
+   |
+   = help: assign this const to a local or static variable, and use the variable here
 
 error: a const item with interior mutability should not be borrowed
-   --> $DIR/non_copy_const.rs:119:14
-    |
-119 |     let _ = &ATOMIC_TUPLE.0[0]; //~ ERROR interior mutability
-    |              ^^^^^^^^^^^^
-    |
-    = help: assign this const to a local or static variable, and use the variable here
+  --> $DIR/non_copy_const.rs:128:14
+   |
+LL |     let _ = &ATOMIC_TUPLE.0[0]; //~ ERROR interior mutability
+   |              ^^^^^^^^^^^^
+   |
+   = help: assign this const to a local or static variable, and use the variable here
 
 error: a const item with interior mutability should not be borrowed
-   --> $DIR/non_copy_const.rs:120:13
-    |
-120 |     let _ = ATOMIC_TUPLE.0[0].load(Ordering::SeqCst); //~ ERROR interior mutability
-    |             ^^^^^^^^^^^^
-    |
-    = help: assign this const to a local or static variable, and use the variable here
+  --> $DIR/non_copy_const.rs:129:13
+   |
+LL |     let _ = ATOMIC_TUPLE.0[0].load(Ordering::SeqCst); //~ ERROR interior mutability
+   |             ^^^^^^^^^^^^
+   |
+   = help: assign this const to a local or static variable, and use the variable here
 
 error: a const item with interior mutability should not be borrowed
-   --> $DIR/non_copy_const.rs:126:13
-    |
-126 |     let _ = ATOMIC_TUPLE.0[0]; //~ ERROR interior mutability
-    |             ^^^^^^^^^^^^
-    |
-    = help: assign this const to a local or static variable, and use the variable here
+  --> $DIR/non_copy_const.rs:135:13
+   |
+LL |     let _ = ATOMIC_TUPLE.0[0]; //~ ERROR interior mutability
+   |             ^^^^^^^^^^^^
+   |
+   = help: assign this const to a local or static variable, and use the variable here
 
 error: a const item with interior mutability should not be borrowed
-   --> $DIR/non_copy_const.rs:131:5
-    |
-131 |     CELL.set(2); //~ ERROR interior mutability
-    |     ^^^^
-    |
-    = help: assign this const to a local or static variable, and use the variable here
+  --> $DIR/non_copy_const.rs:140:5
+   |
+LL |     CELL.set(2); //~ ERROR interior mutability
+   |     ^^^^
+   |
+   = help: assign this const to a local or static variable, and use the variable here
 
 error: a const item with interior mutability should not be borrowed
-   --> $DIR/non_copy_const.rs:132:16
-    |
-132 |     assert_eq!(CELL.get(), 6); //~ ERROR interior mutability
-    |                ^^^^
-    |
-    = help: assign this const to a local or static variable, and use the variable here
+  --> $DIR/non_copy_const.rs:141:16
+   |
+LL |     assert_eq!(CELL.get(), 6); //~ ERROR interior mutability
+   |                ^^^^
+   |
+   = help: assign this const to a local or static variable, and use the variable here
 
 error: a const item with interior mutability should not be borrowed
-   --> $DIR/non_copy_const.rs:145:5
-    |
-145 |     u64::ATOMIC.store(5, Ordering::SeqCst); //~ ERROR interior mutability
-    |     ^^^^^^^^^^^
-    |
-    = help: assign this const to a local or static variable, and use the variable here
+  --> $DIR/non_copy_const.rs:154:5
+   |
+LL |     u64::ATOMIC.store(5, Ordering::SeqCst); //~ ERROR interior mutability
+   |     ^^^^^^^^^^^
+   |
+   = help: assign this const to a local or static variable, and use the variable here
 
 error: a const item with interior mutability should not be borrowed
-   --> $DIR/non_copy_const.rs:146:16
-    |
-146 |     assert_eq!(u64::ATOMIC.load(Ordering::SeqCst), 9); //~ ERROR interior mutability
-    |                ^^^^^^^^^^^
-    |
-    = help: assign this const to a local or static variable, and use the variable here
+  --> $DIR/non_copy_const.rs:155:16
+   |
+LL |     assert_eq!(u64::ATOMIC.load(Ordering::SeqCst), 9); //~ ERROR interior mutability
+   |                ^^^^^^^^^^^
+   |
+   = help: assign this const to a local or static variable, and use the variable here
 
 error: aborting due to 31 previous errors