| Age | Commit message (Collapse) | Author | Lines |
|
Also, make `-Zverbose` dump all info about constants.
|
|
In such a case, the `Infer` is converted to a `Bound`
|
|
Existing code could overlook types/substitutions that are
embedded in (e.g.) an unevaluated constant.
|
|
Didn't find any bugs here, but you really don't want these to fall out
of sync.
|
|
Remove as_str if the type is already &str
Fix https://github.com/rust-lang/rust/issues/62642
r? @estebank
do you think the suggestion tip is good enough?
|
|
|
|
|
|
|
|
|
|
Deny specializing items not in the parent impl
Part of https://github.com/rust-lang/rust/issues/29661 (https://github.com/rust-lang/rfcs/pull/2532). At least sort of?
This was discussed in https://github.com/rust-lang/rust/pull/61812#discussion_r300504114 and is needed for that PR to make progress (fixing an unsoundness).
One annoyance with doing this is that it sometimes requires users to copy-paste a provided trait method into an impl just to mark it `default` (ie. there is no syntax to forward this impl method to the provided trait method).
cc @Centril and @arielb1
|
|
r=Mark-Simulacrum
Optimize integral pattern matching
Various improvements to integral pattern matching. Together they reduce instruction counts for `unicode_normalization-check-clean` by about 16%.
r? @Mark-Simulacrum
|
|
It's now unused, even with -Zquery-dep-graph
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The `if let Some(val) = value.try_eval_bits(...)` branch in `from_const()` is
very hot for the `unicode_normalization` benchmark.
This commit introduces a special-case alternative for scalars that avoids
`try_eval_bits()` and all the functions it calls (`Const::eval()`,
`ConstValue::try_to_bits()`, `ConstValue::try_to_scalar()`, and
`Scalar::to_bits()`), instead extracting the result immediately.
The type and value checking done by `Scalar::to_bits()` is replicated by moving
it into a new function `Scalar::check_raw()` and using that new function in the
special case.
PR #64673 introduced some special-case handling of scalar types in
`Const::try_eval_bits()`. This handling is now moved out of that function into
the new `IntRange::integral_size_and_signed_bias` function.
This commit reduces the instruction count for
`unicode_normalization-check-clean` by about 10%.
|
|
Simplify ExprUseVisitor
* Remove HIR const qualification
* Remove parts of ExprUseVisitor that aren't being used
r? @eddyb
|
|
Replace ClosureSubsts with SubstsRef
Addresses https://github.com/rust-lang/rust/issues/42340 part 3
https://github.com/rust-lang/rust/pull/59312 might benefit from this clean up.
r? @nikomatsakis
|
|
|
|
|
|
Fix ICE #64964
Fixes #64964, which is an ICE with `await`ing in a method + incr-comp.
|
|
Make comment about dummy type a bit more clear
|
|
|
|
|
|
r=wesleywiser
SelfProfiler API refactoring and part one of event review
This PR refactors the `SelfProfiler` a little bit so that most profiling methods are RAII-based. The codegen backend code already had something similar, this refactoring pulls this functionality up into `SelfProfiler` itself, for general use.
The second commit of this PR is a review and update of the existing events we are already recording. Names have been made more consistent. CGU names have been removed from event names. They will be added back in when function parameter recording is implemented.
There is still some work to be done for adding new events, especially around trait resolution and the incremental system.
r? @wesleywiser
|
|
|
|
|
|
Simplify interners
Some code readability improvements.
|
|
Co-Authored-By: Oliver Scherer <github35764891676564198441@oli-obk.de>
|
|
|
|
r=nikomatsakis
async/await: improve not-send errors
cc #64130.
```
note: future does not implement `std::marker::Send` because this value is used across an await
--> $DIR/issue-64130-non-send-future-diags.rs:15:5
|
LL | let g = x.lock().unwrap();
| - has type `std::sync::MutexGuard<'_, u32>`
LL | baz().await;
| ^^^^^^^^^^^ await occurs here, with `g` maybe used later
LL | }
| - `g` is later dropped here
```
r? @nikomatsakis
|
|
It's not necessary.
|
|
It's only used in two places, and the code is shorter and more readable
with it gone.
|
|
This is a leftover from when there were global and thread-local arenas.
|
|
So the order matches the order in `CtxtInterners`.
|
|
Also avoid interning when it's not necessary.
This commit reduces instruction counts for a couple of benchmarks by up to 1%.
|
|
This commit reduces instruction counts for several benchmarks by up to
5%.
|
|
This commit reduces instruction counts for several benchmarks by up to
5%.
|
|
This commit improves obligation errors for async/await:
```
note: future does not implement `std::marker::Send` because this value is used across an
await
--> $DIR/issue-64130-non-send-future-diags.rs:15:5
|
LL | let g = x.lock().unwrap();
| - has type `std::sync::MutexGuard<'_, u32>`
LL | baz().await;
| ^^^^^^^^^^^ await occurs here, with `g` maybe used later
LL | }
| - `g` is later dropped here
```
Signed-off-by: David Wood <david@davidtw.co>
|
|
|
|
Introduce librustc_index crate
Closes #50592
|
|
|
|
|
|
Optimize try_eval_bits to avoid layout queries
This specifically targets match checking, but is possibly more widely
useful as well. In code with large, single-value match statements, we
were previously spending a lot of time running layout_of for the
primitive types (integers, chars) -- which is essentially useless. This
optimizes the code to avoid those query calls by directly obtaining the
size for these types, when possible.
It may be worth considering adding a `size_of` query in the future which
might be far faster, especially if specialized for "const" cases --
match arms being the most obvious example. It's possibly such a function
would benefit from *not* being a query as well, since it's trivially
evaluatable from the sty for many cases whereas a query needs to hash
the input and such.
|
|
This specifically targets match checking, but is possibly more widely
useful as well. In code with large, single-value match statements, we
were previously spending a lot of time running layout_of for the
primitive types (integers, chars) -- which is essentially useless. This
optimizes the code to avoid those query calls by directly obtaining the
size for these types, when possible.
It may be worth considering adding a `size_of` query in the future which
might be far faster, especially if specialized for "const" cases --
match arms being the most obvious example. It's possibly such a function
would benefit from *not* being a query as well, since it's trivially
evaluatable from the sty for many cases whereas a query needs to hash
the input and such.
|
|
Add support for relating slices in `super_relate_consts`
This allows passing strings as generic arguments.
Fixes #63773
Fixes #60813
r? @varkor
|