Skip to content

Update deps #3788

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Sep 8, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
612 changes: 293 additions & 319 deletions Cargo.lock

Large diffs are not rendered by default.

13 changes: 6 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ rustfmt-format-diff = []
generic-simd = ["bytecount/generic-simd"]

[dependencies]
atty = "0.2"
itertools = "0.8"
toml = "0.5"
serde = { version = "1.0", features = ["derive"] }
Expand All @@ -48,19 +47,19 @@ env_logger = "0.6"
getopts = "0.2"
derive-new = "0.5"
cargo_metadata = "0.8"
rustc-ap-rustc_target = "581.0.0"
rustc-ap-syntax = "581.0.0"
rustc-ap-syntax_pos = "581.0.0"
rustc-ap-rustc_target = "583.0.0"
rustc-ap-syntax = "583.0.0"
rustc-ap-syntax_pos = "583.0.0"
failure = "0.1.3"
bytecount = "0.5"
bytecount = "0.6"
unicode-width = "0.1.5"
unicode_categories = "0.1.1"
dirs = "2.0.1"
ignore = "0.4.6"
annotate-snippets = { version = "0.6", features = ["ansi_term"] }
structopt = "0.2.18"
structopt = "0.3"

rustfmt-config_proc_macro = { version = "0.1.2", path = "config_proc_macro" }
rustfmt-config_proc_macro = { version = "0.2", path = "config_proc_macro" }

# A noop dependency that changes in the Rust repository, it's a bit of a hack.
# See the `src/tools/rustc-workspace-hack/README.md` file in `rust-lang/rust`
Expand Down
50 changes: 25 additions & 25 deletions config_proc_macro/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions config_proc_macro/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rustfmt-config_proc_macro"
version = "0.1.2"
version = "0.2.0"
authors = ["topecongiro <[email protected]>"]
edition = "2018"
description = "A collection of procedural macros for rustfmt"
Expand All @@ -12,9 +12,9 @@ repository = "https://github.com/rust-lang/rustfmt"
proc-macro = true

[dependencies]
proc-macro2 = "0.4"
quote = "0.6"
syn = { version = "0.15", features = ["full", "visit"] }
proc-macro2 = "1.0"
quote = "1.0"
syn = { version = "1.0", features = ["full", "visit"] }

[dev-dependencies]
serde = { version = "1.0", features = ["derive"] }
Expand Down
10 changes: 5 additions & 5 deletions config_proc_macro/src/attrs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,19 @@ pub fn is_config_value(attr: &syn::Attribute) -> bool {
}

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

fn get_name_value_str_lit(attr: &syn::Attribute, name: &str) -> Option<String> {
attr.interpret_meta().and_then(|meta| match meta {
attr.parse_meta().ok().and_then(|meta| match meta {
syn::Meta::NameValue(syn::MetaNameValue {
ref ident,
ref path,
lit: syn::Lit::Str(ref lit_str),
..
}) if ident == name => Some(lit_str.value()),
}) if path.is_ident(name) => Some(lit_str.value()),
_ => None,
})
}
3 changes: 1 addition & 2 deletions src/cargo-fmt/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ use structopt::StructOpt;
#[derive(StructOpt, Debug)]
#[structopt(
bin_name = "cargo fmt",
author = "",
about = "This utility formats all bin and lib files of \
the current crate using rustfmt."
)]
Expand Down Expand Up @@ -51,7 +50,7 @@ pub struct Opts {

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

/// Format all packages (only usable in workspaces)
Expand Down
6 changes: 2 additions & 4 deletions src/config/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ use std::collections::{hash_set, HashSet};
use std::fmt;
use std::path::{Path, PathBuf};

use atty;
use itertools::Itertools;
use rustfmt_config_proc_macro::config_type;
use serde::de::{SeqAccess, Visitor};
Expand Down Expand Up @@ -147,17 +146,16 @@ pub enum Color {
pub enum Version {
/// 1.x.y. When specified, rustfmt will format in the same style as 1.0.0.
One,
/// 2.x.y. When specified, rustfmt will formatin the the latest style.
/// 2.x.y. When specified, rustfmt will format in the the latest style.
Two,
}

impl Color {
/// Whether we should use a coloured terminal.
pub fn use_colored_tty(self) -> bool {
match self {
Color::Always => true,
Color::Always | Color::Auto => true,
Color::Never => false,
Color::Auto => atty::is(atty::Stream::Stdout),
}
}
}
Expand Down
Loading