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

Deprecated attribute on trait impls is useless #51470

Closed
Havvy opened this issue Jun 10, 2018 · 2 comments
Closed

Deprecated attribute on trait impls is useless #51470

Havvy opened this issue Jun 10, 2018 · 2 comments
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-lint Area: Lints (warnings about flaws in source code) such as unused_mut. A-trait-system Area: Trait system

Comments

@Havvy
Copy link
Contributor

Havvy commented Jun 10, 2018

I'd expect the following code to warn, but it doesn't:

struct Struct;

trait Trait {
  fn f(&self);
}

#[deprecated(since="0.0.0" note="example deprecation")]
impl Struct for Trait {
  fn f(&self) {}
}

fn main() {
  Struct.f();
}

Note: It is an error to put the deprecated attribute on the fn f in the impl itself.

@stokhos stokhos added A-impl-trait Area: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch. A-lint Area: Lints (warnings about flaws in source code) such as unused_mut. labels Jun 10, 2018
@Havvy
Copy link
Contributor Author

Havvy commented Jun 11, 2018

This should be A-Trait, not A-Impl-Trait.

@pietroalbini pietroalbini added A-diagnostics Area: Messages for errors, warnings, and lints A-trait-system Area: Trait system and removed A-impl-trait Area: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch. labels Jun 11, 2018
@kennytm
Copy link
Member

kennytm commented Jun 26, 2018

Duplicateof #39935.

@kennytm kennytm closed this as completed Jun 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-lint Area: Lints (warnings about flaws in source code) such as unused_mut. A-trait-system Area: Trait system
Projects
None yet
Development

No branches or pull requests

4 participants