]> git.lizzy.rs Git - rust.git/blob - src/test/ui/imports/unnamed_pub_trait.rs
Sync portable-simd to rust-lang/portable-simd@72df4c45056a8bc0d1b3f06fdc828722177f0763
[rust.git] / src / test / ui / imports / unnamed_pub_trait.rs
1 // aux-build:unnamed_pub_trait_source.rs
2
3 /*
4  * This crate declares an unnameable public path for our item. Make sure we don't suggest
5  * importing it by name, and instead we suggest importing it by glob.
6  */
7 extern crate unnamed_pub_trait_source;
8
9 fn main() {
10     //~^ HELP the following trait is implemented but not in scope; perhaps add a `use` for it:
11     //~| SUGGESTION unnamed_pub_trait_source::prelude::*; // trait Tr
12     use unnamed_pub_trait_source::S;
13     S.method();
14     //~^ ERROR no method named `method` found for struct `S` in the current scope [E0599]
15     //~| HELP items from traits can only be used if the trait is in scope
16 }