forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#86096 - FabianWolff:ec-E0316, r=GuillaumeGomez
Comment out unused error codes and add description for E0316 I have added an extended description of `E0316` and commented out a bunch of unused error codes to make clear the fact that they are no longer in use. You can check for yourself with ```shell for ec in \ E0314 E0315 E0473 E0474 E0475 E0479 E0480 E0481 \ E0483 E0484 E0485 E0486 E0487 E0488 E0489 do if [ ! -z "`grep -r $ec compiler/* --exclude-dir=rustc_error_codes`" ] then echo $ec false fi done ``` i.e. these error codes appear nowhere in the compiler code and thus cannot be emitted. r? `@GuillaumeGomez`
- Loading branch information
Showing
3 changed files
with
49 additions
and
16 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
A `where` clause contains a nested quantification over lifetimes. | ||
|
||
Erroneous code example: | ||
|
||
```compile_fail,E0316 | ||
trait Tr<'a, 'b> {} | ||
fn foo<T>(t: T) | ||
where | ||
for<'a> &'a T: for<'b> Tr<'a, 'b>, // error: nested quantification | ||
{ | ||
} | ||
``` | ||
|
||
Rust syntax allows lifetime quantifications in two places within | ||
`where` clauses: Quantifying over the trait bound only (as in | ||
`Ty: for<'l> Trait<'l>`) and quantifying over the whole clause | ||
(as in `for<'l> &'l Ty: Trait<'l>`). Using both in the same clause | ||
leads to a nested lifetime quantification, which is not supported. | ||
|
||
The following example compiles, because the clause with the nested | ||
quantification has been rewritten to use only one `for<>`: | ||
|
||
``` | ||
trait Tr<'a, 'b> {} | ||
fn foo<T>(t: T) | ||
where | ||
for<'a, 'b> &'a T: Tr<'a, 'b>, // 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