]> git.lizzy.rs Git - rust.git/blob - src/test/ui/const-generics/invalid-const-arg-for-type-param.stderr
Merge commit 'd822110d3b5625b9dc80ccc442e06fc3cc851d76' into clippyup
[rust.git] / src / test / ui / const-generics / invalid-const-arg-for-type-param.stderr
1 error[E0107]: this associated function takes 0 generic arguments but 1 generic argument was supplied
2   --> $DIR/invalid-const-arg-for-type-param.rs:6:23
3    |
4 LL |     let _: u32 = 5i32.try_into::<32>().unwrap();
5    |                       ^^^^^^^^ expected 0 generic arguments
6    |
7 note: associated function defined here, with 0 generic parameters
8   --> $SRC_DIR/core/src/convert/mod.rs:LL:COL
9    |
10 LL |     fn try_into(self) -> Result<T, Self::Error>;
11    |        ^^^^^^^^
12 help: consider moving this generic argument to the `TryInto` trait, which takes up to 1 argument
13    |
14 LL |     let _: u32 = TryInto::<32>::try_into(5i32).unwrap();
15    |                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
16 help: remove these generics
17    |
18 LL -     let _: u32 = 5i32.try_into::<32>().unwrap();
19 LL +     let _: u32 = 5i32.try_into().unwrap();
20    |
21
22 error[E0599]: no method named `f` found for struct `S` in the current scope
23   --> $DIR/invalid-const-arg-for-type-param.rs:9:7
24    |
25 LL | struct S;
26    | -------- method `f` not found for this struct
27 ...
28 LL |     S.f::<0>();
29    |       ^ method not found in `S`
30
31 error[E0107]: this struct takes 0 generic arguments but 1 generic argument was supplied
32   --> $DIR/invalid-const-arg-for-type-param.rs:12:5
33    |
34 LL |     S::<0>;
35    |     ^----- help: remove these generics
36    |     |
37    |     expected 0 generic arguments
38    |
39 note: struct defined here, with 0 generic parameters
40   --> $DIR/invalid-const-arg-for-type-param.rs:3:8
41    |
42 LL | struct S;
43    |        ^
44
45 error: aborting due to 3 previous errors
46
47 Some errors have detailed explanations: E0107, E0599.
48 For more information about an error, try `rustc --explain E0107`.