Skip to content

Remove PhantomData<*const ()> from peripherals #458

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

- Don't generate pre Edition 2018 `extern crate` statements anymore

- Remove `PhantomData` marker from peripherals

## [v0.17.0] - 2019-12-31

### Fixed
Expand Down
3 changes: 1 addition & 2 deletions src/generate/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ pub fn render(

out.extend(quote! {
use core::ops::Deref;
use core::marker::PhantomData;
});

// Retaining the previous assumption
Expand Down Expand Up @@ -190,7 +189,7 @@ pub fn render(
#[doc = #p]
pub #id: #id,
});
exprs.extend(quote!(#id: #id { _marker: PhantomData },));
exprs.extend(quote!(#id: #id {}, ));
}

let span = Span::call_site();
Expand Down
2 changes: 1 addition & 1 deletion src/generate/peripheral.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ pub fn render(
// Insert the peripheral structure
out.extend(quote! {
#[doc = #description]
pub struct #name_pc { _marker: PhantomData<*const ()> }
pub struct #name_pc { }

unsafe impl Send for #name_pc {}

Expand Down