mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-14 02:49:40 +00:00

Currently it relies on special treatment of `kw::Empty`, which is really easy to get wrong. This commit makes the special case clearer in the type system by using `Option`. It's a bit clumsy, but the synthetic name handling itself is a bit clumsy; better to make it explicit than sneak it in. Fixes #133426.
21 lines
464 B
Rust
21 lines
464 B
Rust
//! Test for the crash in #133426, caused by an empty symbol being used for a
|
|
//! type name.
|
|
|
|
#![allow(incomplete_features)]
|
|
#![feature(never_patterns)]
|
|
|
|
fn a(
|
|
_: impl Iterator<
|
|
Item = [(); {
|
|
match *todo!() { ! }; //~ ERROR type `!` cannot be dereferenced
|
|
}],
|
|
>,
|
|
) {
|
|
}
|
|
|
|
fn b(_: impl Iterator<Item = { match 0 { ! } }>) {}
|
|
//~^ ERROR associated const equality is incomplete
|
|
//~| ERROR expected type, found constant
|
|
|
|
fn main() {}
|