diff options
| author | varkor <github@varkor.com> | 2019-09-26 12:10:43 +0100 |
|---|---|---|
| committer | varkor <github@varkor.com> | 2019-09-26 12:10:43 +0100 |
| commit | e3fb05dc3c32160e89ad354297b168fae11ffba1 (patch) | |
| tree | 92c76cff5b4e73f9792c66f04ec9b3bed3d79039 | |
| parent | bea3d67c77dd643ef1f89c8bd6562e90b373cec4 (diff) | |
| download | rust-e3fb05dc3c32160e89ad354297b168fae11ffba1.tar.gz rust-e3fb05dc3c32160e89ad354297b168fae11ffba1.zip | |
Rename some `_sty` variables to `_kind`
| -rw-r--r-- | src/librustc/ty/context.rs | 8 | ||||
| -rw-r--r-- | src/librustc/ty/flags.rs | 8 | ||||
| -rw-r--r-- | src/librustc_codegen_llvm/builder.rs | 8 | ||||
| -rw-r--r-- | src/librustdoc/clean/mod.rs | 8 |
4 files changed, 16 insertions, 16 deletions
diff --git a/src/librustc/ty/context.rs b/src/librustc/ty/context.rs index bfaaca68830..6c3bb3ebb77 100644 --- a/src/librustc/ty/context.rs +++ b/src/librustc/ty/context.rs @@ -132,13 +132,13 @@ impl<'tcx> CtxtInterners<'tcx> { #[allow(rustc::usage_of_ty_tykind)] #[inline(never)] fn intern_ty(&self, - st: TyKind<'tcx> + kind: TyKind<'tcx> ) -> Ty<'tcx> { - self.type_.intern(st, |st| { - let flags = super::flags::FlagComputation::for_sty(&st); + self.type_.intern(kind, |kind| { + let flags = super::flags::FlagComputation::for_kind(&kind); let ty_struct = TyS { - kind: st, + kind, flags: flags.flags, outer_exclusive_binder: flags.outer_exclusive_binder, }; diff --git a/src/librustc/ty/flags.rs b/src/librustc/ty/flags.rs index 297c001dae9..6e43aa6a25d 100644 --- a/src/librustc/ty/flags.rs +++ b/src/librustc/ty/flags.rs @@ -19,9 +19,9 @@ impl FlagComputation { } #[allow(rustc::usage_of_ty_tykind)] - pub fn for_sty(st: &ty::TyKind<'_>) -> FlagComputation { + pub fn for_kind(kind: &ty::TyKind<'_>) -> FlagComputation { let mut result = FlagComputation::new(); - result.add_sty(st); + result.add_kind(kind); result } @@ -63,8 +63,8 @@ impl FlagComputation { } #[allow(rustc::usage_of_ty_tykind)] - fn add_sty(&mut self, st: &ty::TyKind<'_>) { - match st { + fn add_kind(&mut self, kind: &ty::TyKind<'_>) { + match kind { &ty::Bool | &ty::Char | &ty::Int(_) | diff --git a/src/librustc_codegen_llvm/builder.rs b/src/librustc_codegen_llvm/builder.rs index b8b0e77d098..71a6067fd48 100644 --- a/src/librustc_codegen_llvm/builder.rs +++ b/src/librustc_codegen_llvm/builder.rs @@ -324,7 +324,7 @@ impl BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> { use syntax::ast::UintTy::*; use rustc::ty::{Int, Uint}; - let new_sty = match ty.kind { + let new_kind = match ty.kind { Int(Isize) => Int(self.tcx.sess.target.isize_ty), Uint(Usize) => Uint(self.tcx.sess.target.usize_ty), ref t @ Uint(_) | ref t @ Int(_) => t.clone(), @@ -332,7 +332,7 @@ impl BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> { }; let name = match oop { - OverflowOp::Add => match new_sty { + OverflowOp::Add => match new_kind { Int(I8) => "llvm.sadd.with.overflow.i8", Int(I16) => "llvm.sadd.with.overflow.i16", Int(I32) => "llvm.sadd.with.overflow.i32", @@ -347,7 +347,7 @@ impl BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> { _ => unreachable!(), }, - OverflowOp::Sub => match new_sty { + OverflowOp::Sub => match new_kind { Int(I8) => "llvm.ssub.with.overflow.i8", Int(I16) => "llvm.ssub.with.overflow.i16", Int(I32) => "llvm.ssub.with.overflow.i32", @@ -362,7 +362,7 @@ impl BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> { _ => unreachable!(), }, - OverflowOp::Mul => match new_sty { + OverflowOp::Mul => match new_kind { Int(I8) => "llvm.smul.with.overflow.i8", Int(I16) => "llvm.smul.with.overflow.i16", Int(I32) => "llvm.smul.with.overflow.i32", diff --git a/src/librustdoc/clean/mod.rs b/src/librustdoc/clean/mod.rs index 635f07c3886..e4a8720f5ea 100644 --- a/src/librustdoc/clean/mod.rs +++ b/src/librustdoc/clean/mod.rs @@ -1098,7 +1098,7 @@ fn external_generic_args( substs: SubstsRef<'_>, ) -> GenericArgs { let mut skip_self = has_self; - let mut ty_sty = None; + let mut ty_kind = None; let args: Vec<_> = substs.iter().filter_map(|kind| match kind.unpack() { GenericArgKind::Lifetime(lt) => { lt.clean(cx).and_then(|lt| Some(GenericArg::Lifetime(lt))) @@ -1108,7 +1108,7 @@ fn external_generic_args( None } GenericArgKind::Type(ty) => { - ty_sty = Some(&ty.kind); + ty_kind = Some(&ty.kind); Some(GenericArg::Type(ty.clean(cx))) } GenericArgKind::Const(ct) => Some(GenericArg::Const(ct.clean(cx))), @@ -1117,8 +1117,8 @@ fn external_generic_args( match trait_did { // Attempt to sugar an external path like Fn<(A, B,), C> to Fn(A, B) -> C Some(did) if cx.tcx.lang_items().fn_trait_kind(did).is_some() => { - assert!(ty_sty.is_some()); - let inputs = match ty_sty { + assert!(ty_kind.is_some()); + let inputs = match ty_kind { Some(ty::Tuple(ref tys)) => tys.iter().map(|t| t.expect_ty().clean(cx)).collect(), _ => return GenericArgs::AngleBracketed { args, bindings }, }; |
