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

Rustup #9174

Merged
merged 39 commits into from
Jul 15, 2022
Merged

Rustup #9174

merged 39 commits into from
Jul 15, 2022

Conversation

flip1995
Copy link
Member

r? @ghost

changelog: none

flip1995 and others added 30 commits June 30, 2022 10:50
Suggest using block for `extern "abi" fn` with no body

`@rustbot` modify labels: +A-diagnostics
…r=wesleywiser

Finishing touches for `#[expect]` (RFC 2383)

This PR adds documentation and some functionality to rustc's lint passes, to manually fulfill expectations. This is needed for some lints in Clippy. Hopefully, it should be one of the last things before we can move forward with stabilizing this feature.

As part of this PR, I've also updated `clippy::duplicate_mod` to showcase how this new functionality can be used and to ensure that it works correctly.

---

changelog: [`duplicate_mod`]: Fixed lint attribute interaction

r? `@wesleywiser`

cc: rust-lang/rust#97660, rust-lang/rust#85549

And I guess that's it. Here have a magical unicorn 🦄
Make MIR basic blocks field public

This makes it possible to mutably borrow different fields of the MIR
body without resorting to methods like `basic_blocks_local_decls_mut_and_var_debug_info`.

To preserve validity of control flow graph caches in the presence of
modifications, a new struct `BasicBlocks` wraps together basic blocks
and control flow graph caches.

The `BasicBlocks` dereferences to `IndexVec<BasicBlock, BasicBlockData>`.
On the other hand a mutable access requires explicit `as_mut()` call.
This lint seems to have been broken by #98446
Shorten def_span of closures to just their header

Continuation of rust-lang/rust#93967.
Add test for and fix rust-lang#9131

This lint seems to have been broken by #98446 -- but of course, there was no clippy test for this case at the time.

`expr.span.ctxt().outer_expn_data()` now has `MacroKind::Derive` instead of `MacroKind::Attr` for something like:

```
#[derive(Clone, Debug)]
pub struct UnderscoreInStruct {
    _foo: u32,
}
```

---

changelog: none

closes: rust-lang#9131
Build the Clippy book as part of x.py doc

r? ``@ehuss`` since you said you would be interested in helping moving this forward.

cc ``@jyn514`` as part of the bootstrap team.
Lower let-else in MIR

This MR will switch to lower let-else statements in MIR building instead.

To lower let-else in MIR, we build a mini-switch two branches. One branch leads to the matching case, and the other leads to the `else` block. This arrangement will allow temporary lifetime analysis running as-is so that the temporaries are properly extended according to the same rule applied to regular `let` statements.

cc rust-lang/rust#87335

Fix #98672
`UnsafeCell` blocks niches inside its nested type from being available outside

fixes #87341

This implements the plan by `@eddyb` in rust-lang/rust#87341 (comment)

Somewhat related PR (not strictly necessary, but that cleanup made this PR simpler): #94527
Pull Derefer before ElaborateDrops

_Follow up work to #97025 #96549 #96116 #95887 #95649_

This moves `Derefer` before `ElaborateDrops` and creates a new `Rvalue` called `VirtualRef` that allows us to bypass many constraints for `DerefTemp`.

r? `@oli-obk`
Rollup of 5 pull requests

Successful merges:

 - #98574 (Lower let-else in MIR)
 - #99011 (`UnsafeCell` blocks niches inside its nested type from being available outside)
 - #99030 (diagnostics: error messages when struct literals fail to parse)
 - #99155 (Keep unstable target features for asm feature checking)
 - #99199 (Refactor: remove an unnecessary `span_to_snippet`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors
Copy link
Collaborator

bors commented Jul 14, 2022

💔 Test failed - checks-action_test

@flip1995
Copy link
Member Author

  = note: D:\a\rust-clippy\rust-clippy\target\debug\deps\clippy_driver.exe : fatal error LNK1180: insufficient disk space to complete link

image

@xFrednet
Copy link
Member

Hmmm, windows, haven't we had this problem before? I think we had to ping the infra team, if I'm not mistaken

@flip1995
Copy link
Member Author

I don't think so. But then again, if there are problems, it is with windows and I usually suppress windows memories.

@xFrednet
Copy link
Member

