Rollup merge of #106242 - estebank:diff-markers, r=jyn514
Detect diff markers in the parser Partly address #32059.
This commit is contained in:
commit
031a2143f0
26 changed files with 438 additions and 5 deletions
11
src/test/ui/parser/diff-markers/enum-2.rs
Normal file
11
src/test/ui/parser/diff-markers/enum-2.rs
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
enum E {
|
||||
Foo {
|
||||
<<<<<<< HEAD //~ ERROR encountered diff marker
|
||||
x: u8,
|
||||
|||||||
|
||||
z: (),
|
||||
=======
|
||||
y: i8,
|
||||
>>>>>>> branch
|
||||
}
|
||||
}
|
||||
21
src/test/ui/parser/diff-markers/enum-2.stderr
Normal file
21
src/test/ui/parser/diff-markers/enum-2.stderr
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
error: encountered diff marker
|
||||
--> $DIR/enum-2.rs:3:1
|
||||
|
|
||||
LL | <<<<<<< HEAD
|
||||
| ^^^^^^^ after this is the code before the merge
|
||||
LL | x: u8,
|
||||
LL | |||||||
|
||||
| -------
|
||||
LL | z: (),
|
||||
LL | =======
|
||||
| -------
|
||||
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 <https://git-scm.com/book/en/v2/Git-Tools-Advanced-Merging#_checking_out_conflicts>
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
7
src/test/ui/parser/diff-markers/enum.rs
Normal file
7
src/test/ui/parser/diff-markers/enum.rs
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
enum E {
|
||||
<<<<<<< HEAD //~ ERROR encountered diff marker
|
||||
Foo(u8),
|
||||
=======
|
||||
Bar(i8),
|
||||
>>>>>>> branch
|
||||
}
|
||||
18
src/test/ui/parser/diff-markers/enum.stderr
Normal file
18
src/test/ui/parser/diff-markers/enum.stderr
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
error: encountered diff marker
|
||||
--> $DIR/enum.rs:2:1
|
||||
|
|
||||
LL | <<<<<<< HEAD
|
||||
| ^^^^^^^ after this is the code before the merge
|
||||
LL | Foo(u8),
|
||||
LL | =======
|
||||
| -------
|
||||
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 <https://git-scm.com/book/en/v2/Git-Tools-Advanced-Merging#_checking_out_conflicts>
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
16
src/test/ui/parser/diff-markers/fn-arg.rs
Normal file
16
src/test/ui/parser/diff-markers/fn-arg.rs
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
trait T {
|
||||
fn foo(
|
||||
<<<<<<< HEAD //~ ERROR encountered diff marker
|
||||
x: u8,
|
||||
=======
|
||||
x: i8,
|
||||
>>>>>>> branch
|
||||
) {}
|
||||
}
|
||||
|
||||
struct S;
|
||||
impl T for S {}
|
||||
|
||||
fn main() {
|
||||
S::foo(42);
|
||||
}
|
||||
18
src/test/ui/parser/diff-markers/fn-arg.stderr
Normal file
18
src/test/ui/parser/diff-markers/fn-arg.stderr
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
error: encountered diff marker
|
||||
--> $DIR/fn-arg.rs:3:1
|
||||
|
|
||||
LL | <<<<<<< HEAD
|
||||
| ^^^^^^^ after this is the code before the merge
|
||||
LL | x: u8,
|
||||
LL | =======
|
||||
| -------
|
||||
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 <https://git-scm.com/book/en/v2/Git-Tools-Advanced-Merging#_checking_out_conflicts>
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
10
src/test/ui/parser/diff-markers/item-with-attr.rs
Normal file
10
src/test/ui/parser/diff-markers/item-with-attr.rs
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
#[attribute]
|
||||
<<<<<<< HEAD //~ ERROR encountered diff marker
|
||||
fn foo() {}
|
||||
=======
|
||||
fn bar() {}
|
||||
>>>>>>> branch
|
||||
|
||||
fn main() {
|
||||
foo();
|
||||
}
|
||||
18
src/test/ui/parser/diff-markers/item-with-attr.stderr
Normal file
18
src/test/ui/parser/diff-markers/item-with-attr.stderr
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
error: encountered diff marker
|
||||
--> $DIR/item-with-attr.rs:2:1
|
||||
|
|
||||
LL | <<<<<<< HEAD
|
||||
| ^^^^^^^ after this is the code before the merge
|
||||
LL | fn foo() {}
|
||||
LL | =======
|
||||
| -------
|
||||
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 <https://git-scm.com/book/en/v2/Git-Tools-Advanced-Merging#_checking_out_conflicts>
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
9
src/test/ui/parser/diff-markers/item.rs
Normal file
9
src/test/ui/parser/diff-markers/item.rs
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<<<<<<< HEAD //~ ERROR encountered diff marker
|
||||
fn foo() {}
|
||||
=======
|
||||
fn bar() {}
|
||||
>>>>>>> branch
|
||||
|
||||
fn main() {
|
||||
foo();
|
||||
}
|
||||
18
src/test/ui/parser/diff-markers/item.stderr
Normal file
18
src/test/ui/parser/diff-markers/item.stderr
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
error: encountered diff marker
|
||||
--> $DIR/item.rs:1:1
|
||||
|
|
||||
LL | <<<<<<< HEAD
|
||||
| ^^^^^^^ after this is the code before the merge
|
||||
LL | fn foo() {}
|
||||
LL | =======
|
||||
| -------
|
||||
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 <https://git-scm.com/book/en/v2/Git-Tools-Advanced-Merging#_checking_out_conflicts>
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
15
src/test/ui/parser/diff-markers/statement.rs
Normal file
15
src/test/ui/parser/diff-markers/statement.rs
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
trait T {
|
||||
fn foo() {}
|
||||
fn bar() {}
|
||||
}
|
||||
|
||||
struct S;
|
||||
impl T for S {}
|
||||
|
||||
fn main() {
|
||||
<<<<<<< HEAD //~ ERROR encountered diff marker
|
||||
S::foo();
|
||||
=======
|
||||
S::bar();
|
||||
>>>>>>> branch
|
||||
}
|
||||
18
src/test/ui/parser/diff-markers/statement.stderr
Normal file
18
src/test/ui/parser/diff-markers/statement.stderr
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
error: encountered diff marker
|
||||
--> $DIR/statement.rs:10:1
|
||||
|
|
||||
LL | <<<<<<< HEAD
|
||||
| ^^^^^^^ after this is the code before the merge
|
||||
LL | S::foo();
|
||||
LL | =======
|
||||
| -------
|
||||
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 <https://git-scm.com/book/en/v2/Git-Tools-Advanced-Merging#_checking_out_conflicts>
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
12
src/test/ui/parser/diff-markers/struct-expr.rs
Normal file
12
src/test/ui/parser/diff-markers/struct-expr.rs
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
struct S {
|
||||
x: u8,
|
||||
}
|
||||
fn main() {
|
||||
let _ = S {
|
||||
<<<<<<< HEAD //~ ERROR encountered diff marker
|
||||
x: 42,
|
||||
=======
|
||||
x: 0,
|
||||
>>>>>>> branch
|
||||
}
|
||||
}
|
||||
18
src/test/ui/parser/diff-markers/struct-expr.stderr
Normal file
18
src/test/ui/parser/diff-markers/struct-expr.stderr
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
error: encountered diff marker
|
||||
--> $DIR/struct-expr.rs:6:1
|
||||
|
|
||||
LL | <<<<<<< HEAD
|
||||
| ^^^^^^^ after this is the code before the merge
|
||||
LL | x: 42,
|
||||
LL | =======
|
||||
| -------
|
||||
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 <https://git-scm.com/book/en/v2/Git-Tools-Advanced-Merging#_checking_out_conflicts>
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
7
src/test/ui/parser/diff-markers/struct.rs
Normal file
7
src/test/ui/parser/diff-markers/struct.rs
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
struct S {
|
||||
<<<<<<< HEAD //~ ERROR encountered diff marker
|
||||
x: u8,
|
||||
=======
|
||||
x: i8,
|
||||
>>>>>>> branch
|
||||
}
|
||||
18
src/test/ui/parser/diff-markers/struct.stderr
Normal file
18
src/test/ui/parser/diff-markers/struct.stderr
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
error: encountered diff marker
|
||||
--> $DIR/struct.rs:2:1
|
||||
|
|
||||
LL | <<<<<<< HEAD
|
||||
| ^^^^^^^ after this is the code before the merge
|
||||
LL | x: u8,
|
||||
LL | =======
|
||||
| -------
|
||||
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 <https://git-scm.com/book/en/v2/Git-Tools-Advanced-Merging#_checking_out_conflicts>
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
14
src/test/ui/parser/diff-markers/trait-item.rs
Normal file
14
src/test/ui/parser/diff-markers/trait-item.rs
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
trait T {
|
||||
<<<<<<< HEAD //~ ERROR encountered diff marker
|
||||
fn foo() {}
|
||||
=======
|
||||
fn bar() {}
|
||||
>>>>>>> branch
|
||||
}
|
||||
|
||||
struct S;
|
||||
impl T for S {}
|
||||
|
||||
fn main() {
|
||||
S::foo();
|
||||
}
|
||||
18
src/test/ui/parser/diff-markers/trait-item.stderr
Normal file
18
src/test/ui/parser/diff-markers/trait-item.stderr
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
error: encountered diff marker
|
||||
--> $DIR/trait-item.rs:2:1
|
||||
|
|
||||
LL | <<<<<<< HEAD
|
||||
| ^^^^^^^ after this is the code before the merge
|
||||
LL | fn foo() {}
|
||||
LL | =======
|
||||
| -------
|
||||
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 <https://git-scm.com/book/en/v2/Git-Tools-Advanced-Merging#_checking_out_conflicts>
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
7
src/test/ui/parser/diff-markers/tuple-struct.rs
Normal file
7
src/test/ui/parser/diff-markers/tuple-struct.rs
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
struct S(
|
||||
<<<<<<< HEAD //~ ERROR encountered diff marker
|
||||
u8,
|
||||
=======
|
||||
i8,
|
||||
>>>>>>> branch
|
||||
);
|
||||
18
src/test/ui/parser/diff-markers/tuple-struct.stderr
Normal file
18
src/test/ui/parser/diff-markers/tuple-struct.stderr
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
error: encountered diff marker
|
||||
--> $DIR/tuple-struct.rs:2:1
|
||||
|
|
||||
LL | <<<<<<< HEAD
|
||||
| ^^^^^^^ after this is the code before the merge
|
||||
LL | u8,
|
||||
LL | =======
|
||||
| -------
|
||||
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 <https://git-scm.com/book/en/v2/Git-Tools-Advanced-Merging#_checking_out_conflicts>
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
9
src/test/ui/parser/diff-markers/use-statement.rs
Normal file
9
src/test/ui/parser/diff-markers/use-statement.rs
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
use foo::{
|
||||
<<<<<<< HEAD //~ ERROR encountered diff marker
|
||||
bar,
|
||||
=======
|
||||
baz,
|
||||
>>>>>>> branch
|
||||
};
|
||||
|
||||
fn main() {}
|
||||
18
src/test/ui/parser/diff-markers/use-statement.stderr
Normal file
18
src/test/ui/parser/diff-markers/use-statement.stderr
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
error: encountered diff marker
|
||||
--> $DIR/use-statement.rs:2:1
|
||||
|
|
||||
LL | <<<<<<< HEAD
|
||||
| ^^^^^^^ after this is the code before the merge
|
||||
LL | bar,
|
||||
LL | =======
|
||||
| -------
|
||||
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 <https://git-scm.com/book/en/v2/Git-Tools-Advanced-Merging#_checking_out_conflicts>
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue