about summary refs log tree commit diff
path: root/compiler/rustc_trait_selection/src
AgeCommit message (Collapse)AuthorLines
2023-09-23Check types live across yields in generators tooMichael Goulet-0/+7
2023-09-23Check that closure's by-value captures are sizedMichael Goulet-0/+11
2023-09-22Auto merge of #115920 - Zoxc:depkind-u16, r=cjgillotbors-4/+5
Move `DepKind` to `rustc_query_system` and define it as `u16` This moves the `DepKind` type to `rustc_query_system` where it's defined with an inner `u16` field. This decouples it from `rustc_middle` and is a step towards letting other crates define dep kinds. It also allows some type parameters to be removed. The `DepKind` trait is replaced with a `Deps` trait. That's used when some operations or information about dep kinds which is unavailable in `rustc_query_system` are still needed. r? `@cjgillot`
2023-09-21Auto merge of #115897 - eduardosm:check-fn-sig, r=compiler-errorsbors-0/+1
rustc_hir_analysis: add a helper to check function the signature mismatches This function is now used to check `#[panic_handler]`, `start` lang item, `main`, `#[start]` and intrinsic functions. The diagnosis produced are now closer to the ones produced by trait/impl method signature mismatch. This is the first time I do anything with rustc_hir_analysis/rustc_hir_typeck, so comments and suggestions about things I did wrong or that could be improved will be appreciated.
2023-09-21Suggest desugaring to RPITIT when AFIT is required to be an auto traitMichael Goulet-0/+137
2023-09-21Record asyncness span in HIRMichael Goulet-2/+4
2023-09-21Move `DepKind` to `rustc_query_system` and define it as `u16`John Kåre Alsaker-4/+5
2023-09-21reviewlcnr-78/+75
2023-09-21wlcnr-1/+1
2023-09-21slight refactor, add commentlcnr-11/+20
2023-09-21HACK: avoid hang in structurally_normalizelcnr-3/+9
2023-09-21proof trees: use for `intercrate_ambiguity_causes`lcnr-212/+698
2023-09-20remove `impl<'tcx> ToPredicate<'tcx, Clause<'tcx>> for ↵Ziru Niu-5/+7
PolyProjectionPredicate<'tcx>`
2023-09-19rustc_hir_analysis: add a helper to check function the signature mismatchesEduardo Sánchez Muñoz-0/+1
This function is now used to check `#[panic_handler]`, `start` lang item, `main`, `#[start]` and intrinsic functions. The diagnosis produced are now closer to the ones produced by trait/impl method signature mismatch.
2023-09-19Explain HRTB + infer limitations of old solverMichael Goulet-0/+75
2023-09-18Auto merge of #115748 - RalfJung:post-mono, r=oli-obkbors-31/+36
move required_consts check to general post-mono-check function This factors some code that is common between the interpreter and the codegen backends into shared helper functions. Also as a side-effect the interpreter now uses the same `eval` functions as everyone else to get the evaluated MIR constants. Also this is in preparation for another post-mono check that will be needed for (the current hackfix for) https://github.com/rust-lang/rust/issues/115709: ensuring that all locals are dynamically sized. I didn't expect this to change diagnostics, but it's just cycle errors that change. r? `@oli-obk`
2023-09-18remove provisional cachelcnr-186/+64
2023-09-18Rollup merge of #115838 - lcnr:added-goals, r=compiler-errorsMatthias Krüger-68/+117
inspect: closer to proof trees for coherence a continuation of #115751. Now explicitly store the added goals r? ```@compiler-errors```
2023-09-18Remove unused `Lift` derives.Nicholas Nethercote-2/+2
I found these by commenting out all `Lift` derives and then adding back the ones that were necessary to successfully compile.
2023-09-17Auto merge of #114452 - weiznich:feature/diagnostic_on_unimplemented, ↵bors-25/+84
r=compiler-errors `#[diagnostic::on_unimplemented]` without filters This commit adds support for a `#[diagnostic::on_unimplemented]` attribute with the following options: * `message` to customize the primary error message * `note` to add a customized note message to an error message * `label` to customize the label part of the error message The relevant behavior is specified in [RFC-3366](https://rust-lang.github.io/rfcs/3366-diagnostic-attribute-namespace.html)
2023-09-15Canonicalize effect vars in new solverMichael Goulet-2/+21
2023-09-14move required_consts check to general post-mono-check functionRalf Jung-31/+36
2023-09-14differentiate root and nested goalslcnr-25/+57
2023-09-14inspect: explicitly store added goalslcnr-1/+19
2023-09-14order `added_goals_evaluation` and `nested_probes`lcnr-24/+25
2023-09-14`GoalCandidate` to `Probe`lcnr-29/+27
2023-09-14Auto merge of #115751 - lcnr:inspect-cleanup, r=compiler-errorsbors-205/+200
some inspect improvements split from #114810 because I still want to experiment a bunch with that PR and these changes are self-contained. r? `@compiler-errors`
2023-09-13make the set of methods between our two Const types more consistentRalf Jung-1/+1
2023-09-13make the eval() functions on our const types return the resulting valueRalf Jung-4/+4
2023-09-12`#[diagnostic::on_unimplemented]` without filtersGeorg Semmler-25/+84
This commit adds support for a `#[diagnostic::on_unimplemented]` attribute with the following options: * `message` to customize the primary error message * `note` to add a customized note message to an error message * `label` to customize the label part of the error message Co-authored-by: León Orell Valerian Liehr <me@fmease.dev> Co-authored-by: Michael Goulet <michael@errs.io>
2023-09-11Auto merge of #114586 - oli-obk:patch_tait_rpit_order_check, ↵bors-4/+42
r=lcnr,compiler-errors Bubble up opaque <eq> opaque operations instead of picking an order In case we are in `Bubble` mode (meaning every opaque type that is defined in the current crate is treated as if it were in its defining scope), we don't try to register an opaque type as the hidden type of another opaque type, but instead bubble up an obligation to equate them at the query caller site. Usually that means we have a `DefiningAnchor::Bind` and thus can reliably figure out whether an opaque type is in its defining scope. Where we can't, we'll error out, so the default is sound. With this change we start using `AliasTyEq` predicates in the old solver, too. fixes https://github.com/rust-lang/rust/issues/108498 But also regresses `tests/ui/impl-trait/anon_scope_creep.rs`. Our use of `Bubble` for `check_opaque_type_well_formed` is going to keep biting us. r? `@lcnr` `@compiler-errors`
2023-09-11Bubble up opaque <eq> opaque operations instead of picking an orderOli Scherer-4/+42
2023-09-11Rollup merge of #115743 - compiler-errors:no-impls, r=davidtwcoMatthias Krüger-5/+19
Point out if a local trait has no implementations Slightly helps with #115741
2023-09-11Rollup merge of #115727 - fee1-dead-contrib:effect-fallback, r=oli-obkMatthias Krüger-0/+3
Implement fallback for effect param r? `@oli-obk` or `@lcnr` tracking issue for this ongoing work: https://github.com/rust-lang/rust/issues/110395
2023-09-11dedup `GoalEvaluationStep` and `GoalCandidate`lcnr-42/+56
also handle 2 panics when dumping proof trees for the whole test suite - need to actually tell the proof tree builder about overflow - need to handle a recursion_limit of 0 :<
2023-09-11inspect: strongly typed CandidateKindlcnr-103/+66
2023-09-11inspect: handle `None` in `nested`lcnr-27/+7
2023-09-11split GoalEvaluation and CanonicalGoalEvaluationlcnr-60/+98
the unnormalized goal is in the callers inference context, while anything inside of the `CanonicalGoalEvaluation` is inside of a new one.
2023-09-11Disentangle `Debug` and `Display` for `Ty`.Nicholas Nethercote-1/+1
The `Debug` impl for `Ty` just calls the `Display` impl for `Ty`. This is surprising and annoying. In particular, it means `Debug` doesn't show as much information as `Debug` for `TyKind` does. And `Debug` is used in some user-facing error messages, which seems bad. This commit changes the `Debug` impl for `Ty` to call the `Debug` impl for `TyKind`. It also does a number of follow-up changes to preserve existing output, many of which involve inserting `with_no_trimmed_paths!` calls. It also adds `Display` impls for `UserType` and `Canonical`. Some tests have changes to expected output: - Those that use the `rustc_abi(debug)` attribute. - Those that use the `EMIT_MIR` annotation. In each case the output is slightly uglier than before. This isn't ideal, but it's pretty weird (particularly for the attribute) that the output is using `Debug` in the first place. They're fairly obscure attributes (I hadn't heard of them) so I'm not worried by this. For `async-is-unwindsafe.stderr`, there is one line that now lacks a full path. This is a consistency improvement, because all the other mentions of `Context` in this test lack a path.
2023-09-10Point out if a local trait has no implementationsMichael Goulet-5/+19
2023-09-10Implement fallback for effect paramDeadbeef-0/+3
2023-09-07Don't suggest dereferencing to unsized typeMichael Goulet-1/+14
2023-09-06Auto merge of #115529 - chenyukang:yukang-fix-115402-overflowsize, ↵bors-0/+10
r=compiler-errors Fix error report for size overflow from transmute Fixes #115402 The span in the error reporting always points to the `dst`, this is an old issue, I may open another PR to fix it.
2023-09-06Fix error report for size overflow from transmuteyukang-0/+10
2023-09-05 unconstrained region vars: do not ICE ICE babylcnr-9/+5
2023-09-05Rollup merge of #115519 - compiler-errors:next-solver-assoc-ice, r=lcnrMatthias Krüger-1/+15
Don't ICE on associated type projection without feature gate in new solver Self-explanatory, we should avoid ICEs when the feature gate is not enabled. Continue to ICE when the feature gate *is* enabled, though. Fixes #115500
2023-09-05Auto merge of #115467 - compiler-errors:assoc-ty-object-safety, r=oli-obkbors-0/+9
Do not require associated types with Self: Sized to uphold bounds when confirming object candidate RPITITs and associated types that have `Self: Sized` bounds are opted out of the `dyn Trait` well-formedness check that happens during confirmation. This ensures that we can actually *use* `dyn Trait`s that have associated types that, e.g., have GATs and RPITITs and other naughty things as long as those are opted-out of object safety via a `Self: Sized` bound. Fixes #115464 This seems like a natural part of https://github.com/rust-lang/rust/pull/112319#issuecomment-1592574451, and I don't think needs re-litigation. r? `@oli-obk`
2023-09-03Don't ICE on associated type projection without feature gateMichael Goulet-1/+15
2023-09-02Do not require associated types with Self: Sized to uphold bounds when ↵Michael Goulet-6/+6
confirming object candidate
2023-09-02RPITITs are considered object-safe, they're always on Self:Sized methodsMichael Goulet-0/+9