Closed
Description
The following code compiles on stable but fails to compile on beta and nightly with the warning "use of deprecated item Deprecated
":
#![deny(warnings)]
#[deprecated]
trait Deprecated {}
#[deprecated]
struct DeprecatedTy;
#[allow(deprecated)]
impl Deprecated for DeprecatedTy {}
#[allow(deprecated)]
fn foo() -> impl Deprecated { DeprecatedTy }
fn main() {
foo();
}
Error:
error: use of deprecated item 'Deprecated'
--> src/main.rs:13:18
|
13 | fn foo() -> impl Deprecated { DeprecatedTy }
| ^^^^^^^^^^
|
note: lint level defined here
--> src/main.rs:1:9
|
1 | #![deny(warnings)]
| ^^^^^^^^
= note: #[deny(deprecated)] implied by #[deny(warnings)]
error: aborting due to previous error
Possibly related to @oli-obk 's refactoring of impl Trait
?