Skip to content

Commit 41e60d1

Browse files
committed
Monomorphize generator field types for debuginfo
1 parent 61097bc commit 41e60d1

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

src/librustc_codegen_ssa/mir/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -627,6 +627,7 @@ fn arg_local_refs<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>(
627627
.zip(state_tys)
628628
.enumerate()
629629
.filter_map(move |(i, (decl, ty))| {
630+
let ty = fx.monomorphize(&ty);
630631
decl.name.map(|name| (i + upvar_count + 1, name, false, ty))
631632
})
632633
}).into_iter().flatten();
+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// run-pass
2+
// compile-flags: -g
3+
4+
#![feature(generators, generator_trait)]
5+
6+
use std::ops::Generator;
7+
8+
struct Database;
9+
10+
impl Database {
11+
fn get_connection(&self) -> impl Iterator<Item = ()> {
12+
Some(()).into_iter()
13+
}
14+
15+
fn check_connection(&self) -> impl Generator<Yield = (), Return = ()> + '_ {
16+
move || {
17+
let iter = self.get_connection();
18+
for i in iter {
19+
yield i
20+
}
21+
}
22+
}
23+
}
24+
25+
fn main() {
26+
Database.check_connection();
27+
}

0 commit comments

Comments
 (0)