Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/)
and this project adheres to [Semantic Versioning](https://semver.org/).

## [Unreleased]
- Fix dangling implicit derives

## [v0.28.0] - 2022-12-25

Expand Down
17 changes: 16 additions & 1 deletion src/generate/peripheral.rs
Original file line number Diff line number Diff line change
Expand Up @@ -859,7 +859,7 @@ fn compare_this_against_prev(
Ok(None)
}

/// Compare the given type name against previous regexs, then inspect fields
/// Compare previous type names against the given regex, then inspect fields
fn compare_prev_against_this(
reg: &MaybeArray<RegisterInfo>,
ty_name: &str,
Expand Down Expand Up @@ -913,6 +913,21 @@ fn compare_prev_against_this(
}
}
}
if let DeriveInfo::Implicit(my_rpath) = &my_derive_info {
match prev_derive_info {
DeriveInfo::Implicit(their_rpath) => {
if their_rpath.name == ty_name {
(_, *their_rpath) = find_root(&my_rpath.name, path, index)?;
}
}
DeriveInfo::Explicit(their_rpath) => {
if their_rpath.name == ty_name {
(_, *their_rpath) = find_root(&my_rpath.name, path, index)?;
}
}
_ => {}
}
}
}
}
Ok(my_derive_info)
Expand Down