-
-
Notifications
You must be signed in to change notification settings - Fork 14.9k
Expand file tree
/
Copy pathno-transparent-fail.rs
More file actions
47 lines (41 loc) · 1.17 KB
/
no-transparent-fail.rs
File metadata and controls
47 lines (41 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
//@ check-fail
//@ edition:2018
// gate-test-transparent_modules
mod y {
macro_rules! s {
() => {};
}
pub(crate) use s;
}
trait IWantAMethod {
fn method(&self) {}
}
impl IWantAMethod for () {}
fn foo() {
struct S;
impl S {
const NAME: &'static str = "S";
}
enum C {
B,
}
use y::s;
mod x {
// early resolution
s!(); //~ ERROR cannot find macro `s` in this scope
// late resolution
struct Y(S); //~ ERROR cannot find type `S` in this scope
impl Y {
// hir_typeck type dependent name resolution of associated const
const SNAME: &'static str = S::NAME; //~ ERROR failed to resolve: use of undeclared type `S`
}
fn bar() -> C {
//~^ ERROR cannot find type `C` in this scope
// method lookup, resolving appropriate trait in scope
().method(); //~ ERROR no method named `method` found for unit type `()` in the current scope
// hir ty lowering type dependent name resolution of associated enum variant
C::B //~ ERROR failed to resolve: use of undeclared type `C`
}
}
}
fn main() {}