diff --git a/bindgen/lib.rs b/bindgen/lib.rs index 8a7453bbcd..9e22e37ce6 100644 --- a/bindgen/lib.rs +++ b/bindgen/lib.rs @@ -208,7 +208,7 @@ impl std::fmt::Display for Formatter { Self::Prettyplease => "prettyplease", }; - s.fmt(f) + std::fmt::Display::fmt(&s, f) } } @@ -999,6 +999,12 @@ impl Bindings { cmd.args(["--config-path", path]); } + let edition = self + .options + .rust_edition + .unwrap_or_else(|| self.options.rust_target.latest_edition()); + cmd.args(["--edition", &format!("{edition}")]); + let mut child = cmd.spawn()?; let mut child_stdin = child.stdin.take().unwrap(); let mut child_stdout = child.stdout.take().unwrap();