File tree 2 files changed +29
-2
lines changed
2 files changed +29
-2
lines changed Original file line number Diff line number Diff line change @@ -2274,7 +2274,7 @@ impl<'a> Resolver<'a> {
2274
2274
let resolution = if let Some ( resolution) = self . resolve_possibly_assoc_item ( pat_id,
2275
2275
qself, path, namespace) {
2276
2276
if resolution. depth == 0 {
2277
- if expected_fn ( resolution. base_def ) {
2277
+ if expected_fn ( resolution. base_def ) || resolution . base_def == Def :: Err {
2278
2278
resolution
2279
2279
} else {
2280
2280
resolve_error (
@@ -2345,7 +2345,7 @@ impl<'a> Resolver<'a> {
2345
2345
) ;
2346
2346
None
2347
2347
}
2348
- Def :: Local ( ..) | Def :: Upvar ( ..) | Def :: Fn ( ..) => {
2348
+ Def :: Local ( ..) | Def :: Upvar ( ..) | Def :: Fn ( ..) | Def :: Err => {
2349
2349
// These entities are explicitly allowed
2350
2350
// to be shadowed by fresh bindings.
2351
2351
None
Original file line number Diff line number Diff line change
1
+ // Copyright 2016 The Rust Project Developers. See the COPYRIGHT
2
+ // file at the top-level directory of this distribution and at
3
+ // http://rust-lang.org/COPYRIGHT.
4
+ //
5
+ // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6
+ // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7
+ // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8
+ // option. This file may not be copied, modified, or distributed
9
+ // except according to those terms.
10
+
11
+ // Check that unresolved imports do not create additional errors and ICEs
12
+
13
+ mod m {
14
+ pub use unresolved; //~ ERROR unresolved import `unresolved`
15
+
16
+ fn f ( ) {
17
+ let unresolved = 0 ; // OK
18
+ }
19
+ }
20
+
21
+ fn main ( ) {
22
+ match 0u8 {
23
+ m:: unresolved => { } // OK
24
+ m:: unresolved( ..) => { } // OK
25
+ m:: unresolved { ..} => { } // OK
26
+ }
27
+ }
You can’t perform that action at this time.
0 commit comments