about summary refs log tree commit diff
path: root/src/librustc/infer
AgeCommit message (Collapse)AuthorLines
2020-03-30rustc -> rustc_middle part 1Mazdak Farrokhzad-616/+0
2020-03-10rust-lang.github.io/rustc-dev-guide -> rustc-dev-guide.rust-lang.orgSantiago Pastorino-1/+1
2020-03-10Rename rustc guide to rustc dev guideSantiago Pastorino-1/+1
2020-03-10Rename rustc-guide to rustc-dev-guideSantiago Pastorino-1/+1
2020-02-16Make librustc compile.Camille GILLOT-1/+2
2020-02-16Move librustc/{traits,infer} to librustc_infer.Camille GILLOT-16887/+0
2020-02-14Use member constraint for most opaque types in NLLMatthew Jasper-15/+41
This ensures that NLL will infer suitable values for regions in opaque types when it's possible.
2020-02-14Improve opaque type lifetime errorsMatthew Jasper-17/+5
* Use better span for member constraint errors * Avoid a bad suggestion * Don't report member constraint errors if we have other universal region errors.
2020-02-14Address review commentsMatthew Jasper-17/+28
2020-02-14Erase regions in opaque types in typeckMatthew Jasper-16/+21
2020-02-14Simplify function signature in opaque_typesMatthew Jasper-8/+4
2020-02-14Distinguish RPIT from other impl traitMatthew Jasper-0/+1
2020-02-12Rollup merge of #69059 - ljedrz:unused_stuff, r=Dylan-DPCDylan DPC-2/+0
Remove a few unused objects As far as I can tell, these won't be missed: - `infer::region_constraints::ConstraintInfo` - `driver::DefaultCallbacks` - ~~`hir::intravisit::ParDeepVisitor`~~
2020-02-12remove some unused objectsljedrz-2/+0
2020-02-11Invert control in struct_lint_level.jumbatm-1/+1
Caller now passes in a `decorate` function, which is only run if the lint is allowed.
2020-02-10Reduce the number of `RefCell`s in `InferCtxt`.Nicholas Nethercote-231/+298
`InferCtxt` contains six structures within `RefCell`s. Every time we create and dispose of (commit or rollback) a snapshot we have to `borrow_mut` each one of them. This commit moves the six structures under a single `RefCell`, which gives significant speed-ups by reducing the number of `borrow_mut` calls. To avoid runtime errors I had to reduce the lifetimes of dynamic borrows in a couple of places.
2020-02-07Auto merge of #65232 - nikomatsakis:lazy-norm-anon-const-push-2, r=matthewjasperbors-71/+261
replace the leak check with universes, take 2 This PR is an attempt to revive the "universe-based region check", which is an important step towards lazy normalization. Unlike before, we also modify the definition of `'empty` so that it is indexed by a universe. This sidesteps some of the surprising effects we saw before -- at the core, we no longer think that `exists<'a> { forall<'b> { 'b: 'a } }` is solveable. The new region lattice looks like this: ``` static ----------+-----...------+ (greatest) | | | early-bound and | | free regions | | | | | scope regions | | | | | empty(root) placeholder(U1) | | / | | / placeholder(Un) empty(U1) -- / | / ... / | / empty(Un) -------- (smallest) ``` This PR has three effects: * It changes a fair number of error messages, I think for the better. * It fixes a number of bugs. The old algorithm was too conservative and caused us to reject legal subtypings. * It also causes two regressions (things that used to compile, but now do not). * `coherence-subtyping.rs` gets an additional error. This is expected. * `issue-57639.rs` regresses as before, for the reasons covered in #57639. Both of the regressions stem from the same underlying property: without the leak check, the instantaneous "subtype" check is not able to tell whether higher-ranked subtyping will succeed or not. In both cases, we might be able to fix the problem by doing a 'leak-check like change' at some later point (e.g., as part of coherence). This is a draft PR because: * I didn't finish ripping out the leak-check completely. * We might want to consider a crater run before landing this. * We might want some kind of design meeting to cover the overall strategy. * I just remembered I never finished 100% integrating this into the canonicalization code. * I should also review what happens in NLL region checking -- it probably still has a notion of bottom (empty set). r? @matthewjasper
2020-02-06Rollup merge of #68524 - jonas-schievink:generator-resume-arguments, r=ZoxcDylan DPC-0/+1
Generator Resume Arguments cc https://github.com/rust-lang/rust/issues/43122 and https://github.com/rust-lang/rust/issues/56974 Blockers: * [x] Fix miscompilation when resume argument is live across a yield point (https://github.com/rust-lang/rust/pull/68524#issuecomment-578459069) * [x] Fix 10% compile time regression in `await-call-tree` benchmarks (https://github.com/rust-lang/rust/pull/68524#issuecomment-578487162) * [x] Fix remaining 1-3% regression (https://github.com/rust-lang/rust/pull/68524#issuecomment-579566255) - resolved (https://github.com/rust-lang/rust/pull/68524#issuecomment-581144901) * [x] Make dropck rules account for resume arguments (https://github.com/rust-lang/rust/pull/68524#issuecomment-578541137) Follow-up work: * Change async/await desugaring to make use of this feature * Rewrite [`box_region.rs`](https://github.com/rust-lang/rust/blob/3d8778d767f0dde6fe2bc9459f21ead8e124d8cb/src/librustc_data_structures/box_region.rs) to use resume arguments (this shows up in profiles too)
2020-02-06lint impls that will become incoherent when leak-check is removedNiko Matsakis-3/+4
2020-02-06add the ability to skip leak check within a snapshotNiko Matsakis-12/+37
The intention is that coherence code will skip the leak check and determine whether two impls *would have* overlapped, and then issue a warning.
2020-02-06apply various formatting nitsNiko Matsakis-9/+9
2020-02-06use derive(Debug) for TypeTraceNiko Matsakis-7/+1
2020-02-06index ReEmpty by universeNiko Matsakis-24/+155
We now make `'empty` indexed by a universe index, resulting in a region lattice like this: ``` static ----------+-----...------+ (greatest) | | | early-bound and | | free regions | | | | | scope regions | | | | | empty(root) placeholder(U1) | | / | | / placeholder(Un) empty(U1) -- / | / ... / | / empty(Un) -------- (smallest) ``` Therefore, `exists<A> { forall<B> { B: A } }` is now unprovable, because A must be at least Empty(U1) and B is placeholder(U2), and hence the two regions are unrelated.
2020-02-06integrate the `sub_free_regions` code so we have only one copy of itNiko Matsakis-8/+34
2020-02-06add a `IsEmpty` for use in verified boundsNiko Matsakis-8/+25
We currently have a kind of arbitrary check for `Verify` conditions which says that if the "test region" is `'empty`, then the check passes. This was added to fix #42467 -- it happens to be correct for the purposes that we use verify bounds for, but it doesn't feel generally correct. Replace with a more principled test.
2020-02-06do not limit NiceRegionError to SubSupConflict or ConcreteFailureNiko Matsakis-13/+9
2020-02-05Move ExpectedFound::new to ty::error.Camille GILLOT-10/+0
2020-02-05Move implementation of UnifyKey to unify_key.rs.Camille GILLOT-15/+15
2020-02-05Move infer::canonical datatypes to infer::types.Camille GILLOT-334/+364
2020-02-05Move infer::region_constraints::MemberConstraint to infer::types module.Camille GILLOT-24/+32
2020-02-02Add a resume type param to the generator substsJonas Schievink-0/+1
...and unify it with `()` for now
2020-02-02Avoid exponential behaviour when relating typesMatthew Jasper-2/+19
2020-01-27don't clone types that are copy, round two.Matthias Krüger-5/+5
2020-01-25Use better bound names in `-Zverbose` modeEsteban Küber-3/+7
2020-01-18remove rustc_error_codes deps except in rustc_driverMazdak Farrokhzad-10/+0
2020-01-18Auto merge of #68001 - Marwes:lexical_region_resolve, r=nikomatsakisbors-40/+36
perf: Only search potentially changed constraints in lexical_region_resolve Gives a big performance increase to the unicode_normalization benchmark in my testing.
2020-01-17Use named fields for `hir::ItemKind::Impl`Dylan MacKenzie-1/+1
2020-01-17perf: Only search the potentially changed constraints in lexical_region_resolveMarkus Westerlind-50/+29
2020-01-17perf: Filter out and process fixed constraints first in region expansionMarkus Westerlind-16/+33
Should reduce the number of elements as well as branches in the extremely hot loop and process_constraint in benchmarks such as unicode_normalization
2020-01-16don't clone types that are copyMatthias Krüger-1/+1
found via clippy
2020-01-14Avoid calling tcx.hir().get() on CRATE_HIR_IDAaron Hill-1/+1
This was causing an ICE when enabling trace logging for an unrelated module, since the arguments to `trace!` ended up getting evaluated
2020-01-10nix syntax::errors & prefer rustc_errors over errorsMazdak Farrokhzad-20/+18
2020-01-10Rollup merge of #67922 - Centril:lowering-cleanup, r=petrochenkovMazdak Farrokhzad-2/+2
rustc_ast_lowering: misc cleanup & rustc dep reductions - The first two commits do some code simplification. - The next three do some file splitting (getting `lib.rs` below the 3kloc tidy lint). - The remaining commits reduce the number of `rustc::` imports. This works towards making lowering independent of the `rustc` crate. r? @oli-obk cc @Zoxc
2020-01-10Rollup merge of #66463 - estebank:point-at-closure-and-opaque-types, r=CentrilMazdak Farrokhzad-5/+139
Point at opaque and closure type definitions in type errors Fixes #57266, fixes #67117.
2020-01-09{rustc::util -> rustc_data_structures}::capturesMazdak Farrokhzad-2/+2
2020-01-09Rollup merge of #68026 - llogiq:ch-ch-ch-ch-changes, r=varkorMazdak Farrokhzad-6/+2
Small improvements in lexical_region_resolve This just replaces a trivial `if` condition with a `|=` in two places. I could even have used a `fold` in the first case, but I think it would be less readable.
2020-01-08Small improvements in lexical_region_resolveAndre Bogus-6/+2
2020-01-08normalize rustc::hir::intravisit importsMazdak Farrokhzad-2/+2
2020-01-08intravisit: abstract over HIR MapMazdak Farrokhzad-3/+10
2020-01-08remove unnecessary `Debug`Esteban Küber-1/+1