]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-10412.rs
Auto merge of #60377 - Centril:rollup-42fxe9u, r=Centril
[rust.git] / src / test / ui / issues / issue-10412.rs
1 trait Serializable<'self, T> { //~ ERROR lifetimes cannot use keyword names
2     fn serialize(val : &'self T) -> Vec<u8>; //~ ERROR lifetimes cannot use keyword names
3     fn deserialize(repr : &[u8]) -> &'self T; //~ ERROR lifetimes cannot use keyword names
4 }
5
6 impl<'self> Serializable<str> for &'self str { //~ ERROR lifetimes cannot use keyword names
7     //~^ ERROR lifetimes cannot use keyword names
8     //~| ERROR missing lifetime specifier
9     fn serialize(val : &'self str) -> Vec<u8> { //~ ERROR lifetimes cannot use keyword names
10         vec![1]
11     }
12     fn deserialize(repr: &[u8]) -> &'self str { //~ ERROR lifetimes cannot use keyword names
13         "hi"
14     }
15 }
16
17 fn main() {
18     println!("hello");
19     let x = "foo".to_string();
20     let y = x;
21     println!("{}", y);
22 }