File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change 1
- #![ allow( clippy:: if_same_then_else, clippy:: no_effect, clippy:: redundant_closure_call) ]
1
+ #![ allow(
2
+ clippy:: if_same_then_else,
3
+ clippy:: no_effect,
4
+ clippy:: redundant_closure_call,
5
+ clippy:: mut_from_ref
6
+ ) ]
2
7
#![ warn( clippy:: needless_pass_by_ref_mut) ]
3
8
#![ feature( lint_reasons) ]
4
9
//@no-rustfix
@@ -270,6 +275,18 @@ pub async fn closure4(n: &mut usize) {
270
275
} ) ( ) ;
271
276
}
272
277
278
+ struct Data < T : ?Sized > {
279
+ value : T ,
280
+ }
281
+ // Unsafe functions should not warn.
282
+ unsafe fn get_mut_unchecked < T > ( ptr : & NonNull < Data < T > > ) -> & mut T {
283
+ & mut ( * ptr. as_ptr ( ) ) . value
284
+ }
285
+ // Unsafe blocks should not warn.
286
+ fn get_mut_unchecked2 < T > ( ptr : & NonNull < Data < T > > ) -> & mut T {
287
+ unsafe { & mut ( * ptr. as_ptr ( ) ) . value }
288
+ }
289
+
273
290
fn main ( ) {
274
291
let mut u = 0 ;
275
292
let mut v = vec ! [ 0 ] ;
You can’t perform that action at this time.
0 commit comments