about summary refs log tree commit diff
path: root/compiler/rustc_infer/src
AgeCommit message (Collapse)AuthorLines
2022-12-20rustc: Remove needless lifetimesJeremy Stucki-2/+2
2022-12-20Auto merge of #105880 - Nilstrieb:make-newtypes-less-not-rust, r=oli-obkbors-6/+4
Improve syntax of `newtype_index` This makes it more like proper Rust and also makes the implementation a lot simpler. Mostly just turns weird flags in the body into proper attributes. It should probably also be converted to an attribute macro instead of function-like, but that can be done in a future PR.
2022-12-20Auto merge of #105575 - compiler-errors:impl-wf-lint, r=oli-obkbors-2/+7
Add `IMPLIED_BOUNDS_ENTAILMENT` lint Implements a lint (#105572) version of the hard-error introduced in #105483. Context is in that PR. r? `@lcnr` cc `@oli-obk` who had asked for this to be a lint first Not sure if this needs to be an FCP, since it's a lint for now.
2022-12-19Auto merge of #103600 - compiler-errors:early-binder-nits, r=spastorinobors-6/+5
Address some `EarlyBinder` nits
2022-12-19Add IMPLIED_BOUNDS_ENTAILMENT lintMichael Goulet-2/+7
2022-12-19implement the skeleton of the updated trait solverlcnr-1/+5
2022-12-19Rollup merge of #105864 - matthiaskrgr:compl, r=NilstriebDylan DPC-8/+2
clippy::complexity fixes filter_next needless_question_mark bind_instead_of_map manual_find derivable_impls map_identity redundant_slicing skip_while_next unnecessary_unwrap needless_bool r? `@compiler-errors`
2022-12-19clippy::complexity fixesMatthias Krüger-8/+2
filter_next needless_question_mark bind_instead_of_map manual_find derivable_impls map_identity redundant_slicing skip_while_next unnecessary_unwrap needless_bool
2022-12-18Rollup merge of #105873 - matthiaskrgr:clippy_fmt, r=NilstriebMatthias Krüger-12/+6
use &str / String literals instead of format!()
2022-12-18A few small cleanups for `newtype_index`Nilstrieb-4/+2
Remove the `..` from the body, only a few invocations used it and it's inconsistent with rust syntax. Use `;` instead of `,` between consts. As the Rust syntax gods inteded.
2022-12-18Make `#[debug_format]` an attribute in `newtype_index`Nilstrieb-2/+2
This removes the `custom` format functionality as its only user was trivially migrated to using a normal format. If a new use case for a custom formatting impl pops up, you can add it back.
2022-12-18Rollup merge of #105875 - matthiaskrgr:needless_borrowed_reference, r=oli-obkMatthias Krüger-1/+1
don't destuct references just to reborrow
2022-12-18don't restuct references just to reborrowMatthias Krüger-1/+1
2022-12-18avoid .into() conversion to identical typesMatthias Krüger-1/+1
2022-12-18use &str / String literals instead of format!()Matthias Krüger-12/+6
2022-12-15Auto merge of #105657 - oli-obk:mk_projection_ty, r=lcnrbors-45/+38
Guard ProjectionTy creation against passing the wrong number of substs r? `@lcnr`
2022-12-14Auto merge of #105233 - mejrs:always_eager, r=estebankbors-1/+1
Always evaluate vecs of subdiagnostics eagerly See https://rust-lang.zulipchat.com/#narrow/stream/336883-i18n/topic/.23100717.20lists!/near/310186705 for context
2022-12-14Prevent the creation of `TraitRef` without dedicated methodsOli Scherer-6/+4
2022-12-14Ensure no one constructs `AliasTy`s themselvesOli Scherer-39/+34
2022-12-14Rollup merge of #105611 - BoxyUwU:more_granular_placeholderification, ↵Matthias Krüger-15/+38
r=wesleywiser fold instead of obliterating args Fixes #105608 we call `const_eval_resolve` on the following constant: ``` def: playground::{impl#0}::and::{constant#0}, substs: [ ConstKind::Unevaluated { def: playground::{impl#0}::and::{constant#0}, substs: [ ConstKind::Value(0x0), _, ] } _, ], ``` when expanded out to `ConstKind::Expr` there are no infer vars so we attempt to evaluate it after replacing infer vars with garbage, however the current logic for replacing with garbage replaces _the whole arg containing the infer var_ rather than just the infer var. This means that after garbage replacement has occured we attempt to evaluate: ``` def: playground::{impl#0}::and::{constant#0}, substs: [ PLACEHOLDER, PLACEHOLDER, ], ``` Which then leads to ctfe being unable to evaluate the const. With this PR we attempt to evaluate: ``` def: playground::{impl#0}::and::{constant#0}, substs: [ ConstKind::Unevaluated { def: playground::{impl#0}::and::{constant#0}, substs: [ ConstKind::Value(0x0), PLACEHOLDER, ] } PLACEHOLDER, ], ``` which ctfe _can_ handle. I am not entirely sure why this function is supposed to replace params with placeholders rather than just inference vars :thinking:
2022-12-14Rollup merge of #105523 - estebank:suggest-collect-vec, r=compiler-errorsMatthias Krüger-38/+66
Suggest `collect`ing into `Vec<_>` Fix #105510.
2022-12-13rename argumentEsteban Küber-2/+6
2022-12-13review commentsEsteban Küber-28/+27
2022-12-13Suggest `: Type` instead of `: _`Esteban Küber-6/+9
2022-12-13Remove unnecessary code and account for turbofish suggestionEsteban Küber-25/+31
Remove previously existing fallback that tried to give a good turbofish suggestion, `need_type_info` is already good enough. Special case `::<Vec<_>` suggestion for `Iterator::collect`.
2022-12-13Suggest `collect`ing into `Vec<_>`Esteban Küber-8/+24
2022-12-13Address a few more nitsMichael Goulet-6/+6
2022-12-13Combine identical alias armsMichael Goulet-5/+4
2022-12-13Combine projection and opaque into aliasMichael Goulet-54/+61
2022-12-13squash OpaqueTy and ProjectionTy into AliasTyMichael Goulet-40/+40
2022-12-13ProjectionTy.item_def_id -> ProjectionTy.def_idMichael Goulet-19/+18
2022-12-13Use ty::OpaqueTy everywhereMichael Goulet-43/+67
2022-12-13Auto merge of #105350 - compiler-errors:faster-binder-relate, r=oli-obkbors-0/+20
Fast-path some binder relations A simpler approach than #104598 Fixes #104583 r? types
2022-12-13EarlyBinder nitsMichael Goulet-6/+5
2022-12-13Fast path some binder relationsMichael Goulet-0/+20
2022-12-13remove unnecessary uses of `clone`Takayuki Maeda-1/+1
2022-12-12fold instead of obliterating argsBoxy-15/+38
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-04Always evaluate vecs of subdiagnostics eagerlymejrs-1/+1
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