mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
change non-canonical clone impl to {*self}, fix some doc comments
This commit is contained in:
@@ -416,7 +416,7 @@ pub fn as_slice(&'a self) -> &'a str {
|
||||
/// it in the generated .dot file. They can also provide more
|
||||
/// elaborate (and non-unique) label text that is used in the graphviz
|
||||
/// rendered output.
|
||||
|
||||
///
|
||||
/// The graph instance is responsible for providing the DOT compatible
|
||||
/// identifiers for the nodes and (optionally) rendered labels for the nodes and
|
||||
/// edges, as well as an identifier for the graph itself.
|
||||
|
||||
@@ -2654,7 +2654,7 @@ pub fn debug_stats(self) -> impl fmt::Debug {
|
||||
|
||||
impl<'tcx, T: 'tcx + ?Sized + PointeeSized> Clone for InternedInSet<'tcx, T> {
|
||||
fn clone(&self) -> Self {
|
||||
InternedInSet(self.0)
|
||||
*self
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -141,7 +141,7 @@ pub struct MatchArm<'p, Cx: PatCx> {
|
||||
|
||||
impl<'p, Cx: PatCx> Clone for MatchArm<'p, Cx> {
|
||||
fn clone(&self) -> Self {
|
||||
Self { pat: self.pat, has_guard: self.has_guard, arm_data: self.arm_data }
|
||||
*self
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -174,10 +174,7 @@ pub(crate) enum PatOrWild<'p, Cx: PatCx> {
|
||||
|
||||
impl<'p, Cx: PatCx> Clone for PatOrWild<'p, Cx> {
|
||||
fn clone(&self) -> Self {
|
||||
match self {
|
||||
PatOrWild::Wild => PatOrWild::Wild,
|
||||
PatOrWild::Pat(pat) => PatOrWild::Pat(pat),
|
||||
}
|
||||
*self
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -824,7 +824,7 @@ struct PlaceCtxt<'a, Cx: PatCx> {
|
||||
impl<'a, Cx: PatCx> Copy for PlaceCtxt<'a, Cx> {}
|
||||
impl<'a, Cx: PatCx> Clone for PlaceCtxt<'a, Cx> {
|
||||
fn clone(&self) -> Self {
|
||||
Self { cx: self.cx, ty: self.ty }
|
||||
*self
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -153,8 +153,8 @@ pub struct Registry {
|
||||
terminate_count: AtomicUsize,
|
||||
}
|
||||
|
||||
/// ////////////////////////////////////////////////////////////////////////
|
||||
/// Initialization
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// Initialization
|
||||
|
||||
static mut THE_REGISTRY: Option<Arc<Registry>> = None;
|
||||
static THE_REGISTRY_SET: Once = Once::new();
|
||||
@@ -407,12 +407,12 @@ pub(crate) fn release_thread(&self) {
|
||||
}
|
||||
}
|
||||
|
||||
/// ////////////////////////////////////////////////////////////////////////
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
/// MAIN LOOP
|
||||
///
|
||||
/// So long as all of the worker threads are hanging out in their
|
||||
/// top-level loop, there is no work to be done.
|
||||
|
||||
///
|
||||
/// Push a job into the given `registry`. If we are running on a
|
||||
/// worker thread for the registry, this will push onto the
|
||||
/// deque. Else, it will inject from the outside (which is slower).
|
||||
@@ -668,8 +668,8 @@ fn new(stealer: Stealer<JobRef>) -> ThreadInfo {
|
||||
}
|
||||
}
|
||||
|
||||
/// ////////////////////////////////////////////////////////////////////////
|
||||
/// WorkerThread identifiers
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// WorkerThread identifiers
|
||||
|
||||
pub(super) struct WorkerThread {
|
||||
/// the "worker" half of our local deque
|
||||
@@ -1019,8 +1019,6 @@ fn steal(&self) -> Option<JobRef> {
|
||||
}
|
||||
}
|
||||
|
||||
/// ////////////////////////////////////////////////////////////////////////
|
||||
|
||||
unsafe fn main_loop(thread: ThreadBuilder) {
|
||||
let worker_thread = &WorkerThread::from(thread);
|
||||
unsafe { WorkerThread::set_current(worker_thread) };
|
||||
|
||||
Reference in New Issue
Block a user