From c84b7815b363ad5f2dec9d5f830666ccef440458 Mon Sep 17 00:00:00 2001 From: Niko Matsakis Date: Tue, 27 Feb 2018 17:36:33 -0500 Subject: [PATCH] add a comment --- src/librustc_typeck/check/wfcheck.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/librustc_typeck/check/wfcheck.rs b/src/librustc_typeck/check/wfcheck.rs index 4eb3e29ec69..39e757c52ff 100644 --- a/src/librustc_typeck/check/wfcheck.rs +++ b/src/librustc_typeck/check/wfcheck.rs @@ -370,6 +370,9 @@ impl<'a, 'gcx> CheckTypeWellFormedVisitor<'a, 'gcx> { // Here the default `Vec<[u32]>` is not WF because `[u32]: Sized` does not hold. for d in generics.types.iter().cloned().filter(is_our_default).map(|p| p.def_id) { let ty = fcx.tcx.type_of(d); + // ignore dependent defaults -- that is, where the default of one type + // parameter includes another (e.g., ). In those cases, we can't + // be sure if it will error or not as user might always specify the other. if !ty.needs_subst() { fcx.register_wf_obligation(ty, fcx.tcx.def_span(d), self.code.clone()); }