Skip to content

Commit 34d3c13

Browse files
committed
Fix publishing again
1 parent fa1cc5a commit 34d3c13

File tree

3 files changed

+44
-9
lines changed

3 files changed

+44
-9
lines changed

codegen/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ documentation = "https://docs.rs/gluon"
1616
proc-macro = true
1717

1818
[dependencies]
19-
syn = "1"
19+
syn = { version = "1", features = ["extra-traits"] }
2020
quote = "1"
2121
proc-macro2 = "1"
2222

codegen/src/attr.rs

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
use proc_macro2::{Group, Span, TokenStream, TokenTree};
22

3-
use syn::{
4-
self,
5-
parse::{self, Parse},
6-
Meta::*,
7-
Path,
3+
use {
4+
quote::ToTokens,
5+
syn::{
6+
self,
7+
parse::{self, Parse},
8+
Meta::*,
9+
Path,
10+
},
811
};
912

1013
fn get_gluon_meta_items(attr: &syn::Attribute) -> Option<Vec<syn::NestedMeta>> {
@@ -84,7 +87,18 @@ impl Container {
8487
Some(get_lit_str(&m.path, &m.path, &m.lit).unwrap().value())
8588
}
8689

87-
_ => panic!("unexpected gluon container attribute: {:?}", meta_item),
90+
Meta(meta_item) => {
91+
let path = meta_item
92+
.path()
93+
.into_token_stream()
94+
.to_string()
95+
.replace(' ', "");
96+
panic!("unexpected gluon container attribute: `{}`", path)
97+
}
98+
99+
Lit(_) => {
100+
panic!("Unexpected literal in gluon container attribute",);
101+
}
88102
}
89103
}
90104
}
@@ -108,7 +122,10 @@ fn get_lit_str<'a>(
108122
if let syn::Lit::Str(ref lit) = *lit {
109123
Ok(lit)
110124
} else {
111-
panic!("Expected attribute `{:?}` to be a string", attr_name)
125+
panic!(
126+
"Expected attribute `{:?}` to be a string",
127+
attr_name.into_token_stream().to_string().replace(' ', "")
128+
)
112129
}
113130
}
114131

scripts/travis.sh

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,20 @@ export RUST_BACKTRACE=1
55

66
# Split the tests into two on travis so to avoid timing out
77

8+
declare -a PROJECTS=(
9+
gluon_codegen
10+
gluon_base
11+
gluon_parser
12+
gluon_check
13+
gluon_completion
14+
gluon_vm
15+
gluon_format
16+
gluon
17+
gluon_c-api
18+
gluon_doc
19+
gluon_repl
20+
)
21+
822
if [ -z $NO_NORMAL_TEST ]; then
923
cargo test --features "test" --all "$@"
1024
cargo test --features "test" --all --bins "$@"
@@ -17,5 +31,9 @@ if [ -z $NO_NORMAL_TEST ]; then
1731
echo "TRAVIS_RUST_VERSION=$TRAVIS_RUST_VERSION"
1832
(echo $TRAVIS_RUST_VERSION | grep nightly) && cargo test --features "test nightly" -p gluon --test compiletest "$@"
1933

20-
cargo check --all --no-default-features "$@"
34+
# Check each crate individually so that features from one do not affect another which would break publish
35+
for PROJECT in "${PROJECTS[@]}"
36+
do
37+
cargo check --package "${PROJECT}" --no-default-features "$@"
38+
done
2139
fi

0 commit comments

Comments
 (0)