about summary refs log tree commit diff
path: root/tests/ui/generic-const-items/parameter-defaults.stderr
blob: 9bf1f6412f59b1f335966b55a61515d0ab77f11a (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
error: defaults for generic parameters are not allowed here
  --> $DIR/parameter-defaults.rs:10:12
   |
LL | const NONE<T = ()>: Option<T> = None::<T>;
   |            ^^^^^^

error: defaults for generic parameters are not allowed here
  --> $DIR/parameter-defaults.rs:14:16
   |
LL |     const NADA<T = ()>: Option<T> = None::<T>;
   |                ^^^^^^

error[E0282]: type annotations needed for `Option<_>`
  --> $DIR/parameter-defaults.rs:20:18
   |
LL | fn body0() { let _ = NONE; }
   |                  ^   ---- type must be known at this point
   |
help: consider giving this pattern a type, where the type for type parameter `T` is specified
   |
LL | fn body0() { let _: Option<T> = NONE; }
   |                   +++++++++++

error[E0282]: type annotations needed for `Option<_>`
  --> $DIR/parameter-defaults.rs:21:18
   |
LL | fn body1() { let _ = Host::NADA; }
   |                  ^   ---------- type must be known at this point
   |
help: consider giving this pattern a type, where the type for type parameter `T` is specified
   |
LL | fn body1() { let _: Option<T> = Host::NADA; }
   |                   +++++++++++

error: aborting due to 4 previous errors

For more information about this error, try `rustc --explain E0282`.