about summary refs log tree commit diff
path: root/tests/ui/impl-trait
AgeCommit message (Collapse)AuthorLines
2023-07-28Rollup merge of #114146 - compiler-errors:dont-report-rpitit-name, r=spastorinoMatthias Krüger-0/+99
Skip reporting item name when checking RPITIT GAT's associated type bounds hold Doesn't really make sense to label an item that has a name that users can't really mention. Fixes #114145. Also fixes #113794. r? `@spastorino`
2023-07-28Auto merge of #113312 - Ddystopia:auto-trait-fun, r=lcnrbors-0/+10
discard default auto trait impls if explicit ones exist (rebase of #85048) Rebase of #85048
2023-07-28Auto merge of #114134 - fee1-dead-contrib:rm-constness-from-param-env, r=oli-obkbors-10/+9
Remove `constness` from `ParamEnv` This should be replaced by keyword generics/effects. cc #110395 r? `@oli-obk`
2023-07-27Add additional testMichael Goulet-0/+44
2023-07-27Insert RPITITs that were shadowed by missing ADTs that resolve to type errorMichael Goulet-0/+27
2023-07-27tighten span slightly for synthetic itemMichael Goulet-2/+2
2023-07-27Skip reporting item name when checking RPITIT GAT's associated type bounds holdMichael Goulet-0/+55
2023-07-27update tests, adding known-bugDeadbeef-10/+9
2023-07-27Consider a goal as NOT changed if its response is identity modulo regionsMichael Goulet-1/+1
2023-07-20Auto merge of #113622 - RickleAndMortimer:issue-113184-fix, r=oli-obkbors-0/+2
add links to query documentation for E0391 This PR adds links to https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for the rustc --explain E0391 and within the compiler error itself. Fixes: #113184
2023-07-19Auto merge of #113690 - aliemjay:opaque-defined-by-trait, r=compiler-errorsbors-0/+12
allow opaques to be defined by trait queries, again This basically reverts #112963. Moreover, all call-sites of `enter_canonical_trait_query` can now define opaque types, see the ui test `defined-by-user-annotation.rs`. Fixes #113689 r? `@compiler-errors` `@oli-obk`
2023-07-18moved note as unspanned note, moved note to the bottom of the msgnxya-10/+2
2023-07-18added links as a notenxya-2/+2
2023-07-18add links to query documentation for E0391nxya-2/+2
2023-07-18added links as a notenxya-2/+12
2023-07-18add links to query documentation for E0391nxya-2/+2
2023-07-15Check entry type as part of item type checking.Camille GILLOT-8/+8
2023-07-14allow opaques to be defined by trait queriesAli MJ Al-Nasrawy-0/+12
2023-07-10Auto merge of #112988 - spastorino:new-rpitit-24, r=compiler-errorsbors-85/+408
Replace RPITIT current impl with new strategy that lowers as a GAT This PR replaces the current implementation of RPITITs with the new implementation that we had under -Zlower-impl-trait-in-trait-to-assoc-ty flag that lowers the RPIT as a GAT on the trait and on the impls that implement that trait. Opening this PR as a draft because this goes after #112682, ~#112981~ and ~#112983~. As soon as those are merged, I can rebase and we should run perf, crater and test a lot. r? `@compiler-errors`
2023-07-08Replace RPITIT current impl with new strategy that lowers as a GATSantiago Pastorino-85/+408
2023-07-08Auto merge of #113491 - matthiaskrgr:rollup-mueqz7h, r=matthiaskrgrbors-2/+2
Rollup of 6 pull requests Successful merges: - #113005 (Don't call `query_normalize` when reporting similar impls) - #113064 (std: edit [T]::swap docs) - #113138 (Add release notes for 1.71.0) - #113217 (resolve typerelative ctors to adt) - #113254 (Use consistent formatting in Readme) - #113482 (Migrate GUI colors test to original CSS color format) r? `@ghost` `@rustbot` modify labels: rollup
2023-07-08Rollup merge of #113005 - compiler-errors:dont-query-normalize, r=cjgillotMatthias Krüger-2/+2
Don't call `query_normalize` when reporting similar impls Firstly, It's sketchy to be using `query_normalize` at all during HIR typeck -- it's asking for an ICE 😅. Secondly, we're normalizing an impl trait ref that potentially has parameter types in `ty::ParamEnv::empty()`, which is kinda sketchy as well. The only UI test change from removing this normalization is that we don't evaluate anonymous constants in impls, which end up giving us really ugly suggestions: ``` error[E0277]: the trait bound `[X; 35]: Default` is not satisfied --> /home/gh-compiler-errors/test.rs:4:5 | 4 | <[X; 35] as Default>::default(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Default` is not implemented for `[X; 35]` | = help: the following other types implement trait `Default`: &[T] &mut [T] [T; 32] [T; core::::array::{impl#30}::{constant#0}] [T; core::::array::{impl#31}::{constant#0}] [T; core::::array::{impl#32}::{constant#0}] [T; core::::array::{impl#33}::{constant#0}] [T; core::::array::{impl#34}::{constant#0}] and 27 others ``` So just fold the impls with a `BottomUpFolder` that calls `ty::Const::eval`. This doesn't work totally correctly with generic-const-exprs, but it's fine for stable code, and this is error reporting after all.
2023-07-08Rollup merge of #113335 - compiler-errors:reveal-opaques-in-new-solver, r=lcnrMatthias Krüger-0/+11
Reveal opaques in new solver We were testing against the wrong reveal mode :fearful: Also a couple of misc commits that I don't want to really put in separate prs r? ``@lcnr``
2023-07-08Auto merge of #113474 - compiler-errors:rollup-07x1up7, r=compiler-errorsbors-0/+51
Rollup of 8 pull requests Successful merges: - #113413 (Add needs-triage to all new issues) - #113426 (Don't ICE in `resolve_bound_vars` when associated return-type bounds are in bad positions) - #113427 (Remove `variances_of` on RPITIT GATs, remove its one use-case) - #113441 (miri: check that assignments do not self-overlap) - #113453 (Remove unused from_method from rustc_on_unimplemented) - #113456 (Avoid calling report_forbidden_specialization for RPITITs) - #113466 (Update cargo) - #113467 (Fix comment of `fn_can_unwind`) r? `@ghost` `@rustbot` modify labels: rollup
2023-07-07Add regression test for RPITITsSantiago Pastorino-0/+51
2023-07-07Normalize opaques during codegen in new solverMichael Goulet-0/+11
2023-07-07Require TAITs to be mentioned in the signatures of functions that register ↵Oli Scherer-22/+89
hidden types for them
2023-07-06deal with opaque types without cyclinglcnr-66/+71
2023-07-06update auto trait handlinglcnr-61/+66
2023-07-05Add some extra information to opaque type cycle errorsOli Scherer-7/+149
2023-07-04Auto merge of #113303 - compiler-errors:yeet-chalk, r=lcnrbors-5/+3
Remove chalk support from the compiler Removes chalk (`-Ztrait-solver=chalk`) from the compiler and prunes any dead code resulting from this, mainly: * Remove the chalk compatibility layer in `compiler/rustc_traits/src/chalk` * Remove the chalk flag `-Ztrait-solver=chalk` and its `TraitEngine` implementation * Remove `TypeWellFormedFromEnv` (and its many `bug!()` match arms) * Remove the chalk migration mode from compiletest * Remove the `chalkify` UI tests (do we want to keep any of these, but migrate them to `-Ztrait-solver=next`??) Fulfills rust-lang/types-team#93. r? `@jackh726`
2023-07-04Auto merge of #113215 - compiler-errors:rpitit-predicates-tweaks, r=spastorinobors-15/+52
Make RPITITs assume/require their parent method's predicates Removes a FIXME from the `param_env` query where we were manually adding the parent function's predicates to the RPITIT's assumptions. r? `@spastorino`
2023-07-03Remove compare modeMichael Goulet-2/+0
2023-07-03Remove chalk from the compilerMichael Goulet-3/+3
2023-07-01Rollup merge of #113182 - compiler-errors:rpit-stricter-captures, r=oli-obkMatthias Krüger-24/+167
Error when RPITITs' hidden types capture more lifetimes than their trait definitions This implements a stricter set of captures rules for RPITITs. They now may only capture: 1. Lifetimes from the impl header (both the self type and any trait substs -- we may want to restrict just to the self type's lifetimes, but the PR makes that easy to do, too) 2. Lifetimes mentioned by the `impl Trait` in the trait method's definition. Namely, they may not mention lifetimes from the method (early or late) that are not mentioned in the `impl Trait`. cc #105258 which I think was trying to do this too, though I'm not super familiar with what exactly differs from that or why that one was broken. cc #112194 (doesn't fix this issue per se, because it's still an open question, but I think this is objectively better than the status quo, and gets us closer to resolving that issue.) Technically is a fix for the ICE in #108580, but it turns that issue into an error now. We can decide separately whether or not nested RPITITs should capture lifetimes from their parents. r? ``@oli-obk``
2023-06-30Additional wf testMichael Goulet-10/+51
2023-06-30RPITITs inherit method predicatesMichael Goulet-5/+1
2023-06-30Rollup merge of #113171 - spastorino:new-rpitit-25, r=compiler-errorsMatthias Krüger-0/+19
Properly implement variances_of for RPITIT GAT This fixes some of the issues found by crater run in https://github.com/rust-lang/rust/pull/112988#issuecomment-1610019572 r? ``@compiler-errors``
2023-06-30Rollup merge of #113165 - compiler-errors:rpitits-foreign-bounds, r=spastorinoMatthias Krüger-0/+4
Encode item bounds for `DefKind::ImplTraitPlaceholder` This was lost in a refactoring -- `hir::ItemKind::OpaqueTy` doesn't always map to `DefKind::Opaque`, specifically for RPITITs, so the check was migrated subtly wrong, and unfortunately I never had a test for this 🙃 Fixes #113155 r? ``@cjgillot``
2023-06-30Rollup merge of #113071 - ↵Matthias Krüger-9/+3
compiler-errors:no-parent-non-lifetime-args-in-apit, r=eholk Account for late-bound vars from parent arg-position impl trait We should be reporting an error like we do for late-bound args coming from a parent APIT. Fixes #113016
2023-06-30Adapt tests from #105258Michael Goulet-6/+151
2023-06-30Flip the order of binder instantiation for better diagnosticsMichael Goulet-13/+7
2023-06-30Error for RPITIT hidden tys that capture more than their trait defnMichael Goulet-17/+21
2023-06-29Properly implement variances_of for RPITIT GATSantiago Pastorino-0/+19
2023-06-29Encode item bounds for DefKind::ImplTraitPlaceholderMichael Goulet-0/+4
2023-06-27Don't sort strings right after we just sorted by typesMichael Goulet-2/+2
2023-06-27More testsMichael Goulet-0/+27
2023-06-26migrate lifetime tooMichael Goulet-9/+3
2023-06-25Rollup merge of #113036 - TaKO8Ki:fix-112094, r=compiler-errorsMatthias Krüger-0/+12
Accept `ReStatic` for RPITIT Fixes #112094 Regression in https://github.com/rust-lang/rust/commit/8216b7f22934cea2422c79565df9c30ac8db93e0 If there is a better suggestion, I will go with that.
2023-06-26accept `ReStatic` for RPITITTakayuki Maeda-0/+12
add an ui test for #112094