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

Trait bounds on trait type parameters never checked #7266

Closed
msullivan opened this issue Jun 20, 2013 · 0 comments
Closed

Trait bounds on trait type parameters never checked #7266

msullivan opened this issue Jun 20, 2013 · 0 comments

Comments

@msullivan
Copy link
Contributor

Type parameters to traits can have trait bounds, but these bounds are not checked when implementing the trait.

pub trait Clone2 {
    fn clone(&self) -> Self;
}


trait Getter<T: Clone2> {
    fn get(&self) -> T;
}

impl Getter<int> for int {
    fn get(&self) -> int { *self }
}

int doesn't implement Clone2, but this program is accepted.

@ghost ghost assigned msullivan Jun 20, 2013
@msullivan msullivan removed their assignment Jun 16, 2014
flip1995 pushed a commit to flip1995/rust that referenced this issue Jun 3, 2021
…fate

Downgrade suspicious_op..._groupings to Nursery

This addresses rust-lang#6722.

changelog: Downgrade [`suspicious_lint_operations`] to Nursery
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant