Skip to content

Commit 55993e8

Browse files
authored
Merge branch 'main' into raw-define
2 parents 1434597 + 0951406 commit 55993e8

2 files changed

Lines changed: 26 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
on:
2+
pull_request:
23
push:
34

45
permissions: {}

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)