Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions src/test/ui/mir/issue-99852.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// check-pass
// compile-flags: -C opt-level=3

#![crate_type = "lib"]

fn lambda<T: Default>() -> T {
if true && let Some(bar) = transform() {
bar
} else {
T::default()
}
}

fn transform<T>() -> Option<T> {
None
}
27 changes: 27 additions & 0 deletions src/test/ui/mir/issue-99866.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// check-pass
// compile-flags: -C opt-level=3

#![crate_type = "lib"]

pub trait Backend {
type DescriptorSetLayout;
}

pub struct Back;

impl Backend for Back {
type DescriptorSetLayout = u32;
}

pub struct HalSetLayouts {
vertex_layout: <Back as Backend>::DescriptorSetLayout,
}

impl HalSetLayouts {
pub fn iter<DSL>(self) -> DSL
where
Back: Backend<DescriptorSetLayout = DSL>,
{
self.vertex_layout
}
}