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 #8728

Closed
wants to merge 29 commits into from
Closed

Rustup #8728

wants to merge 29 commits into from

Conversation

flip1995
Copy link
Member

r? @ghost

changelog: none

b-naber and others added 22 commits April 2, 2022 12:21
- Create hir_crate_items query which traverses tcx.hir_crate(()).owners to return a hir::ModuleItems
- use tcx.hir_crate_items in tcx.hir().items() to return an iterator of hir::ItemId
- add par_items(impl Fn(hir::ItemId)) to traverse all items in parallel

Signed-off-by: Miguel Guarniz <[email protected]>
…cote

Cached stable hash cleanups

r? `@nnethercote`

Add a sanity assertion in debug mode to check that the cached hashes are actually the ones we get if we compute the hash each time.

Add a new data structure that bundles all the hash-caching work to make it easier to re-use it for different interned data structures
Loading the fallback bundle in compilation sessions that won't go on to
emit any errors unnecessarily degrades compile time performance, so
lazily create the Fluent bundle when it is first required.

Signed-off-by: David Wood <[email protected]>
Use mir constant in thir instead of ty::Const

This is blocked on rust-lang/rust#94059 (does include its changes, the first two commits in this PR correspond to those changes) and rust-lang/rust#93800 being reinstated (which had to be reverted). Mainly opening since `@lcnr` offered to give some feedback and maybe also for a perf-run (if necessary).

This currently contains a lot of duplication since some of the logic of `ty::Const` had to be copied to `mir::ConstantKind`, but with the introduction of valtrees a lot of that functionality will disappear from `ty::Const`.

Only the last commit contains changes that need to be reviewed here. Did leave some `FIXME` comments regarding future implementation decisions and some things that might be incorrectly implemented.

r? `@oli-obk`
errors: lazily load fallback fluent bundle

Addresses (hopefully) rust-lang/rust#95667 (comment).

Loading the fallback bundle in compilation sessions that won't go on to emit any errors unnecessarily degrades compile time performance, so lazily create the Fluent bundle when it is first required.

r? `@ghost` (just for perf initially)
Check var scope if it exist

Fixes #92893.

Added helper function to check the scope of a variable, if it doesn't have a scope call delay_span_bug, which avoids us trying to get a block/scope that doesn't exist.

Had to increase `ROOT_ENTRY_LIMIT` was getting tidy error
Implement sym operands for global_asm!

Tracking issue: #93333

This PR is pretty much a complete rewrite of `sym` operand support for inline assembly so that the same implementation can be shared by `asm!` and `global_asm!`. The main changes are:
- At the AST level, `sym` is represented as a special `InlineAsmSym` AST node containing a path instead of an `Expr`.
- At the HIR level, `sym` is split into `SymStatic` and `SymFn` depending on whether the path resolves to a static during AST lowering (defaults to `SynFn` if `get_early_res` fails).
  - `SymFn` is just an `AnonConst`. It runs through typeck and we just collect the resulting type at the end. An error is emitted if the type is not a `FnDef`.
  - `SymStatic` directly holds a path and the `DefId` of the `static` that it is pointing to.
- The representation at the MIR level is mostly unchanged. There is a minor change to THIR where `SymFn` is a constant instead of an expression.
- At the codegen level we need to apply the target's symbol mangling to the result of `tcx.symbol_name()` depending on the target. This is done by calling the LLVM name mangler, which handles all of the details.
  - On Mach-O, all symbols have a leading underscore.
  - On x86 Windows, different mangling is used for cdecl, stdcall, fastcall and vectorcall.
  - No mangling is needed on other platforms.

r? `@nagisa`
cc `@eddyb`
Refactor HIR item-like traversal (part 1)

Issue  #95004

- Create hir_crate_items query which traverses tcx.hir_crate(()).owners to return a hir::ModuleItems
- use tcx.hir_crate_items in tcx.hir().items() to return an iterator of hir::ItemId
- use tcx.hir_crate_items to introduce a tcx.hir().par_items(impl Fn(hir::ItemId)) to traverse all items in parallel;

