]> git.lizzy.rs Git - rust.git/blob - src/test/ui/existential_types/existential_type.nll.stderr
90840bf205ca2e5ebfe75a072e19f59a58a049b2
[rust.git] / src / test / ui / existential_types / existential_type.nll.stderr
1 error: defining existential type use differs from previous
2   --> $DIR/existential_type.rs:23:1
3    |
4 LL | / fn bar() -> Foo { //~ ERROR defining existential type use differs from previous
5 LL | |     42i32
6 LL | | }
7    | |_^
8    |
9 note: previous use here
10   --> $DIR/existential_type.rs:19:1
11    |
12 LL | / fn foo() -> Foo {
13 LL | |     ""
14 LL | | }
15    | |_^
16
17 error[E0308]: mismatched types
18   --> $DIR/existential_type.rs:36:5
19    |
20 LL | fn bomp() -> boo::Boo {
21    |              -------- expected `Boo` because of return type
22 LL |     "" //~ ERROR mismatched types
23    |     ^^ expected anonymized type, found reference
24    |
25    = note: expected type `Boo`
26               found type `&'static str`
27
28 error[E0308]: mismatched types
29   --> $DIR/existential_type.rs:50:23
30    |
31 LL |         let _: &str = bomp(); //~ ERROR mismatched types
32    |                       ^^^^^^ expected &str, found anonymized type
33    |
34    = note: expected type `&str`
35               found type `Boo`
36
37 error[E0308]: mismatched types
38   --> $DIR/existential_type.rs:54:9
39    |
40 LL |     fn bomp() -> boo::Boo {
41    |                  -------- expected `Boo` because of return type
42 LL |         "" //~ ERROR mismatched types
43    |         ^^ expected anonymized type, found reference
44    |
45    = note: expected type `Boo`
46               found type `&'static str`
47
48 error[E0277]: the trait bound `T: Trait` is not satisfied
49   --> $DIR/existential_type.rs:61:1
50    |
51 LL | existential type Underconstrained<T: Trait>: 'static; //~ ERROR the trait bound `T: Trait`
52    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Trait` is not implemented for `T`
53    |
54    = help: consider adding a `where T: Trait` bound
55    = note: the return type of a function must have a statically known size
56
57 warning: not reporting region error due to nll
58   --> $DIR/existential_type.rs:78:1
59    |
60 LL | existential type WrongGeneric<T>: 'static;
61    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
62
63 error[E0308]: mismatched types
64   --> $DIR/existential_type.rs:93:27
65    |
66 LL |     let _: &'static str = x; //~ mismatched types
67    |                           ^ expected reference, found anonymized type
68    |
69    = note: expected type `&'static str`
70               found type `NoReveal`
71
72 error[E0605]: non-primitive cast: `NoReveal` as `&'static str`
73   --> $DIR/existential_type.rs:94:13
74    |
75 LL |     let _ = x as &'static str; //~ non-primitive cast
76    |             ^^^^^^^^^^^^^^^^^
77    |
78    = note: an `as` expression can only be used to convert between primitive types. Consider using the `From` trait
79
80 error: could not find defining uses
81   --> $DIR/existential_type.rs:28:1
82    |
83 LL | existential type Bar: std::fmt::Debug; //~ ERROR could not find defining uses
84    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
85
86 error: could not find defining uses
87   --> $DIR/existential_type.rs:32:5
88    |
89 LL |     pub existential type Boo: ::std::fmt::Debug; //~ ERROR could not find defining uses
90    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
91
92 error: defining existential type use differs from previous
93   --> $DIR/existential_type.rs:74:1
94    |
95 LL | / fn my_iter2<T>(t: T) -> MyIter<T> { //~ ERROR defining existential type use differs from previous
96 LL | |     Some(t).into_iter()
97 LL | | }
98    | |_^
99    |
100 note: previous use here
101   --> $DIR/existential_type.rs:70:1
102    |
103 LL | / fn my_iter<T>(t: T) -> MyIter<T> {
104 LL | |     std::iter::once(t)
105 LL | | }
106    | |_^
107
108 error: aborting due to 10 previous errors
109
110 Some errors occurred: E0277, E0308, E0605.
111 For more information about an error, try `rustc --explain E0277`.