Give a better error message for duplicate built-in macros#76143
Merged
bors merged 1 commit intorust-lang:masterfrom Sep 2, 2020
Merged
Give a better error message for duplicate built-in macros#76143bors merged 1 commit intorust-lang:masterfrom
bors merged 1 commit intorust-lang:masterfrom
Conversation
Contributor
|
Some changes occurred in diagnostic error codes |
c7dad7a to
245ad9f
Compare
compiler/rustc_resolve/src/macros.rs
Outdated
Contributor
There was a problem hiding this comment.
In practice the current span and the previous span are going to point to the same place though, if we are talking about issues like #75176.
Member
Author
There was a problem hiding this comment.
For #75176, it would have been the same, yes. However that in itself would have been helpful debugging the issue: it shows that the same crate is being loaded twice. And for problems that are less obscure this will be very helpful since it points straight to the other location that conflicts.
Contributor
|
r=me with #76143 (comment) addressed and commits squashed. |
Previously, this would say no such macro existed, but this was misleading, since the macro _did_ exist, it was just already seen. - Say where the macro was previously defined - Add long-form error message
65f25c2 to
be2947d
Compare
Member
Author
|
@bors r=petrochenkov |
Collaborator
|
📌 Commit be2947d has been approved by |
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Sep 2, 2020
Rollup of 14 pull requests Successful merges: - rust-lang#74880 (Add trailing comma support to matches macro) - rust-lang#76074 (Add new `-Z dump-mir-spanview` option) - rust-lang#76088 (Add more examples to lexicographic cmp on Iterators.) - rust-lang#76099 (Add info about `!` and `impl Trait`) - rust-lang#76126 (Use "Fira Sans" for crate list font) - rust-lang#76132 (Factor out StmtKind::MacCall fields into `MacCallStmt` struct) - rust-lang#76143 (Give a better error message for duplicate built-in macros) - rust-lang#76158 (Stabilise link-self-contained option) - rust-lang#76201 (Move to intra-doc links for library/core/src/panic.rs) - rust-lang#76206 (Make all methods of `std::net::Ipv6Addr` const) - rust-lang#76207 (# Move to intra-doc links for library/core/src/clone.rs) - rust-lang#76212 (Document lint missing_doc_code_examples is nightly-only) - rust-lang#76218 (lexer: Tiny improvement to shebang detection) - rust-lang#76221 (Clean up header in `iter` docs for `for` loops) Failed merges: r? @ghost
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Minor follow-up to #75176 giving a better error message for duplicate builtin macros. This would have made it a little easier to debug.
r? @petrochenkov