-
Notifications
You must be signed in to change notification settings - Fork 13k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 #68257. Fixes #68398. r? @eddyb
- Loading branch information
Showing
25 changed files
with
349 additions
and
233 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.