You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
borrow_deref_ref ignores the usage of &raw const *s and treats it like &*s, which is obviously wrong.
Lint Name
borrow_deref_ref
Reproducer
I tried this code:
fnmain(){let s = "Hello, world!\n";let p = &rawconst*s;unsafe{
libc::printf(p as*consti8);}}
I saw this happen:
warning: deref on an immutable reference
--> src/main.rs:3:13
|
3 | let p = &raw const *s;
| ^^^^^^^^^^^^^ help: if you would like to reborrow, try removing `&*`: `s`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrow_deref_ref
= note: `#[warn(clippy::borrow_deref_ref)]` on by default
Activity
Auto merge of #13600 - samueltardieu:push-tzuvnutssmrs, r=xFrednet