compilation fails with rustc-1.39.0
Closed this issue · 2 comments
d-xo commented
cargo build
fails locally. I'm not really into rust, am I doing something wrong?
$ rustc --version
rustc 1.39.0
$ cargo --version
cargo 1.39.0
$ cargo build
Compiling git-remote-s3 v0.1.1 (/home/me/code/mine/git-remote-s3)
error: expected one of `!`, `,`, `.`, `::`, `?`, `{`, `}`, or an operator, found `None`
--> src/main.rs:61:13
|
60 | Some(idx) => idx
| -- - expected one of 8 possible tokens here
| |
| while parsing the `match` arm starting here
61 | None =>
| ^^^^ unexpected token
error: expected one of `.`, `;`, `?`, or an operator, found `let`
--> src/main.rs:65:9
|
64 | }
| - help: a semicolon may be missing here
65 | let bucket = url.get(..slash).unwrap();
| ^^^
warning: unreachable statement
--> src/main.rs:65:9
|
59 | let slash = match url.find('/') {
| _____________________-
60 | | Some(idx) => idx
61 | | None =>
62 | | bail!("remote url does not appear to have a prefix. expected a url in the format s3://bucket/prefix")
63 | | 0
64 | | }
| |_________- any code following this expression is unreachable
65 | let bucket = url.get(..slash).unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unreachable statement
|
= note: `#[warn(unreachable_code)]` on by default
error: aborting due to 2 previous errors
error: could not compile `git-remote-s3`.
To learn more, run the command again with --verbose.
bgahagan commented
Thanks for letting me know @xwvvvvwx. Looks like I was missing some brackets required by 1.39. The latest code on master should now compile on 1.39
d-xo commented
confirmed, builds now 🙂 🙏