File tree Expand file tree Collapse file tree 1 file changed +27
-1
lines changed Expand file tree Collapse file tree 1 file changed +27
-1
lines changed Original file line number Diff line number Diff line change @@ -500,7 +500,7 @@ fn main() {
500
500
}
501
501
502
502
#[ test]
503
- fn coerce_unsize_expected_type ( ) {
503
+ fn coerce_unsize_expected_type_1 ( ) {
504
504
check_no_mismatches (
505
505
r#"
506
506
//- minicore: coerce_unsized
@@ -520,6 +520,32 @@ fn main() {
520
520
) ;
521
521
}
522
522
523
+ #[ test]
524
+ fn coerce_unsize_expected_type_2 ( ) {
525
+ // FIXME: this is wrong, #9560
526
+ check (
527
+ r#"
528
+ //- minicore: coerce_unsized
529
+ struct InFile<T>;
530
+ impl<T> InFile<T> {
531
+ fn with_value<U>(self, value: U) -> InFile<U> { InFile }
532
+ }
533
+ struct RecordField;
534
+ trait AstNode {}
535
+ impl AstNode for RecordField {}
536
+
537
+ fn takes_dyn(it: InFile<&dyn AstNode>) {}
538
+
539
+ fn test() {
540
+ let x: InFile<()> = InFile;
541
+ let n = &RecordField;
542
+ takes_dyn(x.with_value(n));
543
+ // ^^^^^^^^^^^^^^^ expected InFile<&dyn AstNode>, got InFile<&RecordField>
544
+ }
545
+ "# ,
546
+ ) ;
547
+ }
548
+
523
549
#[ test]
524
550
fn coerce_array_elems_lub ( ) {
525
551
check_no_mismatches (
You can’t perform that action at this time.
0 commit comments