Repository: immunant/c2rust (language: rust)

Issue:
Fails to compile on latest nightly
See https://github.com/time-rs/time/issues/681, it seems like some dependencies need to be updated since it isn't used directly...

Adding the following to Cargo.toml in this repository seems to fix it for the time being.
```
[patch.crates-io]
time = { git = "https://github.com/time-rs/time" }
```

Update: I think the correct fix would actually be updating Cargo.lock and the time-macros crate.


Discussion / hints:
With the risk of stating the obvious, this is also causing `cargo install c2rust` to fail.
Note that c2rust used to compile just fine also on stable Rust. So as theoparis mentioned in the update, unlocking time-rs-macros sounds like the way to go. We need time 0.3.35 to fix the build issue, which needs Rust 1.67, which is more recent than the currently locked nightly.

Fix patch:
diff --git a/Cargo.lock b/Cargo.lock
index 2a8d9e267f..ea76e32fa3 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -181,12 +181,10 @@ dependencies = [
  "c2rust-transpile",
  "clap 3.2.25",
  "env_logger",
- "git-testament",
  "is_executable",
  "log",
  "regex",
  "shlex",
- "time-macros",
 ]
 
 [[package]]
@@ -749,29 +747,6 @@ version = "0.27.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "ad0a93d233ebf96623465aad4046a8d3aa4da22d4f4beba5388838c8a434bbb4"
 
-[[package]]
-name = "git-testament"
-version = "0.2.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "986bf57c808270f3a0a0652c3bfce0f5d667aa5f5b465616dc697c7f390834b1"
-dependencies = [
- "git-testament-derive",
- "no-std-compat",
-]
-
-[[package]]
-name = "git-testament-derive"
-version = "0.1.14"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4a782db5866c7ab75f3552dda4cbf34e3e257cc64c963c6ed5af1e12818e8ae6"
-dependencies = [
- "log",
- "proc-macro2",
- "quote",
- "syn 1.0.109",
- "time",
-]
-
 [[package]]
 name = "glob"
 version = "0.3.1"
@@ -1016,12 +991,6 @@ dependencies = [
  "adler",
 ]
 
-[[package]]
-name = "no-std-compat"
-version = "0.4.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b93853da6d84c2e3c7d730d6473e8817692dd89be387eb01b94d7f108ecb5b8c"
-
 [[package]]
 name = "nom"
 version = "7.1.3"
@@ -1482,33 +1451,6 @@ dependencies = [
  "once_cell",
 ]
 
-[[package]]
-name = "time"
-version = "0.3.18"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "af0097eaf301d576d0b2aead7a59facab6d53cc636340f0291fab8446a2e8613"
-dependencies = [
- "itoa",
- "serde",
- "time-core",
- "time-macros",
-]
-
-[[package]]
-name = "time-core"
-version = "0.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2e153e1f1acaef8acc537e68b44906d2db6436e2b35ac2c6b42640fff91f00fd"
-
-[[package]]
-name = "time-macros"
-version = "0.2.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d967f99f534ca7e495c575c62638eebc2898a8c84c119b89e250477bc4ba16b2"
-dependencies = [
- "time-core",
-]
-
 [[package]]
 name = "toml_datetime"
 version = "0.6.1"
diff --git a/c2rust/Cargo.toml b/c2rust/Cargo.toml
index 0288e0819d..a763b68382 100644
--- a/c2rust/Cargo.toml
+++ b/c2rust/Cargo.toml
@@ -20,14 +20,11 @@ azure-devops = { project = "immunant/c2rust", pipeline = "immunant.c2rust", buil
 anyhow = "1.0"
 clap = { version = "3.2.22", features = ["yaml", "cargo", "derive"] }
 env_logger = "0.10"
-git-testament = "0.2.1"
 is_executable = "1.0"
 log = "0.4"
 regex = "1.3"
 shlex = "1.3"
 c2rust-transpile = { version = "0.18.0", path = "../c2rust-transpile" }
-# Required to avoid too-new version (dep of git-testament) which our rustc cannot compile
-time-macros = "=0.2.6"
 
 [build-dependencies]
 c2rust-build-paths = { path = "../c2rust-build-paths", version = "0.18.0" }
diff --git a/c2rust/src/main.rs b/c2rust/src/main.rs
index 59b0918098..a17f39f5c7 100644
--- a/c2rust/src/main.rs
+++ b/c2rust/src/main.rs
@@ -1,6 +1,5 @@
 use anyhow::anyhow;
 use clap::{crate_authors, App, AppSettings, Arg};
-use git_testament::{git_testament, render_testament};
 use is_executable::IsExecutable;
 use std::borrow::Cow;
 use std::collections::HashMap;
@@ -11,8 +10,6 @@ use std::process;
 use std::process::Command;
 use std::str;
 
-git_testament!(TESTAMENT);
-
 /// A `c2rust` sub-command.
 struct SubCommand {
     /// The path to the [`SubCommand`]'s executable,
@@ -124,7 +121,7 @@ fn main() -> anyhow::Result<()> {
 
     // If we didn't get a subcommand, then use `clap` for parsing and error/help messages.
     let matches = App::new("C2Rust")
-        .version(&*render_testament!(TESTAMENT))
+        .version(env!("CARGO_PKG_VERSION"))
         .author(crate_authors!(", "))
         .settings(&[AppSettings::SubcommandRequiredElseHelp])
         .subcommands(sub_commands.keys().map(|name| {


Test patch: