Skip to content

librustc: offer suggestions for unresolved names. - #5096

Closed
luqmana wants to merge 3 commits into
rust-lang:incomingfrom
luqmana:spell
Closed

librustc: offer suggestions for unresolved names.#5096
luqmana wants to merge 3 commits into
rust-lang:incomingfrom
luqmana:spell

Conversation

@luqmana

@luqmana luqmana commented Feb 23, 2013

Copy link
Copy Markdown
Contributor

Address #2281

-> % cat foo.rs
fn foo() -> int {
    let bar = 10;

    bad
}
-> % rustc foo.rs
foo.rs:4:4: 4:7 error: unresolved name: `bad`. Did you mean: `bar`?
foo.rs:4     bad
             ^~~
error: aborting due to previous error

@bstrie

bstrie commented Feb 23, 2013

Copy link
Copy Markdown
Contributor

This looks really cool.

@jdm

jdm commented Feb 23, 2013

Copy link
Copy Markdown
Contributor

\o/

@luqmana

luqmana commented Feb 27, 2013

Copy link
Copy Markdown
Contributor Author

r? @catamorphism

bors added a commit that referenced this pull request Feb 27, 2013
Address #2281


```
-> % cat foo.rs
fn foo() -> int {
    let bar = 10;

    bad
}
```

```
-> % rustc foo.rs
foo.rs:4:4: 4:7 error: unresolved name: `bad`. Did you mean: `bar`?
foo.rs:4     bad
             ^~~
error: aborting due to previous error
```
@bors bors closed this Feb 27, 2013
bors added a commit to rust-lang-ci/rust that referenced this pull request May 2, 2020
Don't use ExpnKind::descr to get the name of a bang macro.

This is the same change as the first commit in rust-lang#68407, but applied to clippy.
The new code should work both before and after the changes in rust-lang#68407.

changelog: none
RalfJung added a commit to RalfJung/rust that referenced this pull request Jun 12, 2026
U007D pushed a commit to U007D/rust-mos that referenced this pull request Aug 21, 2026
5096: Fix handling of whitespace when applying SSR within macro expansions. r=matklad a=davidlattimore

I originally did replacement by passing in the full file text. Then as some point I thought I could do without it. Turns out calling .text() on a node coming from a macro expansion isn't a great idea, especially when you then try and use ranges from the original source to cut that text. The test I added here actually panics without the rest of this change (sorry I didn't notice sooner).

5097: Fix SSR prompt following rust-lang#4919 r=matklad a=davidlattimore



Co-authored-by: David Lattimore <dml@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants