Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
4029a03
Make match in `register_res` easier to read
jyn514 May 3, 2021
132211b
Remove `to_url_str`
jyn514 Apr 23, 2021
5079744
Remove `PrimitiveType::as_str`
jyn514 Apr 23, 2021
b4524f8
Fix suggestion for removing &mut from &mut macro!().
m-ou-se Jun 2, 2021
ecebb66
Add test for removing &mut for &mut format!().
m-ou-se Jun 2, 2021
55769a5
wasm: Make simd types passed via indirection again
alexcrichton Jun 3, 2021
e848be0
don't suggest unsized indirection in where-clauses
tlyu Jun 3, 2021
877cfb1
Warn against boxed DST in `improper_ctypes_definitions` lint
marmeladema May 31, 2021
1aba171
Update to semver 1.0.3
dtolnay Jun 4, 2021
1d1b1eb
Note that `ninja = false` goes under `[llvm]`
jyn514 Jun 4, 2021
3ed7f3f
Improve error message
jyn514 Jun 4, 2021
7411a9e
rustdoc: link to stable/beta docs consistently in documentation
jyn514 May 5, 2021
1a5cc25
Remove unused code from `rustc_data_structures::sync`
jyn514 Mar 29, 2021
3412957
Unify parallel and non-parallel APIs
jyn514 Mar 31, 2021
7564312
Rollup merge of #83653 - jyn514:unused-sync-code, r=wesleywiser
JohnTitor Jun 4, 2021
74c744e
Rollup merge of #84466 - jyn514:prim-str, r=GuillaumeGomez
JohnTitor Jun 4, 2021
3a8bb38
Rollup merge of #84880 - jyn514:cleanup-itemkind, r=GuillaumeGomez
JohnTitor Jun 4, 2021
01b0e6e
Rollup merge of #84942 - jyn514:channel-replace, r=Manishearth
JohnTitor Jun 4, 2021
ec9e7d5
Rollup merge of #85853 - marmeladema:improper-ctypes-definitions-boxe…
JohnTitor Jun 4, 2021
5ebc4d3
Rollup merge of #85939 - m-ou-se:fix-remove-ref-macro-invocation, r=e…
JohnTitor Jun 4, 2021
5d30ab8
Rollup merge of #85966 - alexcrichton:wasm-simd-indirect, r=workingju…
JohnTitor Jun 4, 2021
2da4295
Rollup merge of #85979 - tlyu:where-no-unsized-indirection, r=estebank
JohnTitor Jun 4, 2021
d5c9894
Rollup merge of #85983 - dtolnay:semverx, r=ehuss
JohnTitor Jun 4, 2021
062e789
Rollup merge of #85988 - jyn514:ninja-error, r=joshtriplett
JohnTitor Jun 4, 2021
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
Prev Previous commit
Next Next commit
Remove unused code from rustc_data_structures::sync
  • Loading branch information
