Skip to content

Commit 619e3e8

Browse files
committed
---
yaml --- r: 193893 b: refs/heads/beta c: bd2096c h: refs/heads/master i: 193891: a62def6 v: v3
1 parent 98cff54 commit 619e3e8

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
@@ -31,7 +31,7 @@ refs/heads/automation-fail: 1bf06495443584539b958873e04cc2f864ab10e4
3131
refs/heads/issue-18208-method-dispatch-3-quick-reject: 2009f85b9f99dedcec4404418eda9ddba90258a2
3232
refs/heads/batch: b7fd822592a4fb577552d93010c4a4e14f314346
3333
refs/heads/building: 126db549b038c84269a1e4fe46f051b2c15d6970
34-
refs/heads/beta: 99a508bc1795a7913ad790a3bf60f68dc782f282
34+
refs/heads/beta: bd2096c497580da263c20e8231666a995722ac29
3535
refs/heads/windistfix: 7608dbad651f02e837ed05eef3d74a6662a6e928
3636
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
3737
refs/heads/tmp: de8a23bbc3a7b9cbd7574b5b91a34af59bf030e6

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