• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 {
take_ref_self(ref self: Pin<&mut Self>)8     fn take_ref_self(ref self: Pin<&mut Self>) {} //~ ERROR expected identifier, found keyword `self`
take_ref_mut_self(ref mut self: Pin<&mut 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 
main()14 fn main() {}
15