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

Provide more context for rustc +nightly -Zunstable-options on stable #112692

Merged
merged 1 commit into from
Jun 28, 2023

Conversation

jieyouxu
Copy link
Member

Screenshot 2023-06-16 123456

Closes #110090.

@rustbot
Copy link
Collaborator

rustbot commented Jun 16, 2023

r? @davidtwco

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Jun 16, 2023
@rust-log-analyzer

This comment has been minimized.

@jieyouxu jieyouxu force-pushed the better-err-msg-for-unstable-options branch from cc456df to facd1d3 Compare June 16, 2023 05:02
@rustbot
Copy link
Collaborator

rustbot commented Jun 16, 2023

Some changes occurred in src/tools/clippy

cc @rust-lang/clippy

Some changes occurred in src/tools/rustfmt

cc @rust-lang/rustfmt

The Miri subtree was changed

cc @rust-lang/miri

@rust-log-analyzer

This comment has been minimized.

@jieyouxu jieyouxu force-pushed the better-err-msg-for-unstable-options branch from facd1d3 to 7de7085 Compare June 16, 2023 05:14
@rust-log-analyzer

This comment has been minimized.

@jieyouxu jieyouxu force-pushed the better-err-msg-for-unstable-options branch from 7de7085 to 5bb6338 Compare June 16, 2023 05:22
@rust-log-analyzer

This comment has been minimized.

@jieyouxu jieyouxu force-pushed the better-err-msg-for-unstable-options branch from 5bb6338 to 401c241 Compare June 16, 2023 05:33
@rustbot
Copy link
Collaborator

rustbot commented Jun 16, 2023

Some changes occurred in compiler/rustc_codegen_cranelift

cc @bjorn3

@rust-log-analyzer

This comment has been minimized.

@jieyouxu jieyouxu force-pushed the better-err-msg-for-unstable-options branch 3 times, most recently from b71f9aa to ca7e0b3 Compare June 16, 2023 05:54
@rust-log-analyzer

This comment has been minimized.

@@ -67,7 +67,8 @@ impl rustc_driver::Callbacks for MiriCompilerCalls {
tcx.sess.fatal("miri cannot be run on programs that fail compilation");
}

init_late_loggers(tcx);
let handler = EarlyErrorHandler::new(ErrorOutputType::default());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it expected that a second handler gets created here? That seems odd and doesn't seem to happen with the other tools.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not intentional and I think it was just a leftover from me trying to change stuff.

