| Age | Commit message (Collapse) | Author | Lines |
|
|
|
These combine two `HygieneData::with` calls into one.
|
|
This combines multiple `HygieneData::with` calls into one, by combining
parts of `hygienic_eq` and `adjust_ident`.
|
|
This combines two `HygieneData::with` calls into one on a hot path.
|
|
Store CtxtInterners for local values in AllArenas
r? @eddyb
|
|
Remove _all_ codegen dependencies on `rustc_mir` :tada:
~This code is pretty self-contained. It has no references to the rest of `rustc_mir`. Moving it to its own crate means that almost all of the references from `rustc_codegen_*` to `rustc_mir` are instead moved to `rustc_monomorphize`, which should help improve compile times for the compiler a bit...~
With the help of eddyb and oli-obk, all of the dependencies of `librustc_codegen_*` on `librustc_mir` have been removed:
- dependencies on `rustc_mir::monomorphize` were moved to `rustc::mir::mono`
- `rustc_mir::const_eval::const_field` is made into a query.
- `rustc_mir::interpret::type_name` is made into a query.
This should help reduce compile time when working on `rustc_mir` :clock1:
cc #47849
r? @eddyb
|
|
|
|
|
|
|
|
Add more detail to type inference error
When encountering code where type inference fails, add more actionable
information:
```
fn main() {
let foo = Vec::new();
}
```
```
error[E0282]: type annotations needed in `std::vec::Vec<T>`
--> $DIR/vector-no-ann.rs:2:16
|
LL | let foo = Vec::new();
| --- ^^^^^^^^ cannot infer type for `T` in `std::vec::Vec<T>`
| |
| consider giving `foo` a type
```
Fix #25633.
|
|
Miri: give machine the chance to tag all allocations
r? @oli-obk
The Miri side of this is at https://github.com/rust-lang/rust/pull/61278.
|
|
Rollup of 6 pull requests
Successful merges:
- #61380 (Fix some issues with `unwrap_usize` instead of `assert_usize`)
- #61423 (codegen: change `$6d$` to `$u6d$`)
- #61438 (Point at individual type args on arg count mismatch)
- #61441 (Tweak wording when encountering `fn` call in pattern)
- #61451 (Fix missing semicolon in doc)
- #61458 (Fix typo in AsRef doc)
Failed merges:
r? @ghost
|
|
Fix some issues with `unwrap_usize` instead of `assert_usize`
Fixes https://github.com/rust-lang/rust/issues/61337.
Fixes https://github.com/rust-lang/rust/issues/61341.
Fixes https://github.com/rust-lang/rust/issues/61422.
r? @eddyb
|
|
rustc: remove Res::Upvar.
By keeping track of the current "`body_owner`" (the `DefId` of the current fn/closure/const/etc.) in several passes, `Res::Upvar` and `hir::Upvar` don't need to contain contextual information about the closure.
By leveraging [`indexmap`](https://docs.rs/indexmap), the list of upvars for a given closure can now also be queried, to check whether a local variable is a closure capture, and so `Res::Upvar` can be merged with `Res::Local`.
And finally, the `tcx.upvars(...)` query now collects upvars from HIR, without relying on `rustc_resolve`.
r? @petrochenkov cc @varkor @davidtwco
|
|
tag all allocations
|
|
|
|
|
|
|
|
light refactoring of global AllocMap
* rename AllocKind -> GlobalAlloc. This stores the allocation itself, not just its kind.
* rename the methods that allocate stuff to have consistent names.
Cc @oli-obk
|
|
|
|
Remove GlobalArenas and use Arena instead
r? @eddyb
|
|
Remove ty::BrFresh and RegionConstraintCollector::new_bound
Fixes #60957
r? @matthewjasper
|
|
```
error[E0282]: type annotations needed in `std::result::Result<i32, E>`
--> file7.rs:3:13
|
3 | let b = Ok(4);
| - ^^ cannot infer type for `E` in `std::result::Result<i32, E>`
| |
| consider giving `b` a type`
```
|
|
|
|
|
|
|
|
|
|
Avoid `hygiene_data` lookups
These commits mostly introduce compound operations that allow two close adjacent `hygiene_data` lookups to be combined.
r? @petrochenkov
|
|
* rename AllocKind -> GlobalAlloc. This stores the allocation itself, not just its kind.
* rename the methods that allocate stuff to have consistent names.
|
|
It's a hot function that returns a 2-tuple, but the hottest call site
(`hygienic_eq`) discards the second element.
This commit renames `adjust_ident` as `adjust_ident_and_get_scope`, and
then introduces a new `adjust_ident` that only computes the first
element. This change also avoids the need to pass in an unused
`DUMMY_HIR_ID` argument in a couple of places, which is nice.
|
|
It's measurably faster to avoid the context comparison when possible.
The commit also adds `hygienic_eq` in one appropriate place.
|
|
Changes the type `mir::Mir` into `mir::Body`
Fixes part 1 of #60229 (previously attempted in #60242).
I stumbled upon the issue and it seems that the previous attempt at solving it was not merged. This is a second try more up-to-date.
The commit should have changed comments as well.
At the time of writting, it passes the tidy and check tool.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The commit should have changed comments as well.
At the time of writting, it passes the tidy and check tool.
Revisions asked by eddyb :
- Renamed of all the occurences of {visit/super}_mir
- Renamed test structures `CachedMir` to `Cached`
Fixing the missing import on `AggregateKind`
|
|
rename Scalar::Bits to Scalar::Raw and bits field to data
Also use this opportunity to seal some abstraction leaks (other modules constructing `Scalar::Bits` directly instead of using a constructor).
r? @oli-obk
|
|
modify pretty.rs which recently added "Associated*"
|
|
We are going to uniform the terminology of all associated items.
Methods that may or may not have `self` are called "associated
functions". Because `AssociatedFn` is a bit long, we rename `Associated`
to `Assoc`.
|
|
|
|
|
|
|
|
|
|
|
|
|