Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Point at path segment on module not found #43447

Merged
merged 1 commit into from
Jul 26, 2017
Merged

Conversation

estebank
Copy link
Contributor

@estebank estebank commented Jul 24, 2017

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
Collaborator

r? @pnkfelix

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

@carols10cents carols10cents added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 24, 2017
@estebank estebank force-pushed the import-span branch 3 times, most recently from 8ffc03d to 1213bb8 Compare July 25, 2017 00:39
@estebank
Copy link
Contributor Author

r? @nikomatsakis

@nikomatsakis
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Jul 25, 2017

📌 Commit 1213bb8 has been approved by nikomatsakis

};
let mut err = struct_span_err!(resolver.session, span, E0432, "{}", msg);
if let Some((_, p)) = name {
let mut err = struct_span_err!(resolver.session, span, E0432, "{}", msg);;;;
Copy link
Contributor

Choose a reason for hiding this comment

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

;;;;

Hmmm

Copy link
Contributor Author

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
Contributor Author

@bors r=nikomatsakis

@bors
Copy link
Contributor

bors commented Jul 26, 2017

📌 Commit 552ff07 has been approved by nikomatsakis

@Mark-Simulacrum
Copy link
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`
```

Fix rust-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:master Jul 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: 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