Skip to content
This repository was archived by the owner on Jul 30, 2025. It is now read-only.

Conversation

@korken89
Copy link
Contributor

@korken89 korken89 commented Apr 7, 2020

Exclusive should be a wrapper around a reference to the original resource. Else it becomes quite useless in conjunction with real resources.

This was noticed when moving RTFM to mutex_trait, see here: https://github.com/rtfm-rs/cortex-m-rtfm/blob/8073f648cfc967d9efbb2f936e3f0e10a580a64f/examples/generics.rs#L50
(this currently does not compile as we are not taking a reference to the original resource)

Copy link
Contributor

@jonas-schievink jonas-schievink left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to me. I don't think there's really any use case for a by-value Exclusive, so this seems better.

bors r+

@bors
Copy link
Contributor

bors bot commented Apr 7, 2020

🔒 Permission denied

Existing reviewers: click here to make jonas-schievink a reviewer

Copy link
Contributor

@therealprof therealprof left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@therealprof
Copy link
Contributor

bors r+

bors bot added a commit that referenced this pull request Apr 7, 2020
7: Exclusive should be a wrapper around a reference to the original reso… r=therealprof a=korken89

Exclusive should be a wrapper around a reference to the original resource. Else it becomes quite useless in conjunction with real resources.

This was noticed when moving RTFM to `mutex_trait`, see here: https://github.com/rtfm-rs/cortex-m-rtfm/blob/8073f648cfc967d9efbb2f936e3f0e10a580a64f/examples/generics.rs#L50
(this currently does not compile as we are not taking a reference to the original resource)

Co-authored-by: Emil Fresk <emil.fresk@gmail.com>
@bors
Copy link
Contributor

bors bot commented Apr 7, 2020

Timed out

@therealprof
Copy link
Contributor

bors r+

@bors
Copy link
Contributor

bors bot commented Apr 7, 2020

Build succeeded

@bors bors bot merged commit 0327c7e into master Apr 7, 2020
@bors bors bot deleted the reference_exclusive branch April 7, 2020 22:53
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants