about summary refs log tree commit diff
path: root/compiler/rustc_passes/src/check_const.rs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/rustc_passes/src/check_const.rs')
-rw-r--r--compiler/rustc_passes/src/check_const.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_passes/src/check_const.rs b/compiler/rustc_passes/src/check_const.rs
index 4062862ad74..116aaf48349 100644
--- a/compiler/rustc_passes/src/check_const.rs
+++ b/compiler/rustc_passes/src/check_const.rs
@@ -198,8 +198,8 @@ impl<'tcx> Visitor<'tcx> for CheckConstVisitor<'tcx> {
             of_trait: Some(trait_ref),
             ..
         }) = item.kind
+            && let Some(def_id) = trait_ref.trait_def_id()
         {
-            let def_id = trait_ref.trait_def_id().unwrap();
             let source_map = tcx.sess.source_map();
             if !tcx.has_attr(def_id, sym::const_trait) {
                 tcx.sess