Skip to content

Commit

Permalink
Add regression test for #59502
Browse files Browse the repository at this point in the history
This issue was fixed using a hacky recursion "fuel" argument, but the
issue was never minimized nor was a regression test added. The
underlying bug is still unfixed, so this test should help with fixing it
and removing the `recurse` hack.
  • Loading branch information
camelid committed Dec 28, 2021
1 parent 7d1ec64 commit 908a9d4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/librustdoc/html/render/search_index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ fn get_index_type_name(clean_type: &clean::Type) -> Option<Symbol> {
///
/// Important note: It goes through generics recursively. So if you have
/// `T: Option<Result<(), ()>>`, it'll go into `Option` and then into `Result`.
#[instrument(level = "trace", skip(tcx, res))]
fn add_generics_and_bounds_as_types<'tcx>(
generics: &Generics,
arg: &Type,
Expand Down Expand Up @@ -316,6 +317,7 @@ fn add_generics_and_bounds_as_types<'tcx>(

if recurse >= 10 {
// FIXME: remove this whole recurse thing when the recursion bug is fixed
// See #59502 for the original issue.
return;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// check-pass

// Minimization of issue #59502

trait MyTrait<T> {
type Output;
}

pub fn pow<T: MyTrait<T, Output = T>>(arg: T) -> T {
arg
}

0 comments on commit 908a9d4

Please sign in to comment.