-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Add error codes for libsyntax_ext #48173
Add error codes for libsyntax_ext #48173
Conversation
@rust-lang/compiler, can we get someone to answer @GuillaumeGomez questions? |
I have no idea what the problem is :( |
I personally have dislike to error codes in general. |
That helps. 😆 |
@GuillaumeGomez where is your branch? did you opt into the feature gate? |
oh, @eddyb also says that you need to do |
see also: Lines 181 to 183 in b1f8e6f
|
I'll wait for next beta then. |
@GuillaumeGomez I think a new beta was released by now? |
Cool, I'll come back to it then. |
0a55905
to
12a0afe
Compare
Updated. |
Ah, right, the tests I added can only work on stage 2 compiler... Is there a way to make these two tests to be run only on stage 2? |
This never got a reviewer... r? @eddyb |
Travis is unhappy, to start: |
@nikomatsakis: yes because tests can only be run on stage2. Which is why I asked:
|
@GuillaumeGomez I think it's |
Thanks @eddyb! |
src/libsyntax_ext/diagnostics.rs
Outdated
// In vim you can `:set tw=80` and use `gq` to wrap paragraphs. Use `:set tw=0` to disable. | ||
register_long_diagnostics! { | ||
E0660: r##" | ||
An invalid syntax was passed to the `asm` macro. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Grammatical nit: I don't think of "syntax" as something you can have "one" of. I would rather say, "The argument to the asm
macro is not well-formed" or something like that, perhaps?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fine by me!
b257f6a
to
612be77
Compare
612be77
to
f367567
Compare
Fixed tests. |
@bors r+ |
📌 Commit f367567 has been approved by |
…tebank Add error codes for libsyntax_ext I intend to add error codes for `libsyntax_ext` as well. However, they cannot be used at stage 0 directly so I thought it might be possible to enable them at the stage 1 only so we can have access to the macros. However, the error code registration seems to not work this way. Currently I get the following error: ``` error: used diagnostic code E0660 not registered --> libsyntax_ext/asm.rs:93:25 | 93 | span_err!(cx, sp, E0660, "malformed inline assembly"); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) error: used diagnostic code E0661 not registered --> libsyntax_ext/asm.rs:151:33 | 151 | / span_err!(cx, sp, E0661, 152 | | "output operand constraint lacks '=' or '+'"); | |________________________________________________________________________________________^ | = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) error: aborting due to 2 previous errors error: Could not compile `syntax_ext`. ``` If anyone has an idea, I'd gladly take it. I'm trying to figure this out on my side as well. I also opened this PR to know if it was worth it to continue (maybe we don't want this?). Anyway, any answer for both questions is very welcome! cc @rust-lang/compiler
☀️ Test successful - status-appveyor, status-travis |
Care to explain why? Was this just a problem with the old bootstrap compiler? This stage-0-conditional is still present in current master, and causing confusion like #53380 |
We need some macros (which are defined later on) to be defined. |
But why are those not in the beta bootstrap compiler? I do not understand how what you said relates to my question. :) |
Hard to explain since I don't have the precise context in mind. Just gave you what I had in memory. ;) |
I intend to add error codes for
libsyntax_ext
as well. However, they cannot be used at stage 0 directly so I thought it might be possible to enable them at the stage 1 only so we can have access to the macros. However, the error code registration seems to not work this way. Currently I get the following error:If anyone has an idea, I'd gladly take it. I'm trying to figure this out on my side as well. I also opened this PR to know if it was worth it to continue (maybe we don't want this?).
Anyway, any answer for both questions is very welcome!
cc @rust-lang/compiler