Auto merge of #54005 - eddyb:uniform-paths-self-resolve, r=petrochenkov

rustc_resolve: allow `use crate_name;` under `uniform_paths`.

Specifically, `use crate_name;` and `use crate_name::{self, ...};` are now allowed, whereas previously there would produce a (false positive) ambiguity error, as the ambiguity detection code was seeing the `crate_name` import as a locally-available definition to conflict with the crate.

r? @petrochenkov cc @aturon @joshtriplett @Centril
This commit is contained in:
bors 2018-09-06 23:29:56 +00:00
commit ad7b22ef29
4 changed files with 39 additions and 32 deletions

View file

@ -1,17 +0,0 @@
// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// edition:2018
#![feature(uniform_paths)]
use std;
fn main() {}

View file

@ -1,14 +0,0 @@
error: `std` import is redundant
--> $DIR/redundant.rs:15:5
|
LL | use std;
| ^^^
| |
| refers to external crate `::std`
| defines `self::std`, shadowing itself
|
= help: remove or write `::std` explicitly instead
= note: relative `use` paths enabled by `#![feature(uniform_paths)]`
error: aborting due to previous error