Closed
Description
This won't be easy to fix, but filing a bug just so I can track it in a // known-bug
issue. This was found out of an attempt to replicate rust-lang/miri#2433 in a UI test.
#![feature(type_alias_impl_trait)]
#![feature(const_trait_impl)]
#![feature(const_refs_to_cell)]
#![feature(inline_const)]
use std::marker::Destruct;
trait T {
type Item;
}
type Alias<'a> = impl T<Item = &'a ()>;
struct S;
impl<'a> T for &'a S {
type Item = &'a ();
}
const fn filter_positive<'a>() -> &'a Alias<'a> {
&&S
}
const fn with_positive<F: ~const for<'a> Fn(&'a Alias<'a>) + ~const Destruct>(fun: F) {
fun(filter_positive());
}
const fn foo(_: &Alias<'_>) {}
const BAR: () = {
with_positive(foo);
};
fn main() {}
Metadata
Metadata
Assignees
Labels
Category: This is a bug.Call for participation: An issue has been fixed and does not reproduce, but no test has been added.`#[feature(type_alias_impl_trait)]`Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Relevant to the compiler team, which will review and decide on the PR/issue.ICE tracked in rust-lang/glacier.This issue requires a nightly compiler in some way.