From: Philip Herron Date: Wed, 24 Jun 2026 14:32:23 +0000 (+0100) Subject: gccrs: Add test case to show bug is fixed X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e2b4cfd5ca5ce84c7ae861d7485589bf277226cf;p=thirdparty%2Fgcc.git gccrs: Add test case to show bug is fixed Fixes Rust-GCC#4481 gcc/testsuite/ChangeLog: * rust/compile/issue-4481.rs: New test. Signed-off-by: Philip Herron --- diff --git a/gcc/testsuite/rust/compile/issue-4481.rs b/gcc/testsuite/rust/compile/issue-4481.rs new file mode 100644 index 00000000000..32477d84553 --- /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 {} + +fn foo() +where + T: Trait fn(&'b u32)>, // { dg-error {bounds not satisfied for abi:rust fnptr .& u32 ,. -> .. .NewTrait. is not satisfied \[E0277\]} } +{ +} + +impl<'a> Trait 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; +}