]> git.lizzy.rs Git - rust.git/commitdiff
Tweak wording
authorEsteban Küber <esteban@kuber.com.ar>
Thu, 29 Dec 2022 02:46:20 +0000 (18:46 -0800)
committerEsteban Küber <esteban@kuber.com.ar>
Thu, 29 Dec 2022 04:45:07 +0000 (20:45 -0800)
14 files changed:
compiler/rustc_parse/src/parser/diagnostics.rs
compiler/rustc_parse/src/parser/item.rs
compiler/rustc_parse/src/parser/stmt.rs
src/test/ui/parser/diff-markers/enum-2.stderr
src/test/ui/parser/diff-markers/enum.stderr
src/test/ui/parser/diff-markers/fn-arg.stderr
src/test/ui/parser/diff-markers/item-with-attr.stderr
src/test/ui/parser/diff-markers/item.stderr
src/test/ui/parser/diff-markers/statement.stderr
src/test/ui/parser/diff-markers/struct-expr.stderr
src/test/ui/parser/diff-markers/struct.stderr
src/test/ui/parser/diff-markers/trait-item.stderr
src/test/ui/parser/diff-markers/tuple-struct.stderr
src/test/ui/parser/diff-markers/use-statement.stderr

index ffadb77320adcce89c60f839d30009df1be38d61..dd7341af4d52ca2808f54bd8d56bffdbecf229cf 100644 (file)
@@ -2586,7 +2586,6 @@ pub fn recover_diff_marker(&mut self) {
                 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 @@ pub fn recover_diff_marker(&mut self) {
             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()
     }
index b996ce0a15571737fdb3a757698650d1a6e15743..c6b6c04de85042afabc17e2463f60e4a8a205128 100644 (file)
@@ -1583,7 +1583,7 @@ fn parse_tuple_struct_body(&mut self) -> PResult<'a, Vec<FieldDef>> {
             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());
index 4cbf89169b67e83c37a119cb8b7f03ef841c10c5..0daae457d30224caee7db8d154d93c01537c167e 100644 (file)
@@ -537,7 +537,7 @@ pub(crate) fn parse_block_tail(
                 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());
index 5264a5964884c89eded817db3319e6eb64cda60e..4e612a5427a12483193acde0593a0339f8887571 100644 (file)
@@ -2,13 +2,17 @@ error: encountered diff marker
   --> $DIR/enum-2.rs:3:1
    |
 LL | <<<<<<< HEAD
-   | ^^^^^^^ start
+   | ^^^^^^^ after this is the code before the merge
 LL |         x: u8,
 LL | =======
-   | ^^^^^^^ middle
+   | -------
 LL |         x: i8,
 LL | >>>>>>> branch
-   | ^^^^^^^ end
+   | ^^^^^^^ above this are the incoming code changes
+   |
+   = 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
+   = 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
+   = 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>
 
 error: aborting due to previous error
 
index 6bdc20d3cd3248967e905754c4792deece0ddba1..abbf3fb41e790a871427069b56e1b22189f50aec 100644 (file)
@@ -2,13 +2,17 @@ error: encountered diff marker
   --> $DIR/enum.rs:2:1
    |
 LL | <<<<<<< HEAD
-   | ^^^^^^^ start
+   | ^^^^^^^ after this is the code before the merge
 LL |     Foo(u8),
 LL | =======
-   | ^^^^^^^ middle
+   | -------
 LL |     Bar(i8),
 LL | >>>>>>> branch
-   | ^^^^^^^ end
+   | ^^^^^^^ above this are the incoming code changes
+   |
+   = 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
+   = 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
+   = 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>
 
 error: aborting due to previous error
 
index 4a816ff75bc87cefbe6f03954ee005f1cf02480f..933a206410e10803d8850a2213a6bb8cc3c6b75b 100644 (file)
@@ -2,13 +2,17 @@ error: encountered diff marker
   --> $DIR/fn-arg.rs:3:1
    |
 LL | <<<<<<< HEAD
-   | ^^^^^^^ start
+   | ^^^^^^^ after this is the code before the merge
 LL |         x: u8,
 LL | =======
-   | ^^^^^^^ middle
+   | -------
 LL |         x: i8,
 LL | >>>>>>> branch
-   | ^^^^^^^ end
+   | ^^^^^^^ above this are the incoming code changes
+   |
+   = 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
+   = 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
+   = 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>
 
 error: aborting due to previous error
 
index 4fcb782846eb0d784b894eb3abede9b725cb508d..850e2368e55d1aef0ef6fc5854a9938a05d62edd 100644 (file)
@@ -2,13 +2,17 @@ error: encountered diff marker
   --> $DIR/item-with-attr.rs:2:1
    |
 LL | <<<<<<< HEAD
-   | ^^^^^^^ start
+   | ^^^^^^^ after this is the code before the merge
 LL | fn foo() {}
 LL | =======
-   | ^^^^^^^ middle
+   | -------
 LL | fn bar() {}
 LL | >>>>>>> branch
-   | ^^^^^^^ end
+   | ^^^^^^^ above this are the incoming code changes
+   |
+   = 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
+   = 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
+   = 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>
 
 error: aborting due to previous error
 
