Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Give nice errors on merge conflict markers #44403

Closed
chris-morgan opened this issue Sep 7, 2017 · 2 comments
Closed

Give nice errors on merge conflict markers #44403

chris-morgan opened this issue Sep 7, 2017 · 2 comments

Comments

@chris-morgan
Copy link
Member

Take code like this:

<<<<<<< HEAD
fn foo() -> Foo { }
=======
pub fn foo() -> Foo { }
>>>>>>> something

Outside macros and strings, this kind of thing will always fail to parse (seven equals signs in a row is always illegal), though the precise errors it will fail with will vary depends on the context.

It’d be nice if the compiler, on detecting a syntax error caused by merge conflict markers, gave a friendlier error message, something like this:

error: file contains merge conflict markers
  --> <anon>:1:1
   |
1  | <<<<<<< HEAD
   | ^^^^^^^ merge conflict marker here

(Inspiration: Perl 5.26.0 produces a syntax error like “Version control conflict marker at line 123” thanks to https://rt.perl.org/Public/Bug/Display.html?id=127993.)

@jonas-schievink
Copy link
Contributor

jonas-schievink commented Sep 8, 2017

Duplicate of #36879

(and #32059)

@chris-morgan
Copy link
Member Author

Sigh. I thought I searched for a duplicate before filing this but that was another thing that I did just before.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants