Skip to content

Commit

Permalink
Make Id a "fundamental" type (like Box)
Browse files Browse the repository at this point in the history
This changes the coherence rules to give Id less flexibility in terms of forwards compatibility, but in return allowing downstream crates (like objc2_foundation) to implement From for this type.
  • Loading branch information
madsmtm committed Oct 29, 2021
1 parent 4dd5852 commit 56a112f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions objc2/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ The bindings can be used on Linux or *BSD utilizing the
)]
#![warn(missing_docs)]
#![allow(clippy::missing_safety_doc)]
#![feature(fundamental)]
// Update in Cargo.toml as well.
#![doc(html_root_url = "https://docs.rs/objc2/0.2.7")]

Expand Down
1 change: 1 addition & 0 deletions objc2/src/rc/id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ use crate::Message;
/// let cloned: Id<T, Shared> = shared.clone();
/// // Do something with `&T` here
/// ```
#[fundamental]
#[repr(transparent)]
// TODO: Figure out if `Message` bound on `T` would be better here?
// TODO: Add `?Sized + ptr::Thin` bound on `T` to allow for extern types
Expand Down

0 comments on commit 56a112f

Please sign in to comment.