Skip to content

Commit be1ed1b

Browse files
authored
Rollup merge of #102148 - RalfJung:miri-test, r=oli-obk
add regression test for miri issue 2433 Adding this here because the test needs to be run with debug assertions enabled to be sure so I had to run it in the rustc workspace. Cc rust-lang/miri#2433 r? `@oli-obk`
2 parents 2a006cc + a7cdfaf commit be1ed1b

File tree

3 files changed

+24
-0
lines changed

3 files changed

+24
-0
lines changed

src/tools/miri/cargo-miri/src/main.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#![cfg_attr(bootstrap, feature(let_else))]
12
#![allow(clippy::useless_format, clippy::derive_partial_eq_without_eq, rustc::internal)]
23

34
#[macro_use]

src/tools/miri/src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#![feature(is_some_with)]
1111
#![feature(nonzero_ops)]
1212
#![feature(local_key_cell_methods)]
13+
#![cfg_attr(bootstrap, feature(let_else))]
1314
// Configure clippy and other lints
1415
#![allow(
1516
clippy::collapsible_else_if,
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#![feature(type_alias_impl_trait)]
2+
3+
trait T { type Item; }
4+
5+
type Alias<'a> = impl T<Item = &'a ()>;
6+
7+
struct S;
8+
impl<'a> T for &'a S {
9+
type Item = &'a ();
10+
}
11+
12+
fn filter_positive<'a>() -> Alias<'a> {
13+
&S
14+
}
15+
16+
fn with_positive(fun: impl Fn(Alias<'_>)) {
17+
fun(filter_positive());
18+
}
19+
20+
fn main() {
21+
with_positive(|_| ());
22+
}

0 commit comments

Comments
 (0)