-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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 #91164 - Badel2:usefulness-stack-overflow, r=davidtwco
Fix stack overflow in `usefulness.rs` Fix #88747 Applied the suggestion from `@nbdd0121,` not sure if this has any drawbacks. The first call to `ensure_sufficient_stack` is not needed to fix the test case, but I added it to be safe.
- Loading branch information
Showing
2 changed files
with
21 additions
and
4 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,14 @@ | ||
// check-pass: this used to be a stack overflow because of recursion in `usefulness.rs` | ||
|
||
macro_rules! long_tuple_arg { | ||
([$($t:tt)*]#$($h:tt)*) => { | ||
long_tuple_arg!{[$($t)*$($t)*]$($h)*} | ||
}; | ||
([$([$t:tt $y:tt])*]) => { | ||
pub fn _f(($($t,)*): ($($y,)*)) {} | ||
} | ||
} | ||
|
||
long_tuple_arg!{[[_ u8]]########## ###} | ||
|
||
fn main() {} |