It’s definitely an interesting idea, because the latest modules proposal involves adding dependency crates to the prelude as well. At the least, the compatibility lint questions overlap.
(I don’t have a strong opinion either way about anything else in particular changing in the prelude, except maybe… add HashMap?)
This is more about usual inference breakage from adding new methods/impls, rather than about prelude specifically.
Prelude additions may cause this only if traits are added into the prelude, but not other kinds of items.
@petrochenkov could you explain which problems does adding a new trait to the prelude introduce ?
I’ve heard that it can be problematic a couple of times, but I don’t know much more than that. Is it just that it can make previously un-ambiguous code ambiguous if the trait methods have the same identifiers as other items in the users code?
Yes, method call value.method() can become ambiguous if previously we had one trait Tr1 in scope with method method where typeof(value): Tr1, but with prelude addition we have another Tr2 in scope with method method where typeof(value): Tr2.