Skip to content

Commit 4ec801a

Browse files
committed
---
yaml --- r: 191793 b: refs/heads/snap-stage3 c: bd2096c h: refs/heads/master i: 191791: cd5b562 v: v3
1 parent ae04a00 commit 4ec801a

File tree

2 files changed

+15
-8
lines changed

2 files changed

+15
-8
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 809a554fca2d0ebc2ba50077016fe282a4064752
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 99a508bc1795a7913ad790a3bf60f68dc782f282
4+
refs/heads/snap-stage3: bd2096c497580da263c20e8231666a995722ac29
55
refs/heads/try: ce76bff75603a754d092456285ff455eb871633d
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d

branches/snap-stage3/src/librustc_trans/trans/meth.rs

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -842,13 +842,20 @@ fn emit_vtable_methods<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>,
842842
return nullptr;
843843
}
844844

845-
let predicates =
846-
monomorphize::apply_param_substs(tcx,
847-
&substs,
848-
&impl_method_type.predicates.predicates);
849-
if !predicates_hold(ccx, predicates.into_vec()) {
850-
debug!("emit_vtable_methods: predicates do not hold");
851-
return nullptr;
845+
// If this is a default method, it's possible that it
846+
// relies on where clauses that do not hold for this
847+
// particular set of type parameters. Note that this
848+
// method could then never be called, so we do not want to
849+
// try and trans it, in that case. Issue #23435.
850+
if ty::provided_source(tcx, impl_method_def_id).is_some() {
851+
let predicates =
852+
monomorphize::apply_param_substs(tcx,
853+
&substs,
854+
&impl_method_type.predicates.predicates);
855+
if !predicates_hold(ccx, predicates.into_vec()) {
856+
debug!("emit_vtable_methods: predicates do not hold");
857+
return nullptr;
858+
}
852859
}
853860

854861
trans_fn_ref_with_substs(ccx,

0 commit comments

Comments
 (0)