]> git.lizzy.rs Git - rust.git/blob - src/test/debuginfo/generic-static-method-on-struct-and-enum.rs
Auto merge of #54624 - arielb1:evaluate-outlives, r=nikomatsakis
[rust.git] / src / test / debuginfo / generic-static-method-on-struct-and-enum.rs
1 // Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
4 //
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
10
11 // min-lldb-version: 310
12
13 // compile-flags:-g
14
15 // gdb-command:run
16
17 // STRUCT
18 // gdb-command:print arg1
19 // gdb-check:$1 = 1
20 // gdb-command:print arg2
21 // gdb-check:$2 = 2
22 // gdb-command:continue
23
24 // ENUM
25 // gdb-command:print arg1
26 // gdb-check:$3 = -3
27 // gdb-command:print arg2
28 // gdb-check:$4 = 4.5
29 // gdb-command:print arg3
30 // gdb-check:$5 = 5
31 // gdb-command:continue
32
33
34 #![feature(omit_gdb_pretty_printer_section)]
35 #![omit_gdb_pretty_printer_section]
36
37 struct Struct {
38     x: isize
39 }
40
41 impl Struct {
42
43     fn static_method<T1, T2>(arg1: T1, arg2: T2) -> isize {
44         zzz(); // #break
45         return 0;
46     }
47 }
48
49 enum Enum {
50     Variant1 { x: isize },
51     Variant2,
52     Variant3(f64, isize, char),
53 }
54
55 impl Enum {
56
57     fn static_method<T1, T2, T3>(arg1: T1, arg2: T2, arg3: T3) -> isize {
58         zzz(); // #break
59         return 1;
60     }
61 }
62
63 fn main() {
64     Struct::static_method(1, 2);
65     Enum::static_method(-3, 4.5f64, 5);
66 }
67
68 fn zzz() {()}