Fixed 53359: E0432 unresolved import on the same line is now emiting one diagnostic

Addressed estebank's comments for 53359
This commit is contained in:
Pramod Bisht 2018-09-03 17:27:14 +00:00
parent c2afca3667
commit 21ba03e2b9
5 changed files with 87 additions and 28 deletions

View file

@ -1,12 +1,3 @@
error[E0432]: unresolved import `a::$crate`
--> $DIR/dollar-crate-is-keyword-2.rs:15:13
|
LL | use a::$crate; //~ ERROR unresolved import `a::$crate`
| ^^^^^^^^^ no `$crate` in `a`
...
LL | m!();
| ----- in this macro invocation
error[E0433]: failed to resolve. `$crate` in paths can only be used in start position
--> $DIR/dollar-crate-is-keyword-2.rs:16:16
|
@ -16,6 +7,15 @@ LL | use a::$crate::b; //~ ERROR `$crate` in paths can only be used in s
LL | m!();
| ----- in this macro invocation
error[E0432]: unresolved import `a::$crate`
--> $DIR/dollar-crate-is-keyword-2.rs:15:13
|
LL | use a::$crate; //~ ERROR unresolved import `a::$crate`
| ^^^^^^^^^ no `$crate` in `a`
...
LL | m!();
| ----- in this macro invocation
error[E0433]: failed to resolve. `$crate` in paths can only be used in start position
--> $DIR/dollar-crate-is-keyword-2.rs:17:21
|

View file

@ -0,0 +1,14 @@
// 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.
use std::time::{foo, bar, buzz};
use std::time::{abc, def};
fn main(){
println!("Hello World!");
}

View file

@ -0,0 +1,20 @@
error[E0432]: unresolved imports `std::time::foo`, `std::time::bar`, `std::time::buzz`
--> $DIR/issue-53565.rs:10:17
|
LL | use std::time::{foo, bar, buzz};
| ^^^ ^^^ ^^^^ no `buzz` in `time`
| | |
| | no `bar` in `time`
| no `foo` in `time`
error[E0432]: unresolved imports `std::time::abc`, `std::time::def`
--> $DIR/issue-53565.rs:11:17
|
LL | use std::time::{abc, def};
| ^^^ ^^^ no `def` in `time`
| |
| no `abc` in `time`
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0432`.