| Age | Commit message (Collapse) | Author | Lines |
|
|
|
Remove universes from `ty::ParamEnv`
This change was never meant to land. #48407 takes an alternate approach. However, that PR is now blocked on some issues with canonicalization, and rebasing these reverts gets harder each time, so let's just get this bit out of the way now.
r? @nikomatsakis
|
|
This reverts commit 35e78b5cddc04c6bd13da2a1290d27cfb8ae8db8.
|
|
Produce nice array lengths on a best effort basis
fixes #49208
r? @estebank
|
|
|
|
|
|
Types will no longer default to `()`, instead always defaulting to `!`.
This disables the associated warning and removes the flag from TyTuple
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The ena version has an improved interface. I suspect
`librustc_data_structures` should start migrating out to crates.io in
general.
|
|
|
|
The glossaries in the draft rustc-guide book and librustc/README.md
state that `NodeId` is being gradually phased out in favor of `HirId`;
as such, the present author claims that we ought to have a typedef for
efficient `HirId` maps and sets in the module for such, even if no use
for them has been made as yet (compatibility constraints preventing the
use of it in the author's present unit of work): it is important to
create the psychological "affordance" (in James J. Gibson's sense) that
`HirId`s are a thing that compiler developers can work with.
|
|
across suspension points to borrowck. Fixes #44197, #45259 and #45093.
|
|
|
|
incr.comp.: Cache check_match and use ensure() for coherence-related queries.
Some minor optimizations.
r? @nikomatsakis
|
|
We now add the suitable `impl Trait` constraints.
|
|
|
|
This is needed to allow the `ClosureRegionRequirements` to capture
types that include regions.
|
|
|
|
Closes #45843
|
|
move closure kind, signature into `ClosureSubsts`
Instead of using side-tables, store the closure-kind and signature in the substitutions themselves. This has two key effects:
- It means that the closure's type changes as inference finds out more things, which is very nice.
- As a result, it avoids the need for the `freshen_closure_like` code (though we still use it for generators).
- It avoids cyclic closures calls.
- These were never meant to be supported, precisely because they make a lot of the fancy inference that we do much more complicated. However, due to an oversight, it was previously possible -- if challenging -- to create a setup where a closure *directly* called itself (see e.g. #21410).
We have to see what the effect of this change is, though. Needs a crater run. Marking as [WIP] until that has been assessed.
r? @arielb1
|
|
|
|
After this change, impl Trait existentials are
desugared to a new `abstract type` definition
paired with a set of lifetimes to apply.
In-scope generics are included as parents of the
`abstract type` generics. Parent regions are
replaced with static, and parent regions
referenced in the `impl Trait` type are duplicated
at the end of the `abstract type`'s generics.
|
|
|
|
|
|
|
|
|
|
Now they don't shadow other lifetimes.
|
|
Friendlier error message for closure argument type mismatch
Rebased #42270.
Fixes #42143.
---
`test.rs`:
```rust
fn main() {
foo(|_: i32, _: usize| ());
}
fn foo<F>(_: F) where F: Fn(&str, usize) {}
```
Before:
```
error[E0281]: type mismatch: `[closure@test.rs:2:9: 2:30]` implements the trait `std::ops::Fn<(i32, usize)>`, but the trait `for<'r> std::ops::Fn<(&'r str, usize)>` is required
--> test.rs:2:5
|
2 | foo(|_: i32, _: usize| ());
| ^^^ --------------------- implements `std::ops::Fn<(i32, usize)>`
| |
| expected &str, found i32
| requires `for<'r> std::ops::Fn<(&'r str, usize)>`
|
= note: required by `foo`
```
After (early):
```
error[E0631]: type mismatch in closure arguments
--> test.rs:2:5
|
2 | foo(|_: i32, _: usize| ());
| ^^^ --------------------- takes arguments of type `i32` and `usize`
| |
| expected arguments of type `&str` and `usize`
|
= note: required by `foo`
```
After (current):
```
error[E0631]: type mismatch in closure arguments
--> test.rs:2:5
|
2 | foo(|_: i32, _: usize| ());
| ^^^ --------------------- found signature of `fn(i32, usize) -> _`
| |
| expected signature of `for<'r> fn(&'r str, usize) -> _`
|
= note: required by `foo`
```
~~Compiler output has been changed, and a few tests are failing. Help me writing/fixing tests!~~
r? @nikomatsakis
|
|
encode region::Scope using fewer bytes
Now that region::Scope is no longer interned, its size is more important. This PR encodes region::Scope in 8 bytes instead of 12, which should speed up region inference somewhat (perf testing needed) and should improve the margins on #36799 by 64MB (that's not a lot, I did this PR mostly to speed up region inference).
This is a perf-sensitive PR. Please don't roll me up.
r? @eddyb
This is based on #44743 so I could get more accurate measurements on #36799.
|
|
|
|
Fixes #42143.
E0281 is totally replaced by E0631. UI tests are updated accordingly.
|
|
|
|
|
|
|
|
|
|
This commit moves the calculation of the `LanguageItems` structure into a
query rather than being calculated before the `TyCtxt` exists, with the eventual
end goal of removing some `CrateStore` methods.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
https://github.com/rust-lang-nursery/rust-forge/blob/master/profile-queries.md
|