8

Allow Trait inheritance with cycles on associated types by spastorino · Pull Req...

 3 years ago
source link: https://github.com/rust-lang/rust/pull/79209
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Contributor

nikomatsakis left a comment

I thought I had some good creative ideas for tests but as I look at it, most of them are kind of the same as the tests you already have.

I guess I think we should test some scenarios that ARE still ambiguous, e.g.

trait Foo { type Item; }
trait Bar<T> { type Item; }
trait Baz: Foo + Bar<Self::Item> { }

/// Ensures that the super-predicates of the trait with a `DefId`

/// of `trait_def_id` are converted and stored. This also ensures that

/// the transitive super-predicates are converted.

fn super_predicates_that_define_assoc_type(

nikomatsakis on Nov 20

Contributor

Hmm so this is a query... it's a bit unusual in that most query providers either operate on local def-ids or external def-ids but not both. (The typical strategy, in other words, would be to define this query by encoding it into the metadata.) But that seems kind of silly here, I don't see a reason to encode more into the metadata. So this setup is probably ok. But I feel like we have to be sure to setup the provider also for external crates or we will see ICEs -- I'm a bit surprised our tests aren't encountering them yet, actually.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK