Auto merge of #68434 - varkor:astconv-mismatch-error, r=nikomatsakis
Move generic arg/param validation to `create_substs_for_generic_args` to resolve various const generics issues This changes some diagnostics, but I think they're around as helpful as the previous ones, and occur infrequently regardless. Fixes https://github.com/rust-lang/rust/issues/68257. Fixes https://github.com/rust-lang/rust/issues/68398. r? @eddyb
This commit is contained in:
commit
6d69caba11
25 changed files with 349 additions and 233 deletions
20
src/librustc_error_codes/error_codes/E0747.md
Normal file
20
src/librustc_error_codes/error_codes/E0747.md
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
Generic arguments must be provided in the same order as the corresponding
|
||||
generic parameters are declared.
|
||||
|
||||
Erroneous code example:
|
||||
|
||||
```compile_fail,E0747
|
||||
struct S<'a, T>(&'a T);
|
||||
|
||||
type X = S<(), 'static>; // error: the type argument is provided before the
|
||||
// lifetime argument
|
||||
```
|
||||
|
||||
The argument order should be changed to match the parameter declaration
|
||||
order, as in the following.
|
||||
|
||||
```
|
||||
struct S<'a, T>(&'a T);
|
||||
|
||||
type X = S<'static, ()>; // ok
|
||||
```
|
||||
Loading…
Add table
Add a link
Reference in a new issue