-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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 #98610 - lcnr:emit_inference_failure_err-ice, r=estebank
fix `emit_inference_failure_err` ICE fixes #98598 this fix doesn't make me too happy, but 🤷
- Loading branch information
Showing
8 changed files
with
119 additions
and
7 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
21 changes: 21 additions & 0 deletions
21
src/test/ui/inference/need_type_info/expr-struct-type-relative-enum.rs
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,21 @@ | ||
trait Foo { | ||
type Output; | ||
|
||
fn baz() -> Self::Output; | ||
} | ||
|
||
fn needs_infer<T>() {} | ||
|
||
enum Bar { | ||
Variant {} | ||
} | ||
|
||
impl Foo for u8 { | ||
type Output = Bar; | ||
fn baz() -> Self::Output { | ||
needs_infer(); //~ ERROR type annotations needed | ||
Self::Output::Variant {} | ||
} | ||
} | ||
|
||
fn main() {} |
14 changes: 14 additions & 0 deletions
14
src/test/ui/inference/need_type_info/expr-struct-type-relative-enum.stderr
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 @@ | ||
error[E0282]: type annotations needed | ||
--> $DIR/expr-struct-type-relative-enum.rs:16:9 | ||
| | ||
LL | needs_infer(); | ||
| ^^^^^^^^^^^ cannot infer type of the type parameter `T` declared on the function `needs_infer` | ||
| | ||
help: consider specifying the generic argument | ||
| | ||
LL | needs_infer::<T>(); | ||
| +++++ | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0282`. |
21 changes: 21 additions & 0 deletions
21
src/test/ui/inference/need_type_info/expr-struct-type-relative-gat.rs
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,21 @@ | ||
#![feature(generic_associated_types)] | ||
|
||
trait Foo { | ||
type Output<T>; | ||
|
||
fn baz(); | ||
} | ||
|
||
enum Bar<T> { | ||
Simple {}, | ||
Generic(T), | ||
} | ||
|
||
impl Foo for u8 { | ||
type Output<T> = Bar<T>; | ||
fn baz() { | ||
Self::Output::Simple {}; //~ ERROR type annotations needed | ||
} | ||
} | ||
|
||
fn main() {} |
9 changes: 9 additions & 0 deletions
9
src/test/ui/inference/need_type_info/expr-struct-type-relative-gat.stderr
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[E0282]: type annotations needed | ||
--> $DIR/expr-struct-type-relative-gat.rs:17:9 | ||
| | ||
LL | Self::Output::Simple {}; | ||
| ^^^^^^^^^^^^ cannot infer type for type parameter `T` declared on the associated type `Output` | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0282`. |
21 changes: 21 additions & 0 deletions
21
src/test/ui/inference/need_type_info/expr-struct-type-relative.rs
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,21 @@ | ||
// regression test for #98598 | ||
|
||
trait Foo { | ||
type Output; | ||
|
||
fn baz() -> Self::Output; | ||
} | ||
|
||
fn needs_infer<T>() {} | ||
|
||
struct Bar {} | ||
|
||
impl Foo for u8 { | ||
type Output = Bar; | ||
fn baz() -> Self::Output { | ||
needs_infer(); //~ ERROR type annotations needed | ||
Self::Output {} | ||
} | ||
} | ||
|
||
fn main() {} |
14 changes: 14 additions & 0 deletions
14
src/test/ui/inference/need_type_info/expr-struct-type-relative.stderr
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 @@ | ||
error[E0282]: type annotations needed | ||
--> $DIR/expr-struct-type-relative.rs:16:9 | ||
| | ||
LL | needs_infer(); | ||
| ^^^^^^^^^^^ cannot infer type of the type parameter `T` declared on the function `needs_infer` | ||
| | ||
help: consider specifying the generic argument | ||
| | ||
LL | needs_infer::<T>(); | ||
| +++++ | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0282`. |