rust/tests/ui/const-generics
Trevor Gross ceae37188b
Rollup merge of #126575 - fmease:update-lint-type_alias_bounds, r=compiler-errors
Make it crystal clear what lint `type_alias_bounds` actually signifies

This is part of my work on https://github.com/rust-lang/rust/labels/F-lazy_type_alias ([tracking issue](#112792)).

---

To recap, the lint `type_alias_bounds` detects bounds on generic parameters and where clauses on (eager) type aliases. These bounds should've never been allowed because they are currently neither enforced[^1] at usage sites of type aliases nor thoroughly checked for correctness at definition sites due to the way type aliases are represented in the compiler. Allowing them was an oversight.

Explicitly label this as a known limitation of the type checker/system and establish the experimental feature `lazy_type_alias` as its eventual proper solution.

Where this becomes a bit tricky (for me as a rustc dev) are the "secondary effects" of these bounds whose existence I sadly can't deny. As a matter of fact, type alias bounds do play some small roles during type checking. However, after a lot of thinking over the last two weeks I've come to the conclusion (not without second-guessing myself though) that these use cases should not trump the fact that these bounds are currently *inherently broken*. Therefore the lint `type_alias_bounds` should and will continue to flag bounds that may have subordinate uses.

The two *known* secondary effects are:

1. They may enable the use of "shorthand" associated type paths `T::Assoc` (as opposed to fully qualified paths `<T as Trait>::Assoc`) where `T` is a type param bounded by some trait `Trait` which defines that assoc ty.
2. They may affect the default lifetime of trait object types passed as a type argument to the type alias. That concept is called (trait) object lifetime default.

The second one is negligible, no question asked. The first one however is actually "kinda nice" (for writability) and comes up in practice from time to time.

So why don't I just special-case trait bounds that "define" shorthand assoc type paths as originally planned in #125709?

1. Starting to permit even a tiny subset of bounds would already be enough to send a signal to users that bounds in type aliases have been legitimized and that they can expect to see type alias bounds in the wild from now on (proliferation). This would be actively misleading and dangerous because those bounds don't behave at all like one would expect, they are *not real*[^2]!
   1. Let's take `type A<T: Trait> = T::Proj;` for example. Everywhere else in the language `T: Trait` means `T: Trait + Sized`. For type aliases, that's not the case though: `T: Trait` and `T: Trait + ?Sized` for that matter do neither mean `T: Trait + Sized` nor `T: Trait + ?Sized` (for both!). Instead, whether `T` requires `Sized` or not entirely depends on the definition of `Trait`[^2]. Namely, whether or not it is bounded by `Sized`.
   2. Given `type A<T: Trait<AssocA = ()>> = T::AssocB;`, while `X: Trait` gets checked given `A<X>` (by virtue of projection wfchecking post alias expansion[^2]), the associated type constraint `AssocA = ()` gets dropped entirely! While we could choose to warn on such cases, it would inevitably lead to a huge pile of special cases.
   3. While it's common knowledge that the body / aliased type / RHS of an (eager) type alias does not get checked for well-formedness, I'm not sure if people would realize that that extends to bounds as well. Namely, `type A<T: Trait<[u8]>> = T::Proj;` compiles even if `Trait`'s generic parameter requires `Sized`. Of course, at usage sites `[u8]: Sized` would still end up getting checked[^2], so it's not a huge problem if you have full control over `A`. However, imagine that `A` was actually part of a public API and was never used inside the defining crate (not unreasonable). In such a scenario, downstream users would be presented with an impossible to use type alias! Remember, bounds may grow arbitrarily complex and nuanced in practice.
   4. Even if we allowed trait bounds that "define" shorthand assoc type paths, we would still need to continue to warn in cases where the assoc ty comes from a supertrait despite the fact that the shorthand syntax can be used: `type A<T: Sub> = T::Assoc;` does compile given `trait Sub: Super {}` and `trait Super { type Assoc; }`. However, `A<X>` does not enforce `X: Sub`, only `X: Super`[^2]. All that to say, type alias bounds are simply not real and we shouldn't pretend they are!
   5. Summarizing the points above, we would be legitimizing bounds that are completely broken!
