Skip to content

Commit f0a9c8a

Browse files
authored
Rollup merge of rust-lang#150191 - hkBst:clippy-fix-15, r=Kivooeo
change non-canonical clone impl to {*self}, fix some doc comments
2 parents 3c74b3d + 5d8a096 commit f0a9c8a

File tree

6 files changed

+11
-16
lines changed

6 files changed

+11
-16
lines changed

compiler/rustc_graphviz/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ impl<'a> Id<'a> {
416416
/// it in the generated .dot file. They can also provide more
417417
/// elaborate (and non-unique) label text that is used in the graphviz
418418
/// rendered output.
419-
419+
///
420420
/// The graph instance is responsible for providing the DOT compatible
421421
/// identifiers for the nodes and (optionally) rendered labels for the nodes and
422422
/// edges, as well as an identifier for the graph itself.

compiler/rustc_middle/src/ty/context.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2654,7 +2654,7 @@ struct InternedInSet<'tcx, T: ?Sized + PointeeSized>(&'tcx T);
26542654

26552655
impl<'tcx, T: 'tcx + ?Sized + PointeeSized> Clone for InternedInSet<'tcx, T> {
26562656
fn clone(&self) -> Self {
2657-
InternedInSet(self.0)
2657+
*self
26582658
}
26592659
}
26602660

compiler/rustc_pattern_analysis/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ pub struct MatchArm<'p, Cx: PatCx> {
141141

142142
impl<'p, Cx: PatCx> Clone for MatchArm<'p, Cx> {
143143
fn clone(&self) -> Self {
144-
Self { pat: self.pat, has_guard: self.has_guard, arm_data: self.arm_data }
144+
*self
145145
}
146146
}
147147

compiler/rustc_pattern_analysis/src/pat.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -174,10 +174,7 @@ pub(crate) enum PatOrWild<'p, Cx: PatCx> {
174174

175175
impl<'p, Cx: PatCx> Clone for PatOrWild<'p, Cx> {
176176
fn clone(&self) -> Self {
177-
match self {
178-
PatOrWild::Wild => PatOrWild::Wild,
179-
PatOrWild::Pat(pat) => PatOrWild::Pat(pat),
180-
}
177+
*self
181178
}
182179
}
183180

compiler/rustc_pattern_analysis/src/usefulness.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -824,7 +824,7 @@ struct PlaceCtxt<'a, Cx: PatCx> {
824824
impl<'a, Cx: PatCx> Copy for PlaceCtxt<'a, Cx> {}
825825
impl<'a, Cx: PatCx> Clone for PlaceCtxt<'a, Cx> {
826826
fn clone(&self) -> Self {
827-
Self { cx: self.cx, ty: self.ty }
827+
*self
828828
}
829829
}
830830

compiler/rustc_thread_pool/src/registry.rs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,8 @@ pub struct Registry {
153153
terminate_count: AtomicUsize,
154154
}
155155

156-
/// ////////////////////////////////////////////////////////////////////////
157-
/// Initialization
156+
///////////////////////////////////////////////////////////////////////////
157+
// Initialization
158158

159159
static mut THE_REGISTRY: Option<Arc<Registry>> = None;
160160
static THE_REGISTRY_SET: Once = Once::new();
@@ -407,12 +407,12 @@ impl Registry {
407407
}
408408
}
409409

410-
/// ////////////////////////////////////////////////////////////////////////
410+
///////////////////////////////////////////////////////////////////////////
411411
/// MAIN LOOP
412412
///
413413
/// So long as all of the worker threads are hanging out in their
414414
/// top-level loop, there is no work to be done.
415-
415+
///
416416
/// Push a job into the given `registry`. If we are running on a
417417
/// worker thread for the registry, this will push onto the
418418
/// deque. Else, it will inject from the outside (which is slower).
@@ -668,8 +668,8 @@ impl ThreadInfo {
668668
}
669669
}
670670

671-
/// ////////////////////////////////////////////////////////////////////////
672-
/// WorkerThread identifiers
671+
///////////////////////////////////////////////////////////////////////////
672+
// WorkerThread identifiers
673673

674674
pub(super) struct WorkerThread {
675675
/// the "worker" half of our local deque
@@ -1019,8 +1019,6 @@ impl WorkerThread {
10191019
}
10201020
}
10211021

1022-
/// ////////////////////////////////////////////////////////////////////////
1023-
10241022
unsafe fn main_loop(thread: ThreadBuilder) {
10251023
let worker_thread = &WorkerThread::from(thread);
10261024
unsafe { WorkerThread::set_current(worker_thread) };

0 commit comments

Comments
 (0)