Debian Codegraph @

tests/compile-fail/payload_fn2.rs

raw symbols SCIP
1 // Copyright (c) 2015 Robert Clipsham <[email protected]>
2 //
3 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
4 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
5 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
6 // option. This file may not be copied, modified, or distributed
7 // except according to those terms.
8
9 extern crate pnet_macros;
10 extern crate pnet_macros_support;
11 use pnet_macros::packet;
12
13 #[packet]
14 pub struct PacketWithPayload2 {
15 banana: u8,
16 #[payload(length_fn = "length_of_payload")] //~ ERROR: unknown attribute: payload
17 payload: Vec<u8>,
18 }
19
20 fn length_of_payload(_: &PacketWithPayload2Packet) -> usize { //~ ERROR cannot find type `PacketWithPayload2Packet` in this scope
21 // FIXME
22 unimplemented!()
23 }
24
25 fn main() {}