@@ -4,6 +4,7 @@ error: a `const` item with interior mutability should not be borrowed
44LL | ATOMIC.store(1, Ordering::SeqCst);
55 | ^^^^^^
66 |
7+ = note: there is a compiler inserted borrow here
78 = help: assign this const to a local or static variable, and use the variable here
89note: the lint level is defined here
910 --> tests/ui/borrow_interior_mutable_const/others.rs:1:9
@@ -12,108 +13,120 @@ LL | #![deny(clippy::borrow_interior_mutable_const)]
1213 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1314
1415error: 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
1617 |
1718LL | assert_eq!(ATOMIC.load(Ordering::SeqCst), 5);
1819 | ^^^^^^
1920 |
21+ = note: there is a compiler inserted borrow here
2022 = help: assign this const to a local or static variable, and use the variable here
2123
2224error: 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
2426 |
2527LL | let _once_ref = &ONCE_INIT;
26- | ^^^^^^^^^
28+ | ^ ^^^^^^^^^
2729 |
2830 = help: assign this const to a local or static variable, and use the variable here
2931
3032error: 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
3234 |
3335LL | let _once_ref_2 = &&ONCE_INIT;
34- | ^^^^^^^^^
36+ | ^ ^^^^^^^^^
3537 |
3638 = help: assign this const to a local or static variable, and use the variable here
3739
3840error: 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
4042 |
4143LL | let _once_ref_4 = &&&&ONCE_INIT;
42- | ^^^^^^^^^
44+ | ^ ^^^^^^^^^
4345 |
4446 = help: assign this const to a local or static variable, and use the variable here
4547
4648error: 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
4850 |
4951LL | let _once_mut = &mut ONCE_INIT;
50- | ^^^^^^^^^
52+ | ^^^^^ ^^^^^^^^^
5153 |
5254 = help: assign this const to a local or static variable, and use the variable here
5355
5456error: 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
5658 |
5759LL | let _ = &ATOMIC_TUPLE;
58- | ^^^^^^^^^^^^
60+ | ^ ^^^^^^^^^^^^
5961 |
6062 = help: assign this const to a local or static variable, and use the variable here
6163
6264error: 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
6466 |
6567LL | let _ = &ATOMIC_TUPLE.0;
66- | ^^^^^^^^^^^^
68+ | ^^^ ^^^^^^^^^^^^
6769 |
6870 = help: assign this const to a local or static variable, and use the variable here
6971
7072error: 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
7274 |
7375LL | let _ = &(&&&&ATOMIC_TUPLE).0;
74- | ^^^^^^^^^^^^
76+ | ^ ^^^^^^^^^^^^
7577 |
7678 = help: assign this const to a local or static variable, and use the variable here
7779
7880error: 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
8082 |
8183LL | let _ = &ATOMIC_TUPLE.0[0];
82- | ^^^^^^^^^^^^
84+ | ^^^^^^ ^^^^^^^^^^^^
8385 |
8486 = help: assign this const to a local or static variable, and use the variable here
8587
8688error: 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
8890 |
8991LL | let _ = ATOMIC_TUPLE.0[0].load(Ordering::SeqCst);
90- | ^^^^^^^^^^^^
92+ | ^^^^^^^^^^^^^^^^^
9193 |
94+ = note: there is a compiler inserted borrow here
9295 = help: assign this const to a local or static variable, and use the variable here
9396
9497error: 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
9699 |
97- LL | let _ = ATOMIC_TUPLE.0[0] ;
98- | ^^^^^^^^^^^^
100+ LL | let _ = (&&&& ATOMIC_TUPLE).0 ;
101+ | ^ ^^^^^^^^^^^^
99102 |
100103 = help: assign this const to a local or static variable, and use the variable here
101104
102105error: 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
104115 |
105116LL | CELL.set(2);
106117 | ^^^^
107118 |
119+ = note: there is a compiler inserted borrow here
108120 = help: assign this const to a local or static variable, and use the variable here
109121
110122error: 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
112124 |
113125LL | assert_eq!(CELL.get(), 6);
114126 | ^^^^
115127 |
128+ = note: there is a compiler inserted borrow here
116129 = help: assign this const to a local or static variable, and use the variable here
117130
118- error: aborting due to 14 previous errors
131+ error: aborting due to 15 previous errors
119132
0 commit comments