Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add test for incremental ICE: slice-pattern-const.rs #83085 #124165

Merged
merged 1 commit into from
Apr 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions tests/incremental/slice-pattern-const-ice-83085.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
//@ compile-flags: -Zincremental-verify-ich=yes
// issue: rust-lang/rust#83085 incremental ICE: forcing query with already existing `DepNode`
// this used to fail to build straight away without needing any kind of
// stage1/2 builds but tidy demands it
//@ revisions:rpass1 rpass2

fn main() {
const BOO: &[u8; 0] = &[];
match &[] {
BOO => (),
b"" => (),
_ => (),
}
}

#[derive(PartialEq, Eq)]
struct Id<'a> {
ns: &'a str,
}
fn visit_struct() {
let id = Id { ns: "random1" };
const FLAG: Id<'static> = Id {
ns: "needs_to_be_the_same",
};
match id {
FLAG => {}
_ => {}
}
}
fn visit_struct2() {
let id = Id { ns: "random2" };
const FLAG: Id<'static> = Id {
ns: "needs_to_be_the_same",
};
match id {
FLAG => {}
_ => {}
}
}
Loading