Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix unresolved inference variable ICE.
This commit moves well-formedness check for the `UserTypeAnnotation::Ty(..)` case from always running to only when the code is reachable. This solves the ICE that resulted from `src/test/ui/issue-54943-1.rs` (a minimal repro of `dropck-eyepatch` run-pass tests that failed). The main well-formedness check that was intended to be run despite unreachable code still is, that being the `UserTypeAnnotation::TypeOf(..)` case. Before this PR, the other case wasn't being checked at all. It is possible to fix this ICE while still always checking well-formedness for the `UserTypeAnnotation::Ty(..)` case but that solution will ICE in unreachable code for that case, the diff for that change [can be found here](0). [0]: https://gist.github.com/davidtwco/f9751ffd9c0508f7251c0f17adc3af53
- Loading branch information
Showing
5 changed files
with
79 additions
and
16 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#![feature(nll)] | ||
|
||
// This test is a minimal version of an ICE in the dropck-eyepatch tests | ||
// found in the fix for #54943. | ||
|
||
// compile-pass | ||
|
||
fn foo<T>(_t: T) { | ||
} | ||
|
||
fn main() { | ||
struct A<'a, B: 'a>(&'a B); | ||
let (a1, a2): (String, A<_>) = (String::from("auto"), A(&"this")); | ||
foo((a1, a2)); | ||
} |
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,18 @@ | ||
#![feature(nll)] | ||
|
||
// This test is a minimal version of an ICE in the dropck-eyepatch tests | ||
// found in the fix for #54943. In particular, this test is in unreachable | ||
// code as the initial fix for this ICE only worked if the code was reachable. | ||
|
||
// compile-pass | ||
|
||
fn foo<T>(_t: T) { | ||
} | ||
|
||
fn main() { | ||
return; | ||
|
||
struct A<'a, B: 'a>(&'a B); | ||
let (a1, a2): (String, A<_>) = (String::from("auto"), A(&"this")); | ||
foo((a1, a2)); | ||
} |
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