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

marker_trait_attr: overlapping impls can cause compilation failures #84917

Closed
lcnr opened this issue May 4, 2021 · 1 comment · Fixed by #88139
Closed

marker_trait_attr: overlapping impls can cause compilation failures #84917

lcnr opened this issue May 4, 2021 · 1 comment · Fixed by #88139
Labels
C-bug Category: This is a bug. F-marker_trait_attr `#![feature(marker_trait_attr)]`

Comments

@lcnr
Copy link
Contributor

lcnr commented May 4, 2021

#![feature(marker_trait_attr)]

#[marker]
pub trait F {}
impl<T> F for T where T: Copy {}
impl<T> F for T where T: 'static {}

results in

error[E0310]: the parameter type `T` may not live long enough
 --> src/lib.rs:5:9
  |
5 | impl<T> F for T where T: Copy {}
  |      -  ^ ...so that the type `T` will meet its required lifetime bounds
  |      |
  |      help: consider adding an explicit lifetime bound...: `T: 'static`

This should not happen

@lcnr lcnr added the C-bug Category: This is a bug. label May 4, 2021
@lcnr
Copy link
Contributor Author

lcnr commented May 4, 2021

taken from #29864 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. F-marker_trait_attr `#![feature(marker_trait_attr)]`
Projects
None yet
1 participant