]> git.proxmox.com Git - rustc.git/blob - src/test/ui/rfc-2091-track-caller/error-with-trait-fn-impl.rs
New upstream version 1.43.0+dfsg1
[rustc.git] / src / test / ui / rfc-2091-track-caller / error-with-trait-fn-impl.rs
1 // check-fail
2
3 #![feature(track_caller)]
4
5 trait Trait {
6 fn unwrap(&self);
7 }
8
9 impl Trait for u64 {
10 #[track_caller] //~ ERROR: `#[track_caller]` may not be used on trait methods
11 fn unwrap(&self) {}
12 }
13
14 struct S;
15
16 impl S {
17 #[track_caller] // ok
18 fn foo() {}
19 }
20
21 fn main() {}