Skip to content

Commit 1ae0233

Browse files
committed
Stop letting items shadow reexported glob imports
1 parent 1de70d3 commit 1ae0233

File tree

7 files changed

+24
-14
lines changed

7 files changed

+24
-14
lines changed

Diff for: src/libcore/fmt/mod.rs

+10-3
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,14 @@
1212
1313
#![stable(feature = "rust1", since = "1.0.0")]
1414

15-
use prelude::v1::*;
15+
use clone::Clone;
16+
use char::CharExt;
17+
use str::StrExt;
18+
use iter::Iterator;
19+
use slice::SliceExt;
20+
use marker::Sized;
21+
use option::Option::{self, Some, None};
22+
use result::Result::Ok;
1623

1724
use cell::{Cell, RefCell, Ref, RefMut, BorrowState};
1825
use marker::PhantomData;
@@ -980,7 +987,7 @@ impl<'a> Formatter<'a> {
980987
/// afterwards depending on whether right or left alignment is requested.
981988
fn with_padding<F>(&mut self, padding: usize, default: Alignment,
982989
f: F) -> Result
983-
where F: FnOnce(&mut Formatter) -> Result,
990+
where F: ::ops::FnOnce(&mut Formatter) -> Result,
984991
{
985992
use char::CharExt;
986993
let align = match self.align {
@@ -1576,7 +1583,7 @@ impl<T: ?Sized> Debug for PhantomData<T> {
15761583
}
15771584

15781585
#[stable(feature = "rust1", since = "1.0.0")]
1579-
impl<T: Copy + Debug> Debug for Cell<T> {
1586+
impl<T: ::marker::Copy + Debug> Debug for Cell<T> {
15801587
fn fmt(&self, f: &mut Formatter) -> Result {
15811588
write!(f, "Cell {{ value: {:?} }}", self.get())
15821589
}

Diff for: src/librustc_resolve/resolve_imports.rs

-7
Original file line numberDiff line numberDiff line change
@@ -136,13 +136,6 @@ impl<'a> NameResolution<'a> {
136136
_ => { self.binding = Some(binding); return Ok(()); }
137137
};
138138

139-
// FIXME #31337: We currently allow items to shadow glob-imported re-exports.
140-
if !old_binding.is_import() && binding.defined_with(DefModifiers::GLOB_IMPORTED) {
141-
if let NameBindingKind::Import { binding, .. } = binding.kind {
142-
if binding.is_import() { return Ok(()); }
143-
}
144-
}
145-
146139
Err(old_binding)
147140
}
148141
}

Diff for: src/libstd/sys/unix/fs.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010

1111
use prelude::v1::*;
1212
use io::prelude::*;
13-
use os::unix::prelude::*;
13+
use os::unix::prelude::OsStrExt;
14+
use os::unix::prelude::OsStringExt;
1415

1516
use ffi::{CString, CStr, OsString, OsStr};
1617
use fmt;

Diff for: src/libstd/thread/mod.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,8 @@
160160
161161
#![stable(feature = "rust1", since = "1.0.0")]
162162

163-
use prelude::v1::*;
163+
use string::String;
164+
use boxed::Box;
164165

165166
use any::Any;
166167
use cell::UnsafeCell;

Diff for: src/test/compile-fail/resolve-conflict-item-vs-import.rs

+8
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,13 @@ use std::mem::transmute;
1313

1414
fn transmute() {}
1515

16+
mod foo {
17+
pub fn baz() {}
18+
pub use self::baz as bar;
19+
}
20+
21+
use foo::*; //~ ERROR import `bar` conflicts with value in this module
22+
fn bar() {}
23+
1624
fn main() {
1725
}

Diff for: src/test/run-pass/issue-26873-onefile.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ mod A {
2222
pub struct T;
2323
}
2424

25-
pub use self::C::T;
25+
pub use self::C::T as Q;
2626
}
2727

2828
use A::*;

Diff for: src/test/run-pass/issue_26873_multifile/A/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@
1111
pub mod B;
1212
pub mod C;
1313

14-
pub use self::C::T;
14+
pub use self::C::T as Q;
1515

0 commit comments

Comments
 (0)