]> git.proxmox.com Git - rustc.git/blame - src/test/ui/rust-2018/trait-import-suggestions.rs
New upstream version 1.66.0+dfsg1
[rustc.git] / src / test / ui / rust-2018 / trait-import-suggestions.rs
CommitLineData
8faf50e0 1// edition:2018
0bf4aa26
XL
2// aux-build:trait-import-suggestions.rs
3// compile-flags:--extern trait-import-suggestions
0531ce1d 4
b7449926 5mod foo {
0bf4aa26
XL
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;
a1dfa0c6 22 x.foobar(); //~ ERROR no method named `foobar`
0bf4aa26 23 }
b7449926 24}
0531ce1d 25
8faf50e0 26fn main() {
0bf4aa26 27 let x: u32 = 22;
a1dfa0c6
XL
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`
54a0048b 31}