From b7e443397471062e5681ecefb6638577cefb9571 Mon Sep 17 00:00:00 2001 From: Michael Goulet Date: Wed, 19 Jan 2022 20:07:04 -0800 Subject: Foreign types are trivially drop - Also rename a trivial_const_drop to match style of other functions in the util module. - Also add a test for `const Drop` that doesn't depend on a `~const` bound. - Also comment a bit why we remove the const bound during dropck impl check. --- compiler/rustc_const_eval/src/transform/check_consts/qualifs.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'compiler/rustc_const_eval/src') diff --git a/compiler/rustc_const_eval/src/transform/check_consts/qualifs.rs b/compiler/rustc_const_eval/src/transform/check_consts/qualifs.rs index 8dfdbf5d9dd..91610b15eb9 100644 --- a/compiler/rustc_const_eval/src/transform/check_consts/qualifs.rs +++ b/compiler/rustc_const_eval/src/transform/check_consts/qualifs.rs @@ -148,7 +148,7 @@ impl Qualif for NeedsNonConstDrop { fn in_any_value_of_ty<'tcx>(cx: &ConstCx<'_, 'tcx>, ty: Ty<'tcx>) -> bool { // Avoid selecting for simple cases, such as builtin types. - if ty::util::trivial_const_drop(ty) { + if ty::util::is_trivially_const_drop(ty) { return false; } -- cgit 1.4.1-3-g733a5