Skip to content

Commit d562e8d

Browse files
committed
release(statum): prepare 0.8.4
1 parent 8d4e0e5 commit d562e8d

9 files changed

Lines changed: 37 additions & 55 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Statum targets stable Rust and currently supports Rust `1.93+`.
3434

3535
```toml
3636
[dependencies]
37-
statum = "0.8.3"
37+
statum = "0.8.4"
3838
```
3939

4040
## 60-Second Example

statum-core/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ name = "statum-core"
2020
readme = "README.md"
2121
repository = "https://github.com/eboody/statum"
2222
rust-version = "1.93"
23-
version = "0.8.3"
23+
version = "0.8.4"
2424

2525
[package.metadata.modum]
2626
weak_modules = [

statum-examples/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ version = "0.8"
2121

2222
[dependencies.statum]
2323
path = "../statum"
24-
version = "0.8.3"
24+
version = "0.8.4"
2525

2626
[dependencies.tokio]
2727
features = ["full"]
@@ -37,7 +37,7 @@ license = "MIT"
3737
name = "statum-examples"
3838
publish = false
3939
rust-version = "1.93"
40-
version = "0.8.3"
40+
version = "0.8.4"
4141

4242
[package.metadata.modum]
4343
weak_modules = [

statum-macros/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ trybuild = "1.0"
2222

2323
[dev-dependencies.statum-core]
2424
path = "../statum-core"
25-
version = "0.8.3"
25+
version = "0.8.4"
2626

2727
[features]
2828
default = []
@@ -48,4 +48,4 @@ name = "statum-macros"
4848
readme = "README.md"
4949
repository = "https://github.com/eboody/statum"
5050
rust-version = "1.93"
51-
version = "0.8.3"
51+
version = "0.8.4"

statum-macros/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ pub fn validators(attr: TokenStream, item: TokenStream) -> TokenStream {
227227
fn resolved_current_module_path(span: Span, macro_name: &str) -> Result<String, TokenStream> {
228228
let resolved = module_path_for_span(span)
229229
.or_else(current_module_path_opt)
230-
.or_else(|| crate::machine::is_rust_analyzer().then_some("crate".to_string()));
230+
.or_else(|| crate::callsite::source_info_for_span(span).is_none().then_some("crate".to_string()));
231231

232232
resolved.ok_or_else(|| {
233233
let message = format!(

statum-macros/src/machine/metadata.rs

Lines changed: 20 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -86,35 +86,26 @@ impl MachineInfo {
8686
pub fn from_item_struct(item: &ItemStruct) -> syn::Result<Self> {
8787
let line_number = item.ident.span().start().line;
8888
let Some((file_path, line_number)) = source_info_for_span(item.ident.span()) else {
89-
if is_rust_analyzer() {
90-
return Ok(Self {
91-
name: item.ident.to_string(),
92-
vis: item.vis.to_token_stream().to_string(),
93-
derives: item
94-
.attrs
95-
.iter()
96-
.filter_map(extract_derives)
97-
.flatten()
98-
.collect(),
99-
presentation: parse_present_attrs(&item.attrs)?,
100-
presentation_types: parse_presentation_types_attr(&item.attrs)?,
101-
module_path: "crate".into(),
102-
line_number,
103-
fields: collect_fields(item),
104-
generics: item.generics.to_token_stream().to_string(),
105-
state_generic_name: extract_state_generic_name(&item.generics),
106-
file_path: None,
107-
crate_root: std::env::var("CARGO_MANIFEST_DIR").ok(),
108-
file_fingerprint: None,
109-
});
110-
}
111-
return Err(syn::Error::new(
112-
item.ident.span(),
113-
format!(
114-
"Internal error: could not read source information for `#[machine]` struct `{}`.",
115-
item.ident
116-
),
117-
));
89+
return Ok(Self {
90+
name: item.ident.to_string(),
91+
vis: item.vis.to_token_stream().to_string(),
92+
derives: item
93+
.attrs
94+
.iter()
95+
.filter_map(extract_derives)
96+
.flatten()
97+
.collect(),
98+
presentation: parse_present_attrs(&item.attrs)?,
99+
presentation_types: parse_presentation_types_attr(&item.attrs)?,
100+
module_path: "crate".into(),
101+
line_number,
102+
fields: collect_fields(item),
103+
generics: item.generics.to_token_stream().to_string(),
104+
state_generic_name: extract_state_generic_name(&item.generics),
105+
file_path: None,
106+
crate_root: std::env::var("CARGO_MANIFEST_DIR").ok(),
107+
file_fingerprint: None,
108+
});
118109
};
119110
let Some(module_path) = module_path_for_line(&file_path, line_number) else {
120111
if is_rust_analyzer() {

statum-macros/src/state.rs

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -340,21 +340,12 @@ impl EnumInfo {
340340
pub fn from_item_enum(item: &ItemEnum) -> syn::Result<Self> {
341341
let line_number = item.ident.span().start().line;
342342
let Some((file_path, line_number)) = source_info_for_span(item.ident.span()) else {
343-
if crate::machine::is_rust_analyzer() {
344-
return Self::from_item_enum_with_module_and_file(
345-
item,
346-
"crate".into(),
347-
None,
348-
line_number,
349-
);
350-
}
351-
return Err(syn::Error::new(
352-
item.ident.span(),
353-
format!(
354-
"Internal error: could not read source information for `#[state]` enum `{}`.",
355-
item.ident
356-
),
357-
));
343+
return Self::from_item_enum_with_module_and_file(
344+
item,
345+
"crate".into(),
346+
None,
347+
line_number,
348+
);
358349
};
359350
let Some(module_path) = module_path_for_line(&file_path, line_number) else {
360351
if crate::machine::is_rust_analyzer() {

statum/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
[dependencies.statum-core]
22
path = "../statum-core"
3-
version = "0.8.3"
3+
version = "0.8.4"
44

55
[dependencies.statum-macros]
66
path = "../statum-macros"
7-
version = "0.8.3"
7+
version = "0.8.4"
88

99
[dev-dependencies.tokio]
1010
features = ["full"]
@@ -28,7 +28,7 @@ name = "statum"
2828
readme = "README.md"
2929
repository = "https://github.com/eboody/statum"
3030
rust-version = "1.93"
31-
version = "0.8.3"
31+
version = "0.8.4"
3232

3333
[package.metadata.modum]
3434
generic_nouns = [

statum/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ This crate re-exports:
1919

2020
```toml
2121
[dependencies]
22-
statum = "0.8.3"
22+
statum = "0.8.4"
2323
```
2424

2525
Statum targets stable Rust and currently supports Rust `1.93+`.

0 commit comments

Comments
 (0)