summaryrefslogtreecommitdiffstats
path: root/tests/ui/lifetimes/unusual-rib-combinations.stderr
blob: 92a2ef2f432f12617858067d9de7ebbcdfdd735c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
error[E0106]: missing lifetime specifier
  --> $DIR/unusual-rib-combinations.rs:24:15
   |
LL | fn d<const C: S>() {}
   |               ^ expected named lifetime parameter

error[E0770]: the type of const parameters must not depend on other generic parameters
  --> $DIR/unusual-rib-combinations.rs:29:22
   |
LL | struct Bar<const N: &'a (dyn for<'a> Foo<'a>)>;
   |                      ^^ the type must not depend on the parameter `'a`
   |
   = note: lifetime parameters may not be used in the type of const parameters

error[E0214]: parenthesized type parameters may only be used with a `Fn` trait
  --> $DIR/unusual-rib-combinations.rs:7:16
   |
LL | fn a() -> [u8; foo::()] {
   |                ^^^^^^^ only `Fn` traits may use parentheses

error[E0214]: parenthesized type parameters may only be used with a `Fn` trait
  --> $DIR/unusual-rib-combinations.rs:14:15
   |
LL | fn b<const C: u8()>() {}
   |               ^^^^ only `Fn` traits may use parentheses

error[E0214]: parenthesized type parameters may only be used with a `Fn` trait
  --> $DIR/unusual-rib-combinations.rs:18:10
   |
LL | fn c<T = u8()>() {}
   |          ^^^^ only `Fn` traits may use parentheses

error: defaults for type parameters are only allowed in `struct`, `enum`, `type`, or `trait` definitions
  --> $DIR/unusual-rib-combinations.rs:18:6
   |
LL | fn c<T = u8()>() {}
   |      ^^^^^^^^
   |
   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
   = note: for more information, see issue #36887 <https://github.com/rust-lang/rust/issues/36887>
   = note: `#[deny(invalid_type_param_default)]` on by default

error[E0308]: mismatched types
  --> $DIR/unusual-rib-combinations.rs:7:16
   |
LL | fn a() -> [u8; foo::()] {
   |                ^^^^^^^ expected `usize`, found fn item
   |
   = note: expected type `usize`
           found fn item `fn() {foo}`

error: `S<'_>` is forbidden as the type of a const generic parameter
  --> $DIR/unusual-rib-combinations.rs:24:15
   |
LL | fn d<const C: S>() {}
   |               ^
   |
   = note: the only supported types are integers, `bool` and `char`
   = help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types

error: `&dyn for<'a> Foo<'a>` is forbidden as the type of a const generic parameter
  --> $DIR/unusual-rib-combinations.rs:29:21
   |
LL | struct Bar<const N: &'a (dyn for<'a> Foo<'a>)>;
   |                     ^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: the only supported types are integers, `bool` and `char`
   = help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types

error: aborting due to 9 previous errors

Some errors have detailed explanations: E0106, E0214, E0308, E0770.
For more information about an error, try `rustc --explain E0106`.