Skip to content

Commit b57dde1

Browse files
CreepySkeletonTeXitoi
authored andcommitted
Update dependencies (#227)
1 parent 8830771 commit b57dde1

File tree

74 files changed

+142
-14
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+142
-14
lines changed

.travis.yml

-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ matrix:
66
- rust: stable
77
- rust: beta
88
- rust: nightly
9-
- rust: nightly
10-
env: FEATURES="--features nightly"
119
- rust: stable
1210
env: RUN=FMT
1311
before_script: rustup component add rustfmt-preview

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ readme = "README.md"
1313

1414
[features]
1515
default = ["clap/default"]
16-
nightly = ["structopt-derive/nightly"]
1716
suggestions = ["clap/suggestions"]
1817
color = ["clap/color"]
1918
wrap_help = ["clap/wrap_help"]
@@ -33,5 +32,6 @@ structopt-derive = { path = "structopt-derive", version = "0.3.0" }
3332

3433
[dev-dependencies]
3534
trybuild = "1.0.5"
35+
version_check = "0.9"
3636

3737
[workspace]

structopt-derive/Cargo.toml

+5-6
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,13 @@ license = "Apache-2.0/MIT"
1414
travis-ci = { repository = "TeXitoi/structopt" }
1515

1616
[dependencies]
17-
syn = { version = "0.15.10", features = ["full"] }
18-
quote = "0.6"
19-
proc-macro2 = "0.4"
20-
heck = "^0.3.0"
21-
proc-macro-error = "0.1"
17+
syn = { version = "1", features = ["full"] }
18+
quote = "1"
19+
proc-macro2 = "1"
20+
heck = "0.3.0"
21+
proc-macro-error = "0.2"
2222

2323
[features]
24-
nightly = ["proc-macro2/nightly"]
2524
paw = []
2625

2726
[lib]

structopt-derive/src/attrs.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ impl Attrs {
295295
.iter()
296296
.filter_map(|attr| {
297297
if attr.path.is_ident("doc") {
298-
attr.interpret_meta()
298+
attr.parse_meta().ok()
299299
} else {
300300
None
301301
}
@@ -304,10 +304,10 @@ impl Attrs {
304304
use crate::Lit::*;
305305
use crate::Meta::*;
306306
if let NameValue(MetaNameValue {
307-
ident, lit: Str(s), ..
307+
path, lit: Str(s), ..
308308
}) = attr
309309
{
310-
if ident != "doc" {
310+
if !path.is_ident("doc") {
311311
return None;
312312
}
313313
let value = s.value();

structopt-derive/src/parse.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ pub fn parse_structopt_attributes(all_attrs: &[Attribute]) -> Vec<StructOptAttr>
193193
.iter()
194194
.filter(|attr| attr.path.is_ident("structopt"))
195195
.flat_map(|attr| {
196-
let attrs: StructOptAttributes = parse2(attr.tts.clone())
196+
let attrs: StructOptAttributes = parse2(attr.tokens.clone())
197197
.map_err(|e| match &*e.to_string() {
198198
// this error message is misleading and points to Span::call_site()
199199
// so we patch it with something meaningful

tests/macro-errors.rs

+12-1
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,19 @@
55
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
66
// option. This file may not be copied, modified, or distributed
77

8+
extern crate version_check;
9+
use version_check::Version;
10+
811
#[test]
912
fn ui() {
1013
let t = trybuild::TestCases::new();
11-
t.compile_fail("tests/ui/*.rs");
14+
15+
t.compile_fail("tests/ui-common/*.rs");
16+
17+
let version = Version::read().unwrap();
18+
if version.at_least("1.39.0") {
19+
t.compile_fail("tests/ui-1.39_post/*.rs");
20+
} else {
21+
t.compile_fail("tests/ui-pre_1.39/*.rs");
22+
}
1223
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
error: Option<Option<T>> type is meaningless for positional argument
2+
--> $DIR/opt_opt_nonpositional.rs:14:8
3+
|
4+
14 | n: Option<Option<u32>>,
5+
| ^^^^^^^^^^^^^^^^^^^
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
error: Option<Vec<T>> type is meaningless for positional argument
2+
--> $DIR/opt_vec_nonpositional.rs:14:8
3+
|
4+
14 | n: Option<Vec<u32>>,
5+
| ^^^^^^^^^^^^^^^^
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
error: Option<Option<T>> type is not allowed for subcommand
2+
--> $DIR/subcommand_opt_opt.rs:18:10
3+
|
4+
18 | cmd: Option<Option<Command>>,
5+
| ^^^^^^^^^^^^^^^^^^^^^^^
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
error: Option<Vec<T>> type is not allowed for subcommand
2+
--> $DIR/subcommand_opt_vec.rs:18:10
3+
|
4+
18 | cmd: Option<Vec<Command>>,
5+
| ^^^^^^^^^^^^^^^^^^^^
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Copyright 2018 Guillaume Pinot (@TeXitoi) <[email protected]>
2+
//
3+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
4+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
5+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
6+
// option. This file may not be copied, modified, or distributed
7+
// except according to those terms.
8+
9+
use structopt::StructOpt;
10+
11+
#[derive(StructOpt, Debug)]
12+
#[structopt(name = "basic")]
13+
struct Opt {
14+
n: Option<Option<u32>>,
15+
}
16+
17+
fn main() {}
+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Copyright 2018 Guillaume Pinot (@TeXitoi) <[email protected]>
2+
//
3+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
4+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
5+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
6+
// option. This file may not be copied, modified, or distributed
7+
// except according to those terms.
8+
9+
use structopt::StructOpt;
10+
11+
#[derive(StructOpt, Debug)]
12+
#[structopt(name = "basic")]
13+
struct Opt {
14+
n: Option<Vec<u32>>,
15+
}
16+
17+
fn main() {}
+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// Copyright 2018 Guillaume Pinot (@TeXitoi) <[email protected]>
2+
//
3+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
4+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
5+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
6+
// option. This file may not be copied, modified, or distributed
7+
// except according to those terms.
8+
9+
use structopt::StructOpt;
10+
11+
#[derive(StructOpt)]
12+
#[structopt(name = "make-cookie")]
13+
struct MakeCookie {
14+
#[structopt(short)]
15+
s: String,
16+
17+
#[structopt(subcommand)]
18+
cmd: Option<Option<Command>>,
19+
}
20+
21+
#[derive(StructOpt)]
22+
enum Command {
23+
#[structopt(name = "pound")]
24+
/// Pound acorns into flour for cookie dough.
25+
Pound { acorns: u32 },
26+
27+
Sparkle {
28+
#[structopt(short)]
29+
color: String,
30+
},
31+
}
32+
33+
fn main() {}
+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// Copyright 2018 Guillaume Pinot (@TeXitoi) <[email protected]>
2+
//
3+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
4+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
5+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
6+
// option. This file may not be copied, modified, or distributed
7+
// except according to those terms.
8+
9+
use structopt::StructOpt;
10+
11+
#[derive(StructOpt)]
12+
#[structopt(name = "make-cookie")]
13+
struct MakeCookie {
14+
#[structopt(short)]
15+
s: String,
16+
17+
#[structopt(subcommand)]
18+
cmd: Option<Vec<Command>>,
19+
}
20+
21+
#[derive(StructOpt)]
22+
enum Command {
23+
#[structopt(name = "pound")]
24+
/// Pound acorns into flour for cookie dough.
25+
Pound { acorns: u32 },
26+
27+
Sparkle {
28+
#[structopt(short)]
29+
color: String,
30+
},
31+
}
32+
33+
fn main() {}

0 commit comments

Comments
 (0)