-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Improve error output of “Detect diff markers in the parser” #113826
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
D-papercut
Diagnostics: An error or lint that needs small tweaks.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Comments
Merged
@rustbot claim |
workingjubilee
added a commit
to workingjubilee/rustc
that referenced
this issue
Jun 21, 2024
Improve conflict marker recovery <!-- If this PR is related to an unstable feature or an otherwise tracked effort, please link to the relevant tracking issue here. If you don't know of a related tracking issue or there are none, feel free to ignore this. This PR will get automatically assigned to a reviewer. In case you would like a specific user to review your work, you can assign it to them by using r? <reviewer name> --> closes rust-lang#113826 r? `@estebank` since you reviewed rust-lang#115413 cc: `@rben01` since you opened up the issue in the first place
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Jun 21, 2024
Improve conflict marker recovery <!-- If this PR is related to an unstable feature or an otherwise tracked effort, please link to the relevant tracking issue here. If you don't know of a related tracking issue or there are none, feel free to ignore this. This PR will get automatically assigned to a reviewer. In case you would like a specific user to review your work, you can assign it to them by using r? <reviewer name> --> closes rust-lang#113826 r? ``@estebank`` since you reviewed rust-lang#115413 cc: ``@rben01`` since you opened up the issue in the first place
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this issue
Jun 21, 2024
Rollup merge of rust-lang#126125 - dev-ardi:conflict-markers, r=estebank Improve conflict marker recovery <!-- If this PR is related to an unstable feature or an otherwise tracked effort, please link to the relevant tracking issue here. If you don't know of a related tracking issue or there are none, feel free to ignore this. This PR will get automatically assigned to a reviewer. In case you would like a specific user to review your work, you can assign it to them by using r? <reviewer name> --> closes rust-lang#113826 r? ```@estebank``` since you reviewed rust-lang#115413 cc: ```@rben01``` since you opened up the issue in the first place
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
D-papercut
Diagnostics: An error or lint that needs small tweaks.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Uh oh!
There was an error while loading. Please reload this page.
Copied from my comment in #106242:
I'd love this functionality but I'm not a huge fan of the error messages themselves.
First, I believe these markers are called conflict markers, not diff markers. (IIUC diff markers are e.g.,
+++ file.rs
.)Second, I think the intermediate markers
|
and=
should also be explained.Third, I find the
help:
tips a bit verbose — especially considering that they'll likely line wrap in most terminals — and perhaps redundant given the content of the^^^^^^^
notes. It might be better to stick thehelp:
info inrustc --explain E####
instead of showing every time this error is encountered. Not sure where I stand on thenote:
tip; it's also a bit long, and its presence might lead people away fromrustc --explain
, which is probably undesirable. (The git documentation also has a lot of extraneous info that most users wouldn't need to solve this error; they just need to know which is old and which is new,<<<<<<<
or>>>>>>>
.)Finally, I think the words “above” and “after” are a bit ambiguous; there's nearly an entire file above and below the outer conflict markers. (What's important is what's between conflict markers.) Furthermore they aren't quite accurate when there's a
|||||||
section, since that section is below the<<<<<<<
but not part of “our” code.I think the following error message would be overall clearer and more accurate:
or, if not using
diff3
,The text was updated successfully, but these errors were encountered: