File: invalid-const-arg-for-type-param.stderr

package info (click to toggle)
rustc-web 1.78.0%2Bdfsg1-2~deb11u3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 1,245,360 kB
  • sloc: xml: 147,985; javascript: 18,022; sh: 11,083; python: 10,265; ansic: 6,172; cpp: 5,023; asm: 4,390; makefile: 4,269
file content (43 lines) | stat: -rw-r--r-- 1,438 bytes parent folder | download | duplicates (4)
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
error[E0107]: method takes 0 generic arguments but 1 generic argument was supplied
  --> $DIR/invalid-const-arg-for-type-param.rs:6:23
   |
LL |     let _: u32 = 5i32.try_into::<32>().unwrap();
   |                       ^^^^^^^^ expected 0 generic arguments
   |
help: consider moving this generic argument to the `TryInto` trait, which takes up to 1 argument
   |
LL |     let _: u32 = TryInto::<32>::try_into(5i32).unwrap();
   |                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
help: remove these generics
   |
LL -     let _: u32 = 5i32.try_into::<32>().unwrap();
LL +     let _: u32 = 5i32.try_into().unwrap();
   |

error[E0599]: no method named `f` found for struct `S` in the current scope
  --> $DIR/invalid-const-arg-for-type-param.rs:9:7
   |
LL | struct S;
   | -------- method `f` not found for this struct
...
LL |     S.f::<0>();
   |       ^ method not found in `S`

error[E0107]: struct takes 0 generic arguments but 1 generic argument was supplied
  --> $DIR/invalid-const-arg-for-type-param.rs:12:5
   |
LL |     S::<0>;
   |     ^----- help: remove these generics
   |     |
   |     expected 0 generic arguments
   |
note: struct defined here, with 0 generic parameters
  --> $DIR/invalid-const-arg-for-type-param.rs:3:8
   |
LL | struct S;
   |        ^

error: aborting due to 3 previous errors

Some errors have detailed explanations: E0107, E0599.
For more information about an error, try `rustc --explain E0107`.