-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Beta backport of PR #73005 (obligation error impl candidate)
- Loading branch information
Showing
5 changed files
with
55 additions
and
181 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
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,19 @@ | ||
// Regression test for issue #72839 | ||
// Tests that we do not overflow during trait selection after | ||
// a type error occurs | ||
use std::ops::Rem; | ||
trait Foo {} | ||
struct MyStruct<T>(T); | ||
|
||
impl<T, U> Rem<MyStruct<T>> for MyStruct<U> where MyStruct<U>: Rem<MyStruct<T>> { | ||
type Output = u8; | ||
fn rem(self, _: MyStruct<T>) -> Self::Output { | ||
panic!() | ||
} | ||
} | ||
|
||
fn main() {} | ||
|
||
fn foo() { | ||
if missing_var % 8 == 0 {} //~ ERROR cannot find | ||
} |
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 @@ | ||
error[E0425]: cannot find value `missing_var` in this scope | ||
--> $DIR/issue-72839-error-overflow.rs:18:8 | ||
| | ||
LL | if missing_var % 8 == 0 {} | ||
| ^^^^^^^^^^^ not found in this scope | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0425`. |