mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 15:23:46 +00:00
2cff3e90bc
This commit moves the `#[do_not_recommend]` attribute to the `#[diagnostic]` namespace. It still requires `#![feature(do_not_recommend)]` to work.
21 lines
526 B
Rust
21 lines
526 B
Rust
//@ revisions: current next
|
|
//@ ignore-compare-mode-next-solver (explicit revisions)
|
|
//@[next] compile-flags: -Znext-solver
|
|
|
|
#![feature(do_not_recommend)]
|
|
|
|
trait Foo {}
|
|
|
|
#[diagnostic::do_not_recommend]
|
|
impl<T> Foo for T where T: Send {}
|
|
|
|
fn needs_foo<T: Foo>() {}
|
|
//~^ NOTE required by a bound in `needs_foo`
|
|
//~| NOTE required by this bound in `needs_foo`
|
|
|
|
fn main() {
|
|
needs_foo::<*mut ()>();
|
|
//~^ ERROR the trait bound `*mut (): Foo` is not satisfied
|
|
//~| NOTE the trait `Foo` is not implemented for `*mut ()`
|
|
}
|