Skip to content

Commit 6ced433

Browse files
committed
rename const-generic to array_proxy
1 parent 3ff94c7 commit 6ced433

File tree

7 files changed

+13
-11
lines changed

7 files changed

+13
-11
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ jobs:
7575
- { rust: stable, vendor: Spansion, options: "--atomics" }
7676
- { rust: stable, vendor: STMicro, options: "" }
7777
- { rust: stable, vendor: STMicro, options: "--atomics" }
78-
- { rust: stable, vendor: STM32-patched, options: "--strict --const_generic --pascal_enum_values --max_cluster_size --atomics --atomics_feature atomics" }
78+
- { rust: stable, vendor: STM32-patched, options: "--strict --array_proxy --pascal_enum_values --max_cluster_size --atomics --atomics_feature atomics" }
7979
- { rust: stable, vendor: Toshiba, options: all }
8080
- { rust: stable, vendor: Toshiba, options: "" }
8181
# Test MSRV

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/).
77

88
## [Unreleased]
99

10+
- rename `const-generic` feature to `array_proxy`
11+
1012
## [v0.30.3] - 2023-11-19
1113

1214
- Remove unstable lints

ci/script.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ main() {
3131

3232
case $OPTIONS in
3333
all)
34-
options="--const_generic --strict --atomics"
34+
options="--array_proxy --strict --atomics"
3535
;;
3636
*)
3737
options=$OPTIONS

src/generate/device.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ pub fn render(d: &Device, config: &Config, device_x: &mut String) -> Result<Toke
157157
}
158158
writeln!(file, "\n{generic_atomic_file}")?;
159159
}
160-
if config.const_generic {
160+
if config.array_proxy {
161161
writeln!(file, "{array_proxy}")?;
162162
}
163163

@@ -177,7 +177,7 @@ pub fn render(d: &Device, config: &Config, device_x: &mut String) -> Result<Toke
177177
}
178178
syn::parse_file(generic_atomic_file)?.to_tokens(&mut tokens);
179179
}
180-
if config.const_generic {
180+
if config.array_proxy {
181181
syn::parse_file(array_proxy)?.to_tokens(&mut tokens);
182182
}
183183

src/generate/peripheral.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1113,7 +1113,7 @@ fn expand_cluster(cluster: &Cluster, config: &Config) -> Result<Vec<RegisterBloc
11131113
size: cluster_size * array_info.dim,
11141114
accessors,
11151115
});
1116-
} else if sequential_indexes_from0 && config.const_generic {
1116+
} else if sequential_indexes_from0 && config.array_proxy {
11171117
// Include a ZST ArrayProxy giving indexed access to the
11181118
// elements.
11191119
let ap_path = array_proxy_type(ty, array_info);
@@ -1221,7 +1221,7 @@ fn expand_register(
12211221
let array_proxy_convertible = ac && disjoint_sequential_addresses;
12221222
let ty = name_to_ty(&ty_name);
12231223

1224-
if array_convertible || (array_proxy_convertible && config.const_generic) {
1224+
if array_convertible || (array_proxy_convertible && config.array_proxy) {
12251225
let span = Span::call_site();
12261226
let nb_name_sc = if let Some(dim_name) = array_info.dim_name.as_ref() {
12271227
util::fullname(dim_name, &info.alternate_group, config.ignore_groups)

src/main.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,11 @@ fn run() -> Result<()> {
8080
.value_name("FEATURE"),
8181
)
8282
.arg(
83-
Arg::new("const_generic")
84-
.long("const_generic")
83+
Arg::new("array_proxy")
84+
.long("array_proxy")
8585
.action(ArgAction::SetTrue)
8686
.help(
87-
"Use const generics to generate writers for same fields with different offsets",
87+
"Use ArrayProxy helper for non-sequential register arrays",
8888
),
8989
)
9090
.arg(

src/util.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ pub struct Config {
3636
#[cfg_attr(feature = "serde", serde(default))]
3737
pub make_mod: bool,
3838
#[cfg_attr(feature = "serde", serde(default))]
39-
pub const_generic: bool,
39+
pub array_proxy: bool,
4040
#[cfg_attr(feature = "serde", serde(default))]
4141
pub ignore_groups: bool,
4242
#[cfg_attr(feature = "serde", serde(default))]
@@ -114,7 +114,7 @@ impl Default for Config {
114114
atomics_feature: None,
115115
generic_mod: false,
116116
make_mod: false,
117-
const_generic: false,
117+
array_proxy: false,
118118
ignore_groups: false,
119119
keep_list: false,
120120
strict: false,

0 commit comments

Comments
 (0)