]> git.proxmox.com Git - rustc.git/blob - tests/ui/imports/unnamed_pub_trait.rs
New upstream version 1.68.2+dfsg1
[rustc.git] / tests / 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 //~^ HELP the following trait is implemented but not in scope; perhaps add a `use` for it:
9 //~| SUGGESTION unnamed_pub_trait_source::prelude::*; // trait Tr
10
11 fn main() {
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 }