Skip to content

drmingdrmer/conflict-trait-in-main

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

This is a reproduce of a rustc bug related to associated type in two crates

related issues: rust-lang/rust#51445

If one crate lib.rs implements a trait(Default) for an associated type(<() as Container>::Item, which is Foo), in another crate main.rs, it seems the compiler treats the associated type(<() as Container>::Item) as a generic type T and assumes T would be any type and results in the conflict with a local type that tries to implement Default, while actually Foo and Wow are actually different types.

And impl Default for <() as Container>::Item does not conflict with types defined in the same crate lib.rs

image

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages