rust/tests/ui/enum
Matthias Krüger 363d158cd8
Rollup merge of #111215 - BoxyUwU:resolve_anon_consts_differently, r=cjgillot
Various changes to name resolution of anon consts

Sorry this PR is kind of all over the place ^^'

Fixes #111012

- Rewrites anon const nameres to all go through `fn resolve_anon_const` explicitly instead of `visit_anon_const` to ensure that we do not accidentally resolve anon consts as if they are allowed to use generics when they aren't. Also means that we dont have bits of code for resolving anon consts that will get out of sync (i.e. legacy const generics and resolving path consts that were parsed as type arguments)
- Renames two of the `LifetimeRibKind`, `AnonConst -> ConcreteAnonConst` and `ConstGeneric -> ConstParamTy`
- Noticed while doing this that under `generic_const_exprs` all lifetimes currently get resolved to errors without any error being emitted which was causing a bunch of tests to pass without their bugs having been fixed, incidentally fixed that in this PR and marked those tests as `// known-bug:`. I'm fine to break those since `generic_const_exprs` is a very unstable incomplete feature and this PR _does_ make generic_const_exprs "less broken" as a whole, also I can't be assed to figure out what the underlying causes of all of them are. This PR reopens #77357 #83993
- Changed `generics_of` to stop providing generics and predicates to enum variant discriminant anon consts since those are not allowed to use generic parameters
- Updated the error for non 'static lifetime in const arguments and the error for non 'static lifetime in const param tys to use `derive(Diagnostic)`

I have a vague idea why const-arg-in-const-arg.rs, in-closure.rs and simple.rs have started failing which is unfortunate since these were deliberately made to work, I think lifetime resolution being broken just means this regressed at some point and nobody noticed because the tests were not testing anything :( I'm fine breaking these too for the same reason as the tests for #77357 #83993. I couldn't get `// known-bug` to work for these ICEs and just kept getting different stderr between CI and local `--bless` so I just removed them and will create an issue to track re-adding (and fixing) the bugs if this PR lands.

r? `@cjgillot` cc `@compiler-errors`
2023-05-09 20:49:32 +02:00
..
enum-and-module-in-same-scope.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
enum-and-module-in-same-scope.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
enum-discrim-autosizing.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
enum-discrim-autosizing.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
enum-discrim-too-small.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
enum-discrim-too-small.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
enum-discrim-too-small2.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
enum-discrim-too-small2.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
enum-in-scope.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
enum-in-scope.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
enum-size-variance.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
enum-size-variance.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
enum-to-float-cast-2.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
enum-to-float-cast-2.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
enum-to-float-cast.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
enum-to-float-cast.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
enum-variant-type-2.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
enum-variant-type-2.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-1821.rs Move tests 2023-05-08 17:58:01 -03:00
issue-42747.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-67945-1.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-67945-1.stderr improve diagnostics and bless tests 2023-05-05 21:42:54 +01:00
issue-67945-2.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-67945-2.stderr improve diagnostics and bless tests 2023-05-05 21:42:54 +01:00
nested-enum.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
nested-enum.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
suggest-default-attribute.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
suggest-default-attribute.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
union-in-enum.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00