Skip to content

Commit 6061ee8

Browse files
committed
Merge branch 'raw-define' of github_coeffaij:coeff-aij/thrust into raw-command
2 parents 0ad2015 + 55993e8 commit 6061ee8

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

src/analyze/crate_.rs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,31 @@ impl<'tcx, 'ctx> Analyzer<'tcx, 'ctx> {
128128
.generic_args(generic_args)
129129
.run(&expected);
130130
}
131+
132+
let mut args: Vec<mir_ty::GenericArg<'tcx>> = Vec::new();
133+
134+
let generics = self.tcx.generics_of(local_def_id);
135+
for idx in 0..generics.count() {
136+
let param = generics.param_at(idx, self.tcx);
137+
let arg = match param.kind {
138+
mir_ty::GenericParamDefKind::Type { .. } => {
139+
if constrained_params.contains(&param.index) {
140+
panic!(
141+
"unable to check generic function with constrained type parameter: {}",
142+
self.tcx.def_path_str(local_def_id)
143+
);
144+
}
145+
self.tcx.types.i32.into()
146+
}
147+
mir_ty::GenericParamDefKind::Const { .. } => {
148+
unimplemented!()
149+
}
150+
mir_ty::GenericParamDefKind::Lifetime { .. } => self.tcx.lifetimes.re_erased.into(),
151+
};
152+
args.push(arg);
153+
}
154+
155+
self.tcx.mk_args(&args)
131156
}
132157

133158
fn placeholder_generic_args(&self, local_def_id: LocalDefId) -> mir_ty::GenericArgsRef<'tcx> {

0 commit comments

Comments
 (0)