about summary refs log tree commit diff
path: root/tests/incremental
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2025-03-26 00:15:24 +0000
committerMichael Goulet <michael@errs.io>2025-03-26 00:15:34 +0000
commit4b22ac5296a7a40aebfc997eec122fbfe50164da (patch)
tree8c9acb3026a002ce562b918cdc5b381bb9904d9d /tests/incremental
parent48994b1674b3212d27b5e83841c0966bc2b4be43 (diff)
downloadrust-4b22ac5296a7a40aebfc997eec122fbfe50164da.tar.gz
rust-4b22ac5296a7a40aebfc997eec122fbfe50164da.zip
Ensure define_opaque is accounted for in HIR hash
Diffstat (limited to 'tests/incremental')
-rw-r--r--tests/incremental/define-opaques.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/incremental/define-opaques.rs b/tests/incremental/define-opaques.rs
new file mode 100644
index 00000000000..d6eae238341
--- /dev/null
+++ b/tests/incremental/define-opaques.rs
@@ -0,0 +1,19 @@
+//@ revisions: rpass1 cfail2
+
+#![feature(type_alias_impl_trait)]
+
+pub type Foo = impl Sized;
+
+#[cfg_attr(rpass1, define_opaque())]
+#[cfg_attr(cfail2, define_opaque(Foo))]
+fn a() {
+    //[cfail2]~^ ERROR item does not constrain `Foo::{opaque#0}`
+    let _: Foo = b();
+}
+
+#[define_opaque(Foo)]
+fn b() -> Foo {
+    ()
+}
+
+fn main() {}