Address review comments

This commit is contained in:
Aaron Hill 2019-07-05 19:10:29 -04:00
parent 2ab8d61882
commit 36008327cc
No known key found for this signature in database
GPG key ID: B4087E510E98B164
6 changed files with 14 additions and 4 deletions

View file

@ -1280,14 +1280,14 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
concrete_is_opaque
);
// concrete_is_opaque is 'true' when we're using an existential
// type without 'revelaing' it. For example, code like this:
// concrete_is_opaque is `true` when we're using an existential
// type without 'revealing' it. For example, code like this:
//
// existential type Foo: Debug;
// fn foo1() -> Foo { ... }
// fn foo2() -> Foo { foo1() }
//
// In 'foo2', we're not revealing the type of 'Foo' - we're
// In `foo2`, we're not revealing the type of `Foo` - we're
// just treating it as the opaque type.
//
// When this occurs, we do *not* want to try to equate

View file

@ -587,6 +587,11 @@ impl<'cx, 'tcx> WritebackCx<'cx, 'tcx> {
}
if !opaque_defn.substs.has_local_value() {
// We only want to add an entry into `concrete_existential_types`
// if we actually found a defining usage of this existential type.
// Otherwise, we do nothing - we'll either find a defining usage
// in some other location, or we'll end up emitting an error due
// to the lack of defining usage
if !skip_add {
let new = ty::ResolvedOpaqueTy {
concrete_type: definition_ty,

View file

@ -1,3 +1,5 @@
// check-pass
#![feature(existential_type)]
#![feature(impl_trait_in_bindings)]
//~^ WARN the feature `impl_trait_in_bindings` is incomplete and may cause the compiler to crash

View file

@ -1,3 +1,5 @@
// check-pass
#![feature(existential_type)]
// Regression test for issue #61863

View file

@ -1,5 +1,6 @@
#![feature(existential_type)]
// check-pass
#![feature(existential_type)]
#![allow(dead_code)]
pub trait MyTrait {}