-
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
Tracking issue for accepting unstable flags in stable compilers #31847
Comments
Can -C link-args, -C llvm-args join this list? Both need a replacement which acceps spaces (#30947) |
@Zoxc for now, no, those are both stable flags and this is just targeted at unstable flags. |
For myself I use I also use
|
+1 on this. (I'm guessing "+1" comments are fine in this thread...?) |
|
Note that passing See this example: https://is.gd/cnjaFI . When run locally with Also, I'd like to point out that many linters are using |
Regardless of whether |
@psFried I believe the plan was to make |
Nominating to consider converting to an error. |
This will break using |
Have any of the useful flags people mentioned (no-trans, time-passes, On Jul 17, 2016 08:27, "Seo Sanghyeon" notifications@github.com wrote: This will break using -Z time-passes with stable compiler. — |
#34858 is an example of using |
I mean, why even ask in this issue for people's use cases if the answers On Jul 19, 2016 07:12, "Seo Sanghyeon" notifications@github.com wrote:
|
Hmm, I think we should considering making a stable variant of Regarding the other flags that were mentioned (time-passes, pretty-expanded, trace-macros): All of these have in common that I feel more comfortable with stabilizing the ability to access said functionality than I do with stabilizing anything about the output. For example, I'd expect What this means is that humans using these switches would probably be fine, but tools would break. Do we think we can realistically declare a stability level of that kind? I guess it is the same as (for example) our general error output, which we expect to change. (We probably want to consider explicit scripting commands like git offers.) |
Compiler team's current thinking: Its too soon to switch off all support for all current But something we may be able to do in the short term is white list a small subset of What small subset? We suggest starting with any that appear in comments on this thread. Get to it people!!! Add them below if not already above! |
The contentious flags are these used for debugging user code. I don't feel like they should have the same stability semantics as normal flags. Maybe have |
It does seem like there is room to have flags that, at minimum, have undefined output. Which effectively means they are unstable and can't really be used for scripting. I am thinking of things like gcc's "dump ast" flags ( |
If there is an answer to how we want to stabilize |
I know the worry is people bundling things into automated scripts that
parse rustc output, but it does seem like we need to find a way to
stabilize options without stabilizing their output format.
…On Sat, Feb 11, 2017 at 5:03 PM, Jake Goulding ***@***.***> wrote:
Is there any possibility of changing --unpretty=mir to an --emit=mir
option? I'd love to be able to use that for the alternative playground. Is
it possible to stabilize the concept of outputting MIR even if the actual
text form completely changes?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#31847 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAC3n9GxZ0xsHcOQWmG2i0hq45YEFH-4ks5rbjBGgaJpZM4Hg8-w>
.
|
I guess we should also consider that there might come a time where MIR no longer even exists (it didn't in Rust 1.0, afterall! 😸). In that case, I even think it would be fine to print the text "MIR was removed in Rust 1.99, nothing to see here!".
Pedantically, we say we output LLVM IR, but we certainly don't control the format of that. And it's already changed incompatibly as Rust has upgraded LLVM over time. Maybe we are worrying more than we need to be? |
The whole point of emiting MIR is for debugging. Comparing MIR output to LLVM-IR/LLVM-BC is unfair here IMO and it should rather be compared with the |
I'm totally OK with whichever format...
But for my own selfish reasons, I'd prefer that the MIR for the entire crate be output into a single file (just like LLVM-IR and ASM), as well as being triggered by
How picky should we be about this aspect? The official playground already parses MIR to some extent. |
@rfcbot concern bootstrap-rustc-builds with the change being planned here, will the There are occasional times where I need to resort to looking at expanded output annotated with node-ids in order to make sense of ICE's that occur from a bootstrap compiler that I am in the process of constructing. |
Nowadays all you have to do is set |
@rfcbot resolved bootstrap-rustc-builds (I'm assuming that whatever else is happening based on the change proposed here, |
One problem I noticed with this issue is that Cargo doesn't detect what version of rust is running before passing -Z flags. As a real example, I've enabled CARGO_INCREMENTAL on one of my computers, and it recently ran into a bug on the nightly compiler. I've fallen back to the stable compiler for now, but I get warning about -Zincremental being passed due to this issue. It would be good if Cargo avoided passing -Z flags to rust before it becomes a hard error. Would it help if I filed an issue about this against cargo? |
Teach rustc --emit=mir I'm opening this PR to discuss: 1. Is this a good idea? 1. Is this a good implementation? I'm sure people will have opinions on both points! This spawned from rust-lang#31847 (comment), so I figured a prototype implementation could help provide a seed to talk about.
See also issue #41743 . |
All major stakeholders have checked in with checkboxes above, and this was re-reviewed during tools triage yesterday, and I've now opened a PR: #41751 |
Removing |
First deprecated in rustc 1.8.0 the intention was to never allow `-Z` flags make their way to the stable channel (or unstable options). After a year of warnings we've seen one of the main use cases, `-Z no-trans`, stabilized as `cargo check`. Otherwise while other use cases remain the sentiment is that now's the time to start forbidding `-Z` by default on stable/beta. Closes rust-lang#31847
@durka we've spent the last year printing that this is going to become an error. |
rustc: Forbid `-Z` flags on stable/beta channels First deprecated in rustc 1.8.0 the intention was to never allow `-Z` flags make their way to the stable channel (or unstable options). After a year of warnings we've seen one of the main use cases, `-Z no-trans`, stabilized as `cargo check`. Otherwise while other use cases remain the sentiment is that now's the time to start forbidding `-Z` by default on stable/beta. Closes rust-lang#31847
rustc: Forbid `-Z` flags on stable/beta channels First deprecated in rustc 1.8.0 the intention was to never allow `-Z` flags make their way to the stable channel (or unstable options). After a year of warnings we've seen one of the main use cases, `-Z no-trans`, stabilized as `cargo check`. Otherwise while other use cases remain the sentiment is that now's the time to start forbidding `-Z` by default on stable/beta. Closes #31847
This issue is intended to track the process of fixing rustc to not accept unstable flags on stable compilers. It's somewhat of a historical mistake that this was allowed, and we're attempting now to repair the logic to disallow unstable flags on the compiler. Today the compiler has a few unstable flags:
-Z
- all debugging options in the compiler are intended to be unstable--pretty
- the pretty printer is quite broken in various ways, and it's output is also generally quite unstable--unpretty
- the flag and formats emitted here were not intended to be stable--error-format
- this support is currently experimental in the compiler and may not be ready for prime-timeFor backwards compatibility the compiler will continue to accept these flags on the stable and beta channels of Rust. In #31793, however, the compiler will start to issue a warning on these channels whenever these flags are passed. The warning message points at this issue.
The next steps on this issue are likely:
If you're coming to this issue via the compiler warning, please feel free to comment with your flag and use case! We're eager to learn which unstable flags are most widely used to prioritize what to stabilize.
The text was updated successfully, but these errors were encountered: