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` --> $DIR/non-primitive-cast-135412.rs:8:13 | LL | let _ = "String" as Arc; | ^^^^^^^^^^^^^^^^^^^^ 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; LL + let _ = Arc::::from("String"); | error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0605`.