rust_compile
rustc refusing to compile (`error[E0308]`). The first error is usually the cause; later ones often follow from it.
rustbuildtoolmatcher
Install: ci-doctor matchers add official/rust_compile
matchers/rust/rust_compile/matcher.yaml
id: rust_compilerole: toolclassification: [rust, build]description: rustc refusing to compile (`error[E0308]`). The first error is usually the cause; later ones often follow from it.pattern: '^error\[E\d+\]: |^error: (could not compile|aborting due to|linking with)'after: 8
In bundles
Fixtures
Framing stripped per provider. Highlighted lines are what this matcher selects; the marked line is the anchor.
rust_compile_errorOpen in playground
1Current runner version: '2.336.0'
2##[group]Operating System
3Ubuntu
424.04.4
5LTS
6##[endgroup]
7Secret source: Actions
8Prepare workflow directory
9Prepare all required actions
10Complete job name: rust_compile_error
11##[group]Set up job
12Image: ubuntu-24.04
13Runner name: 'GitHub Actions 12'
14##[endgroup]
15Download action repository 'actions/checkout@v4'
16Download action repository 'actions/cache@v4'
17##[group]Run actions/checkout@v4
18 with:
19 fetch-depth: 20
20 lfs: false
21##[endgroup]
22Syncing repository: acme/ledger
23##[group]Getting Git version info
24Working directory is '/home/runner/work/ledger/ledger'
25##[endgroup]
26/usr/bin/git checkout --progress --force 8ad41f02
27##[group]Run actions/cache@v4
28 with:
29 path: ~/.cache
30 key: Linux-deps-8ad41f02
31##[endgroup]
32Received 41943040 of 41943040 (100.0%), 40.0 MBs/sec
33Cache restored from key: Linux-deps-8ad41f02
34##[group]Run cargo --version
35cargo --version
36cargo build --release --locked
37shell: /usr/bin/bash -e {0}
38##[endgroup]
39cargo 1.79.0 (ffa9cf99a 2024-06-03)
40 Updating crates.io index
41 Compiling ledger v0.4.1 (/builds/team/ledger)
42error[E0308]: mismatched types
43 --> src/posting.rs:88:31
44 |
4588 | let rate: Decimal = fx_rate(¤cy);
46 | ------- ^^^^^^^^^^^^^^^^^^ expected `Decimal`, found `Option<Decimal>`
47 | |
48 | expected due to this
49 |
50 = note: expected struct `Decimal`
51 found enum `Option<Decimal>`
52help: consider using `Option::expect` to unwrap the `Option<Decimal>` value
53 |
5488 | let rate: Decimal = fx_rate(¤cy).expect("REASON");
55 | +++++++++++++++++
56
57error[E0599]: no method named `to_minor_units` found for struct `Money` in the current scope
58 --> src/posting.rs:141:24
59 |
60141 | let cents = amount.to_minor_units();
61 | ^^^^^^^^^^^^^^ method not found in `Money`
62
63Some errors have detailed explanations: E0308, E0599.
64For more information about an error, try `rustc --explain E0308`.
65error: could not compile `ledger` (lib) due to 2 previous errors
66##[error]Process completed with exit code 101.
67##[group]Post Run actions/checkout@v4
68##[endgroup]
69/usr/bin/git version
70git version 2.54.0
71##[group]Post Run actions/upload-artifact@v4
72##[endgroup]
73Artifact upload complete.
74##[warning]target/release/ledger: no matching files. Ensure that the artifact path is relative to the working directory
75Post job cleanup.
76Cleaning up orphan processes
1Running with gitlab-runner 16.11.0 (a1b2c3d4)
2 on rust-runner-02 Rs9Tk3Lm, system ID: s_ff11223344aa
3Preparing the "docker" executor
4 Using Docker executor with image rust:1.79-slim ...
5Using Docker executor with image rust:1.79-slim ...
6Using docker image sha256:aa11bb22cc33 for rust:1.79-slim with digest rust@sha256:9f8e...
7Preparing environment
8Running on runner-rs9tk3lm-project-42-concurrent-1...
9Fetching changes with git depth set to 20...
10Checking out 4f90c1bb as detached HEAD...
11Checking cache for cargo-registry-1.79...
12Successfully extracted cache
13$ cargo --version
14cargo 1.79.0 (ffa9cf99a 2024-06-03)
15$ cargo build --release --locked
16 Updating crates.io index
17 Compiling ledger v0.4.1 (/builds/team/ledger)
18error[E0308]: mismatched types
19 --> src/posting.rs:88:31
20 |
2188 | let rate: Decimal = fx_rate(¤cy);
22 | ------- ^^^^^^^^^^^^^^^^^^ expected `Decimal`, found `Option<Decimal>`
23 | |
24 | expected due to this
25 |
26 = note: expected struct `Decimal`
27 found enum `Option<Decimal>`
28help: consider using `Option::expect` to unwrap the `Option<Decimal>` value
29 |
3088 | let rate: Decimal = fx_rate(¤cy).expect("REASON");
31 | +++++++++++++++++
32
33error[E0599]: no method named `to_minor_units` found for struct `Money` in the current scope
34 --> src/posting.rs:141:24
35 |
36141 | let cents = amount.to_minor_units();
37 | ^^^^^^^^^^^^^^ method not found in `Money`
38
39Some errors have detailed explanations: E0308, E0599.
40For more information about an error, try `rustc --explain E0308`.
41error: could not compile `ledger` (lib) due to 2 previous errors
42Running after_script
43$ echo "build failed, skipping package"
44build failed, skipping package
45Uploading artifacts for failed job
46WARNING: target/release/ledger: no matching files. Ensure that the artifact path is relative to the working directory
47ERROR: Job failed: exit code 101