1 error: a `const` item with interior mutability should not be borrowed
2 --> $DIR/borrow_interior_mutable_const.rs:44:18
4 LL | let _ = &Self::ASSOC; //~ ERROR interior mutability
7 = note: `-D clippy::borrow-interior-mutable-const` implied by `-D warnings`
8 = help: assign this const to a local or static variable, and use the variable here
10 error: a `const` item with interior mutability should not be borrowed
11 --> $DIR/borrow_interior_mutable_const.rs:80:5
13 LL | ATOMIC.store(1, Ordering::SeqCst); //~ ERROR interior mutability
16 = help: assign this const to a local or static variable, and use the variable here
18 error: a `const` item with interior mutability should not be borrowed
19 --> $DIR/borrow_interior_mutable_const.rs:81:16
21 LL | assert_eq!(ATOMIC.load(Ordering::SeqCst), 5); //~ ERROR interior mutability
24 = help: assign this const to a local or static variable, and use the variable here
26 error: a `const` item with interior mutability should not be borrowed
27 --> $DIR/borrow_interior_mutable_const.rs:84:22
29 LL | let _once_ref = &ONCE_INIT; //~ ERROR interior mutability
32 = help: assign this const to a local or static variable, and use the variable here
34 error: a `const` item with interior mutability should not be borrowed
35 --> $DIR/borrow_interior_mutable_const.rs:85:25
37 LL | let _once_ref_2 = &&ONCE_INIT; //~ ERROR interior mutability
40 = help: assign this const to a local or static variable, and use the variable here
42 error: a `const` item with interior mutability should not be borrowed
43 --> $DIR/borrow_interior_mutable_const.rs:86:27
45 LL | let _once_ref_4 = &&&&ONCE_INIT; //~ ERROR interior mutability
48 = help: assign this const to a local or static variable, and use the variable here
50 error: a `const` item with interior mutability should not be borrowed
51 --> $DIR/borrow_interior_mutable_const.rs:87:26
53 LL | let _once_mut = &mut ONCE_INIT; //~ ERROR interior mutability
56 = help: assign this const to a local or static variable, and use the variable here
58 error: a `const` item with interior mutability should not be borrowed
59 --> $DIR/borrow_interior_mutable_const.rs:98:14
61 LL | let _ = &ATOMIC_TUPLE; //~ ERROR interior mutability
64 = help: assign this const to a local or static variable, and use the variable here
66 error: a `const` item with interior mutability should not be borrowed
67 --> $DIR/borrow_interior_mutable_const.rs:99:14
69 LL | let _ = &ATOMIC_TUPLE.0; //~ ERROR interior mutability
72 = help: assign this const to a local or static variable, and use the variable here
74 error: a `const` item with interior mutability should not be borrowed
75 --> $DIR/borrow_interior_mutable_const.rs:100:19
77 LL | let _ = &(&&&&ATOMIC_TUPLE).0; //~ ERROR interior mutability
80 = help: assign this const to a local or static variable, and use the variable here
82 error: a `const` item with interior mutability should not be borrowed
83 --> $DIR/borrow_interior_mutable_const.rs:101:14
85 LL | let _ = &ATOMIC_TUPLE.0[0]; //~ ERROR interior mutability
88 = help: assign this const to a local or static variable, and use the variable here
90 error: a `const` item with interior mutability should not be borrowed
91 --> $DIR/borrow_interior_mutable_const.rs:102:13
93 LL | let _ = ATOMIC_TUPLE.0[0].load(Ordering::SeqCst); //~ ERROR interior mutability
96 = help: assign this const to a local or static variable, and use the variable here
98 error: a `const` item with interior mutability should not be borrowed
99 --> $DIR/borrow_interior_mutable_const.rs:108:13
101 LL | let _ = ATOMIC_TUPLE.0[0]; //~ ERROR interior mutability
104 = help: assign this const to a local or static variable, and use the variable here
106 error: a `const` item with interior mutability should not be borrowed
107 --> $DIR/borrow_interior_mutable_const.rs:113:5
109 LL | CELL.set(2); //~ ERROR interior mutability
112 = help: assign this const to a local or static variable, and use the variable here
114 error: a `const` item with interior mutability should not be borrowed
115 --> $DIR/borrow_interior_mutable_const.rs:114:16
117 LL | assert_eq!(CELL.get(), 6); //~ ERROR interior mutability
120 = help: assign this const to a local or static variable, and use the variable here
122 error: a `const` item with interior mutability should not be borrowed
123 --> $DIR/borrow_interior_mutable_const.rs:127:5
125 LL | u64::ATOMIC.store(5, Ordering::SeqCst); //~ ERROR interior mutability
128 = help: assign this const to a local or static variable, and use the variable here
130 error: a `const` item with interior mutability should not be borrowed
131 --> $DIR/borrow_interior_mutable_const.rs:128:16
133 LL | assert_eq!(u64::ATOMIC.load(Ordering::SeqCst), 9); //~ ERROR interior mutability
136 = help: assign this const to a local or static variable, and use the variable here
138 error: aborting due to 17 previous errors