Signed-off-by: Miguel Guarniz <[email protected]>

cc `@cjgillot`
`CRATE_DEF_ID` and `CrateNum::as_def_id` are almost always what we want.
Report undeclared lifetimes during late resolution.

First step in rust-lang/rust#91557

We reuse the rib design of the current resolution framework. Specific `LifetimeRib` and `LifetimeRibKind` types are introduced. The most important variant is `LifetimeRibKind::Generics`, which happens each time we encounter something which may introduce generic lifetime parameters. It can be an item or a `for<...>` binder. The `LifetimeBinderKind` specifies how this rib behaves with respect to in-band lifetimes.

r? `@petrochenkov`
Stop using CRATE_DEF_INDEX outside of metadata encoding.

`CRATE_DEF_ID` and `CrateNum::as_def_id` are almost always what we want.  We should not manipulate raw `DefIndex` outside of metadata encoding.
@flip1995
Copy link
Member Author

@bors r+

@bors
Copy link
Collaborator

bors commented Apr 21, 2022

📌 Commit 7b8a08c has been approved by flip1995

bors added a commit that referenced this pull request Apr 21, 2022
Rustup

r? `@ghost`

changelog: none
@bors
Copy link
Collaborator

bors commented Apr 21, 2022

⌛ Testing commit 7b8a08c with merge b4a16a3...

@bors
Copy link
Collaborator

bors commented Apr 21, 2022

💔 Test failed - checks-action_test

@flip1995
Copy link
Member Author

Huh an ICE in our integration tests? 😮 We didn't have that for a long time. I can't find clippy in the backtrace, except for the ICE hook, so this might be on rustc.

@flip1995
Copy link
Member Author

Might be this: rust-lang/rust#96175

I also get a similar ICE, when syncing this into the Rust repo and running ./x.py test src/tools/clippy

Sadly I don't have time to investigate this further today...

@matthiaskrgr
Copy link
Member

Hmm, this one? https://github.com/rust-lang/rust-clippy/runs/6116665649?check_suite_focus=true#step:7:22
This does not look like 96175 to me tbh.

@flip1995
Copy link
Member Author

@bors r+ p=1

@bors
Copy link
Collaborator

bors commented Apr 28, 2022

📌 Commit a5cc047 has been approved by flip1995

@bors
Copy link
Collaborator

bors commented Apr 28, 2022

⌛ Testing commit a5cc047 with merge 0d74c5d...

bors added a commit that referenced this pull request Apr 28, 2022
Rustup

r? `@ghost`

changelog: none
@bors
Copy link
Collaborator

bors commented Apr 28, 2022

💔 Test failed - checks-action_test

@flip1995
Copy link
Member Author

Damn, it isn't fixed in rustc by now... I sadly don't have the bandwidth to dump that much time into this...

@matthiaskrgr matthiaskrgr added the E-help-wanted Call for participation: Help is requested to fix this issue. label Apr 28, 2022
@matthiaskrgr
Copy link
Member

Hmm, I tried to run rust-clippy/target/debug/cargo-clippy --all-targets --all-features -- --cap-lints warn -Wclippy::pedantic -Wclippy::nursery of the rustup branch a5cc047 on chalk e0ade19d139bc784384acc6736cd960c91dd55a1 but I was not able to reproduce the ice, weird 😕

@Alexendoo
Copy link
Member

This one looks to be on rustc, I get the same ICE with cargo +nightly check --all-targets --all-features

@flip1995
Copy link
Member Author

flip1995 commented May 2, 2022

I played ICE breaker: rust-lang/rust#96638

@flip1995
Copy link
Member Author

flip1995 commented May 3, 2022

This ICE should be fixed by now. I'm closing this, since Thursday is already the next sync day.

@flip1995 flip1995 closed this May 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E-help-wanted Call for participation: Help is requested to fix this issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.