|
1 |
| -error: a `const` item with interior mutability should not be borrowed |
| 1 | +error: borrow of a named constant with interior mutability |
2 | 2 | --> tests/ui/borrow_interior_mutable_const/others.rs:54:5
|
3 | 3 | |
|
4 | 4 | LL | ATOMIC.store(1, Ordering::SeqCst);
|
5 | 5 | | ^^^^^^
|
6 | 6 | |
|
7 |
| - = help: assign this const to a local or static variable, and use the variable here |
| 7 | + = help: this lint can be silenced by assigning the value to a local variable before borrowing |
| 8 | + = note: there is a compiler inserted borrow here |
8 | 9 | note: the lint level is defined here
|
9 | 10 | --> tests/ui/borrow_interior_mutable_const/others.rs:1:9
|
10 | 11 | |
|
11 | 12 | LL | #![deny(clippy::borrow_interior_mutable_const)]
|
12 | 13 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
13 | 14 |
|
14 |
| -error: a `const` item with interior mutability should not be borrowed |
| 15 | +error: borrow of a named constant with interior mutability |
15 | 16 | --> tests/ui/borrow_interior_mutable_const/others.rs:55:16
|
16 | 17 | |
|
17 | 18 | LL | assert_eq!(ATOMIC.load(Ordering::SeqCst), 5);
|
18 | 19 | | ^^^^^^
|
19 | 20 | |
|
20 |
| - = help: assign this const to a local or static variable, and use the variable here |
| 21 | + = help: this lint can be silenced by assigning the value to a local variable before borrowing |
| 22 | + = note: there is a compiler inserted borrow here |
21 | 23 |
|
22 |
| -error: a `const` item with interior mutability should not be borrowed |
| 24 | +error: borrow of a named constant with interior mutability |
23 | 25 | --> tests/ui/borrow_interior_mutable_const/others.rs:58:21
|
24 | 26 | |
|
25 | 27 | LL | let _once_ref = &ONCE_INIT;
|
26 | 28 | | ^^^^^^^^^^
|
27 | 29 | |
|
28 |
| - = help: assign this const to a local or static variable, and use the variable here |
| 30 | + = help: this lint can be silenced by assigning the value to a local variable before borrowing |
29 | 31 |
|
30 |
| -error: a `const` item with interior mutability should not be borrowed |
| 32 | +error: borrow of a named constant with interior mutability |
31 | 33 | --> tests/ui/borrow_interior_mutable_const/others.rs:59:24
|
32 | 34 | |
|
33 | 35 | LL | let _once_ref_2 = &&ONCE_INIT;
|
34 | 36 | | ^^^^^^^^^^
|
35 | 37 | |
|
36 |
| - = help: assign this const to a local or static variable, and use the variable here |
| 38 | + = help: this lint can be silenced by assigning the value to a local variable before borrowing |
37 | 39 |
|
38 |
| -error: a `const` item with interior mutability should not be borrowed |
| 40 | +error: borrow of a named constant with interior mutability |
39 | 41 | --> tests/ui/borrow_interior_mutable_const/others.rs:60:26
|
40 | 42 | |
|
41 | 43 | LL | let _once_ref_4 = &&&&ONCE_INIT;
|
42 | 44 | | ^^^^^^^^^^
|
43 | 45 | |
|
44 |
| - = help: assign this const to a local or static variable, and use the variable here |
| 46 | + = help: this lint can be silenced by assigning the value to a local variable before borrowing |
45 | 47 |
|
46 |
| -error: a `const` item with interior mutability should not be borrowed |
| 48 | +error: borrow of a named constant with interior mutability |
47 | 49 | --> tests/ui/borrow_interior_mutable_const/others.rs:61:21
|
48 | 50 | |
|
49 | 51 | LL | let _once_mut = &mut ONCE_INIT;
|
50 | 52 | | ^^^^^^^^^^^^^^
|
51 | 53 | |
|
52 |
| - = help: assign this const to a local or static variable, and use the variable here |
| 54 | + = help: this lint can be silenced by assigning the value to a local variable before borrowing |
53 | 55 |
|
54 |
| -error: a `const` item with interior mutability should not be borrowed |
| 56 | +error: borrow of a named constant with interior mutability |
55 | 57 | --> tests/ui/borrow_interior_mutable_const/others.rs:72:13
|
56 | 58 | |
|
57 | 59 | LL | let _ = &ATOMIC_TUPLE;
|
58 | 60 | | ^^^^^^^^^^^^^
|
59 | 61 | |
|
60 |
| - = help: assign this const to a local or static variable, and use the variable here |
| 62 | + = help: this lint can be silenced by assigning the value to a local variable before borrowing |
61 | 63 |
|
62 |
| -error: a `const` item with interior mutability should not be borrowed |
| 64 | +error: borrow of a named constant with interior mutability |
63 | 65 | --> tests/ui/borrow_interior_mutable_const/others.rs:73:13
|
64 | 66 | |
|
65 | 67 | LL | let _ = &ATOMIC_TUPLE.0;
|
66 | 68 | | ^^^^^^^^^^^^^^^
|
67 | 69 | |
|
68 |
| - = help: assign this const to a local or static variable, and use the variable here |
| 70 | + = help: this lint can be silenced by assigning the value to a local variable before borrowing |
69 | 71 |
|
70 |
| -error: a `const` item with interior mutability should not be borrowed |
| 72 | +error: borrow of a named constant with interior mutability |
71 | 73 | --> tests/ui/borrow_interior_mutable_const/others.rs:74:18
|
72 | 74 | |
|
73 | 75 | LL | let _ = &(&&&&ATOMIC_TUPLE).0;
|
74 | 76 | | ^^^^^^^^^^^^^
|
75 | 77 | |
|
76 |
| - = help: assign this const to a local or static variable, and use the variable here |
| 78 | + = help: this lint can be silenced by assigning the value to a local variable before borrowing |
77 | 79 |
|
78 |
| -error: a `const` item with interior mutability should not be borrowed |
| 80 | +error: borrow of a named constant with interior mutability |
79 | 81 | --> tests/ui/borrow_interior_mutable_const/others.rs:75:13
|
80 | 82 | |
|
81 | 83 | LL | let _ = &ATOMIC_TUPLE.0[0];
|
82 | 84 | | ^^^^^^^^^^^^^^^^^^
|
83 | 85 | |
|
84 |
| - = help: assign this const to a local or static variable, and use the variable here |
| 86 | + = help: this lint can be silenced by assigning the value to a local variable before borrowing |
85 | 87 |
|
86 |
| -error: a `const` item with interior mutability should not be borrowed |
| 88 | +error: borrow of a named constant with interior mutability |
87 | 89 | --> tests/ui/borrow_interior_mutable_const/others.rs:76:13
|
88 | 90 | |
|
89 | 91 | LL | let _ = ATOMIC_TUPLE.0[0].load(Ordering::SeqCst);
|
90 | 92 | | ^^^^^^^^^^^^^^^^^
|
91 | 93 | |
|
92 |
| - = help: assign this const to a local or static variable, and use the variable here |
| 94 | + = help: this lint can be silenced by assigning the value to a local variable before borrowing |
| 95 | + = note: there is a compiler inserted borrow here |
93 | 96 |
|
94 |
| -error: a `const` item with interior mutability should not be borrowed |
| 97 | +error: borrow of a named constant with interior mutability |
95 | 98 | --> tests/ui/borrow_interior_mutable_const/others.rs:79:17
|
96 | 99 | |
|
97 | 100 | LL | let _ = (&&&&ATOMIC_TUPLE).0;
|
98 | 101 | | ^^^^^^^^^^^^^
|
99 | 102 | |
|
100 |
| - = help: assign this const to a local or static variable, and use the variable here |
| 103 | + = help: this lint can be silenced by assigning the value to a local variable before borrowing |
101 | 104 |
|
102 |
| -error: a `const` item with interior mutability should not be borrowed |
| 105 | +error: borrow of a named constant with interior mutability |
103 | 106 | --> tests/ui/borrow_interior_mutable_const/others.rs:80:17
|
104 | 107 | |
|
105 | 108 | LL | let _ = (&&&&ATOMIC_TUPLE).2;
|
106 | 109 | | ^^^^^^^^^^^^^
|
107 | 110 | |
|
108 |
| - = help: assign this const to a local or static variable, and use the variable here |
| 111 | + = help: this lint can be silenced by assigning the value to a local variable before borrowing |
109 | 112 |
|
110 |
| -error: a `const` item with interior mutability should not be borrowed |
| 113 | +error: borrow of a named constant with interior mutability |
111 | 114 | --> tests/ui/borrow_interior_mutable_const/others.rs:87:5
|
112 | 115 | |
|
113 | 116 | LL | CELL.set(2);
|
114 | 117 | | ^^^^
|
115 | 118 | |
|
116 |
| - = help: assign this const to a local or static variable, and use the variable here |
| 119 | + = help: this lint can be silenced by assigning the value to a local variable before borrowing |
| 120 | + = note: there is a compiler inserted borrow here |
117 | 121 |
|
118 |
| -error: a `const` item with interior mutability should not be borrowed |
| 122 | +error: borrow of a named constant with interior mutability |
119 | 123 | --> tests/ui/borrow_interior_mutable_const/others.rs:88:16
|
120 | 124 | |
|
121 | 125 | LL | assert_eq!(CELL.get(), 6);
|
122 | 126 | | ^^^^
|
123 | 127 | |
|
124 |
| - = help: assign this const to a local or static variable, and use the variable here |
| 128 | + = help: this lint can be silenced by assigning the value to a local variable before borrowing |
| 129 | + = note: there is a compiler inserted borrow here |
125 | 130 |
|
126 | 131 | error: aborting due to 15 previous errors
|
127 | 132 |
|
0 commit comments