summary refs log tree commit diff
path: root/compiler/rustc_infer/src
AgeCommit message (Collapse)AuthorLines
2022-12-26Add IMPLIED_BOUNDS_ENTAILMENT lintMichael Goulet-2/+7
2022-12-09Rollup merge of #105443 - compiler-errors:move-more, r=oli-obkMatthias Krüger-660/+1304
Move some queries and methods Each commit's title should be self-explanatory. Motivated to break up some large, general files and move queries into leaf crates.
2022-12-08Rollup merge of #104922 - estebank:fur-elize, r=oli-obkMatthias Krüger-79/+104
Detect long types in E0308 and write them to disk On type error with long types, print an abridged type and write the full type to disk. Print the widest possible short type while still fitting in the terminal.
2022-12-08Move some suggestions from error_reporting to error_reporting::suggestMichael Goulet-660/+1304
2022-12-05Make get_impl_future_output_ty work with AFITMichael Goulet-1/+9
2022-12-03Rollup merge of #105188 - compiler-errors:verbose-ty-err, r=TaKO8KiYuki Okushi-3/+3
Don't elide type information when printing E0308 with `-Zverbose` When we pass `-Zverbose`, we kinda expect for all `_` to be replaced with more descriptive information, for example -- ``` = note: expected fn pointer `fn(_, u32)` found fn item `fn(_, i32) {foo}` ``` Where `_` is the "identical" part of the fn signatures, now gets rendered as: ``` = note: expected fn pointer `fn(i32, u32)` found fn item `fn(i32, i32) {foo}` ```
2022-12-02Don't elide information when printing E0308 with ZverboseMichael Goulet-3/+3
2022-12-02Rollup merge of #105185 - compiler-errors:normalize_fn_sig-in-err-ctxt, r=lcnrMatthias Krüger-39/+10
Move `normalize_fn_sig` to `TypeErrCtxt` r? `@lcnr`
2022-12-02Move normalize_fn_sig to TypeErrCtxtMichael Goulet-39/+10
2022-12-01Drive-by: remove unused type aliasMichael Goulet-1/+0
2022-11-30Auto merge of #99814 - aliemjay:patch-2, r=jackh726bors-3/+6
fix universe map in ifcx.instantiate_canonical_* Previously, `infcx.instantiate_canonical_*` maps the root universe in `canonical` into `ty::UniverseIndex::Root`, I think because it assumes it works with a fresh `infcx` but this is not true for the use cases in mir typeck. Now the root universe is mapped into `infcx.universe()`. I catched this accidentally while reviewing the code. I'm not sure if this is the right fix or if it is really a bug!
2022-11-29Auto merge of #105012 - WaffleLapkin:into, r=oli-obkbors-26/+15
Make `tcx.mk_const` more permissive wrt `kind` argument (`impl Into`) r? `@oli-obk` you've asked for this >:)
2022-11-28Tweak shortening logic to be less trigger happyEsteban Küber-1/+4
2022-11-28Detect long types in E0308 and write them to diskEsteban Küber-79/+101
On type error with long types, print an abridged type and write the full type to disk. Print the widest possible short type while still fitting in the terminal.
2022-11-28Remove `Const::from_value`Maybe Waffle-1/+1
...it's just `mk_const` but without the sparcles
2022-11-28Simplify calls to `tcx.mk_const`Maybe Waffle-18/+7
`mk_const(ty::ConstKind::X(...), ty)` can now be simplified to `mk_cosnt(..., ty)`. I searched with the following regex: \mk_const\([\n\s]*(ty::)?ConstKind\ I've left `ty::ConstKind::{Bound, Error}` as-is, they seem clearer this way.
2022-11-28Remove `tcx.mk_const_var`Maybe Waffle-7/+7
... `tcx.mk_const` can now be used instead
2022-11-28Rollup merge of #104936 - cjgillot:self-rpit-orig-too, r=oli-obkMatthias Krüger-2/+5
Ignore bivariant parameters in test_type_match. https://github.com/rust-lang/rust/pull/103491 made opaque types bivariant with respect of some of their lifetime parameters. Because of this bivariance, some lifetime variables were not unified to anything during borrowck, and were considered as unequal by borrowck type test. This PR makes type test ignore the bivariant parameters in test_type_match. Fixes https://github.com/rust-lang/rust/issues/104815 r? `@oli-obk`
2022-11-28Rollup merge of #104890 - lcnr:small-cleanup, r=fee1-deadDylan DPC-36/+26
small method code cleanup
2022-11-28Rollup merge of #104732 - WaffleLapkin:from_def_idn't, r=compiler-errorsDylan DPC-4/+1
Refactor `ty::ClosureKind` related stuff I've tried to fix all duplication and weirdness, but if I missed something do tell :p r? `@compiler-errors`
2022-11-27Rollup merge of #104976 - WaffleLapkin:move_comments, r=cjgillotMatthias Krüger-21/+21
Prefer doc comments over `//`-comments in compiler Doc comments are generally nicer: they show up in the documentation, they are shown in IDEs when you hover other mentions of items, etc. Thus it makes sense to use them instead of `//`-comments.
2022-11-27Auto merge of #104048 - cjgillot:split-lifetime, r=compiler-errorsbors-26/+24
Separate lifetime ident from lifetime resolution in HIR Drive-by: change how suggested generic args are computed. Fixes https://github.com/rust-lang/rust/issues/103815 I recommend reviewing commit-by-commit.
2022-11-27Prefer doc comments over `//`-comments in compilerMaybe Waffle-21/+21
2022-11-27Use `TyCtxt::is_fn_trait` is a couple more placesMaybe Waffle-4/+1
2022-11-27Rename `fn_trait_kind_from_{from_lang=>def_id}` to better convey meaningMaybe Waffle-1/+1
2022-11-26Rollup merge of #104921 - compiler-errors:no-binder-on-fut-ty, r=cjgillotGuillaume Gomez-19/+14
Remove unnecessary binder from `get_impl_future_output_ty` We never construct an `async fn` with a higher-ranked `impl Future` bound anyways, and basically all the call-sites already skip the binder.
2022-11-26Rollup merge of #104788 - compiler-errors:unresolved-ct-in-gen, r=fee1-deadGuillaume Gomez-36/+65
Do not record unresolved const vars in generator interior Don't record types in the generator interior when we see unresolved const variables. We already do this for associated types -- this is important to avoid unresolved inference variables in the generator results during writeback, since the writeback results get stable hashed in incremental mode. Fixes #104787
2022-11-26Rollup merge of #104786 - WaffleLapkin:amp-mut-help, r=compiler-errorsGuillaume Gomez-5/+2
Use the power of adding helper function to simplify code w/ `Mutability` r? `@compiler-errors`
2022-11-26Ignore bivariant parameters in test_type_match.Camille GILLOT-2/+5
2022-11-26Do not record unresolved const vars in generator interiorMichael Goulet-36/+65
2022-11-26Remove unnecessary binder from get_impl_future_output_tyMichael Goulet-19/+14
2022-11-25Auto merge of #99798 - JulianKnodt:ac1, r=BoxyUwUbors-43/+16
Add `ConstKind::Expr` Starting to implement `ty::ConstKind::Abstract`, most of the match cases are stubbed out, some I was unsure what to add, others I didn't want to add until a more complete implementation was ready. r? `@lcnr`
2022-11-25remove `TypeError::ObjectUnsafeCoercion`lcnr-36/+26
2022-11-25Make `expand_abstract_consts` infallibleBoxy-13/+11
2022-11-25Add expand_abstract_constkadmin-6/+2
Adds the ability to directly expand a const to an expr without having to deal with intermediate steps.
2022-11-25Add empty ConstKind::Abstractkadmin-35/+14
Initial pass at expr/abstract const/s Address comments Switch to using a list instead of &[ty::Const], rm `AbstractConst` Remove try_unify_abstract_consts Update comments Add edits Recurse more More edits Prevent equating associated consts Move failing test to ui Changes this test from incremental to ui, and mark it as failing and a known bug. Does not cause the compiler to ICE, so should be ok.
2022-11-25Introduce PredicateKind::ClauseSantiago Pastorino-26/+32
2022-11-24Remove normalize_projection_typeSantiago Pastorino-8/+0
2022-11-23Add `Mutability::ref_prefix_str`, order `Mutability`, simplify codeMaybe Waffle-5/+2
2022-11-23Separate lifetime ident from resolution in HIR.Camille GILLOT-26/+24
2022-11-22Rollup merge of #103488 - oli-obk:impl_trait_for_tait, r=lcnrManish Goregaokar-20/+152
Allow opaque types in trait impl headers and rely on coherence to reject unsound cases r? ````@lcnr```` fixes #99840
2022-11-22Auto merge of #103578 - petrochenkov:nofict, r=nagisabors-2/+2
Unreserve braced enum variants in value namespace With this PR braced enum variants (`enum E { V { /*...*/ } }`) no longer take a slot in value namespace, so the special case mentioned in the note in https://github.com/rust-lang/rfcs/blob/master/text/1506-adt-kinds.md#braced-structs is removed. Report - https://github.com/rust-lang/rust/pull/103578#issuecomment-1292594900.
2022-11-21Stop passing the self-type as a separate argument.Oli Scherer-1/+1
2022-11-21Allow iterators instead of requiring slices that will get turned into iteratorsOli Scherer-1/+1
2022-11-21Assert that various types have the right amount of generic args and fix the ↵Oli Scherer-1/+1
sites that used the wrong amount
2022-11-21Unreserve braced enum variants in value namespaceVadim Petrochenkov-2/+2
2022-11-21Test generalization during coherenceOli Scherer-1/+5
2022-11-21Add some more assertions for type relations not used during coherenceOli Scherer-8/+13
2022-11-21Type generalization should not look at opaque type in coherenceOli Scherer-2/+1
2022-11-21Remove a function that doesn't actually do anythingOli Scherer-8/+7