@jieyouxu jieyouxu force-pushed the better-err-msg-for-unstable-options branch from ca7e0b3 to d8fe6d9 Compare June 16, 2023 07:44
@@ -59,15 +59,16 @@ impl rustc_driver::Callbacks for MiriCompilerCalls {

fn after_analysis<'tcx>(
&mut self,
handler: &EarlyErrorHandler,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of changing the signature of after_analysis for everyone, it would be better to just add the handler reference as a field in MiriCompilerCalls.

How does this even build currently? You haven't changed the call sites.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a bit awkward if I try to add it as a field to MiriCompilerCalls since the inner handle of handler isn't Sync.

@rust-log-analyzer

This comment has been minimized.

@jieyouxu jieyouxu force-pushed the better-err-msg-for-unstable-options branch from d8fe6d9 to ad32acf Compare June 16, 2023 08:40
@rust-log-analyzer

This comment has been minimized.

@jieyouxu jieyouxu force-pushed the better-err-msg-for-unstable-options branch from ad32acf to 13e3c05 Compare June 16, 2023 09:03
@rust-log-analyzer

This comment has been minimized.

@jieyouxu jieyouxu force-pushed the better-err-msg-for-unstable-options branch from 13e3c05 to 826b97a Compare June 16, 2023 09:41
@bors
Copy link
Contributor

bors commented Jun 22, 2023

☔ The latest upstream changes (presumably #112913) made this pull request unmergeable. Please resolve the merge conflicts.

@jieyouxu jieyouxu force-pushed the better-err-msg-for-unstable-options branch from 826b97a to 54fe071 Compare June 22, 2023 21:57
Copy link
Member

@davidtwco davidtwco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, r=me with the nit below

compiler/rustc_session/src/session.rs Outdated Show resolved Hide resolved
@jieyouxu jieyouxu force-pushed the better-err-msg-for-unstable-options branch from 54fe071 to cef812b Compare June 27, 2023 15:23
@davidtwco
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Jun 27, 2023

📌 Commit cef812b has been approved by davidtwco

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 27, 2023
bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 27, 2023
…iaskrgr

Rollup of 8 pull requests

Successful merges:

 - rust-lang#112207 (Add trustzone and virtualization target features for aarch32.)
 - rust-lang#112454 (Make compiletest aware of targets without dynamic linking)
 - rust-lang#112628 (Allow comparing `Box`es with different allocators)
 - rust-lang#112692 (Provide more context for `rustc +nightly -Zunstable-options` on stable)
 - rust-lang#112972 (Make `UnwindAction::Continue` explicit in MIR dump)
 - rust-lang#113020 (Add tests impl via obj unless denied)
 - rust-lang#113084 (Simplify some conditions)
 - rust-lang#113103 (Normalize types when applying uninhabited predicate.)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit b6144cd into rust-lang:master Jun 28, 2023
@rustbot rustbot added this to the 1.72.0 milestone Jun 28, 2023
@Kobzol
Copy link
Contributor

Kobzol commented Jun 28, 2023

(probably) this PR has regressed coloring of warnings emitted by rustc, and it no longer prints the warning summary at the end.
5ea66686467d3ec5f8c81570e7f0f16ad8dd8cc3 (previous master):

$ rm -rf target && RUSTFLAGS="-Cremark=foo" cargo +5ea66686467d3ec5f8c81570e7f0f16ad8dd8cc3 build --release

image

6b46c996e1d3a07dd73beb2873d74a8a0458d05f (merge containing this PR):

$ rm -rf target && RUSTFLAGS="-Cremark=foo" cargo +6b46c996e1d3a07dd73beb2873d74a8a0458d05f build --release

image

Both commands were executed on a cargo new hello world crate.

@jieyouxu
Copy link
Member Author

(probably) this PR has regressed coloring of warnings emitted by rustc, and it no longer prints the warning summary at the end. 5ea66686467d3ec5f8c81570e7f0f16ad8dd8cc3 (previous master):

Thanks for the notice, I will investigate now.

@jieyouxu
Copy link
Member Author

The fix is trivial... I forgot to handler.abort_if_error_and_set_error_format(error_format); as soon as we have a usable error format in build_session_options. I set it too late.

@jieyouxu
Copy link
Member Author

(probably) this PR has regressed coloring of warnings emitted by rustc, and it no longer prints the warning summary at the end. 5ea66686467d3ec5f8c81570e7f0f16ad8dd8cc3 (previous master):

Opened #113127 to fix this.

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jun 29, 2023
…r=davidtwco

Set error handler output format as soon as possible

Should fix rust-lang#112692 (comment).
smoelius added a commit to smoelius/dylint that referenced this pull request Jul 2, 2023
smoelius added a commit to smoelius/dylint that referenced this pull request Jul 2, 2023
smoelius added a commit to smoelius/dylint that referenced this pull request Jul 2, 2023
smoelius added a commit to trailofbits/dylint that referenced this pull request Jul 2, 2023
floriangru added a commit to floriangru/creusot that referenced this pull request Jul 6, 2023
bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 10, 2023
…davidtwco

Set error handler output format as soon as possible

Should fix rust-lang#112692 (comment).
RalfJung pushed a commit to RalfJung/miri that referenced this pull request Jul 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

stable: Give a better error message for rustc +nightly -Zunstable-options
7 participants