jyn514 committed Jun 4, 2021
commit 1a5cc2552536eabe8c26a0592e71de5f7e3e0ebd
110 changes: 0 additions & 110 deletions compiler/rustc_data_structures/src/sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,46 +43,6 @@ cfg_if! {
use std::ops::Add;
use std::panic::{resume_unwind, catch_unwind, AssertUnwindSafe};

/// This is a single threaded variant of AtomicCell provided by crossbeam.
/// Unlike `Atomic` this is intended for all `Copy` types,
/// but it lacks the explicit ordering arguments.
#[derive(Debug)]
pub struct AtomicCell<T: Copy>(Cell<T>);

impl<T: Copy> AtomicCell<T> {
#[inline]
pub fn new(v: T) -> Self {
AtomicCell(Cell::new(v))
}

#[inline]
pub fn get_mut(&mut self) -> &mut T {
self.0.get_mut()
}
}

impl<T: Copy> AtomicCell<T> {
#[inline]
pub fn into_inner(self) -> T {
self.0.into_inner()
}

#[inline]
pub fn load(&self) -> T {
self.0.get()
}

#[inline]
pub fn store(&self, val: T) {
self.0.set(val)
}

#[inline]
pub fn swap(&self, val: T) -> T {
self.0.replace(val)
}
}

/// This is a single threaded variant of `AtomicU64`, `AtomicUsize`, etc.
/// It differs from `AtomicCell` in that it has explicit ordering arguments
/// and is only intended for use with the native atomic types.
Expand All @@ -99,11 +59,6 @@ cfg_if! {
}

impl<T: Copy> Atomic<T> {
#[inline]
pub fn into_inner(self) -> T {
self.0.into_inner()
}

#[inline]
pub fn load(&self, _: Ordering) -> T {
self.0.get()
Expand All @@ -113,11 +68,6 @@ cfg_if! {
pub fn store(&self, val: T, _: Ordering) {
self.0.set(val)
}

#[inline]
pub fn swap(&self, val: T, _: Ordering) -> T {
self.0.replace(val)
}
}

impl<T: Copy + PartialEq> Atomic<T> {
Expand Down Expand Up @@ -159,22 +109,6 @@ cfg_if! {
(oper_a(), oper_b())
}

pub struct SerialScope;

impl SerialScope {
pub fn spawn<F>(&self, f: F)
where F: FnOnce(&SerialScope)
{
f(self)
}
}

pub fn scope<F, R>(f: F) -> R
where F: FnOnce(&SerialScope) -> R
{
f(&SerialScope)
}

#[macro_export]
macro_rules! parallel {
($($blocks:tt),*) => {
Expand Down Expand Up @@ -246,12 +180,6 @@ cfg_if! {
pub fn new<F: FnMut(usize) -> T>(mut f: F) -> WorkerLocal<T> {
WorkerLocal(OneThread::new(f(0)))
}

/// Returns the worker-local value for each thread
#[inline]
pub fn into_inner(self) -> Vec<T> {
vec![OneThread::into_inner(self.0)]
}
}

impl<T> Deref for WorkerLocal<T> {
Expand Down Expand Up @@ -279,16 +207,6 @@ cfg_if! {
self.0
}

#[inline(always)]
pub fn get_mut(&mut self) -> &mut T {
&mut self.0
}

#[inline(always)]
pub fn lock(&self) -> &T {
&self.0
}

#[inline(always)]
pub fn lock_mut(&mut self) -> &mut T {
&mut self.0
Expand Down Expand Up @@ -318,8 +236,6 @@ cfg_if! {

pub use std::sync::atomic::{AtomicBool, AtomicUsize, AtomicU32, AtomicU64};

pub use crossbeam_utils::atomic::AtomicCell;

pub use std::sync::Arc as Lrc;
pub use std::sync::Weak as Weak;

Expand Down Expand Up @@ -521,16 +437,6 @@ impl<T> RwLock<T> {
RwLock(InnerRwLock::new(inner))
}

#[inline(always)]
pub fn into_inner(self) -> T {
self.0.into_inner()
}

#[inline(always)]
pub fn get_mut(&mut self) -> &mut T {
self.0.get_mut()
}

#[cfg(not(parallel_compiler))]
#[inline(always)]
pub fn read(&self) -> ReadGuard<'_, T> {
Expand All @@ -547,11 +453,6 @@ impl<T> RwLock<T> {
}
}

#[inline(always)]
pub fn with_read_lock<F: FnOnce(&T) -> R, R>(&self, f: F) -> R {
f(&*self.read())
}

#[cfg(not(parallel_compiler))]
#[inline(always)]
pub fn try_write(&self) -> Result<WriteGuard<'_, T>, ()> {
Expand Down Expand Up @@ -580,11 +481,6 @@ impl<T> RwLock<T> {
}
}

#[inline(always)]
pub fn with_write_lock<F: FnOnce(&mut T) -> R, R>(&self, f: F) -> R {
f(&mut *self.write())
}

#[inline(always)]
pub fn borrow(&self) -> ReadGuard<'_, T> {
self.read()
Expand Down Expand Up @@ -633,12 +529,6 @@ impl<T> OneThread<T> {
inner,
}
}

#[inline(always)]
pub fn into_inner(value: Self) -> T {
value.check();
value.inner
}
}

impl<T> Deref for OneThread<T> {
Expand Down