]> git.lizzy.rs Git - rust.git/blob - src/test/ui/const-generics/invalid-const-arg-for-type-param.stderr
Make some diagnostics not depend on the source of what they reference being available
[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 help: consider moving this generic argument to the `TryInto` trait, which takes up to 1 argument
8    |
9 LL |     let _: u32 = TryInto::<32>::try_into(5i32).unwrap();
10    |                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
11 help: remove these generics
12    |
13 LL -     let _: u32 = 5i32.try_into::<32>().unwrap();
14 LL +     let _: u32 = 5i32.try_into().unwrap();
15    |
16
17 error[E0599]: no method named `f` found for struct `S` in the current scope
18   --> $DIR/invalid-const-arg-for-type-param.rs:9:7
19    |
20 LL | struct S;
21    | -------- method `f` not found for this struct
22 ...
23 LL |     S.f::<0>();
24    |       ^ method not found in `S`
25
26 error[E0107]: this struct takes 0 generic arguments but 1 generic argument was supplied
27   --> $DIR/invalid-const-arg-for-type-param.rs:12:5
28    |
29 LL |     S::<0>;
30    |     ^----- help: remove these generics
31    |     |
32    |     expected 0 generic arguments
33    |
34 note: struct defined here, with 0 generic parameters
35   --> $DIR/invalid-const-arg-for-type-param.rs:3:8
36    |
37 LL | struct S;
38    |        ^
39
40 error: aborting due to 3 previous errors
41
42 Some errors have detailed explanations: E0107, E0599.
43 For more information about an error, try `rustc --explain E0107`.