-
Notifications
You must be signed in to change notification settings - Fork 1.7k
error[E0599]: no method named global_tcx
found for type rustc::ty::TyCtxt<'tcx>
in the current scope
#4597
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
looks like they just removed So this I wonder if this will work in clippy too... trying... |
Well I'll be, it worked: diff --git a/clippy_lints/src/enum_clike.rs b/clippy_lints/src/enum_clike.rs
index e1e20c90..2a361856 100644
--- a/clippy_lints/src/enum_clike.rs
+++ b/clippy_lints/src/enum_clike.rs
@@ -48,7 +48,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UnportableVariant {
if let Some(anon_const) = &var.disr_expr {
let param_env = ty::ParamEnv::empty();
let def_id = cx.tcx.hir().body_owner_def_id(anon_const.body);
- let substs = InternalSubsts::identity_for_item(cx.tcx.global_tcx(), def_id);
+ let substs = InternalSubsts::identity_for_item(cx.tcx, def_id);
let instance = ty::Instance::new(def_id, substs);
let c_id = GlobalId {
instance,
diff --git a/clippy_lints/src/utils/mod.rs b/clippy_lints/src/utils/mod.rs
index ffeb90e1..8fd84c07 100644
--- a/clippy_lints/src/utils/mod.rs
+++ b/clippy_lints/src/utils/mod.rs
@@ -799,7 +799,7 @@ pub fn type_is_unsafe_function<'a, 'tcx>(cx: &LateContext<'a, 'tcx>, ty: Ty<'tcx
}
pub fn is_copy<'a, 'tcx>(cx: &LateContext<'a, 'tcx>, ty: Ty<'tcx>) -> bool {
- ty.is_copy_modulo_regions(cx.tcx.global_tcx(), cx.param_env, DUMMY_SP)
+ ty.is_copy_modulo_regions(cx.tcx, cx.param_env, DUMMY_SP)
}
/// Checks if an expression is constructing a tuple-like enum variant or struct The only thing left (untouched) is: $ grep -nrIFw global_tcx
src/librustc/infer/mod.rs:477: global_tcx: TyCtxt<'tcx>,
src/librustc/infer/mod.rs:484: global_tcx: self,
src/librustc/infer/mod.rs:523: global_tcx,
src/librustc/infer/mod.rs:527: global_tcx.enter_local(|tcx| { Hope clippy isn't trying to use that ^. Still compiling or something: |
I'm failing to compile latest rust master because it fails to compile clippy, as follows:
The text was updated successfully, but these errors were encountered: