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

x.py: don't enable -Zconfig-profile or -Zexternal-macro-backtrace with x.py clippy #69388

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/bootstrap/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -759,7 +759,8 @@ impl<'a> Builder<'a> {
};

let mut rustflags = Rustflags::new(&target);
if stage != 0 {
// x.py with nightly clippy needs to run over #[cfg(not(bootstrap)] code in order to function
if stage != 0 || cmd == "clippy" {
Copy link
Member

Choose a reason for hiding this comment

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

I am actually rather surprised by us needing to do this, as AFAICT if the cmd is clippy we should always be in stage 0? When is that not the case today?

(and if Clippy is already in stage 0, then the right flags would be in RUSTFLAGS_BOOTSTRAP, right?)

Copy link
Member Author

Choose a reason for hiding this comment

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

You are right, my code comment is simply wrong.
Looking at --verbose output, we are indeed in stage 0 all the time.
Looking at the error I was getting previously

error[E0061]: this function takes 1 argument but 0 arguments were supplied
  --> src/librustc_data_structures/box_region.rs:87:52
   |
87 |         let result = Pin::new(&mut self.generator).resume();
   |                                                    ^^^^^^- supplied 0 arguments
   |
help: expected the unit value `()`; create it with empty parentheses
   |
87 |         let result = Pin::new(&mut self.generator).resume(());
   |                                                           ^^

and the corresponding code

    #[cfg(bootstrap)]
    pub fn complete(&mut self) -> R {
        // Tell the generator we want it to complete, consuming it and yielding a result
        BOX_REGION_ARG.with(|i| i.set(Action::Complete));

        let result = Pin::new(&mut self.generator).resume();
        if let GeneratorState::Complete(r) = result { r } else { panic!() }
    }

    #[cfg(not(bootstrap))]
    pub fn complete(&mut self) -> R {
        // Tell the generator we want it to complete, consuming it and yielding a result
        BOX_REGION_ARG.with(|i| i.set(Action::Complete));

        let result = Pin::new(&mut self.generator).resume(());
        if let GeneratorState::Complete(r) = result { r } else { panic!() }
    }

we actually need to disable cfg=booststrap for x.py clippy in order to have it work from what it seems.

if let Ok(s) = env::var("CARGOFLAGS_NOT_BOOTSTRAP") {
cargo.args(s.split_whitespace());
}
Expand Down