Skip to content

Commit 908a9d4

Browse files
committed
Add regression test for rust-lang#59502
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.
1 parent 7d1ec64 commit 908a9d4

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

src/librustdoc/html/render/search_index.rs

+2
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,7 @@ fn get_index_type_name(clean_type: &clean::Type) -> Option<Symbol> {
236236
///
237237
/// Important note: It goes through generics recursively. So if you have
238238
/// `T: Option<Result<(), ()>>`, it'll go into `Option` and then into `Result`.
239+
#[instrument(level = "trace", skip(tcx, res))]
239240
fn add_generics_and_bounds_as_types<'tcx>(
240241
generics: &Generics,
241242
arg: &Type,
@@ -316,6 +317,7 @@ fn add_generics_and_bounds_as_types<'tcx>(
316317

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

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// check-pass
2+
3+
// Minimization of issue #59502
4+
5+
trait MyTrait<T> {
6+
type Output;
7+
}
8+
9+
pub fn pow<T: MyTrait<T, Output = T>>(arg: T) -> T {
10+
arg
11+
}

0 commit comments

Comments
 (0)