Skip to content

Commit

Permalink
Update --pretty=expanded to -Zunpretty=expanded
Browse files Browse the repository at this point in the history
`--pretty` is gone as of rust-lang/rust#83491
  • Loading branch information
badboy committed Jul 28, 2021
1 parent 57add9c commit d7d8606
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 13 deletions.
6 changes: 3 additions & 3 deletions docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ trailer = "/* Text to put at the end of the generated file */"
# default: doesn't emit an include guard
include_guard = "mozilla_wr_bindings_h"

# Whether to add a `#pragma once` guard
# Whether to add a `#pragma once` guard
# default: doesn't emit a `#pragma once`
pragma_once = true

Expand Down Expand Up @@ -937,7 +937,7 @@ include = ["webrender", "webrender_traits"]
# default: []
exclude = ["libc"]

# Whether to use a new temporary target directory when running `rustc --pretty=expanded`.
# Whether to use a new temporary target directory when running `rustc -Zunpretty=expanded`.
# This may be required for some build processes.
#
# default: false
Expand Down Expand Up @@ -982,7 +982,7 @@ features = ["cbindgen"]
[ptr]
# An optional string to decorate all pointers that are
# required to be non null. Nullability is inferred from the Rust type: `&T`,
# `&mut T` and `NonNull<T>` all require a valid pointer value.
# `&mut T` and `NonNull<T>` all require a valid pointer value.
non_null_attribute = "_Nonnull"

# Options specific to Cython bindings.
Expand Down
8 changes: 3 additions & 5 deletions src/bindgen/cargo/cargo_expand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ extern crate tempfile;
use self::tempfile::Builder;

#[derive(Debug)]
/// Possible errors that can occur during `rustc --pretty=expanded`.
/// Possible errors that can occur during `rustc -Zunpretty=expanded`.
pub enum Error {
/// Error during creation of temporary directory
Io(io::Error),
/// Output of `cargo metadata` was not valid utf8
Utf8(Utf8Error),
/// Error during execution of `cargo rustc --pretty=expanded`
/// Error during execution of `cargo rustc -Zunpretty=expanded`
Compile(String),
}

Expand Down Expand Up @@ -127,9 +127,7 @@ pub fn expand(
cmd.arg(&package);
cmd.arg("--verbose");
cmd.arg("--");
cmd.arg("-Z");
cmd.arg("unstable-options");
cmd.arg("--pretty=expanded");
cmd.arg("-Zunpretty=expanded");
info!("Command: {:?}", cmd);
let output = cmd.output()?;

Expand Down
8 changes: 4 additions & 4 deletions src/bindgen/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -717,13 +717,13 @@ impl FromStr for Profile {

deserialize_enum_str!(Profile);

/// Settings to apply when running `rustc --pretty=expanded`
/// Settings to apply when running `rustc -Zunpretty=expanded`
#[derive(Debug, Clone, Deserialize)]
#[serde(rename_all = "snake_case")]
#[serde(deny_unknown_fields)]
#[serde(default)]
pub struct ParseExpandConfig {
/// The names of crates to parse with `rustc --pretty=expanded`
/// The names of crates to parse with `rustc -Zunpretty=expanded`
pub crates: Vec<String>,
/// Whether to enable all the features when expanding.
pub all_features: bool,
Expand Down Expand Up @@ -806,10 +806,10 @@ pub struct ParseConfig {
pub include: Option<Vec<String>>,
/// The names of crates to not parse
pub exclude: Vec<String>,
/// The configuration options for `rustc --pretty=expanded`
/// The configuration options for `rustc -Zunpretty=expanded`
#[serde(deserialize_with = "retrocomp_parse_expand_config_deserialize")]
pub expand: ParseExpandConfig,
/// Whether to use a new temporary target directory when running `rustc --pretty=expanded`.
/// Whether to use a new temporary target directory when running `rustc -Zunpretty=expanded`.
/// This may be required for some build processes.
pub clean: bool,
/// List of crate names which generate consts, statics, and fns. By default
Expand Down
2 changes: 1 addition & 1 deletion src/bindgen/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ impl fmt::Display for Error {
}
Error::CargoExpand(ref crate_name, ref error) => write!(
f,
"Parsing crate `{}`: couldn't run `cargo rustc --pretty=expanded`: {:?}",
"Parsing crate `{}`: couldn't run `cargo rustc -Zunpretty=expanded`: {:?}",
crate_name, error
),
Error::ParseSyntaxError {
Expand Down

0 comments on commit d7d8606

Please sign in to comment.