Skip to content

Commit df75ef1

Browse files
committed
Add tests for 99866 and 99852
1 parent 4d45b07 commit df75ef1

File tree

2 files changed

+43
-0
lines changed

2 files changed

+43
-0
lines changed

Diff for: src/test/ui/mir/issue-99852.rs

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// check-pass
2+
// compile-flags: -C opt-level=3
3+
4+
#![crate_type = "lib"]
5+
6+
fn lambda<T: Default>() -> T {
7+
if true && let Some(bar) = transform() {
8+
bar
9+
} else {
10+
T::default()
11+
}
12+
}
13+
14+
fn transform<T>() -> Option<T> {
15+
None
16+
}

Diff for: src/test/ui/mir/issue-99866.rs

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// check-pass
2+
// compile-flags: -C opt-level=3
3+
4+
#![crate_type = "lib"]
5+
6+
pub trait Backend {
7+
type DescriptorSetLayout;
8+
}
9+
10+
pub struct Back;
11+
12+
impl Backend for Back {
13+
type DescriptorSetLayout = u32;
14+
}
15+
16+
pub struct HalSetLayouts {
17+
vertex_layout: <Back as Backend>::DescriptorSetLayout,
18+
}
19+
20+
impl HalSetLayouts {
21+
pub fn iter<DSL>(self) -> DSL
22+
where
23+
Back: Backend<DescriptorSetLayout = DSL>,
24+
{
25+
self.vertex_layout
26+
}
27+
}

0 commit comments

Comments
 (0)