about summary refs log tree commit diff
path: root/compiler/rustc_trait_selection
AgeCommit message (Collapse)AuthorLines
2022-12-18Don't ICE in closure arg borrow suggestionMichael Goulet-5/+3
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-2/+2
2022-12-18use &str / String literals instead of format!()Matthias Krüger-8/+8
2022-12-18remove redundant fn params that were only "used" in recursionMatthias Krüger-6/+1
2022-12-18don't clone Copy typesMatthias Krüger-2/+2
2022-12-17Suggest a `T: Send` bound for `&mut T` upvars in `Send` generatorsMatthew House-17/+22
2022-12-16Auto merge of #105717 - compiler-errors:anonymize, r=jackh726bors-4/+4
always use `anonymize_bound_vars` Unless this is perf-sensitive, it's probably best to always use one anonymize function that does the right thing for all bound vars. r? types
2022-12-16Auto merge of #104334 - compiler-errors:ufcs-sugg-wrong-def-id, r=estebankbors-5/+6
Use impl's def id when calculating type to specify in UFCS Fixes #104327 Fixes #104328 Also addresses https://github.com/rust-lang/rust/pull/102670#discussion_r987381197
2022-12-15Rollup merge of #105727 - estebank:use-impl-trait, r=oli-obkMatthias Krüger-8/+20
Tweak output for bare `dyn Trait` in arguments Fix #35825.
2022-12-15Rollup merge of #105694 - ouz-a:issue_105689, r=estebankMatthias Krüger-13/+15
Don't create dummy if val has escaping bounds var Skips creating/pushing obligations if val has escaping bounds vars. Fixes #105689
2022-12-15Consider lifetimes when comparing assoc types in method chainEsteban Küber-1/+1
Do not say "Type changed to X here" when the only difference is caused by lifetimes.
2022-12-15Use `with_forced_trimmed_paths` moreEsteban Küber-16/+21
2022-12-15Point at method chains on `E0271` errorsEsteban Küber-89/+119
2022-12-15Auto merge of #105746 - matthiaskrgr:rollup-sz3grbv, r=matthiaskrgrbors-18/+26
Rollup of 11 pull requests Successful merges: - #104592 (Ensure async trait impls are async (or otherwise return an opaque type)) - #105623 (Fix `-Z print-type-sizes` for generators with discriminant field ordered first) - #105627 (Auto traits in `dyn Trait + Auto` are suggestable) - #105633 (Make `report_projection_error` more `Term` agnostic) - #105683 (Various cleanups to dest prop) - #105692 (Add regression test for #104678) - #105707 (rustdoc: remove unnecessary CSS `kbd { cursor: default }`) - #105715 (Do not mention long types in E0599 label) - #105722 (more clippy::complexity fixes) - #105724 (rustdoc: remove no-op CSS `.scrape-example .src-line-numbers { margin: 0 }`) - #105730 (rustdoc: remove no-op CSS `.item-info:before { color }`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-12-15Rollup merge of #105633 - compiler-errors:term-agnostic, r=oli-obkMatthias Krüger-18/+26
Make `report_projection_error` more `Term` agnostic Fixes #105632
2022-12-15Auto merge of #105285 - compiler-errors:conflicting-param-env-2, r=estebankbors-28/+99
Highlight conflicting param-env candidates, again Un-reverts #98794 (i.e. reverts #99290). The previous time I attempted to land this PR, it was because of an incremental issue (#99233). The repro instructions in the issue is no longer manifest the ICE -- I think it's because this ambiguity code was refactored (I think by `@lcnr)` to no longer store the ambiguities in the fulfillment error, but instead recompute them on the fly. The main motivation for trying to re-land this is that it fixes #105131 by highlighting the root-cause of the issue, which is conflicting param-env candidates: ``` error[E0283]: type annotations needed: cannot satisfy `Self: Gen<'source>` | note: multiple `impl`s or `where` clauses satisfying `Self: Gen<'source>` found --> $DIR/conflicting-bounds.rs:3:1 | LL | pub trait Gen<'source> { | ^^^^^^^^^^^^^^^^^^^^^^ ... LL | Self: for<'s> Gen<'s, Output = T>; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error For more information about this error, try `rustc --explain E0283`. ``` Fixes #105131. Fixes (again) #98786
2022-12-14Tweak output for bare `dyn Trait` in argumentsEsteban Küber-8/+20
Fix #35825.
2022-12-14always use anonymize_bound_varsMichael Goulet-4/+4
2022-12-14Highlight conflicting param-env candidates, againMichael Goulet-28/+99
2022-12-14Make report_projection_error more term agnosticMichael Goulet-18/+26
2022-12-14drive-by: Fix path spansMichael Goulet-1/+1
2022-12-14Use impl's def id when calculating type to specify UFCSMichael Goulet-4/+5
2022-12-14Fix a freshly detected wrong TraitRefOli Scherer-9/+5
2022-12-14Prevent the creation of `TraitRef` without dedicated methodsOli Scherer-5/+2
2022-12-14Ensure no one constructs `AliasTy`s themselvesOli Scherer-8/+8
2022-12-14Remove many more cases of `mk_substs_trait` that can now use the iterator ↵Oli Scherer-8/+3
scheme`
2022-12-14Rename to match similar methodsOli Scherer-4/+4
2022-12-14Guard `AliasTy` creation against passing the wrong number of substsOli Scherer-17/+9
2022-12-14skip if val has ecaping bound varsouz-a-13/+15
2022-12-14Rollup merge of #105595 - TaKO8Ki:suggest-dereferencing-receiver-argument, ↵Matthias Krüger-6/+28
r=compiler-errors Suggest dereferencing receiver arguments properly Fixes #105429
2022-12-14Rollup merge of #105523 - estebank:suggest-collect-vec, r=compiler-errorsMatthias Krüger-56/+23
Suggest `collect`ing into `Vec<_>` Fix #105510.
2022-12-14Clean up mut keyword checkDeep Majumder-7/+3
2022-12-14Auto merge of #104986 - compiler-errors:opaques, r=oli-obkbors-117/+101
Combine `ty::Projection` and `ty::Opaque` into `ty::Alias` Implements https://github.com/rust-lang/types-team/issues/79. This PR consolidates `ty::Projection` and `ty::Opaque` into a single `ty::Alias`, with an `AliasKind` and `AliasTy` type (renamed from `ty::ProjectionTy`, which is the inner data of `ty::Projection`) defined as so: ``` enum AliasKind { Projection, Opaque, } struct AliasTy<'tcx> { def_id: DefId, substs: SubstsRef<'tcx>, } ``` Since we don't have access to `TyCtxt` in type flags computation, and because repeatedly calling `DefKind` on the def-id is expensive, these two types are distinguished with `ty::AliasKind`, conveniently glob-imported into `ty::{Projection, Opaque}`. For example: ```diff match ty.kind() { - ty::Opaque(..) => + ty::Alias(ty::Opaque, ..) => {} _ => {} } ``` This PR also consolidates match arms that treated `ty::Opaque` and `ty::Projection` identically. r? `@ghost`
2022-12-13Auto merge of #105667 - matthiaskrgr:rollup-fexlc0b, r=matthiaskrgrbors-21/+11
Rollup of 7 pull requests Successful merges: - #105147 (Allow unsafe through inline const) - #105438 (Move some codegen-y methods from `rustc_hir_analysis::collect` -> `rustc_codegen_ssa`) - #105464 (Support #[track_caller] on async closures) - #105476 (Change pattern borrowing suggestions to be verbose and remove invalid suggestion) - #105500 (Make some diagnostics not depend on the source of what they reference being available) - #105628 (Small doc fixes) - #105659 (Don't require owned data in `MaybeStorageLive`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-12-14suggest dereferencing receiver arguments properlyTakayuki Maeda-6/+28
fix a stderr
2022-12-13Mention implementations that satisfy the traitEsteban Küber-2/+19
2022-12-13Remove unnecessary code and account for turbofish suggestionEsteban Küber-54/+4
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-13Address nitsMichael Goulet-6/+1
Co-authored-by: Oli Scherer <github35764891676564198441@oli-obk.de>
2022-12-13Combine identical alias armsMichael Goulet-26/+13
2022-12-13Combine projection and opaque into aliasMichael Goulet-50/+59
2022-12-13squash OpaqueTy and ProjectionTy into AliasTyMichael Goulet-26/+23
2022-12-13ProjectionTy.item_def_id -> ProjectionTy.def_idMichael Goulet-55/+49
2022-12-13Use ty::OpaqueTy everywhereMichael Goulet-12/+14
2022-12-13tidy: ignore filelengthakida31-0/+1
2022-12-13reduce to single suggestion for all argumentsakida31-13/+24
2022-12-13remove manual `fn_decl` extractionakida31-17/+3
2022-12-13change error messageakida31-2/+2
2022-12-13move changes to an extra functionakida31-66/+76