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

Adding Deref impl affects lifetime bounds of other methods #27697

Closed
frewsxcv opened this issue Aug 12, 2015 · 5 comments · Fixed by #62016
Closed

Adding Deref impl affects lifetime bounds of other methods #27697

frewsxcv opened this issue Aug 12, 2015 · 5 comments · Fixed by #62016
Labels
A-lifetimes Area: Lifetimes / regions A-type-system Area: Type system C-bug Category: This is a bug. E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@frewsxcv
Copy link
Member

From https://users.rust-lang.org/t/does-implementing-deref-affect-the-lifetime-bounds-of-all-other-methods/


Code: http://is.gd/AkyE699 http://is.gd/AkyE69

If the Deref is removed, the code compiles. Presumably, the inclusion of the Deref implementation on the trait object causes the lifetime bounds to change on the do_something method.

@Stebalien
Copy link
Contributor

Code: http://is.gd/AkyE69

@bluss
Copy link
Member

bluss commented Aug 12, 2015

For debugging, notice that impl Deref for MyTrait is equivalent to impl Deref for MyTrait + 'static.

@steveklabnik steveklabnik added A-type-system Area: Type system A-lifetimes Area: Lifetimes / regions labels Aug 13, 2015
@steveklabnik
Copy link
Member

Triage: still reproduces today.

@Mark-Simulacrum Mark-Simulacrum added the C-bug Category: This is a bug. label Jul 22, 2017
@frewsxcv
Copy link
Member Author

frewsxcv commented Jun 4, 2018

Triage: still reproduces today.

@pnkfelix
Copy link
Member

This no longer reproduces. Tagging as E-needstest

@pnkfelix pnkfelix added E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Feb 27, 2019
Centril added a commit to Centril/rust that referenced this issue Jun 21, 2019
Centril added a commit to Centril/rust that referenced this issue Jun 21, 2019
Centril added a commit to Centril/rust that referenced this issue Jun 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lifetimes Area: Lifetimes / regions A-type-system Area: Type system C-bug Category: This is a bug. E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants