E0106.rs 994 字节
Newer Older
G
ggomez 已提交
1 2 3 4 5 6 7 8 9 10 11
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

struct Foo {
12 13 14
    x: &bool,
    //~^ ERROR E0106
    //~| NOTE expected lifetime parameter
G
ggomez 已提交
15 16 17
}
enum Bar {
    A(u8),
18 19 20
    B(&bool),
   //~^ ERROR E0106
   //~| NOTE expected lifetime parameter
G
ggomez 已提交
21
}
22 23 24
type MyStr = &str;
        //~^ ERROR E0106
        //~| NOTE expected lifetime parameter
G
ggomez 已提交
25

26 27 28 29 30 31 32 33 34 35 36 37
struct Baz<'a>(&'a str);
struct Buzz<'a, 'b>(&'a str, &'b str);

struct Quux {
    baz: Baz,
    //~^ ERROR E0106
    //~| expected lifetime parameter
    buzz: Buzz,
    //~^ ERROR E0106
    //~| expected 2 lifetime parameters
}

G
ggomez 已提交
38 39
fn main() {
}