File tree Expand file tree Collapse file tree 2 files changed +17
-4
lines changed Expand file tree Collapse file tree 2 files changed +17
-4
lines changed Original file line number Diff line number Diff line change @@ -575,11 +575,11 @@ impl<'a> InferenceContext<'a> {
575
575
} ,
576
576
) ;
577
577
}
578
- Solution :: Ambig ( guidance) => {
579
- if let Guidance :: Definite ( subst) = guidance {
580
- canonicalized. apply_solution ( & mut self . table , subst) ;
581
- }
578
+ Solution :: Ambig ( Guidance :: Definite ( subst) ) => {
579
+ canonicalized. apply_solution ( & mut self . table , subst)
582
580
}
581
+ // FIXME: should we accept ambiguous results here?
582
+ _ => return Err ( TypeError ) ,
583
583
} ;
584
584
let unsize =
585
585
Adjustment { kind : Adjust :: Pointer ( PointerCast :: Unsize ) , target : to_ty. clone ( ) } ;
Original file line number Diff line number Diff line change @@ -559,3 +559,16 @@ fn test() {
559
559
"# ,
560
560
) ;
561
561
}
562
+
563
+ #[ test]
564
+ fn coerce_type_var ( ) {
565
+ check_types (
566
+ r#"
567
+ //- minicore: from, coerce_unsized
568
+ fn test() {
569
+ let x = ();
570
+ let _: &() = &x.into();
571
+ } //^^^^^^^^ ()
572
+ "# ,
573
+ )
574
+ }
You can’t perform that action at this time.
0 commit comments