diff options
| author | Esteban Küber <esteban@kuber.com.ar> | 2022-12-28 18:46:20 -0800 |
|---|---|---|
| committer | Esteban Küber <esteban@kuber.com.ar> | 2022-12-28 20:45:07 -0800 |
| commit | 698ebe357f3323a953d0751d5764966b3ffb3cb7 (patch) | |
| tree | a56357e3cecd851b88bce564f21ed0eca5ef566f /compiler/rustc_parse/src | |
| parent | 38fd5a9acfd4893e572f20591ffea4f3cfd2fc2e (diff) | |
| download | rust-698ebe357f3323a953d0751d5764966b3ffb3cb7.tar.gz rust-698ebe357f3323a953d0751d5764966b3ffb3cb7.zip | |
Tweak wording
Diffstat (limited to 'compiler/rustc_parse/src')
| -rw-r--r-- | compiler/rustc_parse/src/parser/diagnostics.rs | 19 | ||||
| -rw-r--r-- | compiler/rustc_parse/src/parser/item.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_parse/src/parser/stmt.rs | 2 |
3 files changed, 17 insertions, 6 deletions
diff --git a/compiler/rustc_parse/src/parser/diagnostics.rs b/compiler/rustc_parse/src/parser/diagnostics.rs index ffadb77320a..dd7341af4d5 100644 --- a/compiler/rustc_parse/src/parser/diagnostics.rs +++ b/compiler/rustc_parse/src/parser/diagnostics.rs @@ -2586,7 +2586,6 @@ impl<'a> Parser<'a> { break; } if let Some(span) = self.diff_marker(&TokenKind::EqEq, &TokenKind::Eq) { - spans.push(span); middle = Some(span); } if let Some(span) = self.diff_marker(&TokenKind::BinOp(token::Shr), &TokenKind::Gt) { @@ -2597,13 +2596,25 @@ impl<'a> Parser<'a> { self.bump(); } let mut err = self.struct_span_err(spans, "encountered diff marker"); - err.span_label(start, "start"); + err.span_label(start, "after this is the code before the merge"); if let Some(middle) = middle { - err.span_label(middle, "middle"); + err.span_label(middle, ""); } if let Some(end) = end { - err.span_label(end, "end"); + err.span_label(end, "above this are the incoming code changes"); } + err.help( + "if you're having merge conflicts after pulling new code, the top section is the code \ + you already had and the bottom section is the remote code", + ); + err.help( + "if you're in the middle of a rebase, the top section is the code being rebased onto \ + and the bottom section is the code coming from the current commit being rebased", + ); + err.note( + "for an explanation on these markers from the `git` documentation, visit \ + <https://git-scm.com/book/en/v2/Git-Tools-Advanced-Merging#_checking_out_conflicts>", + ); err.emit(); FatalError.raise() } diff --git a/compiler/rustc_parse/src/parser/item.rs b/compiler/rustc_parse/src/parser/item.rs index b996ce0a155..c6b6c04de85 100644 --- a/compiler/rustc_parse/src/parser/item.rs +++ b/compiler/rustc_parse/src/parser/item.rs @@ -1583,7 +1583,7 @@ impl<'a> Parser<'a> { p.collect_tokens_trailing_token(attrs, ForceCollect::No, |p, attrs| { let mut snapshot = None; if p.is_diff_marker(&TokenKind::BinOp(token::Shl), &TokenKind::Lt) { - // Account for `<<<<<<<` diff markers. We can't proactivelly error here because + // Account for `<<<<<<<` diff markers. We can't proactively error here because // that can be a valid type start, so we snapshot and reparse only we've // encountered another parse error. snapshot = Some(p.create_snapshot_for_diagnostic()); diff --git a/compiler/rustc_parse/src/parser/stmt.rs b/compiler/rustc_parse/src/parser/stmt.rs index 4cbf89169b6..0daae457d30 100644 --- a/compiler/rustc_parse/src/parser/stmt.rs +++ b/compiler/rustc_parse/src/parser/stmt.rs @@ -537,7 +537,7 @@ impl<'a> Parser<'a> { break; } if self.is_diff_marker(&TokenKind::BinOp(token::Shl), &TokenKind::Lt) { - // Account for `<<<<<<<` diff markers. We can't proactivelly error here because + // Account for `<<<<<<<` diff markers. We can't proactively error here because // that can be a valid path start, so we snapshot and reparse only we've // encountered another parse error. snapshot = Some(self.create_snapshot_for_diagnostic()); |
