-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rustdoc: Higher-ranked lifetimes can't have bounds
This cleans up the other spot I found where rustdoc was rendering bounds into the lifetime name itself. However, in this case, I don't think it could have actually happened because higher-ranked lifetime definitions aren't currently allowed to have bounds.
- Loading branch information
Showing
4 changed files
with
45 additions
and
29 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// This test ensures that rustdoc doesn't panic on higher-ranked lifetimes | ||
// with bounds, because an error should have already been emitted by rustc. | ||
|
||
pub fn hrlt<'b, 'c>() | ||
where | ||
for<'a: 'b + 'c> &'a (): std::fmt::Debug, | ||
//~^ ERROR lifetime bounds cannot be used in this context | ||
{ | ||
} |
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,10 @@ | ||
error: lifetime bounds cannot be used in this context | ||
--> $DIR/bounded-hr-lifetime.rs:6:13 | ||
| | ||
LL | for<'a: 'b + 'c> &'a (): std::fmt::Debug, | ||
| ^^ ^^ | ||
|
||
error: Compilation failed, aborting rustdoc | ||
|
||
error: aborting due to 2 previous errors | ||
|