about summary refs log tree commit diff
path: root/tests/ui/diagnostic_namespace/on_unimplemented/on_impl_trait.rs
blob: 1ffa604b2bc06b09e3be2187d48cfe2e3cd9efaf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//! used to ICE, see <https://github.com/rust-lang/rust/issues/130627>
//! Instead it should just ignore the diagnostic attribute

#![feature(trait_alias)]

trait Test {}

#[diagnostic::on_unimplemented(message = "blah", label = "blah", note = "blah")]
//~^ WARN `#[diagnostic::on_unimplemented]` can only be applied to trait definitions
trait Alias = Test;

// Use trait alias as bound on type parameter.
fn foo<T: Alias>(v: &T) {}

pub fn main() {
    foo(&1);
    //~^ ERROR the trait bound `{integer}: Alias` is not satisfied
}