Closed
Description
fn main() {
let b = Box::new(0);
let ptr = b.into_raw();
}
Current output:
error[E0599]: no method named `into_raw` found for struct `Box<{integer}>` in the current scope
--> src/main.rs:3:17
|
3 | let ptr = b.into_raw();
| --^^^^^^^^
| | |
| | this is an associated function, not a method
| help: use associated function syntax instead: `Box::<{integer}>::into_raw`
|
= note: found the following associated functions; to be used as methods, functions must have a `self` parameter
= note: the candidate is defined in an impl for the type `Box<T, A>`
However, the "help: use associated function syntax instead: Box::<{integer}>::into_raw
" suggestion is internally marked as "machine applicable", even though it contains the {integer}
placeholder. Running cargo fix --broken-code
on this code, or using rust-analyzer's check-on-save feature and applying the quickfix thus results in invalid code:
fn main() {
let b = Box::new(0);
let ptr = Box::<{integer}>::into_raw();
}