Skip to content

Allow structs to have lifetime parameters even if those lifetimes are unused inside #13999

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

Closed
pcwalton opened this issue May 6, 2014 · 2 comments
Labels
A-lifetimes Area: Lifetimes / regions A-type-system Area: Type system C-enhancement Category: An issue proposing an enhancement or a PR with one.

Comments

@pcwalton
Copy link
Contributor

pcwalton commented May 6, 2014

This has become useful for a few patterns in Servo where we want types that enforce that they can't be "stashed" anywhere.

@alexcrichton
Copy link
Member

Would the marker types suffice for this use case?

@pcwalton
Copy link
Contributor Author

pcwalton commented May 7, 2014

Yeah, I didn't realize they existed. We should switch Servo to use them.

@pcwalton pcwalton closed this as completed May 7, 2014
bors pushed a commit to rust-lang-ci/rust that referenced this issue Jan 28, 2025
I opened rust-lang/rust-clippy#13896 before.
However, I found that there're more cases where Clippy suggests to use
modules that belong to the `std` crate even in a `no_std` environment.
Therefore, this PR include the changes I've made in rust-lang#13896 and new
changes to fix cases I found this time to prevent wrong suggestions in
`no_std` environments as well.

changelog: [`redundant_closure`]: correct suggestion in `no_std`
changelog: [`repeat_vec_with_capacity`]: correct suggestion in `no_std`
changelog: [`single_range_in_vec_init`]: don't emit suggestion to use
`Vec` in `no_std`
changelog: [`drain_collect`]: correct suggestion in `no_std`
changelog: [`map_with_unused_argument_over_ranges`]: correct suggestion
in `no_std`

also close rust-lang#13895
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-enhancement Category: An issue proposing an enhancement or a PR with one.
Projects
None yet
Development

No branches or pull requests

2 participants