Debian Codegraph @

third_party/rust/pin-project/tests/ui/pinned_drop/invalid-self.rs

raw
1 // by-ref binding `ref (mut) self` and sub-patterns `@` are not allowed in receivers (rejected by rustc).
2
3 use std::pin::Pin;
4
5 struct S {}
6
7 impl S {
8 fn take_ref_self(ref self: Pin<&mut Self>) {} //~ ERROR expected identifier, found keyword `self`
9 fn take_ref_mut_self(ref mut self: Pin<&mut Self>) {} //~ ERROR expected identifier, found keyword `self`
10
11 fn self_subpat(self @ S {}: Self) {} //~ ERROR expected one of `)`, `,`, or `:`, found `@`
12 }
13
14 fn main() {}