42aa1273b0
When encountering code like `Box(42)`, suggest `Box::new(42)` and *all* other associated functions that return `-> Box<T>`.
28 lines
897 B
Plaintext
28 lines
897 B
Plaintext
error[E0423]: cannot initialize a tuple struct which contains private fields
|
|
--> $DIR/suggest-box-new.rs:8:19
|
|
|
|
|
LL | wtf: Some(Box(U {
|
|
| ^^^
|
|
|
|
|
note: constructor is not visible here due to private fields
|
|
--> $SRC_DIR/alloc/src/boxed.rs:LL:COL
|
|
|
|
|
= note: private field
|
|
|
|
|
= note: private field
|
|
help: you might have meant to use an associated function to build this type
|
|
|
|
|
LL | wtf: Some(Box::new(U {
|
|
| +++++
|
|
LL | wtf: Some(Box::new_uninit_in(U {
|
|
| +++++++++++++++
|
|
LL | wtf: Some(Box::new_zeroed_in(U {
|
|
| +++++++++++++++
|
|
LL | wtf: Some(Box::new_uninit_slice(U {
|
|
| ++++++++++++++++++
|
|
and 10 other candidates
|
|
|
|
error: aborting due to previous error
|
|
|
|
For more information about this error, try `rustc --explain E0423`.
|