Debian Codegraph @

gcc/testsuite/rust/compile/bounds1.rs

raw
1 #[lang = "sized"]
2 pub trait Sized {}
3
4 mod core {
5 mod ops {
6 #[lang = "add"]
7 pub trait Add<Rhs = Self> {
8 type Output;
9
10 fn add(self, rhs: Rhs) -> Self::Output;
11 }
12 }
13 }
14
15 pub fn foo<T: core::ops::Add<Output = i32>>(a: T) -> i32 {
16 a + a
17 }
18
19 pub fn main() {
20 foo(123f32);
21 // { dg-error "bounds not satisfied for f32 .Add. is not satisfied" "" { target *-*-* } .-1 }
22 }