index 7c81f0fafa6183991cf1ed8738a0d2ca47f2ce92..9ab3631a60e899cbb1ef21ba83b35cba04af29be 100644 (file)
@@ -2,13 +2,17 @@ error: encountered diff marker
   --> $DIR/item.rs:1:1
    |
 LL | <<<<<<< HEAD
-   | ^^^^^^^ start
+   | ^^^^^^^ after this is the code before the merge
 LL | fn foo() {}
 LL | =======
-   | ^^^^^^^ middle
+   | -------
 LL | fn bar() {}
 LL | >>>>>>> branch
-   | ^^^^^^^ end
+   | ^^^^^^^ above this are the incoming code changes
+   |
+   = 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
+   = 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
+   = 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>
 
 error: aborting due to previous error
 
index 4c821c02f0d8df111fa132174034b7cacb292185..7ca2495b829e4e8ad2dc62cd6519269e28286021 100644 (file)
@@ -2,13 +2,17 @@ error: encountered diff marker
   --> $DIR/statement.rs:10:1
    |
 LL | <<<<<<< HEAD
-   | ^^^^^^^ start
+   | ^^^^^^^ after this is the code before the merge
 LL |     S::foo();
 LL | =======
-   | ^^^^^^^ middle
+   | -------
 LL |     S::bar();
 LL | >>>>>>> branch
-   | ^^^^^^^ end
+   | ^^^^^^^ above this are the incoming code changes
+   |
+   = 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
+   = 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
+   = 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>
 
 error: aborting due to previous error
 
index 0ddb1a301e3424fe8ef0dc1a1130e4bd816110bf..d70476a983310e0eadecab6da9165903c99d88b7 100644 (file)
@@ -2,13 +2,17 @@ error: encountered diff marker
   --> $DIR/struct-expr.rs:6:1
    |
 LL | <<<<<<< HEAD
-   | ^^^^^^^ start
+   | ^^^^^^^ after this is the code before the merge
 LL |         x: 42,
 LL | =======
-   | ^^^^^^^ middle
+   | -------
 LL |         x: 0,
 LL | >>>>>>> branch
-   | ^^^^^^^ end
+   | ^^^^^^^ above this are the incoming code changes
+   |
+   = 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
+   = 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
+   = 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>
 
 error: aborting due to previous error
 
index e47bcfdaedcd30b79fd1078ae59df76e3efd41a9..cc0b3da664e7ba222932484598d20b0f621dce12 100644 (file)
@@ -2,13 +2,17 @@ error: encountered diff marker
   --> $DIR/struct.rs:2:1
    |
 LL | <<<<<<< HEAD
-   | ^^^^^^^ start
+   | ^^^^^^^ after this is the code before the merge
 LL |     x: u8,
 LL | =======
-   | ^^^^^^^ middle
+   | -------
 LL |     x: i8,
 LL | >>>>>>> branch
-   | ^^^^^^^ end
+   | ^^^^^^^ above this are the incoming code changes
+   |
+   = 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
+   = 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
+   = 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>
 
 error: aborting due to previous error
 
index 8e18d5db7c745b10840d7ccedae6e72b75bf4b5a..cdc19f8e0765a38be671184a61c5a42d0b3471d4 100644 (file)
@@ -2,13 +2,17 @@ error: encountered diff marker
   --> $DIR/trait-item.rs:2:1
    |
 LL | <<<<<<< HEAD
-   | ^^^^^^^ start
+   | ^^^^^^^ after this is the code before the merge
 LL |     fn foo() {}
 LL | =======
-   | ^^^^^^^ middle
+   | -------
 LL |     fn bar() {}
 LL | >>>>>>> branch
-   | ^^^^^^^ end
+   | ^^^^^^^ above this are the incoming code changes
+   |
+   = 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
+   = 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
+   = 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>
 
 error: aborting due to previous error
 
index 7f30cbcc1f74af0ce5d87cbb2e0f9285a1b7ccb3..d673db89837e7c70ec97d661dfec0559eaa60c6a 100644 (file)
@@ -2,13 +2,17 @@ error: encountered diff marker
   --> $DIR/tuple-struct.rs:2:1
    |
 LL | <<<<<<< HEAD
-   | ^^^^^^^ start
+   | ^^^^^^^ after this is the code before the merge
 LL |     u8,
 LL | =======
-   | ^^^^^^^ middle
+   | -------
 LL |     i8,
 LL | >>>>>>> branch
-   | ^^^^^^^ end
+   | ^^^^^^^ above this are the incoming code changes
+   |
+   = 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
+   = 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
+   = 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>
 
 error: aborting due to previous error
 
index 818c90aa59bac55ba3875a7fbcfd5d159c3ed9b8..12e6f57dd501bb4a919f16efbb756f632c2e33c7 100644 (file)
@@ -2,13 +2,17 @@ error: encountered diff marker
   --> $DIR/use-statement.rs:2:1
    |
 LL | <<<<<<< HEAD
-   | ^^^^^^^ start
+   | ^^^^^^^ after this is the code before the merge
 LL |     bar,
 LL | =======
-   | ^^^^^^^ middle
+   | -------
 LL |     baz,
 LL | >>>>>>> branch
-   | ^^^^^^^ end
+   | ^^^^^^^ above this are the incoming code changes
+   |
+   = 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
+   = 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
+   = 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>
 
 error: aborting due to previous error