about summary refs log tree commit diff
path: root/src/librustc/infer
AgeCommit message (Collapse)AuthorLines
2018-10-15make `UniverseIndex` hashable, rename "sub-" to "superuniverse"Niko Matsakis-4/+4
The only name was silly. U1 can contain everything from U0 *plus* more things.
2018-10-15control canonicalization with a trait vs boolsNiko Matsakis-42/+83
2018-10-15introduce `canonical_var_for_region` helper fnNiko Matsakis-15/+11
2018-10-15rename `QueryResult` to `QueryResponse`Niko Matsakis-62/+62
`Result` really sounds like the rustc result type
2018-10-15bundle up "canonical instantiation" with infcx creationNiko Matsakis-11/+37
2018-10-15canonicalizer.rs: rustfmtNiko Matsakis-24/+18
2018-10-04fix typo: s/tained/tainted/Niko Matsakis-1/+1
2018-10-04remove occurences of `skolemization`Niko Matsakis-34/+34
2018-10-04remove all occurences of `skolemize`Niko Matsakis-2/+2
2018-10-04extend NLL universe code to have >1 placeholder within one universeNiko Matsakis-12/+19
2018-10-04create just one subuniverse per binder -- no need for more, reallyNiko Matsakis-69/+37
2018-10-04reorder the placeholders and inference variables in hr::subNiko Matsakis-7/+9
2018-10-04rename skolemized to placeholderNiko Matsakis-104/+112
2018-10-03Introduce `TyKind::UnnormalizedProjection`scalexm-0/+2
2018-10-02Auto merge of #54701 - arielb1:outlives-later, r=nikomatsakisbors-1/+1
normalize param-env type-outlives predicates last The normalization of type-outlives predicates can depend on misc. environment predicates, but not the other way around. Inferred lifetime bounds can propagate type-outlives bounds far and wide, so their normalization needs to work well. Fixes #54467 r? @nikomatsakis beta-nominating because this is required for inferred_outlives_bounds, which is in beta
2018-10-01normalize param-env type-outlives predicates lastAriel Ben-Yehuda-1/+1
The normalization of type-outlives predicates can depend on misc. environment predicates, but not the other way around. Inferred lifetime bounds can propagate type-outlives bounds far and wide, so their normalization needs to work well. Fixes #54467
2018-10-01Rollup merge of #54641 - ljedrz:cleanup_rustc_infer, r=estebankkennytm-200/+170
A few cleanups and minor improvements to rustc/infer - use unwrap_or(_else) where applicable - convert single-branch matches to if-let - use to_owned instead of to_string with string literals - improve vector allocations - readability improvements - miscellaneous minor code improvements
2018-09-29don't elide lifetimes in paths in librustc/Zack M. Davis-31/+31
This seemed like a good way to kick the tires on the elided-lifetimes-in-paths lint (#52069)—seems to work! This was also pretty tedious—it sure would be nice if `cargo fix` worked on this codebase (#53896)!
2018-09-29rustc/infer: miscellaneous minor code improvementsljedrz-8/+6
2018-09-29rustc/infer: readability improvementsljedrz-25/+21
2018-09-29rustc/infer: improve vector allocationsljedrz-35/+37
2018-09-29rustc/infer: use to_owned instead of to_string with string literalsljedrz-10/+10
2018-09-29rustc/infer: convert single-branch matches to if-letljedrz-104/+88
2018-09-29rustc/infer: use unwrap_or(_else) where applicableljedrz-18/+8
2018-09-28rustc: keep a Span for each predicate in ty::GenericPredicates.Eduard-Mihai Burtescu-2/+5
2018-09-26rustfmt `error_reporting/mod.rs` and `dropck.rs`Niko Matsakis-63/+69
Pacify the mercilous tidy.
2018-09-26convert from an `UnlessNll` flag to a `SuppressRegionErrors` flagNiko Matsakis-26/+40
Hopefully this will help clarify the behavior in the various borrowck modes
2018-09-26use `IfEq` to defer equality comparison around `where` clauses`Niko Matsakis-49/+59
2018-09-26refactor away `AnyRegions` and `AllRegions`Niko Matsakis-38/+49
It's a bit cleaner to just have `AnyBound` and `AllBound`, after all.
2018-09-26introduce `VerifyBound::IfEq` (presently unused)Niko Matsakis-26/+106
2018-09-26change to use impl Trait a bitNiko Matsakis-14/+15
2018-09-26remove handling of verify from taintsetNiko Matsakis-37/+25
This lets us remove `for_each_region` and makes things simpler.
2018-09-26make `normalize` work on any type-foldableNiko Matsakis-11/+19
2018-09-26lexical_region_resolve: rustfmtNiko Matsakis-44/+30
2018-09-26use approx. bounds to decide whether to add outlives obligationsNiko Matsakis-1/+10
Before, if we had a projection like `<T as Foo<'0>>::Bar: 'x` and a where clause like `<T as Foo<'a>>::Bar: 'a`, we considered those to have nothing to do with one another. Therefore, we would use the "overconstrained" path of adding `T: 'x` and `'0: 'x` requirements. We now do a "fuzzy" match where we erase regions first and hence we see the env bound `'a`.
2018-09-26propagate the `compare_ty` fn further upNiko Matsakis-18/+17
2018-09-26introduce the idea of an "approximate match"Niko Matsakis-39/+56
In fact, however, we currently always give back the same exact answers as ever. But we don't rely on them being exact anymore.
2018-09-26introduce a "comparison fn" instead of always use `==`Niko Matsakis-11/+10
2018-09-26split out getting the declared bounds from the env versus traitNiko Matsakis-23/+38
Right now, we just concatenate them
2018-09-26break out the code that computes VerifyBoundsNiko Matsakis-218/+276
Later, we'll defer this work until a separate phase.
2018-09-26apply `process_registered_region_obligations` at the end of regionckNiko Matsakis-27/+30
We used to apply it repeatedly as we went, relying on the current value of the `region_bound_pairs_accum` vector. But now we save those values into a map, so we can just process all the registered region obligations at the end.
2018-09-26use `RegionBoundPairs` type aliasNiko Matsakis-5/+6
2018-09-26change `RegionObligation` to store a `SubregionOrigin`Niko Matsakis-20/+37
2018-09-26use a `UnlessNll` flag to consolidate error reporting pathsNiko Matsakis-32/+15
2018-09-26build up a map of the region-bound pairs for each body-idNiko Matsakis-10/+55
Presently unused.
2018-09-26outlives/env: rustfmtNiko Matsakis-4/+6
2018-09-25Handle locals in closures properly.Alexander Regueiro-8/+5
2018-09-25Lower `impl Trait` types in locals.Alexander Regueiro-3/+3
2018-09-23Auto merge of #54262 - matthewjasper:explain-in-typeck, r=nikomatsakisbors-1/+1
[NLL] Record more infomation on free region constraints in typeck Changes: * Makes the span of the MIR return place point to the return type * Don't try to use a path to a type alias as a path to the adt it aliases (fixes an ICE) * Don't claim that `self` is declared outside of the function. [see this test](https://github.com/rust-lang/rust/commit/f2995d5b1ad0401a80ac4579ebc89295818c3eed#diff-0c9e6b1b204f42129b481df9ce459d44) * Remove boring/interesting distinction and instead add a `ConstraintCategory` to the constraint. * Add categories for implicit `Sized` and `Copy` requirements, for closure bounds, for user type annotations and `impl Trait`. * Don't use the span of the first statement for Locations::All bounds (even if it happens to work on the tests we have) Future work: * Fine tuning the heuristic used to choose the place the report the error. * Reporting multiple places (behind a flag) * Better closure bounds reporting. This probably requires some discussion. r? @nikomatsakis
2018-09-20Auto merge of #54241 - vi:suggest_with_applicability, r=estebankbors-5/+9
Remove usages of span_suggestion without Applicability Use `Applicability::Unspecified` for all of them instead. Shall deprecations for the non-`_with_applicability` functions be added? Shall clippy be addressed somehow? r? @estebank