change non-canonical clone impl to {*self}, fix some doc comments

This commit is contained in:
Marijn Schouten 2025-12-19 14:46:18 +00:00
parent 07a5b02a2d
commit 5d8a096afe
6 changed files with 11 additions and 16 deletions

View file

@ -416,7 +416,7 @@ impl<'a> Id<'a> {
/// 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.

View file

@ -2654,7 +2654,7 @@ struct InternedInSet<'tcx, T: ?Sized + PointeeSized>(&'tcx T);
impl<'tcx, T: 'tcx + ?Sized + PointeeSized> Clone for InternedInSet<'tcx, T> {
fn clone(&self) -> Self {
InternedInSet(self.0)
*self
}
}

View file

@ -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
}
}

View file

@ -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
}
}

View file

@ -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
}
}

View file

@ -154,7 +154,7 @@ pub struct Registry {
}
///////////////////////////////////////////////////////////////////////////
/// Initialization
// Initialization
static mut THE_REGISTRY: Option<Arc<Registry>> = None;
static THE_REGISTRY_SET: Once = Once::new();
@ -412,7 +412,7 @@ impl Registry {
///
/// 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).
@ -669,7 +669,7 @@ impl ThreadInfo {
}
///////////////////////////////////////////////////////////////////////////
/// WorkerThread identifiers
// WorkerThread identifiers
pub(super) struct WorkerThread {
/// the "worker" half of our local deque
@ -1019,8 +1019,6 @@ impl WorkerThread {
}
}
/// ////////////////////////////////////////////////////////////////////////
unsafe fn main_loop(thread: ThreadBuilder) {
let worker_thread = &WorkerThread::from(thread);
unsafe { WorkerThread::set_current(worker_thread) };