]>
Commit | Line | Data |
---|---|---|
13cf67c4 XL |
1 | // edition:2018 |
2 | ||
69743fb6 | 3 | #![allow(non_camel_case_types)] |
532ac7d7 | 4 | #![allow(unused_imports)] |
13cf67c4 XL |
5 | |
6 | mod T { | |
7 | pub struct U; | |
8 | } | |
9 | mod x { | |
10 | pub struct y; | |
11 | } | |
12 | ||
13 | fn type_param<T>() { | |
14 | use T as _; //~ ERROR imports cannot refer to type parameters | |
15 | use T::U; //~ ERROR imports cannot refer to type parameters | |
16 | use T::*; //~ ERROR imports cannot refer to type parameters | |
17 | } | |
18 | ||
19 | fn self_import<T>() { | |
69743fb6 | 20 | use T; //~ ERROR imports cannot refer to type parameters |
13cf67c4 XL |
21 | } |
22 | ||
23 | fn let_binding() { | |
24 | let x = 10; | |
25 | ||
26 | use x as _; //~ ERROR imports cannot refer to local variables | |
27 | use x::y; // OK | |
28 | use x::*; // OK | |
29 | } | |
30 | ||
31 | fn param_binding(x: u8) { | |
32 | use x; //~ ERROR imports cannot refer to local variables | |
33 | } | |
34 | ||
35 | fn match_binding() { | |
36 | match 0 { | |
37 | x => { | |
38 | use x; //~ ERROR imports cannot refer to local variables | |
39 | } | |
40 | } | |
41 | } | |
42 | ||
43 | fn nested<T>() { | |
44 | let x = 10; | |
45 | ||
46 | use {T as _, x}; //~ ERROR imports cannot refer to type parameters | |
47 | //~| ERROR imports cannot refer to local variables | |
48 | } | |
49 | ||
50 | fn main() {} |