diff options
| author | bors <bors@rust-lang.org> | 2023-02-21 12:36:58 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-02-21 12:36:58 +0000 |
| commit | 2a979f8ba02f0c60e327c9764ea27837ba4bb028 (patch) | |
| tree | d9cc6cbdfb11d450d05a47a8b399c7756c2fa8ca /compiler/rustc_parse/src | |
| parent | 9669e57ed1cd81c7f04db39f9b401198ae574c30 (diff) | |
| parent | 4e0cb32311e3e3924ba7d9f93f519ae53ef21bfa (diff) | |
| download | rust-2a979f8ba02f0c60e327c9764ea27837ba4bb028.tar.gz rust-2a979f8ba02f0c60e327c9764ea27837ba4bb028.zip | |
Auto merge of #2794 - RalfJung:rustup, r=RalfJung
Rustup
Diffstat (limited to 'compiler/rustc_parse/src')
| -rw-r--r-- | compiler/rustc_parse/src/parser/item.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/rustc_parse/src/parser/item.rs b/compiler/rustc_parse/src/parser/item.rs index fd46a1292a8..f164bb330f3 100644 --- a/compiler/rustc_parse/src/parser/item.rs +++ b/compiler/rustc_parse/src/parser/item.rs @@ -19,8 +19,8 @@ use rustc_errors::{ struct_span_err, Applicability, DiagnosticBuilder, ErrorGuaranteed, IntoDiagnostic, PResult, StashKey, }; +use rustc_span::edit_distance::edit_distance; use rustc_span::edition::Edition; -use rustc_span::lev_distance::lev_distance; use rustc_span::source_map::{self, Span}; use rustc_span::symbol::{kw, sym, Ident, Symbol}; use rustc_span::DUMMY_SP; @@ -459,7 +459,8 @@ impl<'a> Parser<'a> { // Maybe the user misspelled `macro_rules` (issue #91227) if self.token.is_ident() && path.segments.len() == 1 - && lev_distance("macro_rules", &path.segments[0].ident.to_string(), 3).is_some() + && edit_distance("macro_rules", &path.segments[0].ident.to_string(), 2) + .is_some() { err.span_suggestion( path.span, |
