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 https://github.com/rust-lang/miri/issues/2433 r? ``@oli-obk``
This commit is contained in:
commit
0d0186939b
@ -1,3 +1,4 @@
|
||||
#![cfg_attr(bootstrap, feature(let_else))]
|
||||
#![allow(clippy::useless_format, clippy::derive_partial_eq_without_eq, rustc::internal)]
|
||||
|
||||
#[macro_use]
|
||||
|
@ -10,6 +10,7 @@
|
||||
#![feature(is_some_with)]
|
||||
#![feature(nonzero_ops)]
|
||||
#![feature(local_key_cell_methods)]
|
||||
#![cfg_attr(bootstrap, feature(let_else))]
|
||||
// Configure clippy and other lints
|
||||
#![allow(
|
||||
clippy::collapsible_else_if,
|
||||
|
22
src/tools/miri/tests/pass/issues/issue-miri-2433.rs
Normal file
22
src/tools/miri/tests/pass/issues/issue-miri-2433.rs
Normal file
@ -0,0 +1,22 @@
|
||||
#![feature(type_alias_impl_trait)]
|
||||
|
||||
trait T { type Item; }
|
||||
|
||||
type Alias<'a> = impl T<Item = &'a ()>;
|
||||
|
||||
struct S;
|
||||
impl<'a> T for &'a S {
|
||||
type Item = &'a ();
|
||||
}
|
||||
|
||||
fn filter_positive<'a>() -> Alias<'a> {
|
||||
&S
|
||||
}
|
||||
|
||||
fn with_positive(fun: impl Fn(Alias<'_>)) {
|
||||
fun(filter_positive());
|
||||
}
|
||||
|
||||
fn main() {
|
||||
with_positive(|_| ());
|
||||
}
|
Loading…
Reference in New Issue
Block a user