Skip to content

Commit 8457ab6

Browse files
authored
Rollup merge of rust-lang#36882 - jseyfried:fix_36881, r=eddyb
resolve: fix incorrect code in `module_to_string` Fixes rust-lang#36881. r? @nrc or @eddyb
2 parents 987aea5 + 91e1f24 commit 8457ab6

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

src/librustc_resolve/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3534,7 +3534,7 @@ fn module_to_string(module: Module) -> String {
35343534
} else {
35353535
// danger, shouldn't be ident?
35363536
names.push(token::intern("<opaque>"));
3537-
collect_mod(names, module);
3537+
collect_mod(names, module.parent.unwrap());
35383538
}
35393539
}
35403540
collect_mod(&mut names, module);

src/test/compile-fail/issue-36881.rs

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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+
fn main() {
12+
extern crate rand;
13+
use rand::Rng; //~ ERROR unresolved import
14+
}

0 commit comments

Comments
 (0)