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