Skip to content

Commit ae85375

Browse files
committed
no need to special case std
1 parent 32da6cc commit ae85375

File tree

2 files changed

+7
-11
lines changed

2 files changed

+7
-11
lines changed

src/librustc_resolve/lib.rs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4273,12 +4273,9 @@ impl<'a, 'crateloader: 'a> Resolver<'a, 'crateloader> {
42734273
if self.session.rust_2018() {
42744274
// crate-local absolute paths start with `crate::` in edition 2018
42754275
// FIXME: may also be stabilized for Rust 2015 (Issues #45477, #44660)
4276-
let first_segment_ident = segms[0].ident;
4277-
if first_segment_ident.name != "std" {
4278-
segms.insert(
4279-
0, ast::PathSegment::from_ident(crate_name)
4280-
);
4281-
}
4276+
segms.insert(
4277+
0, ast::PathSegment::from_ident(crate_name)
4278+
);
42824279
}
42834280

42844281
segms.push(ast::PathSegment::from_ident(ident));
@@ -4307,8 +4304,7 @@ impl<'a, 'crateloader: 'a> Resolver<'a, 'crateloader> {
43074304

43084305
let is_extern_crate_that_also_appears_in_prelude =
43094306
name_binding.is_extern_crate() &&
4310-
self.session.rust_2018() &&
4311-
self.extern_prelude.contains(&ident.name);
4307+
self.session.rust_2018();
43124308

43134309
let is_visible_to_user =
43144310
!in_module_is_extern || name_binding.vis == ty::Visibility::Public;

src/test/ui/rust-2018/issue-52202-use-suggestions.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ LL | use crate::plumbing::Drain;
99
|
1010
LL | use std::collections::binary_heap::Drain;
1111
|
12-
LL | use std::collections::binary_heap::Drain;
13-
|
1412
LL | use std::collections::hash_map::Drain;
1513
|
16-
and 9 other candidates
14+
LL | use std::collections::hash_set::Drain;
15+
|
16+
and 3 other candidates
1717

1818
error: aborting due to previous error
1919

0 commit comments

Comments
 (0)