Skip to content

Commit

Permalink
typos and nits
Browse files Browse the repository at this point in the history
  • Loading branch information
RalfJung committed Aug 1, 2023
1 parent 51bed0f commit 1bb9b95
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions text/0000-unsafe-aliased.md
Original file line number Diff line number Diff line change
Expand Up @@ -191,14 +191,14 @@ struct UnsafeAliased<T: ?Sized> {

impl<T: ?Sized> !Send for UnsafeAliased<T> {}

impl<T> UnsafeCell<T> {
impl<T: ?Sized> UnsafeAliased<T> {
/// Constructs a new instance of `UnsafeCell` which will wrap the specified
/// value.
pub fn new(value: T) -> UnsafeAliased<T> {
pub fn new(value: T) -> UnsafeAliased<T> where T: Sized {
UnsafeAliased { value }
}

pub fn into_inner(self) -> T {
pub fn into_inner(self) -> T where T: Sized {
self.value
}

Expand Down Expand Up @@ -290,7 +290,7 @@ Codegen and Miri changes:

- `UnsafeCell`: disables aliasing (and affects but does not fully disable dereferenceable) behind shared refs, i.e. `&UnsafeCell<T>` is special. `UnsafeCell<&T>` (by-val, fully owned) is not special at all and basically like `&T`; `&mut UnsafeCell<T>` is also not special.
- `UnsafeAliased`: disables aliasing (and affects but does not fully disable dereferenceable) behind mutable refs, i.e. `&mut UnsafeAliased<T>` is special. `UnsafeAliased<&mut T>` (by-val, fully owned) is not special at all and basically like `&mut T`; `&UnsafeAliased<T>` is also not special.
- [`MaybeDangling`](https://github.com/rust-lang/rfcs/pull/3336): disables aliasing and dereferencable *of all references (and boxes) directly inside it*, i.e. `MaybeDanling<&[mut] T>` is special. `&[mut] MaybeDangling<T>` is not special at all and basically like `&[mut] T`.
- [`MaybeDangling`](https://github.com/rust-lang/rfcs/pull/3336): disables aliasing and dereferencable *of all references (and boxes) directly inside it*, i.e. `MaybeDangling<&[mut] T>` is special. `&[mut] MaybeDangling<T>` is not special at all and basically like `&[mut] T`.

# Drawbacks
[drawbacks]: #drawbacks
Expand Down

0 comments on commit 1bb9b95

Please sign in to comment.