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
3 changed files with 24 additions and 0 deletions
|
@ -1,3 +1,4 @@
|
||||||
|
#![cfg_attr(bootstrap, feature(let_else))]
|
||||||
#![allow(clippy::useless_format, clippy::derive_partial_eq_without_eq, rustc::internal)]
|
#![allow(clippy::useless_format, clippy::derive_partial_eq_without_eq, rustc::internal)]
|
||||||
|
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
#![feature(is_some_with)]
|
#![feature(is_some_with)]
|
||||||
#![feature(nonzero_ops)]
|
#![feature(nonzero_ops)]
|
||||||
#![feature(local_key_cell_methods)]
|
#![feature(local_key_cell_methods)]
|
||||||
|
#![cfg_attr(bootstrap, feature(let_else))]
|
||||||
// Configure clippy and other lints
|
// Configure clippy and other lints
|
||||||
#![allow(
|
#![allow(
|
||||||
clippy::collapsible_else_if,
|
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…
Add table
Add a link
Reference in a new issue