diff options
| author | bors <bors@rust-lang.org> | 2018-08-22 19:59:52 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2018-08-22 19:59:52 +0000 |
| commit | f1b506af022fdcb054aa90da1fbcf8c0226292d0 (patch) | |
| tree | 43f9e1d2cac8d4a873e634ade9214a6c6baee42d /src/libsyntax/parse | |
| parent | b75b0471a8b87c44e0bd953d2a5c36d896128723 (diff) | |
| parent | f012b4c84e9b44b48510712be0ce64cc964b352a (diff) | |
| download | rust-f1b506af022fdcb054aa90da1fbcf8c0226292d0.tar.gz rust-f1b506af022fdcb054aa90da1fbcf8c0226292d0.zip | |
Auto merge of #53607 - GuillaumeGomez:rollup, r=GuillaumeGomez
Rollup of 10 pull requests
Successful merges:
- #53418 (Mark some suggestions as MachineApplicable)
- #53431 (Moved some feature gate ui tests to correct location)
- #53442 (Update version of rls-data used with save-analysis)
- #53504 (Set applicability for more suggestions.)
- #53541 (Fix missing impl trait display as ret type)
- #53544 (Point at the trait argument when using unboxed closure)
- #53558 (Normalize source line and column numbers.)
- #53562 (Lament the invincibility of the Turbofish)
- #53574 (Suggest direct raw-pointer dereference)
- #53585 (Remove super old comment on function that parses items)
Failed merges:
- #53472 (Use FxHash{Map,Set} instead of the default Hash{Map,Set} everywhere in rustc.)
- #53563 (use String::new() instead of String::from(""), "".to_string(), "".to_owned() or "".into())
r? @ghost
Diffstat (limited to 'src/libsyntax/parse')
| -rw-r--r-- | src/libsyntax/parse/lexer/unicode_chars.rs | 8 | ||||
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 17 |
2 files changed, 14 insertions, 11 deletions
diff --git a/src/libsyntax/parse/lexer/unicode_chars.rs b/src/libsyntax/parse/lexer/unicode_chars.rs index 88ff8582da8..03bf1b5a4e1 100644 --- a/src/libsyntax/parse/lexer/unicode_chars.rs +++ b/src/libsyntax/parse/lexer/unicode_chars.rs @@ -12,7 +12,7 @@ // http://www.unicode.org/Public/security/10.0.0/confusables.txt use syntax_pos::{Span, NO_EXPANSION}; -use errors::DiagnosticBuilder; +use errors::{Applicability, DiagnosticBuilder}; use super::StringReader; const UNICODE_ARRAY: &[(char, &str, char)] = &[ @@ -346,7 +346,11 @@ crate fn check_for_substitution<'a>(reader: &StringReader<'a>, let msg = format!("Unicode character '{}' ({}) looks like '{}' ({}), but it is not", ch, u_name, ascii_char, ascii_name); - err.span_suggestion(span, &msg, ascii_char.to_string()); + err.span_suggestion_with_applicability( + span, + &msg, + ascii_char.to_string(), + Applicability::MaybeIncorrect); true }, None => { diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 5467bab33f9..e85b5dca2b7 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -1079,12 +1079,13 @@ impl<'a> Parser<'a> { self.parse_seq_to_before_tokens(&[ket], sep, TokenExpectType::Expect, f) } - fn parse_seq_to_before_tokens<T, F>(&mut self, - kets: &[&token::Token], - sep: SeqSep, - expect: TokenExpectType, - mut f: F) - -> PResult<'a, Vec<T>> + fn parse_seq_to_before_tokens<T, F>( + &mut self, + kets: &[&token::Token], + sep: SeqSep, + expect: TokenExpectType, + mut f: F, + ) -> PResult<'a, Vec<T>> where F: FnMut(&mut Parser<'a>) -> PResult<'a, T> { let mut first: bool = true; @@ -2058,12 +2059,12 @@ impl<'a> Parser<'a> { TokenExpectType::Expect, |p| p.parse_ty())?; self.bump(); // `)` + let span = lo.to(self.prev_span); let output = if self.eat(&token::RArrow) { Some(self.parse_ty_common(false, false)?) } else { None }; - let span = lo.to(self.prev_span); ParenthesisedArgs { inputs, output, span }.into() }; @@ -6842,8 +6843,6 @@ impl<'a> Parser<'a> { } /// Parse one of the items allowed by the flags. - /// NB: this function no longer parses the items inside an - /// extern crate. fn parse_item_implementation( &mut self, attrs: Vec<Attribute>, |
