Skip to content

Commit d873fa7

Browse files
committed
refactor(rustc_middle): Substs -> GenericArg
1 parent 761324d commit d873fa7

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

Diff for: src/callee.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ use crate::context::CodegenCx;
1717
pub fn get_fn<'gcc, 'tcx>(cx: &CodegenCx<'gcc, 'tcx>, instance: Instance<'tcx>) -> Function<'gcc> {
1818
let tcx = cx.tcx();
1919

20-
assert!(!instance.substs.has_infer());
21-
assert!(!instance.substs.has_escaping_bound_vars());
20+
assert!(!instance.args.has_infer());
21+
assert!(!instance.args.has_escaping_bound_vars());
2222

2323
let sym = tcx.symbol_name(instance).name;
2424

@@ -100,7 +100,7 @@ pub fn get_fn<'gcc, 'tcx>(cx: &CodegenCx<'gcc, 'tcx>, instance: Instance<'tcx>)
100100
// whether we are sharing generics or not. The important thing here is
101101
// that the visibility we apply to the declaration is the same one that
102102
// has been applied to the definition (wherever that definition may be).
103-
let is_generic = instance.substs.non_erasable_generics().next().is_some();
103+
let is_generic = instance.args.non_erasable_generics().next().is_some();
104104

105105
if is_generic {
106106
// This is a monomorphization. Its expected visibility depends

Diff for: src/intrinsic/mod.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ impl<'a, 'gcc, 'tcx> IntrinsicCallMethods<'tcx> for Builder<'a, 'gcc, 'tcx> {
9292
let tcx = self.tcx;
9393
let callee_ty = instance.ty(tcx, ty::ParamEnv::reveal_all());
9494

95-
let (def_id, substs) = match *callee_ty.kind() {
96-
ty::FnDef(def_id, substs) => (def_id, substs),
95+
let (def_id, fn_args) = match *callee_ty.kind() {
96+
ty::FnDef(def_id, fn_args) => (def_id, fn_args),
9797
_ => bug!("expected fn item type, found {}", callee_ty),
9898
};
9999

@@ -142,7 +142,7 @@ impl<'a, 'gcc, 'tcx> IntrinsicCallMethods<'tcx> for Builder<'a, 'gcc, 'tcx> {
142142
}
143143

144144
sym::volatile_load | sym::unaligned_volatile_load => {
145-
let tp_ty = substs.type_at(0);
145+
let tp_ty = fn_args.type_at(0);
146146
let mut ptr = args[0].immediate();
147147
if let PassMode::Cast(ty, _) = &fn_abi.ret.mode {
148148
ptr = self.pointercast(ptr, self.type_ptr_to(ty.gcc_type(self)));
@@ -264,7 +264,7 @@ impl<'a, 'gcc, 'tcx> IntrinsicCallMethods<'tcx> for Builder<'a, 'gcc, 'tcx> {
264264

265265
sym::raw_eq => {
266266
use rustc_target::abi::Abi::*;
267-
let tp_ty = substs.type_at(0);
267+
let tp_ty = fn_args.type_at(0);
268268
let layout = self.layout_of(tp_ty).layout;
269269
let _use_integer_compare = match layout.abi() {
270270
Scalar(_) | ScalarPair(_, _) => true,

Diff for: src/mono_item.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ impl<'gcc, 'tcx> PreDefineMethods<'tcx> for CodegenCx<'gcc, 'tcx> {
3131

3232
#[cfg_attr(not(feature="master"), allow(unused_variables))]
3333
fn predefine_fn(&self, instance: Instance<'tcx>, linkage: Linkage, visibility: Visibility, symbol_name: &str) {
34-
assert!(!instance.substs.has_infer());
34+
assert!(!instance.args.has_infer());
3535

3636
let fn_abi = self.fn_abi_of_instance(instance, ty::List::empty());
3737
self.linkage.set(base::linkage_to_gcc(linkage));

Diff for: src/type_of.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ fn uncached_gcc_type<'gcc, 'tcx>(cx: &CodegenCx<'gcc, 'tcx>, layout: TyAndLayout
101101
if let (&ty::Generator(_, _, _), &Variants::Single { index }) =
102102
(layout.ty.kind(), &layout.variants)
103103
{
104-
write!(&mut name, "::{}", ty::GeneratorSubsts::variant_name(index)).unwrap();
104+
write!(&mut name, "::{}", ty::GeneratorArgs::variant_name(index)).unwrap();
105105
}
106106
Some(name)
107107
}
@@ -282,7 +282,7 @@ impl<'tcx> LayoutGccExt<'tcx> for TyAndLayout<'tcx> {
282282
}
283283
// only wide pointer boxes are handled as pointers
284284
// thin pointer boxes with scalar allocators are handled by the general logic below
285-
ty::Adt(def, substs) if def.is_box() && cx.layout_of(substs.type_at(1)).is_zst() => {
285+
ty::Adt(def, args) if def.is_box() && cx.layout_of(args.type_at(1)).is_zst() => {
286286
let ptr_ty = Ty::new_mut_ptr(cx.tcx,self.ty.boxed_ty());
287287
return cx.layout_of(ptr_ty).scalar_pair_element_gcc_type(cx, index, immediate);
288288
}

0 commit comments

Comments
 (0)