about summary refs log tree commit diff
path: root/compiler/rustc_infer/src
AgeCommit message (Collapse)AuthorLines
2022-12-28Made ty_or_sig and trait_path use their actual types instead of StringNikita Tomashevich-77/+118
2022-12-28Split infer_explicit_lifetime_required into several diagsNikita Tomashevich-29/+43
2022-12-28Address changes of pr 103345Nikita Tomashevich-46/+46
2022-12-28Rename subdiagnostic fields that do not need to be unique nowNikita Tomashevich-17/+7
2022-12-28Use eager translationNikita Tomashevich-11/+27
2022-12-28Split into several messagesNikita Tomashevich-31/+195
2022-12-28More descriptive names for ActualImplExplNotes variantsNikita Tomashevich-6/+6
2022-12-28Rebase and fixNikita Tomashevich-14/+14
2022-12-28Partial work on static_impl_trait.rsNikita Tomashevich-111/+169
2022-12-28Migrate trait_impl_difference.rsNikita Tomashevich-27/+51
2022-12-28Migrate placeholder_error.rsNikita Tomashevich-126/+158
2022-12-28Migrate named_anon_conflict.rsNikita Tomashevich-26/+36
2022-12-28Rollup merge of #106205 - compiler-errors:oopsy, r=fee1-deadfee1-dead-630/+0
Remove some totally duplicated files in `rustc_infer` I have no idea why or how I duplicated these files from `compiler/rustc_infer/src/infer/error_reporting/note.rs`, but I did by accident, and nothing caught it :facepalm:
2022-12-28Remove some totally duplicated filesMichael Goulet-630/+0
2022-12-28Rename module compare_method -> compare_impl_itemMichael Goulet-1/+1
2022-12-27Account for `match` expr in single lineEsteban Küber-2/+2
When encountering `match Some(42) { Some(x) => x, None => "" };`, output ``` error[E0308]: `match` arms have incompatible types --> f53.rs:2:52 | 2 | let _ = match Some(42) { Some(x) => x, None => "" }; | -------------- - ^^ expected integer, found `&str` | | | | | this is found to be of type `{integer}` | `match` arms have incompatible types ```
2022-12-24Bubble up ErrorGuaranteed from region constraints in method item compareMichael Goulet-5/+10
2022-12-24Rename some compare_method functionsMichael Goulet-1/+1
2022-12-24Rollup merge of #105975 - jeremystucki:rustc-remove-needless-lifetimes, r=eholkMatthias Krüger-2/+2
rustc: Remove needless lifetimes
2022-12-23Rollup merge of #105661 - lcnr:evaluate-new, r=compiler-errorsnils-1/+5
implement the skeleton of the updated trait solver cc ```@rust-lang/initiative-trait-system-refactor``` This is mostly following the architecture discussed in the types team meetup. After discussing the desired changes for the trait solver, we encountered cyclic dependencies between them. Most notably between changing evaluate to be canonical and returning inference constraints. We cannot canonicalize evaluate without returning inference constraints due to coinductive cycles. However, caching inference constraints also relies on canonicalization. Implementing both of these changes at once in-place is not feasible. This somewhat closely mirrors the current `evaluate` implementation with the following notable differences: - it moves `project` into the core solver, allowing us to correctly deal with coinductive projections (will be required for implied bounds, perfect derive) - it changes trait solver overflow to be non-fatal (required to backcompat breakage from changes to the iteration order of nested goals, deferred projection equality, generally very useful) - it returns inference constraints and canonicalizes inputs and outputs (required for a lot things, most notably merging fulfill and evaluate, and deferred projection equality) - it is implemented to work with lazy normalization A lot of things aren't yet implemented, but the remaining FIXMEs should all be fairly self-contained and parallelizable. If the architecture looks correct and is what we want here, I would like to quickly merge this and then split the work. r? ```@compiler-errors``` / ```@rust-lang/types``` :3
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