Skip to content

Commit 336314f

Browse files
bors[bot]pellico
andauthored
Merge #658
658: Fixing compilation error when re-exporting module with same name as a Rust package. r=burrbull a=pellico Added self:: when referencing submodule to avoid ambiguity fix issue #657 Co-authored-by: pellico <[email protected]>
2 parents 481f6b8 + 1aeb940 commit 336314f

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1111
- Use `critical_section::with` instead of `interrupt::free` for `Peripherals::take`.
1212
- Bring documentation on how to generate MSP430 PACs up to date (in line with
1313
[msp430_svd](https://github.com/pftbest/msp430_svd)).
14+
- Prefix submodule path with self:: when reexporting submodules to avoid ambiguity in crate path.
1415

1516
## [v0.25.1] - 2022-08-22
1617

src/generate/peripheral.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ pub fn render(p_original: &Peripheral, index: &Index, config: &Config) -> Result
114114
out.extend(quote! {
115115
#[doc = #description]
116116
#feature_any_attribute
117-
pub use #base as #name_snake_case;
117+
pub use self::#base as #name_snake_case;
118118
});
119119
return Ok(out);
120120
}
@@ -170,7 +170,7 @@ pub fn render(p_original: &Peripheral, index: &Index, config: &Config) -> Result
170170
out.extend(quote! {
171171
#[doc = #description]
172172
#feature_attribute
173-
pub use #base as #name_snake_case;
173+
pub use self::#base as #name_snake_case;
174174
});
175175
return Ok(out);
176176
}
@@ -1014,8 +1014,8 @@ fn cluster_block(
10141014

10151015
Ok(quote! {
10161016
#[doc = #description]
1017-
pub use #derived as #name_constant_case;
1018-
pub use #mod_derived as #name_snake_case;
1017+
pub use self::#derived as #name_constant_case;
1018+
pub use self::#mod_derived as #name_snake_case;
10191019
})
10201020
} else {
10211021
let cpath = path.new_cluster(&c.name);
@@ -1032,7 +1032,7 @@ fn cluster_block(
10321032

10331033
Ok(quote! {
10341034
#[doc = #description]
1035-
pub use #name_snake_case::#name_constant_case;
1035+
pub use self::#name_snake_case::#name_constant_case;
10361036

10371037
///Cluster
10381038
#[doc = #description]

0 commit comments

Comments
 (0)