about summary refs log tree commit diff
path: root/tests/ui/rfcs/rfc-2632-const-trait-impl
AgeCommit message (Collapse)AuthorLines
2024-10-22Move testsMichael Goulet-7896/+0
2024-10-17Rollup merge of #128391 - cafce25:issue-128390, r=lcnrMatthias Krüger-4/+5
Change orphan hint from "only" to "any uncovered type inside..." Fix #128390
2024-10-04Bless ui tests.Camille GILLOT-28/+28
2024-10-02Improve const traits diagnostics for new desugaringDeadbeef-137/+114
2024-09-30Rollup merge of #131038 - onkoe:fix/adt_const_params_leak_118179, ↵Matthias Krüger-3/+3
r=compiler-errors Fix `adt_const_params` leaking `{type error}` in error msg Fixes the confusing diagnostic described in #118179. (users would see `{type error}` in some situations, which is pretty weird) `adt_const_params` tracking issue: #95174
2024-09-29fix(hir_analysis/wfcheck): don't leak {type error}Barrett Ray-3/+3
avoid `{type error}` being leaked in user-facing messages, particularly when using the `adt_const_params` feature
2024-09-27properly elaborate effects implied bounds for super traitsDeadbeef-53/+21
2024-09-26Make new information notes instead of labelsJonathan Birk-5/+5
2024-09-24Ban combination of GCE and new solverMichael Goulet-8/+23
2024-09-21Don't elaborate effects predicates into bounds list unless we're actually ↵Michael Goulet-14/+1
collecting implied bounds, not super bounds
2024-09-15stabilize const_mut_refsRalf Jung-37/+34
2024-08-24remove invalid `TyCompat` relation for effectsDeadbeef-2/+13
2024-08-11Add more information link to orphan implsJonathan Birk-1/+2
2024-08-10Differentiate between methods and associated functionsEsteban Küber-22/+22
Accurately refer to assoc fn without receiver as assoc fn instead of methods. Add `AssocItem::descr` method to centralize where we call methods and associated functions.
2024-07-30Adjust orphan note in testsJonathan Birk-1/+1
2024-07-25Rollup merge of #128171 - compiler-errors:arg-compat, r=oli-obkMatthias Krüger-0/+53
Make sure that args are compatible in `resolve_associated_item` Implements a similar check to the one that we have in projection for GATs (#102488, #123240), where we check that the args of an impl item are compatible before returning it. This is done in `resolve_assoc_item`, which is backing `Instance::resolve`, so this is conceptually generalizing the check from GATs to methods/assoc consts. This is important to make sure that the inliner will only visit and substitute MIR bodies that are compatible w/ their trait definitions. This shouldn't happen in codegen, but there are a few ways to get the inliner to be invoked (via calls to `optimized_mir`) before codegen, namely polymorphization and CTFE. Fixes #121957 Fixes #120792 Fixes #120793 Fixes #121063
2024-07-24Make sure that args are compatible in resolve_associated_itemMichael Goulet-0/+53
2024-07-25Rollup merge of #128111 - estebank:no-question, r=fmeaseMatthias Krüger-4/+4
Do not use question as label We don't want to have questions in the diagnostic output. Instead, we use wording that communicates uncertainty, like "might": ``` error[E0432]: unresolved import `spam` --> $DIR/import-from-missing-star-3.rs:2:9 | LL | use spam::*; | ^^^^ you might be missing crate `spam` | = help: consider adding `extern crate spam` to use the `spam` crate ```
2024-07-25Rollup merge of #127054 - compiler-errors:bound-ordering, r=fmeaseMatthias Krüger-18/+26
Reorder trait bound modifiers *after* `for<...>` binder in trait bounds This PR suggests changing the grammar of trait bounds from: ``` [CONSTNESS] [ASYNCNESS] [?] [BINDER] [TRAIT_PATH] const async ? for<'a> Sized ``` to ``` ([BINDER] [CONSTNESS] [ASYNCNESS] | [?]) [TRAIT_PATH] ``` i.e., either ``` ? Sized ``` or ``` for<'a> const async Sized ``` (but not both) ### Why? I think it's strange that the binder applies "more tightly" than the `?` trait polarity. This becomes even weirder when considering that we (or at least, I) want to have `async` trait bounds expressed like: ``` where T: for<'a> async Fn(&'a ()) -> i32, ``` and not: ``` where T: async for<'a> Fn(&'a ()) -> i32, ``` ### Fallout No crates on crater use this syntax, presumably because it's literally useless. This will require modifying the reference grammar, though. ### Alternatives If this is not desirable, then we can alternatively keep parsing `for<'a>` after the `?` but deprecate it with either an FCW (or an immediate hard error), and begin parsing `for<'a>` *before* the `?`.
2024-07-24Do not use question as labelEsteban Küber-4/+4
We don't want to have questions in the diagnostic output. Instead, we use wording that communicates uncertainty, like "might": ``` error[E0432]: unresolved import `spam` --> $DIR/import-from-missing-star-3.rs:2:9 | LL | use spam::*; | ^^^^ you might be missing crate `spam` | = help: consider adding `extern crate spam` to use the `spam` crate ```
2024-07-24Rollup merge of #122192 - oli-obk:type_of_opaque_for_const_checks, r=lcnrMatthias Krüger-35/+3
Do not try to reveal hidden types when trying to prove auto-traits in the defining scope fixes #99793 this avoids the cycle error by just causing a selection error, which is not fatal. We pessimistically assume that freeze does not hold, which is always a safe assumption.
2024-07-24Do not try to reveal hidden types when trying to prove Freeze in the ↵Oli Scherer-35/+3
defining scope
2024-07-22Revert suggestion verbosity changeEsteban Küber-24/+12
2024-07-22Change suggestion message wordingEsteban Küber-4/+4
2024-07-22Use verbose suggestion for "wrong # of generics"Esteban Küber-12/+24
2024-07-16Add `ConstArgKind::Path` and make `ConstArg` its own HIR nodeNoah Lev-13/+4
This is a very large commit since a lot needs to be changed in order to make the tests pass. The salient changes are: - `ConstArgKind` gets a new `Path` variant, and all const params are now represented using it. Non-param paths still use `ConstArgKind::Anon` to prevent this change from getting too large, but they will soon use the `Path` variant too. - `ConstArg` gets a distinct `hir_id` field and its own variant in `hir::Node`. This affected many parts of the compiler that expected the parent of an `AnonConst` to be the containing context (e.g., an array repeat expression). They have been changed to check the "grandparent" where necessary. - Some `ast::AnonConst`s now have their `DefId`s created in rustc_ast_lowering rather than `DefCollector`. This is because in some cases they will end up becoming a `ConstArgKind::Path` instead, which has no `DefId`. We have to solve this in a hacky way where we guess whether the `AnonConst` could end up as a path const since we can't know for sure until after name resolution (`N` could refer to a free const or a nullary struct). If it has no chance as being a const param, then we create a `DefId` in `DefCollector` -- otherwise we decide during ast_lowering. This will have to be updated once all path consts use `ConstArgKind::Path`. - We explicitly use `ConstArgHasType` for array lengths, rather than implicitly relying on anon const type feeding -- this is due to the addition of `ConstArgKind::Path`. - Some tests have their outputs changed, but the changes are for the most part minor (including removing duplicate or almost-duplicate errors). One test now ICEs, but it is for an incomplete, unstable feature and is now tracked at #127009.
2024-07-14add_effects_testBoxy-0/+88
2024-07-11And additionally enforce ? and async/const aren't mixedMichael Goulet-16/+24
2024-07-11Always use a colon in `//@ normalize-*:` headersZalathar-2/+2
2024-07-10Enforce that ? and for<...> are not combinedMichael Goulet-2/+2
2024-07-10Reorder modifiers and polarity to be *after* binder in trait boundsMichael Goulet-2/+2
2024-07-08Rollup merge of #127452 - fee1-dead-contrib:fx-intrinsic-counting, r=fmease许杰友 Jieyou Xu (Joe)-17/+49
Fix intrinsic const parameter counting with `effects` r? project-const-traits
2024-07-07Fix intrinsic const parameter counting with `effects`Deadbeef-17/+49
2024-07-05Process alias-relate obligations when proving receiver_is_validMichael Goulet-49/+2
2024-07-02Actually report normalization-based type errors correctly for alias-relate ↵Michael Goulet-4/+16
obligations in new solver
2024-06-30Migrate tests to use `-Znext-solver`Deadbeef-349/+404
2024-06-30Make `feature(effects)` require `-Znext-solver`Deadbeef-0/+24
2024-06-28address review commentsDeadbeef-15/+9
2024-06-28finishing touches, move fixed ICEs to ui testsDeadbeef-5/+160
2024-06-28general fixups and turn `TODO`s into `FIXME`sDeadbeef-75/+4
2024-06-28bless UI testsDeadbeef-815/+854
2024-06-28bless tests part 1Deadbeef-34/+218
2024-06-28temporarily disable effects on specialization testsDeadbeef-49/+36
2024-06-28Implement `Min` trait in new solverDeadbeef-0/+1
2024-06-28implement new effects desugaringDeadbeef-2/+27
2024-06-22Make `effects` an incomplete featureDeadbeef-88/+679
2024-06-21bless testsDeadbeef-106/+796
2024-06-19Taint infcx when reporting errorsOli Scherer-4/+122
2024-06-05Bless tests and handle tests/crashesBoxy-24/+14
2024-06-04Rollup merge of #125865 - ajwock:ice_not_fully_resolved, r=fee1-deadMichael Goulet-0/+93
Fix ICE caused by ignoring EffectVars in type inference Fixes #119830 ​r? ```@matthiaskrgr```