Skip to content

Point at path segment on module not found - #43447

Merged
bors merged 1 commit into
rust-lang:masterfrom
estebank:import-span
Jul 26, 2017
Merged

Point at path segment on module not found#43447
bors merged 1 commit into
rust-lang:masterfrom
estebank:import-span

Conversation

@estebank

@estebankestebank commented Jul 24, 2017

Copy link
Copy Markdown
Contributor

Point at the correct path segment on a import statement where a module
doesn't exist.

New output:

error[E0432]: unresolved import `std::bar`
--> <anon>:1:10
|
1 | use std::bar::{foo1, foo2};
| ^^^ Could not find `bar` in `std`

instead of:

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`

Fix#43040.

@rust-highfive

Copy link
Copy Markdown
Contributor

r? @pnkfelix

(rust_highfive has picked a reviewer for you, use r? to override)

@carols10centscarols10cents added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 24, 2017
@estebank
estebankforce-pushed the import-span branch 3 times, most recently from 8ffc03d to 1213bb8CompareJuly 25, 2017 00:39
@estebank

Copy link
Copy Markdown
ContributorAuthor

r? @nikomatsakis

@nikomatsakis

Copy link
Copy Markdown
Contributor

@bors r+

@bors

bors commented Jul 25, 2017

Copy link
Copy Markdown
Collaborator

📌 Commit 1213bb8 has been approved by nikomatsakis

Comment threadsrc/librustc_resolve/lib.rs Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

;;;;

Hmmm

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

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`
```
@estebank

Copy link
Copy Markdown
ContributorAuthor

@bors r=nikomatsakis

@bors

bors commented Jul 26, 2017

Copy link
Copy Markdown
Collaborator

📌 Commit 552ff07 has been approved by nikomatsakis

@Mark-Simulacrum

Copy link
Copy Markdown
Member

@bors rollup

Mark-Simulacrum added a commit to Mark-Simulacrum/rust that referenced this pull request Jul 26, 2017
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`
```
Fixrust-lang#43040.
bors added a commit that referenced this pull request Jul 26, 2017
Rollup of 10 pull requests
- Successful merges: #42959, #43447, #43455, #43456, #43458, #43462, #43463, #43465, #43471, #43480
- Failed merges:
@bors
bors merged commit 552ff07 into rust-lang:masterJul 26, 2017
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-reviewStatus: Awaiting review from the assignee but also interested parties.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"Could not find <module> in <module>" uses wrong span when {...} are involved

8 participants

@estebank@rust-highfive@nikomatsakis@bors@Mark-Simulacrum@petrochenkov@pnkfelix@carols10cents