From 46859b01b500dbd68115e119e440cb94a1203f9b Mon Sep 17 00:00:00 2001 From: Katherine Philip Date: Thu, 31 Aug 2023 09:10:03 -0700 Subject: [PATCH 1/2] naming refactor: `diff_marker` to `conflict_marker` --- .../rustc_parse/src/parser/diagnostics.rs | 16 ++++++------ compiler/rustc_parse/src/parser/expr.rs | 2 +- compiler/rustc_parse/src/parser/item.rs | 26 +++++++++---------- compiler/rustc_parse/src/parser/stmt.rs | 6 ++--- 4 files changed, 25 insertions(+), 25 deletions(-) diff --git a/compiler/rustc_parse/src/parser/diagnostics.rs b/compiler/rustc_parse/src/parser/diagnostics.rs index 6c8ef34063f87..570632a525bb5 100644 --- a/compiler/rustc_parse/src/parser/diagnostics.rs +++ b/compiler/rustc_parse/src/parser/diagnostics.rs @@ -2705,13 +2705,13 @@ impl<'a> Parser<'a> { Ok(()) } - pub fn is_diff_marker(&mut self, long_kind: &TokenKind, short_kind: &TokenKind) -> bool { + pub fn is_conflict_marker(&mut self, long_kind: &TokenKind, short_kind: &TokenKind) -> bool { (0..3).all(|i| self.look_ahead(i, |tok| tok == long_kind)) && self.look_ahead(3, |tok| tok == short_kind) } - fn diff_marker(&mut self, long_kind: &TokenKind, short_kind: &TokenKind) -> Option { - if self.is_diff_marker(long_kind, short_kind) { + fn conflict_marker(&mut self, long_kind: &TokenKind, short_kind: &TokenKind) -> Option { + if self.is_conflict_marker(long_kind, short_kind) { let lo = self.token.span; for _ in 0..4 { self.bump(); @@ -2721,8 +2721,8 @@ impl<'a> Parser<'a> { None } - pub fn recover_diff_marker(&mut self) { - let Some(start) = self.diff_marker(&TokenKind::BinOp(token::Shl), &TokenKind::Lt) else { + pub fn recover_conflict_marker(&mut self) { + let Some(start) = self.conflict_marker(&TokenKind::BinOp(token::Shl), &TokenKind::Lt) else { return; }; let mut spans = Vec::with_capacity(3); @@ -2734,13 +2734,13 @@ impl<'a> Parser<'a> { if self.token.kind == TokenKind::Eof { break; } - if let Some(span) = self.diff_marker(&TokenKind::OrOr, &TokenKind::BinOp(token::Or)) { + if let Some(span) = self.conflict_marker(&TokenKind::OrOr, &TokenKind::BinOp(token::Or)) { middlediff3 = Some(span); } - if let Some(span) = self.diff_marker(&TokenKind::EqEq, &TokenKind::Eq) { + if let Some(span) = self.conflict_marker(&TokenKind::EqEq, &TokenKind::Eq) { middle = Some(span); } - if let Some(span) = self.diff_marker(&TokenKind::BinOp(token::Shr), &TokenKind::Gt) { + if let Some(span) = self.conflict_marker(&TokenKind::BinOp(token::Shr), &TokenKind::Gt) { spans.push(span); end = Some(span); break; diff --git a/compiler/rustc_parse/src/parser/expr.rs b/compiler/rustc_parse/src/parser/expr.rs index 9ae3ef6172c73..805ce4f412918 100644 --- a/compiler/rustc_parse/src/parser/expr.rs +++ b/compiler/rustc_parse/src/parser/expr.rs @@ -3276,7 +3276,7 @@ impl<'a> Parser<'a> { /// Parses `ident (COLON expr)?`. fn parse_expr_field(&mut self) -> PResult<'a, ExprField> { let attrs = self.parse_outer_attributes()?; - self.recover_diff_marker(); + self.recover_conflict_marker(); self.collect_tokens_trailing_token(attrs, ForceCollect::No, |this, attrs| { let lo = this.token.span; diff --git a/compiler/rustc_parse/src/parser/item.rs b/compiler/rustc_parse/src/parser/item.rs index 233c701641759..f1991efb05ffe 100644 --- a/compiler/rustc_parse/src/parser/item.rs +++ b/compiler/rustc_parse/src/parser/item.rs @@ -102,9 +102,9 @@ impl<'a> Parser<'a> { fn_parse_mode: FnParseMode, force_collect: ForceCollect, ) -> PResult<'a, Option> { - self.recover_diff_marker(); + self.recover_conflict_marker(); let attrs = self.parse_outer_attributes()?; - self.recover_diff_marker(); + self.recover_conflict_marker(); self.parse_item_common(attrs, true, false, fn_parse_mode, force_collect) } @@ -685,7 +685,7 @@ impl<'a> Parser<'a> { if self.recover_doc_comment_before_brace() { continue; } - self.recover_diff_marker(); + self.recover_conflict_marker(); match parse_item(self) { Ok(None) => { let mut is_unnecessary_semicolon = !items.is_empty() @@ -1014,7 +1014,7 @@ impl<'a> Parser<'a> { /// ``` fn parse_use_tree_list(&mut self) -> PResult<'a, ThinVec<(UseTree, ast::NodeId)>> { self.parse_delim_comma_seq(Delimiter::Brace, |p| { - p.recover_diff_marker(); + p.recover_conflict_marker(); Ok((p.parse_use_tree()?, DUMMY_NODE_ID)) }) .map(|(r, _)| r) @@ -1435,9 +1435,9 @@ impl<'a> Parser<'a> { } fn parse_enum_variant(&mut self) -> PResult<'a, Option> { - self.recover_diff_marker(); + self.recover_conflict_marker(); let variant_attrs = self.parse_outer_attributes()?; - self.recover_diff_marker(); + self.recover_conflict_marker(); self.collect_tokens_trailing_token( variant_attrs, ForceCollect::No, @@ -1647,8 +1647,8 @@ impl<'a> Parser<'a> { let attrs = p.parse_outer_attributes()?; 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 proactively error here because + if p.is_conflict_marker(&TokenKind::BinOp(token::Shl), &TokenKind::Lt) { + // Account for `<<<<<<<` conflict 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()); @@ -1658,7 +1658,7 @@ impl<'a> Parser<'a> { Ok(vis) => vis, Err(err) => { if let Some(ref mut snapshot) = snapshot { - snapshot.recover_diff_marker(); + snapshot.recover_conflict_marker(); } return Err(err); } @@ -1667,7 +1667,7 @@ impl<'a> Parser<'a> { Ok(ty) => ty, Err(err) => { if let Some(ref mut snapshot) = snapshot { - snapshot.recover_diff_marker(); + snapshot.recover_conflict_marker(); } return Err(err); } @@ -1692,9 +1692,9 @@ impl<'a> Parser<'a> { /// Parses an element of a struct declaration. fn parse_field_def(&mut self, adt_ty: &str) -> PResult<'a, FieldDef> { - self.recover_diff_marker(); + self.recover_conflict_marker(); let attrs = self.parse_outer_attributes()?; - self.recover_diff_marker(); + self.recover_conflict_marker(); self.collect_tokens_trailing_token(attrs, ForceCollect::No, |this, attrs| { let lo = this.token.span; let vis = this.parse_visibility(FollowedByType::No)?; @@ -2480,7 +2480,7 @@ impl<'a> Parser<'a> { let mut first_param = true; // Parse the arguments, starting out with `self` being allowed... let (mut params, _) = self.parse_paren_comma_seq(|p| { - p.recover_diff_marker(); + p.recover_conflict_marker(); let param = p.parse_param_general(req_name, first_param).or_else(|mut e| { e.emit(); let lo = p.prev_token.span; diff --git a/compiler/rustc_parse/src/parser/stmt.rs b/compiler/rustc_parse/src/parser/stmt.rs index 12c267351b9aa..2f9cb9f3e54ce 100644 --- a/compiler/rustc_parse/src/parser/stmt.rs +++ b/compiler/rustc_parse/src/parser/stmt.rs @@ -552,8 +552,8 @@ impl<'a> Parser<'a> { if self.token == token::Eof { break; } - if self.is_diff_marker(&TokenKind::BinOp(token::Shl), &TokenKind::Lt) { - // Account for `<<<<<<<` diff markers. We can't proactively error here because + if self.is_conflict_marker(&TokenKind::BinOp(token::Shl), &TokenKind::Lt) { + // Account for `<<<<<<<` conflict 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()); @@ -561,7 +561,7 @@ impl<'a> Parser<'a> { let stmt = match self.parse_full_stmt(recover) { Err(mut err) if recover.yes() => { if let Some(ref mut snapshot) = snapshot { - snapshot.recover_diff_marker(); + snapshot.recover_conflict_marker(); } if self.token == token::Colon { // if next token is following a colon, it's likely a path From fcb03715169f1b011a1edb9b8b7db413d3f063c7 Mon Sep 17 00:00:00 2001 From: Katherine Philip Date: Thu, 31 Aug 2023 09:42:56 -0700 Subject: [PATCH 2/2] update error messages & bless tests --- .../rustc_parse/src/parser/diagnostics.rs | 39 ++++++++++++------- tests/ui/parser/diff-markers/enum-2.rs | 2 +- tests/ui/parser/diff-markers/enum-2.stderr | 16 ++++---- tests/ui/parser/diff-markers/enum.rs | 2 +- tests/ui/parser/diff-markers/enum.stderr | 14 +++---- tests/ui/parser/diff-markers/fn-arg.rs | 2 +- tests/ui/parser/diff-markers/fn-arg.stderr | 14 +++---- .../ui/parser/diff-markers/item-with-attr.rs | 2 +- .../parser/diff-markers/item-with-attr.stderr | 14 +++---- tests/ui/parser/diff-markers/item.rs | 2 +- tests/ui/parser/diff-markers/item.stderr | 14 +++---- tests/ui/parser/diff-markers/statement.rs | 2 +- tests/ui/parser/diff-markers/statement.stderr | 14 +++---- tests/ui/parser/diff-markers/struct-expr.rs | 2 +- .../ui/parser/diff-markers/struct-expr.stderr | 14 +++---- tests/ui/parser/diff-markers/struct.rs | 2 +- tests/ui/parser/diff-markers/struct.stderr | 14 +++---- tests/ui/parser/diff-markers/trait-item.rs | 2 +- .../ui/parser/diff-markers/trait-item.stderr | 14 +++---- tests/ui/parser/diff-markers/tuple-struct.rs | 2 +- .../parser/diff-markers/tuple-struct.stderr | 14 +++---- tests/ui/parser/diff-markers/use-statement.rs | 2 +- .../parser/diff-markers/use-statement.stderr | 14 +++---- 23 files changed, 115 insertions(+), 102 deletions(-) diff --git a/compiler/rustc_parse/src/parser/diagnostics.rs b/compiler/rustc_parse/src/parser/diagnostics.rs index 570632a525bb5..33d6a264f6bd3 100644 --- a/compiler/rustc_parse/src/parser/diagnostics.rs +++ b/compiler/rustc_parse/src/parser/diagnostics.rs @@ -2722,7 +2722,8 @@ impl<'a> Parser<'a> { } pub fn recover_conflict_marker(&mut self) { - let Some(start) = self.conflict_marker(&TokenKind::BinOp(token::Shl), &TokenKind::Lt) else { + let Some(start) = self.conflict_marker(&TokenKind::BinOp(token::Shl), &TokenKind::Lt) + else { return; }; let mut spans = Vec::with_capacity(3); @@ -2734,40 +2735,52 @@ impl<'a> Parser<'a> { if self.token.kind == TokenKind::Eof { break; } - if let Some(span) = self.conflict_marker(&TokenKind::OrOr, &TokenKind::BinOp(token::Or)) { + if let Some(span) = self.conflict_marker(&TokenKind::OrOr, &TokenKind::BinOp(token::Or)) + { middlediff3 = Some(span); } if let Some(span) = self.conflict_marker(&TokenKind::EqEq, &TokenKind::Eq) { middle = Some(span); } - if let Some(span) = self.conflict_marker(&TokenKind::BinOp(token::Shr), &TokenKind::Gt) { + if let Some(span) = self.conflict_marker(&TokenKind::BinOp(token::Shr), &TokenKind::Gt) + { spans.push(span); end = Some(span); break; } self.bump(); } - let mut err = self.struct_span_err(spans, "encountered diff marker"); - err.span_label(start, "after this is the code before the merge"); + let mut err = self.struct_span_err(spans, "encountered git conflict marker"); + + // with diff3 if let Some(middle) = middlediff3 { - err.span_label(middle, ""); + err.span_label( + start, + "between this marker and `|||||||` is the code that we're merging into", + ); + err.span_label(middle, "between this marker and `=======` is the base code (what the two refs diverged from)"); + } else { + err.span_label( + start, + "between this marker and `=======` is the code that we're merging into", + ); } + if let Some(middle) = middle { - err.span_label(middle, ""); + err.span_label(middle, "between this marker and `>>>>>>>` is the incoming code"); } + if let Some(end) = end { - err.span_label(end, "above this are the incoming code changes"); + err.span_label(end, ""); } 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", + "conflict markers indicate that a merge was started but could not be completed due to merge conflicts", ); 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", + "to resolve a conflict, keep only the code you want and then delete the lines containing conflict markers", ); err.note( - "for an explanation on these markers from the `git` documentation, visit \ + "for more information, visit the `git` documentation \ ", ); err.emit(); diff --git a/tests/ui/parser/diff-markers/enum-2.rs b/tests/ui/parser/diff-markers/enum-2.rs index 76ea980fc628d..28c57265841d6 100644 --- a/tests/ui/parser/diff-markers/enum-2.rs +++ b/tests/ui/parser/diff-markers/enum-2.rs @@ -1,6 +1,6 @@ enum E { Foo { -<<<<<<< HEAD //~ ERROR encountered diff marker +<<<<<<< HEAD //~ ERROR encountered git conflict marker x: u8, ||||||| z: (), diff --git a/tests/ui/parser/diff-markers/enum-2.stderr b/tests/ui/parser/diff-markers/enum-2.stderr index 63da5c2a6e1f3..af28fd29fd67d 100644 --- a/tests/ui/parser/diff-markers/enum-2.stderr +++ b/tests/ui/parser/diff-markers/enum-2.stderr @@ -1,21 +1,21 @@ -error: encountered diff marker +error: encountered git conflict marker --> $DIR/enum-2.rs:3:1 | LL | <<<<<<< HEAD - | ^^^^^^^ after this is the code before the merge + | ^^^^^^^ between this marker and `|||||||` is the code that we're merging into LL | x: u8, LL | ||||||| - | ------- + | ------- between this marker and `=======` is the base code (what the two refs diverged from) LL | z: (), LL | ======= - | ------- + | ------- between this marker and `>>>>>>>` is the incoming code LL | y: i8, LL | >>>>>>> branch - | ^^^^^^^ 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 + = help: conflict markers indicate that a merge was started but could not be completed due to merge conflicts + = help: to resolve a conflict, keep only the code you want and then delete the lines containing conflict markers + = note: for more information, visit the `git` documentation error: aborting due to previous error diff --git a/tests/ui/parser/diff-markers/enum.rs b/tests/ui/parser/diff-markers/enum.rs index 45df6e3251d76..31e225ad3b514 100644 --- a/tests/ui/parser/diff-markers/enum.rs +++ b/tests/ui/parser/diff-markers/enum.rs @@ -1,5 +1,5 @@ enum E { -<<<<<<< HEAD //~ ERROR encountered diff marker +<<<<<<< HEAD //~ ERROR encountered git conflict marker Foo(u8), ======= Bar(i8), diff --git a/tests/ui/parser/diff-markers/enum.stderr b/tests/ui/parser/diff-markers/enum.stderr index abbf3fb41e790..948222ffe253b 100644 --- a/tests/ui/parser/diff-markers/enum.stderr +++ b/tests/ui/parser/diff-markers/enum.stderr @@ -1,18 +1,18 @@ -error: encountered diff marker +error: encountered git conflict marker --> $DIR/enum.rs:2:1 | LL | <<<<<<< HEAD - | ^^^^^^^ after this is the code before the merge + | ^^^^^^^ between this marker and `=======` is the code that we're merging into LL | Foo(u8), LL | ======= - | ------- + | ------- between this marker and `>>>>>>>` is the incoming code LL | Bar(i8), LL | >>>>>>> branch - | ^^^^^^^ 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 + = help: conflict markers indicate that a merge was started but could not be completed due to merge conflicts + = help: to resolve a conflict, keep only the code you want and then delete the lines containing conflict markers + = note: for more information, visit the `git` documentation error: aborting due to previous error diff --git a/tests/ui/parser/diff-markers/fn-arg.rs b/tests/ui/parser/diff-markers/fn-arg.rs index 86c355628ab67..31d54ac5cb642 100644 --- a/tests/ui/parser/diff-markers/fn-arg.rs +++ b/tests/ui/parser/diff-markers/fn-arg.rs @@ -1,6 +1,6 @@ trait T { fn foo( -<<<<<<< HEAD //~ ERROR encountered diff marker +<<<<<<< HEAD //~ ERROR encountered git conflict marker x: u8, ======= x: i8, diff --git a/tests/ui/parser/diff-markers/fn-arg.stderr b/tests/ui/parser/diff-markers/fn-arg.stderr index 933a206410e10..8ad5efa4591a0 100644 --- a/tests/ui/parser/diff-markers/fn-arg.stderr +++ b/tests/ui/parser/diff-markers/fn-arg.stderr @@ -1,18 +1,18 @@ -error: encountered diff marker +error: encountered git conflict marker --> $DIR/fn-arg.rs:3:1 | LL | <<<<<<< HEAD - | ^^^^^^^ after this is the code before the merge + | ^^^^^^^ between this marker and `=======` is the code that we're merging into LL | x: u8, LL | ======= - | ------- + | ------- between this marker and `>>>>>>>` is the incoming code LL | x: i8, LL | >>>>>>> branch - | ^^^^^^^ 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 + = help: conflict markers indicate that a merge was started but could not be completed due to merge conflicts + = help: to resolve a conflict, keep only the code you want and then delete the lines containing conflict markers + = note: for more information, visit the `git` documentation error: aborting due to previous error diff --git a/tests/ui/parser/diff-markers/item-with-attr.rs b/tests/ui/parser/diff-markers/item-with-attr.rs index 985907c08b28c..6f86cf8ee9d6b 100644 --- a/tests/ui/parser/diff-markers/item-with-attr.rs +++ b/tests/ui/parser/diff-markers/item-with-attr.rs @@ -1,5 +1,5 @@ #[attribute] -<<<<<<< HEAD //~ ERROR encountered diff marker +<<<<<<< HEAD //~ ERROR encountered git conflict marker fn foo() {} ======= fn bar() {} diff --git a/tests/ui/parser/diff-markers/item-with-attr.stderr b/tests/ui/parser/diff-markers/item-with-attr.stderr index 850e2368e55d1..eb366e62e8d88 100644 --- a/tests/ui/parser/diff-markers/item-with-attr.stderr +++ b/tests/ui/parser/diff-markers/item-with-attr.stderr @@ -1,18 +1,18 @@ -error: encountered diff marker +error: encountered git conflict marker --> $DIR/item-with-attr.rs:2:1 | LL | <<<<<<< HEAD - | ^^^^^^^ after this is the code before the merge + | ^^^^^^^ between this marker and `=======` is the code that we're merging into LL | fn foo() {} LL | ======= - | ------- + | ------- between this marker and `>>>>>>>` is the incoming code LL | fn bar() {} LL | >>>>>>> branch - | ^^^^^^^ 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 + = help: conflict markers indicate that a merge was started but could not be completed due to merge conflicts + = help: to resolve a conflict, keep only the code you want and then delete the lines containing conflict markers + = note: for more information, visit the `git` documentation error: aborting due to previous error diff --git a/tests/ui/parser/diff-markers/item.rs b/tests/ui/parser/diff-markers/item.rs index 4ed36b7b42bcd..6a23d573f61d1 100644 --- a/tests/ui/parser/diff-markers/item.rs +++ b/tests/ui/parser/diff-markers/item.rs @@ -1,4 +1,4 @@ -<<<<<<< HEAD //~ ERROR encountered diff marker +<<<<<<< HEAD //~ ERROR encountered git conflict marker fn foo() {} ======= fn bar() {} diff --git a/tests/ui/parser/diff-markers/item.stderr b/tests/ui/parser/diff-markers/item.stderr index 9ab3631a60e89..0b918dbca579c 100644 --- a/tests/ui/parser/diff-markers/item.stderr +++ b/tests/ui/parser/diff-markers/item.stderr @@ -1,18 +1,18 @@ -error: encountered diff marker +error: encountered git conflict marker --> $DIR/item.rs:1:1 | LL | <<<<<<< HEAD - | ^^^^^^^ after this is the code before the merge + | ^^^^^^^ between this marker and `=======` is the code that we're merging into LL | fn foo() {} LL | ======= - | ------- + | ------- between this marker and `>>>>>>>` is the incoming code LL | fn bar() {} LL | >>>>>>> branch - | ^^^^^^^ 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 + = help: conflict markers indicate that a merge was started but could not be completed due to merge conflicts + = help: to resolve a conflict, keep only the code you want and then delete the lines containing conflict markers + = note: for more information, visit the `git` documentation error: aborting due to previous error diff --git a/tests/ui/parser/diff-markers/statement.rs b/tests/ui/parser/diff-markers/statement.rs index e55d16d3bbb8e..4e074dfa2b935 100644 --- a/tests/ui/parser/diff-markers/statement.rs +++ b/tests/ui/parser/diff-markers/statement.rs @@ -7,7 +7,7 @@ struct S; impl T for S {} fn main() { -<<<<<<< HEAD //~ ERROR encountered diff marker +<<<<<<< HEAD //~ ERROR encountered git conflict marker S::foo(); ======= S::bar(); diff --git a/tests/ui/parser/diff-markers/statement.stderr b/tests/ui/parser/diff-markers/statement.stderr index 7ca2495b829e4..513a6b6caf330 100644 --- a/tests/ui/parser/diff-markers/statement.stderr +++ b/tests/ui/parser/diff-markers/statement.stderr @@ -1,18 +1,18 @@ -error: encountered diff marker +error: encountered git conflict marker --> $DIR/statement.rs:10:1 | LL | <<<<<<< HEAD - | ^^^^^^^ after this is the code before the merge + | ^^^^^^^ between this marker and `=======` is the code that we're merging into LL | S::foo(); LL | ======= - | ------- + | ------- between this marker and `>>>>>>>` is the incoming code LL | S::bar(); LL | >>>>>>> branch - | ^^^^^^^ 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 + = help: conflict markers indicate that a merge was started but could not be completed due to merge conflicts + = help: to resolve a conflict, keep only the code you want and then delete the lines containing conflict markers + = note: for more information, visit the `git` documentation error: aborting due to previous error diff --git a/tests/ui/parser/diff-markers/struct-expr.rs b/tests/ui/parser/diff-markers/struct-expr.rs index 99d2fd662c69c..151eb98e24afe 100644 --- a/tests/ui/parser/diff-markers/struct-expr.rs +++ b/tests/ui/parser/diff-markers/struct-expr.rs @@ -3,7 +3,7 @@ struct S { } fn main() { let _ = S { -<<<<<<< HEAD //~ ERROR encountered diff marker +<<<<<<< HEAD //~ ERROR encountered git conflict marker x: 42, ======= x: 0, diff --git a/tests/ui/parser/diff-markers/struct-expr.stderr b/tests/ui/parser/diff-markers/struct-expr.stderr index d70476a983310..404e298315897 100644 --- a/tests/ui/parser/diff-markers/struct-expr.stderr +++ b/tests/ui/parser/diff-markers/struct-expr.stderr @@ -1,18 +1,18 @@ -error: encountered diff marker +error: encountered git conflict marker --> $DIR/struct-expr.rs:6:1 | LL | <<<<<<< HEAD - | ^^^^^^^ after this is the code before the merge + | ^^^^^^^ between this marker and `=======` is the code that we're merging into LL | x: 42, LL | ======= - | ------- + | ------- between this marker and `>>>>>>>` is the incoming code LL | x: 0, LL | >>>>>>> branch - | ^^^^^^^ 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 + = help: conflict markers indicate that a merge was started but could not be completed due to merge conflicts + = help: to resolve a conflict, keep only the code you want and then delete the lines containing conflict markers + = note: for more information, visit the `git` documentation error: aborting due to previous error diff --git a/tests/ui/parser/diff-markers/struct.rs b/tests/ui/parser/diff-markers/struct.rs index d26464d47bcef..95f3444e84045 100644 --- a/tests/ui/parser/diff-markers/struct.rs +++ b/tests/ui/parser/diff-markers/struct.rs @@ -1,5 +1,5 @@ struct S { -<<<<<<< HEAD //~ ERROR encountered diff marker +<<<<<<< HEAD //~ ERROR encountered git conflict marker x: u8, ======= x: i8, diff --git a/tests/ui/parser/diff-markers/struct.stderr b/tests/ui/parser/diff-markers/struct.stderr index cc0b3da664e7b..4556f2a144654 100644 --- a/tests/ui/parser/diff-markers/struct.stderr +++ b/tests/ui/parser/diff-markers/struct.stderr @@ -1,18 +1,18 @@ -error: encountered diff marker +error: encountered git conflict marker --> $DIR/struct.rs:2:1 | LL | <<<<<<< HEAD - | ^^^^^^^ after this is the code before the merge + | ^^^^^^^ between this marker and `=======` is the code that we're merging into LL | x: u8, LL | ======= - | ------- + | ------- between this marker and `>>>>>>>` is the incoming code LL | x: i8, LL | >>>>>>> branch - | ^^^^^^^ 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 + = help: conflict markers indicate that a merge was started but could not be completed due to merge conflicts + = help: to resolve a conflict, keep only the code you want and then delete the lines containing conflict markers + = note: for more information, visit the `git` documentation error: aborting due to previous error diff --git a/tests/ui/parser/diff-markers/trait-item.rs b/tests/ui/parser/diff-markers/trait-item.rs index 3227c8212c96d..f375dff6898c5 100644 --- a/tests/ui/parser/diff-markers/trait-item.rs +++ b/tests/ui/parser/diff-markers/trait-item.rs @@ -1,5 +1,5 @@ trait T { -<<<<<<< HEAD //~ ERROR encountered diff marker +<<<<<<< HEAD //~ ERROR encountered git conflict marker fn foo() {} ======= fn bar() {} diff --git a/tests/ui/parser/diff-markers/trait-item.stderr b/tests/ui/parser/diff-markers/trait-item.stderr index cdc19f8e0765a..1a28047eb1dae 100644 --- a/tests/ui/parser/diff-markers/trait-item.stderr +++ b/tests/ui/parser/diff-markers/trait-item.stderr @@ -1,18 +1,18 @@ -error: encountered diff marker +error: encountered git conflict marker --> $DIR/trait-item.rs:2:1 | LL | <<<<<<< HEAD - | ^^^^^^^ after this is the code before the merge + | ^^^^^^^ between this marker and `=======` is the code that we're merging into LL | fn foo() {} LL | ======= - | ------- + | ------- between this marker and `>>>>>>>` is the incoming code LL | fn bar() {} LL | >>>>>>> branch - | ^^^^^^^ 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 + = help: conflict markers indicate that a merge was started but could not be completed due to merge conflicts + = help: to resolve a conflict, keep only the code you want and then delete the lines containing conflict markers + = note: for more information, visit the `git` documentation error: aborting due to previous error diff --git a/tests/ui/parser/diff-markers/tuple-struct.rs b/tests/ui/parser/diff-markers/tuple-struct.rs index 7eec35c968da3..f01540f35b038 100644 --- a/tests/ui/parser/diff-markers/tuple-struct.rs +++ b/tests/ui/parser/diff-markers/tuple-struct.rs @@ -1,5 +1,5 @@ struct S( -<<<<<<< HEAD //~ ERROR encountered diff marker +<<<<<<< HEAD //~ ERROR encountered git conflict marker u8, ======= i8, diff --git a/tests/ui/parser/diff-markers/tuple-struct.stderr b/tests/ui/parser/diff-markers/tuple-struct.stderr index d673db89837e7..d58a79e3f94ec 100644 --- a/tests/ui/parser/diff-markers/tuple-struct.stderr +++ b/tests/ui/parser/diff-markers/tuple-struct.stderr @@ -1,18 +1,18 @@ -error: encountered diff marker +error: encountered git conflict marker --> $DIR/tuple-struct.rs:2:1 | LL | <<<<<<< HEAD - | ^^^^^^^ after this is the code before the merge + | ^^^^^^^ between this marker and `=======` is the code that we're merging into LL | u8, LL | ======= - | ------- + | ------- between this marker and `>>>>>>>` is the incoming code LL | i8, LL | >>>>>>> branch - | ^^^^^^^ 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 + = help: conflict markers indicate that a merge was started but could not be completed due to merge conflicts + = help: to resolve a conflict, keep only the code you want and then delete the lines containing conflict markers + = note: for more information, visit the `git` documentation error: aborting due to previous error diff --git a/tests/ui/parser/diff-markers/use-statement.rs b/tests/ui/parser/diff-markers/use-statement.rs index 6306243a5141a..4fc538b2b7002 100644 --- a/tests/ui/parser/diff-markers/use-statement.rs +++ b/tests/ui/parser/diff-markers/use-statement.rs @@ -1,5 +1,5 @@ use foo::{ -<<<<<<< HEAD //~ ERROR encountered diff marker +<<<<<<< HEAD //~ ERROR encountered git conflict marker bar, ======= baz, diff --git a/tests/ui/parser/diff-markers/use-statement.stderr b/tests/ui/parser/diff-markers/use-statement.stderr index 12e6f57dd501b..0afbe9c8ab631 100644 --- a/tests/ui/parser/diff-markers/use-statement.stderr +++ b/tests/ui/parser/diff-markers/use-statement.stderr @@ -1,18 +1,18 @@ -error: encountered diff marker +error: encountered git conflict marker --> $DIR/use-statement.rs:2:1 | LL | <<<<<<< HEAD - | ^^^^^^^ after this is the code before the merge + | ^^^^^^^ between this marker and `=======` is the code that we're merging into LL | bar, LL | ======= - | ------- + | ------- between this marker and `>>>>>>>` is the incoming code LL | baz, LL | >>>>>>> branch - | ^^^^^^^ 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 + = help: conflict markers indicate that a merge was started but could not be completed due to merge conflicts + = help: to resolve a conflict, keep only the code you want and then delete the lines containing conflict markers + = note: for more information, visit the `git` documentation error: aborting due to previous error