Skip to content

Commit 407da0a

Browse files
committed
Rollup merge of rust-lang#53993 - eddyb:issue-53691, r=petrochenkov
rustc_resolve: don't record uniform_paths canaries as reexports. Fixes rust-lang#53691, fixes rust-lang#53484.
2 parents e2e3608 + c34dd37 commit 407da0a

File tree

3 files changed

+46
-1
lines changed

3 files changed

+46
-1
lines changed

src/librustc_resolve/resolve_imports.rs

+9-1
Original file line numberDiff line numberDiff line change
@@ -1147,7 +1147,15 @@ impl<'a, 'b:'a, 'c: 'b> ImportResolver<'a, 'b, 'c> {
11471147
None => continue,
11481148
};
11491149

1150-
if binding.is_import() || binding.is_macro_def() {
1150+
// Don't reexport `uniform_path` canaries.
1151+
let non_canary_import = match binding.kind {
1152+
NameBindingKind::Import { directive, .. } => {
1153+
!directive.is_uniform_paths_canary
1154+
}
1155+
_ => false,
1156+
};
1157+
1158+
if non_canary_import || binding.is_macro_def() {
11511159
let def = binding.def();
11521160
if def != Def::Err {
11531161
if !def.def_id().is_local() {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// Copyright 2018 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+
// edition:2018
12+
13+
#![feature(uniform_paths)]
14+
15+
mod m { pub fn f() {} }
16+
mod n { pub fn g() {} }
17+
18+
pub use m::f;
19+
pub use n::g;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// Copyright 2018 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+
// aux-build:issue-53691.rs
12+
13+
extern crate issue_53691;
14+
15+
fn main() {
16+
issue_53691::f();
17+
issue_53691::g();
18+
}

0 commit comments

Comments
 (0)