review comments

This commit is contained in:
Esteban Küber 2019-11-14 11:29:01 -08:00
parent 578bc438b0
commit 8d1c2612f8
2 changed files with 5 additions and 1 deletions

View File

@ -1231,6 +1231,10 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
trait_ref: ty::TraitRef<'tcx>,
) -> ty::ExistentialTraitRef<'tcx> {
if trait_ref.self_ty() != self.tcx().types.trait_object_dummy_self {
// FIXME: There appears to be a missing filter on top of `expand_trait_aliases`, which
// picks up non-supertraits where clauses - but also, the object safety completely
// ignores trait aliases, which could be object safety hazards. We `delay_span_bug`
// here to avoid an ICE in stable even when the feature is disabled. (#66420)
self.tcx().sess.delay_span_bug(DUMMY_SP, &format!(
"trait_ref_to_existential called on {:?} with non-dummy Self",
trait_ref,

View File

@ -1,4 +1,4 @@
#![feature(trait_alias)]
#![feature(trait_alias)] // Enabled to reduce stderr output, but can be triggered even if disabled.
trait Trait {}
trait WithType {
type Ctx;