From: Philip Herron <[email protected]>

Fixes Rust-GCC#4481

gcc/testsuite/ChangeLog:

        * rust/compile/issue-4481.rs: New test.

Signed-off-by: Philip Herron <[email protected]>
---
This change was merged into the gccrs repository and is posted here for
upstream visibility and potential drive-by review, as requested by GCC
release managers.
Each commit email contains a link to its details on github from where you can
find the Pull-Request and associated discussions.


Commit on github: 
https://github.com/Rust-GCC/gccrs/commit/e2f7d746ace92002e8c3d22aee35bd6284256ab1

The commit has NOT been mentioned in any issue.

The commit has been mentioned in the following pull-request(s):
 - https://github.com/Rust-GCC/gccrs/pull/4605

 gcc/testsuite/rust/compile/issue-4481.rs | 25 ++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
 create mode 100644 gcc/testsuite/rust/compile/issue-4481.rs

diff --git a/gcc/testsuite/rust/compile/issue-4481.rs 
b/gcc/testsuite/rust/compile/issue-4481.rs
new file mode 100644
index 000000000..32477d845
--- /dev/null
+++ b/gcc/testsuite/rust/compile/issue-4481.rs
@@ -0,0 +1,25 @@
+#![feature(no_core, intrinsics, staged_api, lang_items)]
+#![no_core]
+
+#[lang = "sized"]
+pub trait Sized {}
+
+trait Trait<T: NewTrait> {}
+
+fn foo<T>()
+where
+    T: Trait<for<'b> fn(&'b u32)>, // { dg-error {bounds not satisfied for 
abi:rust fnptr .& u32 ,. -> .. .NewTrait. is not satisfied \[E0277\]} }
+{
+}
+
+impl<'a> Trait<fn(&'a u32)> for () {} // { dg-error {bounds not satisfied for 
abi:rust fnptr .& u32 ,. -> .. .NewTrait. is not satisfied \[E0277\]} }
+
+fn main() {
+    foo::<()>();
+}
+
+trait NewTrait {
+    type Assoc;
+    const C: Self::Assoc;
+    fn f(&self) -> Self::Assoc;
+}

base-commit: 1f8c9523bba29177b7884aff330bc45f28f088ec
-- 
2.54.0

Reply via email to