blob: e5e9ee134597d61bbdb7d4d9217fa2b614f68b84 [file] [log] [blame]
error[E0605]: non-primitive cast: `u32` as `Option<_>`
--> $DIR/non-primitive-cast-135412.rs:6:13
|
LL | let _ = 7u32 as Option<_>;
| ^^^^^^^^^^^^^^^^^ an `as` expression can only be used to convert between primitive types or to coerce to a specific trait object
|
help: consider using the `From` trait instead
|
LL - let _ = 7u32 as Option<_>;
LL + let _ = Option::<_>::from(7u32);
|
error[E0605]: non-primitive cast: `&'static str` as `Arc<str>`
--> $DIR/non-primitive-cast-135412.rs:8:13
|
LL | let _ = "String" as Arc<str>;
| ^^^^^^^^^^^^^^^^^^^^ an `as` expression can only be used to convert between primitive types or to coerce to a specific trait object
|
help: consider using the `From` trait instead
|
LL - let _ = "String" as Arc<str>;
LL + let _ = Arc::<str>::from("String");
|
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0605`.