Skip to content

Commit f2018e8

Browse files
committed
Add a fast-path for monomorphic unsizing coercions
1 parent 6c5a721 commit f2018e8

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

compiler/rustc_trait_selection/src/traits/select/confirmation.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1185,6 +1185,11 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
11851185

11861186
// `Struct<T>` -> `Struct<U>`
11871187
(&ty::Adt(def, args_a), &ty::Adt(_, args_b)) => {
1188+
if args_a.is_empty() || args_b.is_empty() {
1189+
assert!(args_a.is_empty());
1190+
assert!(args_b.is_empty());
1191+
return Err(SelectionError::Unimplemented);
1192+
}
11881193
let unsizing_params = tcx.unsizing_params_for_adt(def.did());
11891194
if unsizing_params.is_empty() {
11901195
return Err(SelectionError::Unimplemented);

0 commit comments

Comments
 (0)