Point at path segment on module not found
Point at the correct path segment on a import statement where a module
doesn't exist.
New output:
```rust
error[E0432]: unresolved import `std::bar`
--> <anon>:1:10
|
1 | use std::bar::{foo1, foo2};
| ^^^ Could not find `bar` in `std`
```
instead of:
```rust
error[E0432]: unresolved import `std::bar::foo1`
--> <anon>:1:16
|
1 | use std::bar::{foo1, foo2};
| ^^^^ Could not find `bar` in `std`
error[E0432]: unresolved import `std::bar::foo2`
--> <anon>:1:22
|
1 | use std::bar::{foo1, foo2};
| ^^^^ Could not find `bar` in `std`
```
This commit is contained in:
parent
6c949655de
commit
552ff07758
18 changed files with 194 additions and 129 deletions
13
src/test/ui/span/non-existing-module-import.rs
Normal file
13
src/test/ui/span/non-existing-module-import.rs
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
// Copyright 2017 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::bar::{foo1, foo2};
|
||||
|
||||
fn main() {}
|
||||
8
src/test/ui/span/non-existing-module-import.stderr
Normal file
8
src/test/ui/span/non-existing-module-import.stderr
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
error[E0432]: unresolved import `std::bar`
|
||||
--> $DIR/non-existing-module-import.rs:11:10
|
||||
|
|
||||
11 | use std::bar::{foo1, foo2};
|
||||
| ^^^ Could not find `bar` in `std`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue