diff --git a/compiler/rustc_graphviz/src/lib.rs b/compiler/rustc_graphviz/src/lib.rs index 9f75578aa636c..cd1e573ea28df 100644 --- a/compiler/rustc_graphviz/src/lib.rs +++ b/compiler/rustc_graphviz/src/lib.rs @@ -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. diff --git a/compiler/rustc_middle/src/ty/context.rs b/compiler/rustc_middle/src/ty/context.rs index 471bd1d937e94..9e4692b96418e 100644 --- a/compiler/rustc_middle/src/ty/context.rs +++ b/compiler/rustc_middle/src/ty/context.rs @@ -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 } } diff --git a/compiler/rustc_pattern_analysis/src/lib.rs b/compiler/rustc_pattern_analysis/src/lib.rs index d9bb93a829b59..f3308086ddc64 100644 --- a/compiler/rustc_pattern_analysis/src/lib.rs +++ b/compiler/rustc_pattern_analysis/src/lib.rs @@ -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 } } diff --git a/compiler/rustc_pattern_analysis/src/pat.rs b/compiler/rustc_pattern_analysis/src/pat.rs index 901b72e53995e..51d0703f9c5ce 100644 --- a/compiler/rustc_pattern_analysis/src/pat.rs +++ b/compiler/rustc_pattern_analysis/src/pat.rs @@ -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 } } diff --git a/compiler/rustc_pattern_analysis/src/usefulness.rs b/compiler/rustc_pattern_analysis/src/usefulness.rs index 19446a1efe9cb..971616b189148 100644 --- a/compiler/rustc_pattern_analysis/src/usefulness.rs +++ b/compiler/rustc_pattern_analysis/src/usefulness.rs @@ -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 } } diff --git a/compiler/rustc_thread_pool/src/registry.rs b/compiler/rustc_thread_pool/src/registry.rs index 4a018ea743aea..92bb8961e7dfc 100644 --- a/compiler/rustc_thread_pool/src/registry.rs +++ b/compiler/rustc_thread_pool/src/registry.rs @@ -153,8 +153,8 @@ pub struct Registry { terminate_count: AtomicUsize, } -/// //////////////////////////////////////////////////////////////////////// -/// Initialization +/////////////////////////////////////////////////////////////////////////// +// Initialization static mut THE_REGISTRY: Option> = None; static THE_REGISTRY_SET: Once = Once::new(); @@ -407,12 +407,12 @@ impl Registry { } } - /// //////////////////////////////////////////////////////////////////////// + /////////////////////////////////////////////////////////////////////////// /// 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 @@ 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) };