diff options
| author | Michael Goulet <michael@errs.io> | 2022-10-14 04:55:07 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2022-10-14 05:47:09 +0000 |
| commit | 8c7e836abb62331ebb8350c7724c95241ef95a51 (patch) | |
| tree | b5ffb3822dc316424fc0e918e223434dfd510218 /compiler/rustc_codegen_ssa/src | |
| parent | 0cb217d29b6cd9a67fc493a12a5754ed9d21671a (diff) | |
| download | rust-8c7e836abb62331ebb8350c7724c95241ef95a51.tar.gz rust-8c7e836abb62331ebb8350c7724c95241ef95a51.zip | |
Address nits, add test for implicit dyn-star coercion without feature gate
Diffstat (limited to 'compiler/rustc_codegen_ssa/src')
| -rw-r--r-- | compiler/rustc_codegen_ssa/src/base.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/compiler/rustc_codegen_ssa/src/base.rs b/compiler/rustc_codegen_ssa/src/base.rs index 70e1fe62e47..0ca6408aab9 100644 --- a/compiler/rustc_codegen_ssa/src/base.rs +++ b/compiler/rustc_codegen_ssa/src/base.rs @@ -270,8 +270,11 @@ pub fn cast_to_dyn_star<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>( dst_ty: Ty<'tcx>, old_info: Option<Bx::Value>, ) -> (Bx::Value, Bx::Value) { - debug!("unsize_ptr: {:?} => {:?}", src_ty_and_layout.ty, dst_ty); - assert!(matches!(dst_ty.kind(), ty::Dynamic(_, _, ty::DynStar))); + debug!("cast_to_dyn_star: {:?} => {:?}", src_ty_and_layout.ty, dst_ty); + assert!( + matches!(dst_ty.kind(), ty::Dynamic(_, _, ty::DynStar)), + "destination type must be a dyn*" + ); // FIXME(dyn-star): this is probably not the best way to check if this is // a pointer, and really we should ensure that the value is a suitable // pointer earlier in the compilation process. |