I can't remember where I saw that message before. Zulip and GH search isn't too helpful either 🤔. There is a long thread with a message like this on Zulip, but it seems to be focussed on a release.

But then again, if there are problems, it is with windows and I usually suppress windows memories.

😂 I switched to Linux about 3 - 4 years ago and haven't regretted it one bit.

@flip1995
Copy link
Member Author

Sadly I don't have time to debug this today. Maybe I can look into it this evening

Rollup of 5 pull requests

Successful merges:

 - #97720 (Always create elided lifetime parameters for functions)
 - #98315 (Stabilize `core::ffi:c_*` and rexport in `std::ffi`)
 - #98705 (Implement `for<>` lifetime binder for closures)
 - #99126 (remove allow(rustc::potential_query_instability) in rustc_span)
 - #99139 (Give a better error when `x dist` fails for an optional tool)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@ghost
Copy link

ghost commented Jul 14, 2022

It seems related to generating the pdb file. Maybe try testing with --release.

Support unstable moves via stable in unstable items

part of https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/moving.20items.20to.20core.20unstably and a blocker of rust-lang/rust#90328.

The libs-api team needs the ability to move an already stable item to a new location unstably, in this case for Error in core. Otherwise these changes are insta-stable making them much harder to merge.

This PR attempts to solve the problem by checking the stability of path segments as well as the last item in the path itself, which is currently the only thing checked.
@Jarcho
Copy link
Contributor

Jarcho commented Jul 14, 2022

Something is going wrong here. Just built this locally and the target dir is almost 12GB after running cargo test. clippy_driver.exe itself is 1GB. For reference current master has the target dir at 4.3GB with clippy_driver.exe at a reasonable 17MB. clippy_utils rlib is also ~800MB on this pr.

Both use about 2GB for incremental stuff.

Edit: Looks like all the additional size is from embedded debug info.

@flip1995
Copy link
Member Author

Hm, this sounds like something about debug info has changed in rustc/cargo since the last nightly update 2 weeks ago.

We don't use different deps than on master, nor are we using additional macro expansions that might cause this.

@flip1995
Copy link
Member Author

Found a rust issue for this: rust-lang/rust#99143

@flip1995 flip1995 added the S-blocked Status: marked as blocked ❌ on something else such as an RFC or other implementation work label Jul 14, 2022
@flip1995
Copy link
Member Author

Blocking this for now, hoping for a fix on the rustc side soon-ish. I will work on a workaround if no fix is in sight by the end of the week.

@mati865
Copy link
Contributor

mati865 commented Jul 14, 2022

You might have some luck with (temporarily) replacing windows-msvc with windows-gnu. It's another Tier 1 Windows target which AFAIK is not affected by this issue.

@flip1995
Copy link
Member Author

@bors try

This should now work with the fix merged just before the nightly got released.

@Jarcho Can you please double check, that this indeed works on windows and then r+ this PR?

@bors
Copy link
Collaborator

bors commented Jul 15, 2022

⌛ Trying commit 9178ba1 with merge 336456e...

bors added a commit that referenced this pull request Jul 15, 2022
Rustup

r? `@ghost`

changelog: none
@bors
Copy link
Collaborator

bors commented Jul 15, 2022

☀️ Try build successful - checks-action_dev_test, checks-action_remark_test, checks-action_test
Build commit: 336456e (336456e5d91e8dce04ebd037414feb2168a26135)

@Jarcho
Copy link
Contributor

Jarcho commented Jul 15, 2022

Thank you.

@bors r+

@bors
Copy link
Collaborator

bors commented Jul 15, 2022

📌 Commit 9178ba1 has been approved by Jarcho

It is now in the queue for this repository.

@bors
Copy link
Collaborator

bors commented Jul 15, 2022

⌛ Testing commit 9178ba1 with merge fe68145...

@bors
Copy link
Collaborator

bors commented Jul 15, 2022

☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test
Approved by: Jarcho
Pushing fe68145 to master...

@bors bors merged commit fe68145 into rust-lang:master Jul 15, 2022
@flip1995 flip1995 deleted the rustup branch July 18, 2022 07:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-blocked Status: marked as blocked ❌ on something else such as an RFC or other implementation work
Projects
None yet
Development

Successfully merging this pull request may close these issues.