Remove Clone derive from ImplicitCtxt.

It's unnecessary.
This commit is contained in:
Nicholas Nethercote
2026-03-04 07:18:07 +11:00
parent e8a28e78a9
commit 6a07088b1b
4 changed files with 3 additions and 4 deletions
+1 -1
View File
@@ -42,7 +42,7 @@ fn track_diagnostic<R>(diagnostic: DiagInner, f: &mut dyn FnMut(DiagInner) -> R)
icx.tcx.dep_graph.record_diagnostic(icx.tcx, &diagnostic);
// Diagnostics are tracked, we can ignore the dependency.
let icx = tls::ImplicitCtxt { task_deps: TaskDepsRef::Ignore, ..icx.clone() };
let icx = tls::ImplicitCtxt { task_deps: TaskDepsRef::Ignore, ..*icx };
tls::enter_context(&icx, move || (*f)(diagnostic))
} else {
// In any other case, invoke diagnostics anyway.
+1 -1
View File
@@ -63,7 +63,7 @@ fn with_deps<OP, R>(task_deps: TaskDepsRef<'_>, op: OP) -> R
OP: FnOnce() -> R,
{
ty::tls::with_context(|icx| {
let icx = ty::tls::ImplicitCtxt { task_deps, ..icx.clone() };
let icx = ty::tls::ImplicitCtxt { task_deps, ..*icx };
ty::tls::enter_context(&icx, op)
})
}
@@ -9,7 +9,6 @@
/// executing a new query. Whenever there's a `TyCtxt` value available
/// you should also have access to an `ImplicitCtxt` through the functions
/// in this module.
#[derive(Clone)]
pub struct ImplicitCtxt<'a, 'tcx> {
/// The current `TyCtxt`.
pub tcx: TyCtxt<'tcx>,
+1 -1
View File
@@ -81,7 +81,7 @@ pub(crate) fn start_query<R>(
let icx = ImplicitCtxt {
query: Some(job_id),
query_depth: icx.query_depth + if depth_limit { 1 } else { 0 },
..icx.clone()
..*icx
};
// Use the `ImplicitCtxt` while we execute the query.