Skip to content

Commit ceca014

Browse files
authored
Update deps (#3788)
1 parent 6fec3a6 commit ceca014

File tree

14 files changed

+401
-468
lines changed

14 files changed

+401
-468
lines changed

Cargo.lock

+293-319
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+6-7
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ rustfmt-format-diff = []
3434
generic-simd = ["bytecount/generic-simd"]
3535

3636
[dependencies]
37-
atty = "0.2"
3837
itertools = "0.8"
3938
toml = "0.5"
4039
serde = { version = "1.0", features = ["derive"] }
@@ -48,19 +47,19 @@ env_logger = "0.6"
4847
getopts = "0.2"
4948
derive-new = "0.5"
5049
cargo_metadata = "0.8"
51-
rustc-ap-rustc_target = "581.0.0"
52-
rustc-ap-syntax = "581.0.0"
53-
rustc-ap-syntax_pos = "581.0.0"
50+
rustc-ap-rustc_target = "583.0.0"
51+
rustc-ap-syntax = "583.0.0"
52+
rustc-ap-syntax_pos = "583.0.0"
5453
failure = "0.1.3"
55-
bytecount = "0.5"
54+
bytecount = "0.6"
5655
unicode-width = "0.1.5"
5756
unicode_categories = "0.1.1"
5857
dirs = "2.0.1"
5958
ignore = "0.4.6"
6059
annotate-snippets = { version = "0.6", features = ["ansi_term"] }
61-
structopt = "0.2.18"
60+
structopt = "0.3"
6261

63-
rustfmt-config_proc_macro = { version = "0.1.2", path = "config_proc_macro" }
62+
rustfmt-config_proc_macro = { version = "0.2", path = "config_proc_macro" }
6463

6564
# A noop dependency that changes in the Rust repository, it's a bit of a hack.
6665
# See the `src/tools/rustc-workspace-hack/README.md` file in `rust-lang/rust`

config_proc_macro/Cargo.lock

+25-25
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config_proc_macro/Cargo.toml

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "rustfmt-config_proc_macro"
3-
version = "0.1.2"
3+
version = "0.2.0"
44
authors = ["topecongiro <[email protected]>"]
55
edition = "2018"
66
description = "A collection of procedural macros for rustfmt"
@@ -12,9 +12,9 @@ repository = "https://github.com/rust-lang/rustfmt"
1212
proc-macro = true
1313

1414
[dependencies]
15-
proc-macro2 = "0.4"
16-
quote = "0.6"
17-
syn = { version = "0.15", features = ["full", "visit"] }
15+
proc-macro2 = "1.0"
16+
quote = "1.0"
17+
syn = { version = "1.0", features = ["full", "visit"] }
1818

1919
[dev-dependencies]
2020
serde = { version = "1.0", features = ["derive"] }

config_proc_macro/src/attrs.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -39,19 +39,19 @@ pub fn is_config_value(attr: &syn::Attribute) -> bool {
3939
}
4040

4141
fn is_attr_name_value(attr: &syn::Attribute, name: &str) -> bool {
42-
attr.interpret_meta().map_or(false, |meta| match meta {
43-
syn::Meta::NameValue(syn::MetaNameValue { ref ident, .. }) if ident == name => true,
42+
attr.parse_meta().ok().map_or(false, |meta| match meta {
43+
syn::Meta::NameValue(syn::MetaNameValue { ref path, .. }) if path.is_ident(name) => true,
4444
_ => false,
4545
})
4646
}
4747

4848
fn get_name_value_str_lit(attr: &syn::Attribute, name: &str) -> Option<String> {
49-
attr.interpret_meta().and_then(|meta| match meta {
49+
attr.parse_meta().ok().and_then(|meta| match meta {
5050
syn::Meta::NameValue(syn::MetaNameValue {
51-
ref ident,
51+
ref path,
5252
lit: syn::Lit::Str(ref lit_str),
5353
..
54-
}) if ident == name => Some(lit_str.value()),
54+
}) if path.is_ident(name) => Some(lit_str.value()),
5555
_ => None,
5656
})
5757
}

src/cargo-fmt/main.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ use structopt::StructOpt;
2020
#[derive(StructOpt, Debug)]
2121
#[structopt(
2222
bin_name = "cargo fmt",
23-
author = "",
2423
about = "This utility formats all bin and lib files of \
2524
the current crate using rustfmt."
2625
)]
@@ -51,7 +50,7 @@ pub struct Opts {
5150

5251
/// Options passed to rustfmt
5352
// 'raw = true' to make `--` explicit.
54-
#[structopt(name = "rustfmt_options", raw(raw = "true"))]
53+
#[structopt(name = "rustfmt_options", raw(true))]
5554
rustfmt_options: Vec<String>,
5655

5756
/// Format all packages (only usable in workspaces)

src/config/options.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ use std::collections::{hash_set, HashSet};
22
use std::fmt;
33
use std::path::{Path, PathBuf};
44

5-
use atty;
65
use itertools::Itertools;
76
use rustfmt_config_proc_macro::config_type;
87
use serde::de::{SeqAccess, Visitor};
@@ -147,17 +146,16 @@ pub enum Color {
147146
pub enum Version {
148147
/// 1.x.y. When specified, rustfmt will format in the same style as 1.0.0.
149148
One,
150-
/// 2.x.y. When specified, rustfmt will formatin the the latest style.
149+
/// 2.x.y. When specified, rustfmt will format in the the latest style.
151150
Two,
152151
}
153152

154153
impl Color {
155154
/// Whether we should use a coloured terminal.
156155
pub fn use_colored_tty(self) -> bool {
157156
match self {
158-
Color::Always => true,
157+
Color::Always | Color::Auto => true,
159158
Color::Never => false,
160-
Color::Auto => atty::is(atty::Stream::Stdout),
161159
}
162160
}
163161
}

0 commit comments

Comments
 (0)