Skip to content

Commit 6d1656f

Browse files
committed
---
yaml --- r: 191626 b: refs/heads/tmp c: bd2096c h: refs/heads/master v: v3
1 parent 135e240 commit 6d1656f

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
@@ -34,6 +34,6 @@ refs/heads/building: 126db549b038c84269a1e4fe46f051b2c15d6970
3434
refs/heads/beta: 522d09dfecbeca1595f25ac58c6d0178bbd21d7d
3535
refs/heads/windistfix: 7608dbad651f02e837ed05eef3d74a6662a6e928
3636
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
37-
refs/heads/tmp: 99a508bc1795a7913ad790a3bf60f68dc782f282
37+
refs/heads/tmp: bd2096c497580da263c20e8231666a995722ac29
3838
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3939
refs/tags/homu-tmp: 4a5101a42f8ea36bdbe14749e672ab78cb971726

branches/tmp/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)