mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
Remove Clone derive from ImplicitCtxt.
It's unnecessary.
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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>,
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user