diff options
| author | bors <bors@rust-lang.org> | 2015-11-27 18:41:53 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2015-11-27 18:41:53 +0000 |
| commit | 5dc91a74b1428cf3d09a868727bf20b347664137 (patch) | |
| tree | 1c9f0209f7ec74bc6ecbdc83ded5fda46a29c397 /src/rustllvm/RustWrapper.cpp | |
| parent | ca6365037f2af12d7692672c17788be7e0af98cb (diff) | |
| parent | 4bb7cf11dcb7b4d106456b9c34c2e30638615f47 (diff) | |
| download | rust-5dc91a74b1428cf3d09a868727bf20b347664137.tar.gz rust-5dc91a74b1428cf3d09a868727bf20b347664137.zip | |
Auto merge of #30064 - fhartwig:macro-suggestions, r=sanxiyn
Fixes #13677
This does the same sort of suggestion for misspelt macros that we already do for misspelt identifiers.
Example. Compiling this program:
```rust
macro_rules! foo {
($e:expr) => ( $e )
}
fn main() {
fob!("hello!");
}
```
gives the following error message:
```
/Users/mcp/temp/test.rs:7:5: 7:8 error: macro undefined: 'fob!'
/Users/mcp/temp/test.rs:7 fob!("hello!");
^~~
/Users/mcp/temp/test.rs:7:5: 7:8 help: did you mean `foo`?
/Users/mcp/temp/test.rs:7 fob!("hello!");
```
I had to move the levenshtein distance function into libsyntax for this. Maybe this should live somewhere else (some utility crate?), but I couldn't find a crate to put it in that is imported by libsyntax and the other rustc crates.
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions
