summary refs log tree commit diff
path: root/compiler/rustc_infer/src
AgeCommit message (Collapse)AuthorLines
2022-07-09Only register hidden types for opaque types from the current crate, nothing ↵Oli Scherer-1/+1
else would work anyway.
2022-07-09Make `evaluate_obligation` not succeed unconditionally if it registered new ↵Oli Scherer-0/+8
hidden types for opaque types
2022-07-09use a method instead of manually doing what its body doesOli Scherer-1/+1
2022-06-24Auto merge of #98109 - nikomatsakis:issue-98095, r=jackh726bors-100/+373
fix universes in the NLL type tests In the NLL code, we were not accommodating universes in the `type_test` logic. Fixes #98095. r? `@compiler-errors` This breaks some tests, however, so the purpose of this branch is more explanatory and perhaps to do a crater run.
2022-06-23run `x.py fmt`Niko Matsakis-5/+1
2022-06-23remove misleading commentNiko Matsakis-4/+1
per aliemjay's suggestion
2022-06-23try to clarify confusing commentNiko Matsakis-1/+9
2022-06-23normalize if-eq bounds before testingNiko Matsakis-1/+2
Hat-tip: aliemjay
2022-06-23apply suggestions from oli-obkNiko Matsakis-7/+7
Co-authored-by: Oli Scherer <github35764891676564198441@oli-obk.de>
2022-06-23coallesce docsNiko Matsakis-65/+32
2022-06-23rename IfEqBound to IfEqNiko Matsakis-7/+7
2022-06-23remove VerifyBound::IfEq variantNiko Matsakis-36/+31
2022-06-22Rollup merge of #97818 - compiler-errors:rpit-error-spanned, r=oli-obkYuki Okushi-3/+7
Point at return expression for RPIT-related error Certainly this needs some diagnostic refining, but I wanted to show that it was possible first and foremost. Not sure if this is the right approach. Open to feedback. Fixes #80583
2022-06-21Point at return expression for RPIT-related errorMichael Goulet-3/+7
2022-06-22Rollup merge of #97867 - lcnr:lub-binder, r=oli-obkYuki Okushi-12/+28
lub: don't bail out due to empty binders allows for the following to compile. The equivalent code using `struct Wrapper<'upper>(fn(&'upper ());` already compiles on stable. ```rust let _: fn(&'upper ()) = match v { true => lt_in_fn::<'a>(), false => lt_in_fn::<'b>(), }; ``` see https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=7034a677190110941223cafac6632f70 for a complete example r? ```@rust-lang/types```
2022-06-21Avoid an ICE and instead let the compiler report a useful errorOli Scherer-1/+5
2022-06-15generalize the outlives obligation codeNiko Matsakis-31/+94
The code now accepts `Binder<OutlivesPredicate>` instead of just `OutlivesPredicate` and thus exercises the new, generalized `IfEqBound` codepaths. Note though that we never *produce* Binder<OutlivesPredicate>, so we are only testing a subset of those codepaths that excludes actual higher-ranked outlives bounds.
2022-06-15improved debug outputNiko Matsakis-5/+2
2022-06-15remove compare-fn and use erased-tyNiko Matsakis-17/+23
2022-06-15simplify argument type for to take param-tyNiko Matsakis-6/+4
we don't really take other things
2022-06-15implement (unused) matching solverNiko Matsakis-2/+248
2022-06-15simply the IfEq bound -- we only ever use a regionNiko Matsakis-7/+6
the excessive generality becomes annoying later because it wouldn't implement type folding etc
2022-06-15Rollup merge of #98110 - cjgillot:closure-brace, r=Aaron1011Yuki Okushi-6/+8
Make `ExprKind::Closure` a struct variant. Simple refactor since we both need it to introduce additional fields in `ExprKind::Closure`. r? ``@Aaron1011``
2022-06-14implement valtrees as the type-system representation for constant valuesb-naber-3/+25
2022-06-14Rollup merge of #97935 - nnethercote:rename-ConstS-val-as-kind, r=lcnrDylan DPC-20/+20
Rename the `ConstS::val` field as `kind`. And likewise for the `Const::val` method. Because its type is called `ConstKind`. Also `val` is a confusing name because `ConstKind` is an enum with seven variants, one of which is called `Value`. Also, this gives consistency with `TyS` and `PredicateS` which have `kind` fields. The commit also renames a few `Const` variables from `val` to `c`, to avoid confusion with the `ConstKind::Value` variant. r? `@BoxyUwU`
2022-06-14Auto merge of #98041 - jackh726:remove-regionckmode, r=oli-obkbors-46/+34
Remove RegionckMode in favor of calling new skip_region_resolution Simple cleanup. We can skip a bunch of stuff for places where NLL does the region checking, so skip earlier. r? rust-lang/types
2022-06-14Rename the `ConstS::val` field as `kind`.Nicholas Nethercote-20/+20
And likewise for the `Const::val` method. Because its type is called `ConstKind`. Also `val` is a confusing name because `ConstKind` is an enum with seven variants, one of which is called `Value`. Also, this gives consistency with `TyS` and `PredicateS` which have `kind` fields. The commit also renames a few `Const` variables from `val` to `c`, to avoid confusion with the `ConstKind::Value` variant.
2022-06-13remove unnecessary `to_string` and `String::new`Takayuki Maeda-13/+13
2022-06-13Remove RegionckMode in favor of calling new skip_region_resolutionJack Huey-46/+34
2022-06-12Rollup merge of #98012 - compiler-errors:poly-trait-refs-are-traits, r=cjgillotDylan DPC-1/+3
`ValuePairs::PolyTraitRefs` should be called "trait"s in type error diagnostics Pretty simple, we already do this for `ValuePairs::TraitRefs`...
2022-06-11Make is_suggestable work on all TypeFoldableMichael Goulet-5/+1
2022-06-11Handle empty where-clause betterMichael Goulet-9/+4
2022-06-11ValuePairs::PolyTraitRefs should be called 'trait'Michael Goulet-1/+3
2022-06-12Make `ExprKind::Closure` a struct variant.Camille GILLOT-6/+8
2022-06-11remove an unnecessary format macroTakayuki Maeda-5/+2
2022-06-11Rollup merge of #97967 - BoxyUwU:at_docs_mention_trace, r=compiler-errorsDylan DPC-0/+21
Mention `infer::Trace` methods on `infer::At` methods' docs I missed that you could do `infcx.at(...).trace(...).eq(a, b)` when `a` and `b` dont implement `ToTrace` but does implement `Relate` these docs would have helped see that :sweat_smile:
2022-06-11Rollup merge of #97703 - lcnr:post-89862, r=estebankDylan DPC-73/+31
some additional `need_type_info.rs` cleanup also fixes #97698, fixes #97806 cc `@estebank`
2022-06-10the day that i make a PR without a tidy error..Ellen-7/+7
2022-06-10aEllen-0/+21
2022-06-10use FxHashMap instead of BTreeMaplcnr-4/+3
2022-06-10eagerly check whether we replace any bound varslcnr-24/+15
2022-06-10update higher_ranked_sub docslcnr-27/+35
2022-06-10bound_vars -> infer: don't return lt maplcnr-5/+3
2022-06-10replace bound vars: make caching explicitlcnr-23/+34
2022-06-09rewrite combine doc commentlcnr-23/+23
2022-06-08add test + don't warn on `Res::SelfTy`lcnr-0/+3
2022-06-08lub: don't bail out due to empty binderslcnr-12/+28
2022-06-08need_type_info: don't ICE when detected ty aliaslcnr-6/+15
fixes #97698
2022-06-08dedup diagnostics default params handlinglcnr-67/+13
2022-06-08Auto merge of #97447 - nnethercote:improve-folding, r=jackh726bors-26/+16
Folding revamp r? `@ghost`