File tree Expand file tree Collapse file tree 4 files changed +13
-11
lines changed Expand file tree Collapse file tree 4 files changed +13
-11
lines changed Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ declare_lint! {
4343 /// }
4444 /// ```
4545 pub IMPLICIT_UNSAFE_AUTOREFS ,
46- Deny ,
46+ Warn ,
4747 "implicit reference to a dereference of a raw pointer"
4848}
4949
Original file line number Diff line number Diff line change 1+ // check-pass
12// run-rustfix
23use std::ptr::{addr_of, addr_of_mut};
34
45unsafe fn _test_mut(ptr: *mut [u8]) -> *mut [u8] {
56 addr_of_mut!((&mut (*ptr))[..16])
6- //~^ error : implicit auto-ref creates a reference to a dereference of a raw pointer
7+ //~^ warn : implicit auto-ref creates a reference to a dereference of a raw pointer
78}
89
910unsafe fn _test_const(ptr: *const [u8]) -> *const [u8] {
1011 addr_of!((&(*ptr))[..16])
11- //~^ error : implicit auto-ref creates a reference to a dereference of a raw pointer
12+ //~^ warn : implicit auto-ref creates a reference to a dereference of a raw pointer
1213}
1314
1415fn main() {}
Original file line number Diff line number Diff line change 1+ // check-pass
12// run-rustfix
23use std:: ptr:: { addr_of, addr_of_mut} ;
34
45unsafe fn _test_mut ( ptr : * mut [ u8 ] ) -> * mut [ u8 ] {
56 addr_of_mut ! ( ( * ptr) [ ..16 ] )
6- //~^ error : implicit auto-ref creates a reference to a dereference of a raw pointer
7+ //~^ warn : implicit auto-ref creates a reference to a dereference of a raw pointer
78}
89
910unsafe fn _test_const ( ptr : * const [ u8 ] ) -> * const [ u8 ] {
1011 addr_of ! ( ( * ptr) [ ..16 ] )
11- //~^ error : implicit auto-ref creates a reference to a dereference of a raw pointer
12+ //~^ warn : implicit auto-ref creates a reference to a dereference of a raw pointer
1213}
1314
1415fn main ( ) { }
Original file line number Diff line number Diff line change 1- error : implicit auto-ref creates a reference to a dereference of a raw pointer
2- --> $DIR/implicit_unsafe_autorefs.rs:5 :18
1+ warning : implicit auto-ref creates a reference to a dereference of a raw pointer
2+ --> $DIR/implicit_unsafe_autorefs.rs:6 :18
33 |
44LL | addr_of_mut!((*ptr)[..16])
55 | ^^^^^^
66 |
77 = note: creating a reference requires the pointer to be valid and imposes aliasing requirements
8- = note: `#[deny (implicit_unsafe_autorefs)]` on by default
8+ = note: `#[warn (implicit_unsafe_autorefs)]` on by default
99help: try using a raw pointer method instead; or if this reference is intentional, make it explicit
1010 |
1111LL | addr_of_mut!((&mut (*ptr))[..16])
1212 | +++++ +
1313
14- error : implicit auto-ref creates a reference to a dereference of a raw pointer
15- --> $DIR/implicit_unsafe_autorefs.rs:10 :14
14+ warning : implicit auto-ref creates a reference to a dereference of a raw pointer
15+ --> $DIR/implicit_unsafe_autorefs.rs:11 :14
1616 |
1717LL | addr_of!((*ptr)[..16])
1818 | ^^^^^^
@@ -23,5 +23,5 @@ help: try using a raw pointer method instead; or if this reference is intentiona
2323LL | addr_of!((&(*ptr))[..16])
2424 | ++ +
2525
26- error: aborting due to 2 previous errors
26+ warning: 2 warnings emitted
2727
You can’t perform that action at this time.
0 commit comments