about summary refs log tree commit diff
path: root/tests/ui/traits/next-solver
AgeCommit message (Collapse)AuthorLines
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
2025-04-11Auto merge of #139578 - ferrocene:pa-compiletest-edition, r=jieyouxubors-2/+3
Fix breakage when running compiletest with `--test-args=--edition=2015` Compiletest has an `--edition` flag to change the default edition tests are run with. Unfortunately no test suite successfully executes when that flag is passed. If the edition is set to something greater than 2015 the breakage is expected, since the test suite currently supports only edition 2015 (Ferrous Systems will open an MCP about fixing that soonish). Surprisingly, the test suite is also broken if `--edition=2015` is passed to compiletest. This PR focuses on fixing the latter. This PR fixes the two categories of failures happening when `--edition=2015` is passed: * Some edition-specific tests set their edition through `//@ compile-flags` instead of `//@ edition`. Compiletest doesn't parse the compile flags, so it would see no `//@ edition` and add another `--edition` flag, leading to a rustc error. * Compiletest would add the edition after `//@ compile-flags`, while some tests depend on flags passed to `//@ compile-flags` being the last flags in the rustc invocation. Note that for the first category, I opted to manually go and replace all `//@ compile-flags` setting an edition with an explicit `//@ edition`. We could've changed compiletest to instead check whether an edition was set in `//@ compile-flags`, but I thought it was better to enforce a consistent way to set the edition in tests. I also added the edition to the stamp, so that changing `--edition` results in tests being re-executed. r? `@jieyouxu`
2025-04-10Deeply normalize obligations in BestObligationMichael Goulet-18/+10
2025-04-10replace `//@ compile-flags: --edition` with `//@ edition`Pietro Albini-2/+3
2025-04-08UI tests: add missing diagnostic kinds where possibleVadim Petrochenkov-3/+3
2025-04-03add `TypingMode::Borrowck`lcnr-16/+63
2025-03-24Allow WellFormed goals to be returned from relating in new solverMichael Goulet-0/+48
2025-03-14Do not suggest using `-Zmacro-backtrace` for builtin macrosEsteban Küber-1/+0
For macros that are implemented on the compiler, we do *not* mention the `-Zmacro-backtrace` flag. This includes `derive`s and standard macros.
2025-03-12Rollup merge of #137314 - lcnr:cycles-with-unknown-kind, r=compiler-errorsMatthias Krüger-119/+80
change definitely unproductive cycles to error builds on top of #136824 by adding a third variant to `PathKind` for paths which may change to be coinductive in the future but must not be so right now. Most notably, impl where-clauses of not yet coinductive traits. With this, we can change cycles which are definitely unproductive to a proper error. This fixes https://github.com/rust-lang/trait-system-refactor-initiative/issues/114. This does not affect stable as we keep these cycles as ambiguous during coherence. r? ````````@compiler-errors```````` ````````@nikomatsakis````````
2025-03-11Implement `#[define_opaque]` attribute for functions.Oli Scherer-13/+22
2025-03-05Rollup merge of #137728 - Darksonn:no-tuple-unsize, r=oli-obk许杰友 Jieyou Xu (Joe)-6/+0
Remove unsizing coercions for tuples See https://github.com/rust-lang/rust/issues/42877#issuecomment-2686010847 and below comments for justification. Tracking issue: #42877 Fixes: #135217
2025-03-05keep inductive cycles as ambig in coherencelcnr-0/+32