]> git.lizzy.rs Git - rust.git/blob - src/test/ui/rust-2018/trait-import-suggestions.rs
Rollup merge of #105843 - compiler-errors:sugg-const, r=lcnr
[rust.git] / src / test / ui / rust-2018 / trait-import-suggestions.rs
1 // edition:2018
2 // aux-build:trait-import-suggestions.rs
3 // compile-flags:--extern trait-import-suggestions
4
5 mod foo {
6     mod foobar {
7         pub(crate) trait Foobar {
8             fn foobar(&self) { }
9         }
10
11         impl Foobar for u32 { }
12     }
13
14     pub(crate) trait Bar {
15         fn bar(&self) { }
16     }
17
18     impl Bar for u32 { }
19
20     fn in_foo() {
21         let x: u32 = 22;
22         x.foobar(); //~ ERROR no method named `foobar`
23     }
24 }
25
26 fn main() {
27     let x: u32 = 22;
28     x.bar(); //~ ERROR no method named `bar`
29     x.baz(); //~ ERROR no method named `baz`
30     let y = u32::from_str("33"); //~ ERROR no function or associated item named `from_str`
31 }