about summary refs log tree commit diff
path: root/tests/ui/traits/next-solver
AgeCommit message (Collapse)AuthorLines
2025-09-30add testslcnr-0/+60
2025-09-29add testslcnr-0/+39
2025-09-28Rollup merge of #146675 - Jules-Bertholet:sync-nonexclusive, r=Mark-SimulacrumMatthias Krüger-0/+2
Allow shared access to `Exclusive<T>` when `T: Sync` Addresses libs-api request in https://github.com/rust-lang/rust/issues/98407#issuecomment-3299348713. Adds the following trait impls to `Exclusive<T>`, all bounded on `T: Sync`: - `AsRef<T>` - `Clone` - `Copy` - `PartialEq` - `StructuralPartialEq` - `Eq` - `Hash` - `PartialOrd` - `Ord` - `Fn` ``@rustbot`` label T-libs-api
2025-09-26fix cycle head usages trackinglcnr-0/+55
2025-09-24allow bound regions in writebacklcnr-0/+14
2025-09-21Bless UI testsJules Bertholet-0/+2
2025-09-16Fix other uses of "adaptor"Joe Birr-Pixton-1/+1
2025-08-25support non-defining uses in HIR typecklcnr-25/+89
2025-08-23Auto merge of #145706 - lcnr:uniquification, r=BoxyUwUbors-11/+9
change HIR typeck region uniquification handling approach rust-lang/rust#144405 causes structural lookup of opaque types to not work during HIR typeck, so instead avoid uniquifying goals and instead only reprove them if MIR borrowck actually encounters an error. This doesn't perfectly maintain the property that HIR typeck succeeding implies that MIR typeck succeeds, instead weakening this check to only guarantee that HIR typeck implies that MIR typeck succeeds modulo region uniquification. This means we still get the actually desirable ICEs if we MIR building is broken or we forget to check some property in HIR typeck, without having to deal with the fallout of uniquification in HIR typeck itself. We report errors using the original obligation sources of HIR typeck so diagnostics aren't that negatively impacted either. Here's the history of region uniquification while working on the new trait solver: - rust-lang/rust#107981 - rust-lang/rust#110180 - rust-lang/rust#114117 - rust-lang/rust#130821 - rust-lang/rust#144405 - rust-lang/rust#145706 <- we're here :tada: r? `@BoxyUwU`
2025-08-22On E0277, point at type that doesn't implement boundEsteban Küber-10/+49
When encountering an unmet trait bound, point at local type that doesn't implement the trait: ``` error[E0277]: the trait bound `Bar<T>: Foo` is not satisfied --> $DIR/issue-64855.rs:9:19 | LL | pub struct Bar<T>(<Self as Foo>::Type) where Self: ; | ^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound | help: the trait `Foo` is not implemented for `Bar<T>` --> $DIR/issue-64855.rs:9:1 | LL | pub struct Bar<T>(<Self as Foo>::Type) where Self: ; | ^^^^^^^^^^^^^^^^^ ```
2025-08-22change HIR typeck unification handling approachlcnr-11/+9
2025-08-14add regression testlcnr-0/+43
2025-07-31add testslcnr-0/+81
2025-07-30handle region dependent goals due to infer varslcnr-0/+52
2025-07-25uniquify root goals during HIR typecklcnr-0/+73
2025-07-20Consider param-env for fast pathMichael Goulet-40/+2
2025-07-04Remove Symbol for Named LateParam/Bound variantsMichael Goulet-1/+1
2025-07-03Remove PointerLike traitMichael Goulet-38/+0
2025-06-30Move lazy type alias checks to non-hir-wfckOli Scherer-2/+2
2025-06-27Rollup merge of #142671 - davidtwco:no-default-bounds-attr, r=lcnrGuillaume Gomez-82/+99
add #![rustc_no_implicit_bounds] Follow-up from rust-lang/rust#137944. Adds a new `rustc_attrs` attribute that stops rustc from adding any default bounds. Useful for tests where default bounds just add noise and make debugging harder. After reviewing all tests with `?Sized`, these tests seem like they could probably benefit from `#![rustc_no_implicit_bounds]`. - Skipping most of `tests/ui/unsized` as these seem to want to test `?Sized` - Skipping tests that used `Box<T>` because it's still bound by `T: MetaSized` - Skipping parsing or other tests that cared about `?Sized` syntactically - Skipping tests for `derive(CoercePointee)` because this appears to check that the pointee type is relaxed with `?Sized` explicitly r? `@lcnr`
2025-06-27tests: add #![rustc_no_implicit_bounds]David Wood-82/+99
After reviewing all tests with `?Sized` and discussing with lcnr, these tests seem like they could probably benefit from `#![rustc_no_implicit_bounds]`.
2025-06-24Make missing lifetime suggestion verboseMichael Goulet-3/+6
2025-06-16tests: bless remaining testsDavid Wood-2/+40
These tests just need blessing, they don't have any interesting behaviour changes. Some of these tests have new errors because `LegacyReceiver` cannot be proven to be implemented now that it is also testing for `MetaSized` - but this is just a consequence of the other errors in the test.
2025-06-09Apply nested goals certainty to InspectGoals for normalizes-toMichael Goulet-7/+21
2025-06-02Fast path for stalled obligations on self tyMichael Goulet-5/+2
2025-05-29Structurally normalize types as needed in projection_ty_coreMichael Goulet-0/+32
2025-05-21Rollup merge of #141347 - lcnr:lets-make-it-unsound-3, r=compiler-errorsMatthias Krüger-0/+33
incorrectly prefer builtin `dyn` impls :3 This makes #57893 slightly more exploitable with the new solver. It's still strictly better than the old solver and the underlying unsoundness persists in the new one even without this preference. Properly fixing #57893 is something we've been looking at more deeply recently and discussed at the [Types Meetup during the All-Hands](https://hackmd.io/rz-4ghMzTb2wXOkdLKHaHw#Dyn-traits). Whatever approach we'll end up deciding on will likely require a fairly long transition period and some significant further design work. This should not block `-Znext-solver`. fixes https://github.com/rust-lang/trait-system-refactor-initiative/issues/183 r? `@compiler-errors` cc `@rust-lang/types`
2025-05-21fix better_any breakage by making the solver more unsoundlcnr-0/+33
2025-05-21Rollup merge of #141334 - lcnr:coerce-nested-obligations, r=compiler-errorsMatthias Krüger-0/+16
eagerly check nested obligations when coercing fndefs fixes https://github.com/rust-lang/trait-system-refactor-initiative/issues/212 r? `@compiler-errors`
2025-05-21Rollup merge of #141333 - compiler-errors:param-env-candidate-unnorm, r=lcnrMatthias Krüger-0/+46
Use `DeepRejectCtxt` in `assemble_inherent_candidates_from_param` Fixes https://github.com/rust-lang/trait-system-refactor-initiative/issues/214 We were not properly considering unnormalized param-env candidates in `assemble_inherent_candidates_from_param`. r? lcnr
2025-05-21eagerly check nested obligations when coercing fndefslcnr-0/+16
2025-05-21Use DeepRejectCtxt in assemble_inherent_candidates_from_paramMichael Goulet-0/+46
2025-05-21Do not eagerly fold consts in normalize_param_env_or_error if new solverMichael Goulet-0/+10
2025-05-08Rollup merge of #140711 - compiler-errors:combine-maybes, r=lcnrMatthias Krüger-0/+56
Do not discard constraints on overflow if there was candidate ambiguity Fixes https://github.com/rust-lang/trait-system-refactor-initiative/issues/201. There's a pretty chunky justification in the test. r? lcnr
2025-05-07Use MaybeCause::or to allow constraints from overflows if they are combined ↵Michael Goulet-0/+56
with ambiguity
2025-05-07Only prefer param-env candidates if they remain non-global after normMichael Goulet-19/+16
2025-05-06support duplicates in the opaque_types_storagelcnr-0/+25
2025-05-05Deeply normalize in the new solver in WFMichael Goulet-5/+18
2025-04-26Rollup merge of #140306 - lcnr:specialization-new, r=compiler-errorsMatthias Krüger-31/+24
handle specialization in the new trait solver fixes https://github.com/rust-lang/trait-system-refactor-initiative/issues/187 also fixes the regression in `plonky2_field` from https://github.com/rust-lang/trait-system-refactor-initiative/issues/188 cc https://github.com/rust-lang/rust/pull/111994 r? ```@compiler-errors```
2025-04-25Track per-obligation recursion depth only if there is inferenceMichael Goulet-0/+31
2025-04-25handle specialization in the new trait solverlcnr-31/+24
uwu :3
2025-04-24norm nested aliases before evaluating the parent goallcnr-0/+45
2025-04-18Don't assemble non-env/bound candidates if projection is rigidMichael Goulet-0/+32
2025-04-17Rollup merge of #139774 - compiler-errors:supertrait-alias, r=lcnrMatthias Krüger-0/+103
Fix replacing supertrait aliases in `ReplaceProjectionWith` The new solver has a procedure called `predicates_for_object_candidate`, which elaborates the super-bounds and item-bounds that are required to hold for a dyn trait to implement something via a built-in object impl. In that procedure, there is a folder called `ReplaceProjectionWith` which is responsible for replacing projections that reference `Self`, so that we don't encounter cycles when we then go on to normalize those projections in the process of proving these super-bounds. That folder had a few problems: Firstly, it wasn't actually checking that this was a super bound originating from `Self`. Secondly, it only accounted for a *single* projection type def id, but trait objects can have multiple (i.e. `trait Foo<A, B>: Bar<A, Assoc = A> + Bar<B, Assoc = B>`). To fix the first, it's simple enough to just add an equality check for the self ty. To fix the second, I implemented a matching step that's very similar to the `projection_may_match` check we have for upcasting, since on top of having multiple choices, we need to deal with both non-structural matches and ambiguity. This probably lacks a bit of documentation, but I think it works pretty well. Fixes https://github.com/rust-lang/trait-system-refactor-initiative/issues/171 r? lcnr
2025-04-16Fix replacing supertrait aliases in ReplaceProjectionWithMichael Goulet-0/+103
2025-04-16stepping into impls for norm is unproductivelcnr-0/+188
2025-04-15Rollup merge of #139791 - lcnr:ignore-global-where-bounds, r=compiler-errorsStuart Cook-4/+25
drop global where-bounds before merging candidates fixes https://github.com/rust-lang/trait-system-refactor-initiative/issues/172 r? ```@compiler-errors```
2025-04-14drop global where-bounds before merging candidateslcnr-4/+25
2025-04-14Move `has_self` field to `hir::AssocKind::Fn`.Nicholas Nethercote-2/+2
`hir::AssocItem` currently has a boolean `fn_has_self_parameter` field, which is misplaced, because it's only relevant for associated fns, not for associated consts or types. This commit moves it (and renames it) to the `AssocKind::Fn` variant, where it belongs. This requires introducing a new C-style enum, `AssocTag`, which is like `AssocKind` but without the fields. This is because `AssocKind` values are passed to various functions like `find_by_ident_and_kind` to indicate what kind of associated item should be searched for, and having to specify `has_self` isn't relevant there. New methods: - Predicates `AssocItem::is_fn` and `AssocItem::is_method`. - `AssocItem::as_tag` which converts `AssocItem::kind` to `AssocTag`. Removed `find_by_name_and_kinds`, which is unused. `AssocItem::descr` can now distinguish between methods and associated functions, which slightly improves some error messages.
2025-04-12tests: ensure disabled tests have a reasonJieyou Xu-1/+1