From 8c5ae86496d25ddd9df3486df46bcb671ce619ad Mon Sep 17 00:00:00 2001 From: Simon Sapin Date: Thu, 4 Jul 2019 15:52:37 +0200 Subject: [PATCH] Update src/librustc_typeck/check/mod.rs Co-Authored-By: Mazdak Farrokhzad --- src/librustc_typeck/check/mod.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/librustc_typeck/check/mod.rs b/src/librustc_typeck/check/mod.rs index 294d1992b9d..a8b3a048389 100644 --- a/src/librustc_typeck/check/mod.rs +++ b/src/librustc_typeck/check/mod.rs @@ -1391,7 +1391,9 @@ fn check_union(tcx: TyCtxt<'_>, id: hir::HirId, span: Span) { check_packed(tcx, span, def_id); } -fn check_union_fields<'tcx>(tcx: TyCtxt<'tcx>, _sp: Span, item_def_id: DefId) -> bool { +/// When the `#![feature(untagged_unions)]` gate is active, +/// check that the fields of the `union` does not contain fields that need dropping. +fn check_union_fields(tcx: TyCtxt<'_>, _: Span, item_def_id: DefId) -> bool { // Without the feature we check Copy types only later if !tcx.features().untagged_unions { return true;