Auto merge of #103116 - TaKO8Ki:fix-103053, r=lcnr
Fix `own_substs` ICE Fixes #103053
This commit is contained in:
commit
c19a893f87
3 changed files with 44 additions and 5 deletions
18
src/test/ui/inference/need_type_info/issue-103053.rs
Normal file
18
src/test/ui/inference/need_type_info/issue-103053.rs
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
trait TypeMapper {
|
||||
type MapType;
|
||||
}
|
||||
|
||||
type Mapped<T> = <T as TypeMapper>::MapType;
|
||||
|
||||
struct Test {}
|
||||
|
||||
impl TypeMapper for () {
|
||||
type MapType = Test;
|
||||
}
|
||||
|
||||
fn test() {
|
||||
Mapped::<()> {};
|
||||
None; //~ ERROR type annotations needed
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
14
src/test/ui/inference/need_type_info/issue-103053.stderr
Normal file
14
src/test/ui/inference/need_type_info/issue-103053.stderr
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
error[E0282]: type annotations needed
|
||||
--> $DIR/issue-103053.rs:15:5
|
||||
|
|
||||
LL | None;
|
||||
| ^^^^ cannot infer type of the type parameter `T` declared on the enum `Option`
|
||||
|
|
||||
help: consider specifying the generic argument
|
||||
|
|
||||
LL | None::<T>;
|
||||
| +++++
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0282`.
|
||||
Loading…
Add table
Add a link
Reference in a new issue