]> git.lizzy.rs Git - rust.git/blob - tests/ui/suggestions/into-convert.rs
Rollup merge of #106751 - clubby789:const-intrinsic, r=GuillaumeGomez
[rust.git] / tests / ui / suggestions / into-convert.rs
1 use std::path::{Path, PathBuf};
2 use std::sync::atomic::AtomicU32;
3 use std::sync::Arc;
4
5 fn main() {
6     let x: A = B;
7     //~^ ERROR mismatched types
8     //~| HELP call `Into::into` on this expression to convert `B` into `A`
9
10     let y: Arc<Path> = PathBuf::new();
11     //~^ ERROR mismatched types
12     //~| HELP call `Into::into` on this expression to convert `PathBuf` into `Arc<Path>`
13
14     let z: AtomicU32 = 1;
15     //~^ ERROR mismatched types
16     //~| HELP call `Into::into` on this expression to convert `{integer}` into `AtomicU32`
17 }
18
19 struct A;
20 struct B;
21
22 impl From<B> for A {
23     fn from(_: B) -> Self {
24         A
25     }
26 }