Skip to content
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

Rollup of 12 pull requests #78763

Closed
wants to merge 37 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
4af560e
Move zero-sized-vec-push test
poliorcetics Sep 14, 2020
85afbd8
Rebase conflicts
poliorcetics Oct 17, 2020
4fd06b9
Move vec-macro-repeat test
poliorcetics Oct 3, 2020
42271a5
Move vec swap test
poliorcetics Oct 3, 2020
1bdee96
Move subslice pattern tests to alloc/tests/slice.rs
poliorcetics Oct 3, 2020
251f6da
(rustdoc) fix test for trait impl display
liketechnik Oct 25, 2020
e4d1096
Change as_str → to_string in proc_macro::Ident::span() docs
est31 Oct 28, 2020
300362e
Close the theme picker when Escape is pressed
notriddle Oct 30, 2020
ac3a434
Allow the theme picker to work with arrow keys
notriddle Oct 30, 2020
6918a17
Add aria roles for theme picker menu
notriddle Oct 30, 2020
90c7c63
Add comment describing the Escape key weirdness
notriddle Oct 30, 2020
17b8ca9
Pull theme picker keyboard code into main.js
notriddle Oct 30, 2020
5801109
Move Copy and Clone into the list of traits implemented for all sizes
est31 Nov 4, 2020
93fa023
Fix outdated comment next to array_impl_default
est31 Nov 4, 2020
bcd2f2d
fix a couple of clippy warnings:
matthiaskrgr Nov 4, 2020
69e5729
Simplify the implementation of `get_mut` (no unsafe)
danielhenrymantilla Nov 4, 2020
232b9ba
Move range in ui test to ops test in library/core
sasurau4 Nov 4, 2020
5855fb7
Move f64::NAN ui tests into `library`
Oct 27, 2020
97d5a1b
Fix format
Nov 4, 2020
d8afe98
Clean up docs for 'as' keyword
camelid Oct 19, 2020
3084a55
Don't use `crate` in link text
camelid Nov 5, 2020
bbdb1f0
Clean up some intra-doc links
camelid Nov 5, 2020
677b2ac
Add missing comma
camelid Nov 5, 2020
873ebcb
Fixed typo in comment
eltociear Nov 5, 2020
f9b139f
Add `mod nan` for test
Nov 5, 2020
c63364b
Rollup merge of #76718 - poliorcetics:vec-ui-to-unit-test, r=jyn514
JohnTitor Nov 5, 2020
ab66a6a
Rollup merge of #78093 - camelid:as-cleanup, r=jyn514
JohnTitor Nov 5, 2020
adb3f65
Rollup merge of #78425 - chansuke:move_nan, r=jyn514
JohnTitor Nov 5, 2020
9429067
Rollup merge of #78465 - est31:proc_macro_to_string, r=jyn514
JohnTitor Nov 5, 2020
7a2a7e8
Rollup merge of #78584 - notriddle:master, r=GuillaumeGomez
JohnTitor Nov 5, 2020
3debfd0
Rollup merge of #78716 - est31:array_traits, r=Dylan-DPC
JohnTitor Nov 5, 2020
d189cdb
Rollup merge of #78727 - liketechnik:issue-55201, r=GuillaumeGomez
JohnTitor Nov 5, 2020
d5e239a
Rollup merge of #78733 - matthiaskrgr:cl11ppy, r=jyn514
JohnTitor Nov 5, 2020
3b38f09
Rollup merge of #78735 - danielhenrymantilla:simplify-unsafecell-getm…
JohnTitor Nov 5, 2020
377b6d5
Rollup merge of #78738 - sasurau4:test/move-range-test-to-library-cor…
JohnTitor Nov 5, 2020
8c18b75
Rollup merge of #78757 - camelid:crate-link-text, r=jyn514
JohnTitor Nov 5, 2020
c953bd5
Rollup merge of #78758 - eltociear:patch-1, r=jyn514
JohnTitor Nov 5, 2020
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: 1 addition & 1 deletion compiler/rustc_ast/src/attr/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ pub fn list_contains_name(items: &[NestedMetaItem], name: Symbol) -> bool {
impl MetaItem {
fn token_trees_and_spacings(&self) -> Vec<TreeAndSpacing> {
let mut idents = vec![];
let mut last_pos = BytePos(0 as u32);
let mut last_pos = BytePos(0_u32);
for (i, segment) in self.path.segments.iter().enumerate() {
let is_first = i == 0;
if !is_first {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -739,7 +739,6 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
"cannot infer {} {} {} `{}`{}",
kind_str, preposition, descr, type_name, parent_desc
)
.into()
}
}
}
9 changes: 4 additions & 5 deletions compiler/rustc_interface/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -246,10 +246,10 @@ pub fn get_codegen_backend(sopts: &config::Options) -> Box<dyn CodegenBackend> {

INIT.call_once(|| {
#[cfg(feature = "llvm")]
const DEFAULT_CODEGEN_BACKEND: &'static str = "llvm";
const DEFAULT_CODEGEN_BACKEND: &str = "llvm";

#[cfg(not(feature = "llvm"))]
const DEFAULT_CODEGEN_BACKEND: &'static str = "cranelift";
const DEFAULT_CODEGEN_BACKEND: &str = "cranelift";

let codegen_name = sopts
.debugging_opts
Expand Down Expand Up @@ -414,11 +414,10 @@ pub fn get_codegen_sysroot(backend_name: &str) -> fn() -> Box<dyn CodegenBackend
let libdir = filesearch::relative_target_lib_path(&sysroot, &target);
sysroot.join(libdir).with_file_name("codegen-backends")
})
.filter(|f| {
.find(|f| {
info!("codegen backend candidate: {}", f.display());
f.exists()
})
.next();
});
let sysroot = sysroot.unwrap_or_else(|| {
let candidates = sysroot_candidates
.iter()
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_middle/src/middle/stability.rs
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ impl<'tcx> TyCtxt<'tcx> {
def_id: DefId,
id: Option<HirId>,
span: Span,
unmarked: impl FnOnce(Span, DefId) -> (),
unmarked: impl FnOnce(Span, DefId),
) {
let soft_handler = |lint, span, msg: &_| {
self.struct_span_lint_hir(lint, id.unwrap_or(hir::CRATE_HIR_ID), span, |lint| {
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_middle/src/mir/terminator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ impl SwitchTargets {
pub fn new(targets: impl Iterator<Item = (u128, BasicBlock)>, otherwise: BasicBlock) -> Self {
let (values, mut targets): (SmallVec<_>, SmallVec<_>) = targets.unzip();
targets.push(otherwise);
Self { values: values.into(), targets }
Self { values, targets }
}

/// Builds a switch targets definition that jumps to `then` if the tested value equals `value`,
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_middle/src/ty/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1641,7 +1641,7 @@ pub type PlaceholderConst = Placeholder<BoundVar>;
#[derive(Hash, HashStable)]
pub struct WithOptConstParam<T> {
pub did: T,
/// The `DefId` of the corresponding generic paramter in case `did` is
/// The `DefId` of the corresponding generic parameter in case `did` is
/// a const argument.
///
/// Note that even if `did` is a const argument, this may still be `None`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
let move_out = self.move_data.moves[(*move_site).moi];
let moved_place = &self.move_data.move_paths[move_out.path].place;
// `*(_1)` where `_1` is a `Box` is actually a move out.
let is_box_move = moved_place.as_ref().projection == &[ProjectionElem::Deref]
let is_box_move = moved_place.as_ref().projection == [ProjectionElem::Deref]
&& self.body.local_decls[moved_place.local].ty.is_box();

!is_box_move
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_mir/src/transform/match_branches.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ impl<'tcx> MirPass<'tcx> for MatchBranchSimplification {
};

// Check that destinations are identical, and if not, then don't optimize this block
if &bbs[first].terminator().kind != &bbs[second].terminator().kind {
if bbs[first].terminator().kind != bbs[second].terminator().kind {
continue;
}

Expand Down
5 changes: 2 additions & 3 deletions compiler/rustc_resolve/src/late/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1886,9 +1886,8 @@ impl<'tcx> LifetimeContext<'_, 'tcx> {
if snippet.starts_with('&') && !snippet.starts_with("&'") {
introduce_suggestion
.push((param.span, format!("&'a {}", &snippet[1..])));
} else if snippet.starts_with("&'_ ") {
introduce_suggestion
.push((param.span, format!("&'a {}", &snippet[4..])));
} else if let Some(stripped) = snippet.strip_prefix("&'_ ") {
introduce_suggestion.push((param.span, format!("&'a {}", &stripped)));
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_span/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1574,7 +1574,7 @@ fn normalize_src(src: &mut String, start_pos: BytePos) -> Vec<NormalizedPos> {

/// Removes UTF-8 BOM, if any.
fn remove_bom(src: &mut String, normalized_pos: &mut Vec<NormalizedPos>) {
if src.starts_with("\u{feff}") {
if src.starts_with('\u{feff}') {
src.drain(..3);
normalized_pos.push(NormalizedPos { pos: BytePos(0), diff: 3 });
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1388,11 +1388,7 @@ impl<'a, 'tcx> InferCtxtPrivExt<'tcx> for InferCtxt<'a, 'tcx> {
trait_ref: &ty::PolyTraitRef<'tcx>,
) {
let get_trait_impl = |trait_def_id| {
self.tcx.find_map_relevant_impl(
trait_def_id,
trait_ref.skip_binder().self_ty(),
|impl_def_id| Some(impl_def_id),
)
self.tcx.find_map_relevant_impl(trait_def_id, trait_ref.skip_binder().self_ty(), Some)
};
let required_trait_path = self.tcx.def_path_str(trait_ref.def_id());
let all_traits = self.tcx.all_traits(LOCAL_CRATE);
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_trait_selection/src/traits/fulfill.rs
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ impl<'a, 'b, 'tcx> FulfillProcessor<'a, 'b, 'tcx> {
Err(ErrorHandled::TooGeneric) => {
pending_obligation.stalled_on = substs
.iter()
.filter_map(|ty| TyOrConstInferVar::maybe_from_generic_arg(ty))
.filter_map(TyOrConstInferVar::maybe_from_generic_arg)
.collect();
ProcessResult::Unchanged
}
Expand Down
120 changes: 120 additions & 0 deletions library/alloc/tests/slice.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use std::cell::Cell;
use std::cmp::Ordering::{self, Equal, Greater, Less};
use std::convert::identity;
use std::mem;
use std::panic;
use std::rc::Rc;
Expand Down Expand Up @@ -1778,3 +1779,122 @@ fn repeat_generic_slice() {
assert_eq!([1, 2, 3, 4].repeat(1), vec![1, 2, 3, 4]);
assert_eq!([1, 2, 3, 4].repeat(3), vec![1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4]);
}

#[test]
#[allow(unreachable_patterns)]
fn subslice_patterns() {
// This test comprehensively checks the passing static and dynamic semantics
// of subslice patterns `..`, `x @ ..`, `ref x @ ..`, and `ref mut @ ..`
// in slice patterns `[$($pat), $(,)?]` .

#[derive(PartialEq, Debug, Clone)]
struct N(u8);

macro_rules! n {
($($e:expr),* $(,)?) => {
[$(N($e)),*]
}
}

macro_rules! c {
($inp:expr, $typ:ty, $out:expr $(,)?) => {
assert_eq!($out, identity::<$typ>($inp));
};
}

macro_rules! m {
($e:expr, $p:pat => $b:expr) => {
match $e {
$p => $b,
_ => panic!(),
}
};
}

// == Slices ==

// Matching slices using `ref` patterns:
let mut v = vec![N(0), N(1), N(2), N(3), N(4)];
let mut vc = (0..=4).collect::<Vec<u8>>();

let [..] = v[..]; // Always matches.
m!(v[..], [N(0), ref sub @ .., N(4)] => c!(sub, &[N], n![1, 2, 3]));
m!(v[..], [N(0), ref sub @ ..] => c!(sub, &[N], n![1, 2, 3, 4]));
m!(v[..], [ref sub @ .., N(4)] => c!(sub, &[N], n![0, 1, 2, 3]));
m!(v[..], [ref sub @ .., _, _, _, _, _] => c!(sub, &[N], &n![] as &[N]));
m!(v[..], [_, _, _, _, _, ref sub @ ..] => c!(sub, &[N], &n![] as &[N]));
m!(vc[..], [x, .., y] => c!((x, y), (u8, u8), (0, 4)));

// Matching slices using `ref mut` patterns:
let [..] = v[..]; // Always matches.
m!(v[..], [N(0), ref mut sub @ .., N(4)] => c!(sub, &mut [N], n![1, 2, 3]));
m!(v[..], [N(0), ref mut sub @ ..] => c!(sub, &mut [N], n![1, 2, 3, 4]));
m!(v[..], [ref mut sub @ .., N(4)] => c!(sub, &mut [N], n![0, 1, 2, 3]));
m!(v[..], [ref mut sub @ .., _, _, _, _, _] => c!(sub, &mut [N], &mut n![] as &mut [N]));
m!(v[..], [_, _, _, _, _, ref mut sub @ ..] => c!(sub, &mut [N], &mut n![] as &mut [N]));
m!(vc[..], [x, .., y] => c!((x, y), (u8, u8), (0, 4)));

// Matching slices using default binding modes (&):
let [..] = &v[..]; // Always matches.
m!(&v[..], [N(0), sub @ .., N(4)] => c!(sub, &[N], n![1, 2, 3]));
m!(&v[..], [N(0), sub @ ..] => c!(sub, &[N], n![1, 2, 3, 4]));
m!(&v[..], [sub @ .., N(4)] => c!(sub, &[N], n![0, 1, 2, 3]));
m!(&v[..], [sub @ .., _, _, _, _, _] => c!(sub, &[N], &n![] as &[N]));
m!(&v[..], [_, _, _, _, _, sub @ ..] => c!(sub, &[N], &n![] as &[N]));
m!(&vc[..], [x, .., y] => c!((x, y), (&u8, &u8), (&0, &4)));

// Matching slices using default binding modes (&mut):
let [..] = &mut v[..]; // Always matches.
m!(&mut v[..], [N(0), sub @ .., N(4)] => c!(sub, &mut [N], n![1, 2, 3]));
m!(&mut v[..], [N(0), sub @ ..] => c!(sub, &mut [N], n![1, 2, 3, 4]));
m!(&mut v[..], [sub @ .., N(4)] => c!(sub, &mut [N], n![0, 1, 2, 3]));
m!(&mut v[..], [sub @ .., _, _, _, _, _] => c!(sub, &mut [N], &mut n![] as &mut [N]));
m!(&mut v[..], [_, _, _, _, _, sub @ ..] => c!(sub, &mut [N], &mut n![] as &mut [N]));
m!(&mut vc[..], [x, .., y] => c!((x, y), (&mut u8, &mut u8), (&mut 0, &mut 4)));

// == Arrays ==
let mut v = n![0, 1, 2, 3, 4];
let vc = [0, 1, 2, 3, 4];

// Matching arrays by value:
m!(v.clone(), [N(0), sub @ .., N(4)] => c!(sub, [N; 3], n![1, 2, 3]));
m!(v.clone(), [N(0), sub @ ..] => c!(sub, [N; 4], n![1, 2, 3, 4]));
m!(v.clone(), [sub @ .., N(4)] => c!(sub, [N; 4], n![0, 1, 2, 3]));
m!(v.clone(), [sub @ .., _, _, _, _, _] => c!(sub, [N; 0], n![] as [N; 0]));
m!(v.clone(), [_, _, _, _, _, sub @ ..] => c!(sub, [N; 0], n![] as [N; 0]));
m!(v.clone(), [x, .., y] => c!((x, y), (N, N), (N(0), N(4))));
m!(v.clone(), [..] => ());

// Matching arrays by ref patterns:
m!(v, [N(0), ref sub @ .., N(4)] => c!(sub, &[N; 3], &n![1, 2, 3]));
m!(v, [N(0), ref sub @ ..] => c!(sub, &[N; 4], &n![1, 2, 3, 4]));
m!(v, [ref sub @ .., N(4)] => c!(sub, &[N; 4], &n![0, 1, 2, 3]));
m!(v, [ref sub @ .., _, _, _, _, _] => c!(sub, &[N; 0], &n![] as &[N; 0]));
m!(v, [_, _, _, _, _, ref sub @ ..] => c!(sub, &[N; 0], &n![] as &[N; 0]));
m!(vc, [x, .., y] => c!((x, y), (u8, u8), (0, 4)));

// Matching arrays by ref mut patterns:
m!(v, [N(0), ref mut sub @ .., N(4)] => c!(sub, &mut [N; 3], &mut n![1, 2, 3]));
m!(v, [N(0), ref mut sub @ ..] => c!(sub, &mut [N; 4], &mut n![1, 2, 3, 4]));
m!(v, [ref mut sub @ .., N(4)] => c!(sub, &mut [N; 4], &mut n![0, 1, 2, 3]));
m!(v, [ref mut sub @ .., _, _, _, _, _] => c!(sub, &mut [N; 0], &mut n![] as &mut [N; 0]));
m!(v, [_, _, _, _, _, ref mut sub @ ..] => c!(sub, &mut [N; 0], &mut n![] as &mut [N; 0]));

// Matching arrays by default binding modes (&):
m!(&v, [N(0), sub @ .., N(4)] => c!(sub, &[N; 3], &n![1, 2, 3]));
m!(&v, [N(0), sub @ ..] => c!(sub, &[N; 4], &n![1, 2, 3, 4]));
m!(&v, [sub @ .., N(4)] => c!(sub, &[N; 4], &n![0, 1, 2, 3]));
m!(&v, [sub @ .., _, _, _, _, _] => c!(sub, &[N; 0], &n![] as &[N; 0]));
m!(&v, [_, _, _, _, _, sub @ ..] => c!(sub, &[N; 0], &n![] as &[N; 0]));
m!(&v, [..] => ());
m!(&v, [x, .., y] => c!((x, y), (&N, &N), (&N(0), &N(4))));

// Matching arrays by default binding modes (&mut):
m!(&mut v, [N(0), sub @ .., N(4)] => c!(sub, &mut [N; 3], &mut n![1, 2, 3]));
m!(&mut v, [N(0), sub @ ..] => c!(sub, &mut [N; 4], &mut n![1, 2, 3, 4]));
m!(&mut v, [sub @ .., N(4)] => c!(sub, &mut [N; 4], &mut n![0, 1, 2, 3]));
m!(&mut v, [sub @ .., _, _, _, _, _] => c!(sub, &mut [N; 0], &mut n![] as &[N; 0]));
m!(&mut v, [_, _, _, _, _, sub @ ..] => c!(sub, &mut [N; 0], &mut n![] as &[N; 0]));
m!(&mut v, [..] => ());
m!(&mut v, [x, .., y] => c!((x, y), (&mut N, &mut N), (&mut N(0), &mut N(4))));
}
44 changes: 43 additions & 1 deletion library/alloc/tests/vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::cell::Cell;
use std::collections::TryReserveError::*;
use std::fmt::Debug;
use std::iter::InPlaceIterable;
use std::mem::size_of;
use std::mem::{size_of, swap};
use std::ops::Bound::*;
use std::panic::{catch_unwind, AssertUnwindSafe};
use std::rc::Rc;
Expand Down Expand Up @@ -1912,3 +1912,45 @@ fn test_vec_cycle_wrapped() {
c3.refs.v[0].set(Some(&c1));
c3.refs.v[1].set(Some(&c2));
}

#[test]
fn test_zero_sized_vec_push() {
const N: usize = 8;

for len in 0..N {
let mut tester = Vec::with_capacity(len);
assert_eq!(tester.len(), 0);
assert!(tester.capacity() >= len);
for _ in 0..len {
tester.push(());
}
assert_eq!(tester.len(), len);
assert_eq!(tester.iter().count(), len);
tester.clear();
}
}

#[test]
fn test_vec_macro_repeat() {
assert_eq!(vec![1; 3], vec![1, 1, 1]);
assert_eq!(vec![1; 2], vec![1, 1]);
assert_eq!(vec![1; 1], vec![1]);
assert_eq!(vec![1; 0], vec![]);

// from_elem syntax (see RFC 832)
let el = Box::new(1);
let n = 3;
assert_eq!(vec![el; n], vec![Box::new(1), Box::new(1), Box::new(1)]);
}

#[test]
fn test_vec_swap() {
let mut a: Vec<isize> = vec![0, 1, 2, 3, 4, 5, 6];
a.swap(2, 4);
assert_eq!(a[2], 4);
assert_eq!(a[4], 2);
let mut n = 42;
swap(&mut n, &mut a[0]);
assert_eq!(a[0], 42);
assert_eq!(n, 0);
}
30 changes: 30 additions & 0 deletions library/alloc/tests/vec_deque.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1698,3 +1698,33 @@ fn test_binary_search_by_key() {
assert_eq!(deque.binary_search_by_key(&3, |&(v,)| v), Ok(2));
assert_eq!(deque.binary_search_by_key(&4, |&(v,)| v), Err(3));
}

#[test]
fn test_zero_sized_push() {
const N: usize = 8;

// Zero sized type
struct Zst;

// Test that for all possible sequences of push_front / push_back,
// we end up with a deque of the correct size

for len in 0..N {
let mut tester = VecDeque::with_capacity(len);
assert_eq!(tester.len(), 0);
assert!(tester.capacity() >= len);
for case in 0..(1 << len) {
assert_eq!(tester.len(), 0);
for bit in 0..len {
if case & (1 << bit) != 0 {
tester.push_front(Zst);
} else {
tester.push_back(Zst);
}
}
assert_eq!(tester.len(), len);
assert_eq!(tester.iter().count(), len);
tester.clear();
}
}
}
5 changes: 3 additions & 2 deletions library/core/src/array/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -353,8 +353,9 @@ impl<T: Ord, const N: usize> Ord for [T; N] {
}
}

// The Default impls cannot be generated using the array_impls! macro because
// they require array literals.
// The Default impls cannot be done with const generics because `[T; 0]` doesn't
// require Default to be implemented, and having different impl blocks for
// different numbers isn't supported yet.

macro_rules! array_impl_default {
{$n:expr, $t:ident $($ts:ident)*} => {
Expand Down
3 changes: 1 addition & 2 deletions library/core/src/cell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1733,8 +1733,7 @@ impl<T: ?Sized> UnsafeCell<T> {
#[inline]
#[unstable(feature = "unsafe_cell_get_mut", issue = "76943")]
pub fn get_mut(&mut self) -> &mut T {
// SAFETY: (outer) `&mut` guarantees unique access.
unsafe { &mut *self.get() }
&mut self.value
}

/// Gets a mutable pointer to the wrapped value.
Expand Down
Loading