]> git.lizzy.rs Git - rust.git/blob - tests/mir-opt/inline/caller_with_trivial_bound.rs
Rollup merge of #106644 - alexcrichton:update-wasi-toolchain, r=cuviper
[rust.git] / tests / mir-opt / inline / caller_with_trivial_bound.rs
1 // ignore-wasm32 compiled with panic=abort by default
2 // needs-unwind
3
4 #![crate_type = "lib"]
5 pub trait Factory<T> {
6     type Item;
7 }
8
9 pub struct IntFactory;
10
11 impl<T> Factory<T> for IntFactory {
12     type Item = usize;
13 }
14
15 // EMIT_MIR caller_with_trivial_bound.foo.Inline.diff
16 pub fn foo<T>()
17 where
18     IntFactory: Factory<T>,
19 {
20     let mut x: <IntFactory as Factory<T>>::Item = bar::<T>();
21 }
22
23 #[inline(always)]
24 pub fn bar<T>() -> <IntFactory as Factory<T>>::Item {
25     0usize
26 }