]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-10412.rs
Rollup merge of #91804 - woppopo:const_clone, r=oli-obk
[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 implicit elided lifetime not allowed here
9     //~| ERROR the size for values of type `str` cannot be known at compilation time
10     fn serialize(val : &'self str) -> Vec<u8> { //~ ERROR lifetimes cannot use keyword names
11         vec![1]
12     }
13     fn deserialize(repr: &[u8]) -> &'self str { //~ ERROR lifetimes cannot use keyword names
14         "hi"
15     }
16 }
17
18 fn main() {
19     println!("hello");
20     let x = "foo".to_string();
21     let y = x;
22     println!("{}", y);
23 }