2. It's infeasible to implement: Due to the lack of `TypeckResults` in `ItemCtxt` (and a way to propagate it to other parts of the compiler), the resolution of type-dependent paths in non-`Body` items (most notably type aliases) is not recoverable from the HIR alone which would be necessary because the information of whether an associated type path (projection) is a shorthand is only present pre&in-HIR and doesn't survive HIR ty lowering. Of course, I could rerun parts of HIR ty lowering inside the lint `type_alias_bounds` (namely, `probe_single_ty_param_bound_for_assoc_ty` which would need to be exposed or alternatively a stripped-down version of it). This likely has a performance impact and introduces complexity. In short, the "benefits" are not worth the costs.

---

* 3rd commit: Update a diagnostic to avoid suggesting type alias bounds
* 4th commit: Flag type alias bounds even if the RHS contains inherent associated types.
  * I started to allow them at some point in the past which was not correct (see commit for details)
* 5th commit: Allow type alias bounds if the RHS contains const projections and GCEs are enabled
  * (and add a `FIXME(generic_const_exprs)` to be revisited before (M)GCE's stabilization)
  * As a matter of fact type alias bounds are enforced in this case because the contained AnonConsts do get checked for well-formedness and crucially they inherit the generics and predicates of their parent item (here: the type alias)
* Remaining commits: Improve the lint `type_alias_bounds` itself

---

Fixes #125789 (sugg diag fix).
Fixes #125709 (wontfix, acknowledgement, sugg diag applic fix).
Fixes #104918 (sugg diag applic fix).
Fixes #100270 (wontfix, acknowledgement, sugg diag applic fix).
Fixes #94398 (true fix).

r? `@compiler-errors` `@oli-obk`

[^1]: From the perspective of the trait solver.
[^2]: Given `type A<T: Trait> = T::Proj;`, the reason why the trait bound "`T: Trait`" gets *seemingly* enforced at usage sites of the type alias `A` is simply because `A<X>` gets expanded to "`<X as Trait>::Proj`" very early on and it's the *expansion* that gets checked for well-formedness, not the type alias reference.
2024-07-26 02:20:28 -04:00
..
adt_const_params Revert suggestion verbosity change 2024-07-22 22:51:53 +00:00
array-impls [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
auxiliary Remove some unnecessary allow(incomplete_features) 2024-03-11 19:42:04 +00:00
backcompat [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
defaults Const generic parameters aren't bounds, even if we end up erroring because of the bound that binds the parameter's type 2024-06-19 14:58:29 +00:00
early [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
generic_arg_infer Revert suggestion verbosity change 2024-07-22 22:51:53 +00:00
generic_const_exprs Rollup merge of #126575 - fmease:update-lint-type_alias_bounds, r=compiler-errors 2024-07-26 02:20:28 -04:00
infer Const generic parameters aren't bounds, even if we end up erroring because of the bound that binds the parameter's type 2024-06-19 14:58:29 +00:00
issues Auto merge of #127722 - BoxyUwU:new_adt_const_params_limitations, r=compiler-errors 2024-07-21 05:36:21 +00:00
late-bound-vars make type_flags(ReError) & HAS_ERROR 2024-03-20 17:29:58 +00:00
min_const_generics Split part of adt_const_params into unsized_const_params 2024-07-17 11:01:29 +01:00
occurs-check add test for #97725 2024-03-22 17:12:43 +01:00
parser-error-recovery Update Tests 2024-06-05 20:08:00 -04:00
std Provide structured suggestion for #![feature(foo)] 2024-03-18 16:08:58 +00:00
type-dependent Split part of adt_const_params into unsized_const_params 2024-07-17 11:01:29 +01:00
apit-with-const-param.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
arg-in-pat-1.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
arg-in-pat-2.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
arg-in-pat-3.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
argument_order.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
argument_order.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
array-wrapper-struct-ctor.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
assoc_const_as_type_argument.rs Automatically taint when reporting errors from ItemCtxt 2024-07-09 07:44:17 +00:00
assoc_const_as_type_argument.stderr Automatically taint when reporting errors from ItemCtxt 2024-07-09 07:44:17 +00:00
assoc_const_eq_diagnostic.rs Avoid silencing relevant follow-up errors 2024-01-09 21:08:16 +00:00
assoc_const_eq_diagnostic.stderr Avoid silencing relevant follow-up errors 2024-01-09 21:08:16 +00:00
associated-type-bound-fail.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
associated-type-bound-fail.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
associated-type-bound.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
bad-const-generic-exprs.rs recover more unbraced const args 2023-01-27 19:26:04 +01:00
bad-const-generic-exprs.stderr Detect more cases of = to : typo 2024-03-01 02:03:00 +00:00
bad-generic-in-copy-impl.rs Remove track_errors entirely 2024-01-23 15:23:22 +00:00
bad-generic-in-copy-impl.stderr Remove track_errors entirely 2024-01-23 15:23:22 +00:00
bad-subst-const-kind.rs Add ConstArgKind::Path and make ConstArg its own HIR node 2024-07-16 19:27:28 -07:00
bad-subst-const-kind.stderr Add ConstArgKind::Path and make ConstArg its own HIR node 2024-07-16 19:27:28 -07:00
broken-mir-1.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
broken-mir-2.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
cannot-infer-type-for-const-param.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
coerce_unsized_array.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
concrete-const-as-fn-arg.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
concrete-const-impl-method.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
condition-in-trait-const-arg.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
const_trait_fn-issue-88433.rs bless tests part 1 2024-06-28 10:57:35 +00:00
const-arg-in-const-arg.min.stderr Automatically taint when reporting errors from ItemCtxt 2024-07-09 07:44:17 +00:00
const-arg-in-const-arg.rs Automatically taint when reporting errors from ItemCtxt 2024-07-09 07:44:17 +00:00
const-arg-in-fn.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
const-arg-type-arg-misordered.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
const-arg-type-arg-misordered.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
const-argument-cross-crate-mismatch.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
const-argument-cross-crate-mismatch.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
const-argument-cross-crate.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
const-argument-if-length.full.stderr Provide structured suggestion for unconstrained generic constant 2024-03-21 00:03:59 +00:00
const-argument-if-length.min.stderr Continue compilation after check_mod_type_wf errors 2024-02-14 11:00:30 +00:00
const-argument-if-length.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
const-argument-non-static-lifetime.min.stderr generic_const_exprs: suggest to add the feature, not use it 2023-11-30 20:59:51 +01:00
const-argument-non-static-lifetime.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
const-fn-with-const-param.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
const-generic-default-wont-borrowck.fixed Handle more cases of value suggestions 2024-04-10 20:36:14 +00:00
const-generic-default-wont-borrowck.rs Handle more cases of value suggestions 2024-04-10 20:36:14 +00:00
const-generic-default-wont-borrowck.stderr Handle more cases of value suggestions 2024-04-10 20:36:14 +00:00
const-generic-function.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
const-generic-function.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
const-generic-type_name.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
const-param-after-const-literal-arg.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
const-param-before-other-params.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
const-param-before-other-params.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
const-param-elided-lifetime.full.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
const-param-elided-lifetime.min.stderr Split part of adt_const_params into unsized_const_params 2024-07-17 11:01:29 +01:00
const-param-elided-lifetime.rs Split part of adt_const_params into unsized_const_params 2024-07-17 11:01:29 +01:00
const-param-in-async.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
const-param-type-depends-on-const-param.full.stderr improve diagnostics and bless tests 2023-05-05 21:42:54 +01:00
const-param-type-depends-on-const-param.min.stderr Provide structured suggestion for #![feature(foo)] 2024-03-18 16:08:58 +00:00
const-param-type-depends-on-const-param.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
const-param-type-depends-on-type-param-ungated.rs Remove save-analysis. 2023-02-16 15:14:45 +11:00
const-param-type-depends-on-type-param-ungated.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
const-param-type-depends-on-type-param.full.stderr Bless tests and handle tests/crashes 2024-06-05 22:25:42 +01:00
const-param-type-depends-on-type-param.min.stderr Bless tests and handle tests/crashes 2024-06-05 22:25:42 +01:00
const-param-type-depends-on-type-param.rs Bless tests and handle tests/crashes 2024-06-05 22:25:42 +01:00
const-param-with-additional-obligations.rs Split part of adt_const_params into unsized_const_params 2024-07-17 11:01:29 +01:00
const-param-with-additional-obligations.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
const-parameter-uppercase-lint.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
const-parameter-uppercase-lint.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
core-types.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
cross_crate_complex.rs Mark assoc tys live only if the trait is live 2024-06-18 16:00:57 +08:00
default-ty-closure.rs add test for #116796 2023-12-24 01:58:13 +08:00
default-ty-closure.stderr add test for #116796 2023-12-24 01:58:13 +08:00
deref-into-array-generic.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
different_generic_args_array.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
different_generic_args_array.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
different_generic_args.full.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
different_generic_args.min.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
different_generic_args.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
dont-evaluate-array-len-on-err-1.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
dont-evaluate-array-len-on-err-1.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
dyn-supertraits.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
dyn-supertraits.stderr Update tests 2024-02-07 10:42:01 +08:00
ensure_is_evaluatable.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
ensure_is_evaluatable.stderr Provide structured suggestion for unconstrained generic constant 2024-03-21 00:03:59 +00:00
enum-variants.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
exhaustive-value.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
exhaustive-value.stderr Spell out other trait diagnostic 2024-06-12 12:34:47 +00:00
expose-default-substs-param-env.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
float-generic.adt_const_params.stderr Split part of adt_const_params into unsized_const_params 2024-07-17 11:01:29 +01:00
float-generic.full.stderr Split part of adt_const_params into unsized_const_params 2024-07-17 11:01:29 +01:00
float-generic.rs Split part of adt_const_params into unsized_const_params 2024-07-17 11:01:29 +01:00
float-generic.simple.stderr Split part of adt_const_params into unsized_const_params 2024-07-17 11:01:29 +01:00
fn_with_two_const_inputs.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
fn_with_two_const_inputs.stderr Provide structured suggestion for unconstrained generic constant 2024-03-21 00:03:59 +00:00
fn_with_two_same_const_inputs.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
fn-const-param-call.adt_const_params.stderr Split part of adt_const_params into unsized_const_params 2024-07-17 11:01:29 +01:00
fn-const-param-call.full.stderr Split part of adt_const_params into unsized_const_params 2024-07-17 11:01:29 +01:00
fn-const-param-call.min.stderr Split part of adt_const_params into unsized_const_params 2024-07-17 11:01:29 +01:00
fn-const-param-call.rs Split part of adt_const_params into unsized_const_params 2024-07-17 11:01:29 +01:00
fn-const-param-infer.adt_const_params.stderr Split part of adt_const_params into unsized_const_params 2024-07-17 11:01:29 +01:00
fn-const-param-infer.full.stderr Split part of adt_const_params into unsized_const_params 2024-07-17 11:01:29 +01:00
fn-const-param-infer.min.stderr Split part of adt_const_params into unsized_const_params 2024-07-17 11:01:29 +01:00
fn-const-param-infer.rs Split part of adt_const_params into unsized_const_params 2024-07-17 11:01:29 +01:00
forbid-non-structural_match-types.rs Implement custom diagnostic for ConstParamTy 2023-06-01 18:21:42 +00:00
forbid-non-structural_match-types.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
foreign-item-const-parameter.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
foreign-item-const-parameter.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
generic-param-mismatch.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
generic-param-mismatch.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
ice-68875.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
ice-68875.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
ice-118285-fn-ptr-value.rs fix an ICE when a valtree failed to evaluate 2023-12-02 10:38:42 +01:00
ice-118285-fn-ptr-value.stderr fix an ICE when a valtree failed to evaluate 2023-12-02 10:38:42 +01:00
ice-const-generic-function-return-ty.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
ice-const-generic-function-return-ty.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
ice-unexpected-inference-var-122549.rs add test for #122549 2024-03-21 20:36:13 +01:00
ice-unexpected-inference-var-122549.stderr add test for #122549 2024-03-21 20:36:13 +01:00
impl-const-generic-struct.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
incorrect-number-of-const-args.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
incorrect-number-of-const-args.stderr Revert suggestion verbosity change 2024-07-22 22:51:53 +00:00
infer_arg_from_pat.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
infer_arr_len_from_pat.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
inhabited-assoc-ty-ice-1.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
inhabited-assoc-ty-ice-2.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
integer-literal-generic-arg-in-where-clause.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
intrinsics-type_name-as-const-argument.min.stderr Split part of adt_const_params into unsized_const_params 2024-07-17 11:01:29 +01:00
intrinsics-type_name-as-const-argument.rs Split part of adt_const_params into unsized_const_params 2024-07-17 11:01:29 +01:00
invalid-const-arg-for-type-param.rs diagnostics: remove inconsistent English article "this" from E0107 2023-02-23 10:27:06 -07:00
invalid-const-arg-for-type-param.stderr Revert suggestion verbosity change 2024-07-22 22:51:53 +00:00
invalid-constant-in-args.rs diagnostics: remove inconsistent English article "this" from E0107 2023-02-23 10:27:06 -07:00
invalid-constant-in-args.stderr Revert suggestion verbosity change 2024-07-22 22:51:53 +00:00
invalid-enum.rs Implement custom diagnostic for ConstParamTy 2023-06-01 18:21:42 +00:00
invalid-enum.stderr Implement custom diagnostic for ConstParamTy 2023-06-01 18:21:42 +00:00
invariant.rs Change leak check lint message to behavior is likely to change in the future 2024-02-18 19:16:17 -03:00
invariant.stderr Change leak check lint message to behavior is likely to change in the future 2024-02-18 19:16:17 -03:00
issue-46511.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-46511.stderr Improve the diagnostics for unused generic parameters 2024-02-01 16:18:03 +01:00
issue-66451.rs Split part of adt_const_params into unsized_const_params 2024-07-17 11:01:29 +01:00
issue-66451.stderr Split part of adt_const_params into unsized_const_params 2024-07-17 11:01:29 +01:00
issue-70408.rs Split part of adt_const_params into unsized_const_params 2024-07-17 11:01:29 +01:00
issue-80471.rs Split part of adt_const_params into unsized_const_params 2024-07-17 11:01:29 +01:00
issue-80471.stderr Split part of adt_const_params into unsized_const_params 2024-07-17 11:01:29 +01:00
issue-93647.rs update tests, adding known-bug 2023-07-27 15:51:02 +00:00
issue-93647.stderr Provide structured suggestion for #![feature(foo)] 2024-03-18 16:08:58 +00:00
issue-97007.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-102124.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-105689.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-106419-struct-with-multiple-const-params.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-112505-overflow.rs Fix the overflow issue for transmute_generic_consts 2023-06-11 16:12:59 +08:00
issue-112505-overflow.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
kind_mismatch.rs Don't ICE for kind mismatches during error rendering 2024-04-16 11:52:12 +00:00
kind_mismatch.stderr Don't ICE for kind mismatches during error rendering 2024-04-16 11:52:12 +00:00
legacy-const-generics-bad.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
legacy-const-generics-bad.stderr Account for let foo = expr; to suggest const foo: Ty = expr; 2024-07-11 20:39:24 +00:00
legacy-const-generics.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
lifetime-in-const-param.rs fix: not insert missing lifetime for ConstParamTy 2023-08-08 14:48:17 +08:00
lifetime-in-const-param.stderr Provide structured suggestion for #![feature(foo)] 2024-03-18 16:08:58 +00:00
lookup-method.rs only find segs chain for missing methods when no available candidates 2024-05-14 20:28:55 +08:00
lookup-method.stderr only find segs chain for missing methods when no available candidates 2024-05-14 20:28:55 +08:00
mistyped_const_in_pat.rs Taint infcx when reporting errors 2024-06-19 04:41:56 +00:00
mistyped_const_in_pat.stderr Taint infcx when reporting errors 2024-06-19 04:41:56 +00:00
nested-type.full.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
nested-type.min.stderr Provide structured suggestion for #![feature(foo)] 2024-03-18 16:08:58 +00:00
nested-type.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
not_wf_param_in_rpitit.rs Bless tests and handle tests/crashes 2024-06-05 22:25:42 +01:00
not_wf_param_in_rpitit.stderr Bless tests and handle tests/crashes 2024-06-05 22:25:42 +01:00
opaque_types2.rs Add some regression tests for opaque types and const generics 2024-04-04 15:02:27 +00:00
opaque_types2.stderr Add some regression tests for opaque types and const generics 2024-04-04 15:02:27 +00:00
opaque_types.rs Require any function with a tait in its signature to actually constrain a hidden type 2024-06-12 08:53:59 +00:00
opaque_types.stderr Do not try to reveal hidden types when trying to prove Freeze in the defining scope 2024-07-24 16:00:48 +00:00
outer-lifetime-in-const-generic-default.rs improve diagnostics and bless tests 2023-05-05 21:42:54 +01:00
outer-lifetime-in-const-generic-default.stderr generic_const_exprs: suggest to add the feature, not use it 2023-11-30 20:59:51 +01:00
overlapping_impls.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
params-in-ct-in-ty-param-lazy-norm.full.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
params-in-ct-in-ty-param-lazy-norm.min.stderr generic_const_exprs: suggest to add the feature, not use it 2023-11-30 20:59:51 +01:00
params-in-ct-in-ty-param-lazy-norm.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
parent_generics_of_encoding_impl_trait.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
parent_generics_of_encoding_impl_trait.stderr Const generic parameters aren't bounds, even if we end up erroring because of the bound that binds the parameter's type 2024-06-19 14:58:29 +00:00
parent_generics_of_encoding.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
polymorphic-drop-shim.rs Don't inline drop shims with unsubstituted generic consts in MIR inliner 2024-06-28 10:18:20 -04:00
projection-as-arg-const.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
projection-as-arg-const.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
promotion.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
raw-ptr-const-param-deref.adt_const_params.stderr Split part of adt_const_params into unsized_const_params 2024-07-17 11:01:29 +01:00
raw-ptr-const-param-deref.full.stderr Split part of adt_const_params into unsized_const_params 2024-07-17 11:01:29 +01:00
raw-ptr-const-param-deref.min.stderr Split part of adt_const_params into unsized_const_params 2024-07-17 11:01:29 +01:00
raw-ptr-const-param-deref.rs Split part of adt_const_params into unsized_const_params 2024-07-17 11:01:29 +01:00
raw-ptr-const-param.adt_const_params.stderr Split part of adt_const_params into unsized_const_params 2024-07-17 11:01:29 +01:00
raw-ptr-const-param.full.stderr Split part of adt_const_params into unsized_const_params 2024-07-17 11:01:29 +01:00
raw-ptr-const-param.min.stderr Split part of adt_const_params into unsized_const_params 2024-07-17 11:01:29 +01:00
raw-ptr-const-param.rs Split part of adt_const_params into unsized_const_params 2024-07-17 11:01:29 +01:00
repeat_expr_hack_gives_right_generics.rs Add ConstArgKind::Path and make ConstArg its own HIR node 2024-07-16 19:27:28 -07:00
repeat_expr_hack_gives_right_generics.stderr Add ConstArgKind::Path and make ConstArg its own HIR node 2024-07-16 19:27:28 -07:00
slice-const-param-mismatch.adt_const_params.stderr Split part of adt_const_params into unsized_const_params 2024-07-17 11:01:29 +01:00
slice-const-param-mismatch.full.stderr Split part of adt_const_params into unsized_const_params 2024-07-17 11:01:29 +01:00
slice-const-param-mismatch.min.stderr Split part of adt_const_params into unsized_const_params 2024-07-17 11:01:29 +01:00
slice-const-param-mismatch.rs Split part of adt_const_params into unsized_const_params 2024-07-17 11:01:29 +01:00
slice-const-param.rs Split part of adt_const_params into unsized_const_params 2024-07-17 11:01:29 +01:00
sneaky-array-repeat-expr.rs check array type of repeat exprs is wf 2023-05-04 11:22:40 +01:00
sneaky-array-repeat-expr.stderr check array type of repeat exprs is wf 2023-05-04 11:22:40 +01:00
struct-with-invalid-const-param.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
struct-with-invalid-const-param.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
suggest_const_for_array.rs Automatically taint when reporting errors from ItemCtxt 2024-07-09 07:44:17 +00:00
suggest_const_for_array.stderr Automatically taint when reporting errors from ItemCtxt 2024-07-09 07:44:17 +00:00
trait-const-args.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
transmute_no_gate.rs Add feature gate 2023-04-07 11:18:07 -07:00
transmute_no_gate.stderr Add feature gate 2023-04-07 11:18:07 -07:00
transmute-const-param-static-reference.adt_const_params.stderr Split part of adt_const_params into unsized_const_params 2024-07-17 11:01:29 +01:00
transmute-const-param-static-reference.min.stderr Split part of adt_const_params into unsized_const_params 2024-07-17 11:01:29 +01:00
transmute-const-param-static-reference.rs Split part of adt_const_params into unsized_const_params 2024-07-17 11:01:29 +01:00
transmute-fail.rs Add ConstArgKind::Path and make ConstArg its own HIR node 2024-07-16 19:27:28 -07:00
transmute-fail.stderr Add ConstArgKind::Path and make ConstArg its own HIR node 2024-07-16 19:27:28 -07:00
transmute.rs Sorting arbitrary constants should not be done, as it relies on DefId ordering, which breaks incremental compilation. 2024-03-21 10:45:30 +00:00
transparent-maybeunit-array-wrapper.rs Detect pub structs never constructed and unused associated constants in traits 2024-06-05 23:20:09 +08:00
try_unify_ignore_lifetimes.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
two_matching_preds.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
type_mismatch.rs Add ConstArgKind::Path and make ConstArg its own HIR node 2024-07-16 19:27:28 -07:00
type_mismatch.stderr Add ConstArgKind::Path and make ConstArg its own HIR node 2024-07-16 19:27:28 -07:00
type_not_in_scope.rs Bless tests and handle tests/crashes 2024-06-05 22:25:42 +01:00
type_not_in_scope.stderr Bless tests and handle tests/crashes 2024-06-05 22:25:42 +01:00
type_of_anon_const.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
type-after-const-ok.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
types-mismatch-const-args.full.stderr Modify primary span label for E0308 2023-01-30 20:12:19 +00:00
types-mismatch-const-args.min.stderr Modify primary span label for E0308 2023-01-30 20:12:19 +00:00
types-mismatch-const-args.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
unify_with_nested_expr.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
unify_with_nested_expr.stderr Const generic parameters aren't bounds, even if we end up erroring because of the bound that binds the parameter's type 2024-06-19 14:58:29 +00:00
uninferred-consts-during-codegen-1.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
uninferred-consts-during-codegen-2.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
unknown_adt.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
unknown_adt.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
unused_braces.fixed [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
unused_braces.full.fixed [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
unused_braces.min.fixed [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
unused_braces.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
unused_braces.stderr Fix unused_braces on generic const expr macro call 2023-01-14 15:49:08 +00:00
unused-const-param.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
unused-type-param-suggestion.rs Improve the diagnostics for unused generic parameters 2024-02-01 16:18:03 +01:00
unused-type-param-suggestion.stderr Improve the diagnostics for unused generic parameters 2024-02-01 16:18:03 +01:00
variant-discrimiant-no-generics.full.stderr improve diagnostics and bless tests 2023-05-05 21:42:54 +01:00
variant-discrimiant-no-generics.min.stderr improve diagnostics and bless tests 2023-05-05 21:42:54 +01:00
variant-discrimiant-no-generics.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
where-clauses.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
wrong-normalization.rs Continue compilation even if inherent impl checks fail 2024-02-14 21:04:51 +00:00
wrong-normalization.stderr Continue compilation even if inherent impl checks fail 2024-02-14 21:04:51 +00:00