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#80429 - JulianKnodt:ob_forest, r=Mark-Simul…
…acrum Add regression test for mutual recursion in obligation forest Add regression test for rust-lang#75860 with a slightly smaller example. I was looking at what caused the issue and was surprised when it errors out on nightly, so I just added a regression test which should effectively close the issue, altho it would be nice to find the fix for reference. Also I found that 80066 is not fixed by whatever fixed 75860.
- Loading branch information
Showing
2 changed files
with
31 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
pub fn iso<A, B, F1, F2>(a: F1, b: F2) -> (Box<dyn Fn(A) -> B>, Box<dyn Fn(B) -> A>) | ||
where | ||
F1: (Fn(A) -> B) + 'static, | ||
F2: (Fn(B) -> A) + 'static, | ||
{ | ||
(Box::new(a), Box::new(b)) | ||
} | ||
pub fn iso_un_option<A, B>() -> (Box<dyn Fn(A) -> B>, Box<dyn Fn(B) -> A>) { | ||
let left = |o_a: Option<_>| o_a.unwrap(); | ||
let right = |o_b: Option<_>| o_b.unwrap(); | ||
iso(left, right) | ||
//~^ ERROR overflow | ||
} | ||
|
||
fn main() {} |
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,16 @@ | ||
error[E0275]: overflow evaluating the requirement `Option<_>: Sized` | ||
--> $DIR/mutual-recursion-issue-75860.rs:11:5 | ||
| | ||
LL | iso(left, right) | ||
| ^^^ | ||
| | ||
::: $SRC_DIR/core/src/option.rs:LL:COL | ||
| | ||
LL | pub enum Option<T> { | ||
| - required by this bound in `Option` | ||
| | ||
= help: consider adding a `#![recursion_limit="256"]` attribute to your crate (`mutual_recursion_issue_75860`) | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0275`. |