dropck: Ignore bounds for traits without any items · Issue #24805 · rust-lang/rust (original) (raw)

As stated in RFC 769, the Drop Check rule is supposed to ignore any trait bounds for traits that do not have associated methods (or perhaps that needs to be strengthened to associated items, as implied by this ticket's title).

However, the current dropck implementation is not so general -- I believe it just hard-codes the set of builtin bounds, rather than allowing any empty trait to be ignored.

This is bad because it complicates e.g. adding OIBIT traits to interfaces, since it can cause the dropck rule to start firing (and for new region constraints to be introduced) that can then cause surprising compilation failures.