Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dropck: Ignore bounds for traits without any items #24805

Closed
pnkfelix opened this issue Apr 25, 2015 · 1 comment · Fixed by #25113
Closed

dropck: Ignore bounds for traits without any items #24805

pnkfelix opened this issue Apr 25, 2015 · 1 comment · Fixed by #25113

Comments

@pnkfelix
Copy link
Member

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.

@pnkfelix
Copy link
Member Author

(In particular, I discovered this while doing some prototyping work on stabilizing allocators by adding a Raw OIBIT bound as part of some future-proofing plans.)

pnkfelix added a commit to pnkfelix/rust that referenced this issue Apr 28, 2015
pnkfelix added a commit to pnkfelix/rust that referenced this issue Apr 28, 2015
The new functionality being tested here is that a drop impl bounded by
`UserDefined` does not cause dropck to inject its conservative
constraints on region inference.
pnkfelix added a commit to pnkfelix/rust that referenced this issue May 5, 2015
pnkfelix added a commit to pnkfelix/rust that referenced this issue May 5, 2015
The new functionality being tested here is that a drop impl bounded by
`UserDefined` does not cause dropck to inject its conservative
constraints on region inference.
bors added a commit that referenced this issue May 5, 2015
Generalize dropck to ignore item-less traits

Fix #24805.

(This is the reopened + rebased version of PR #24898)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant