]> git.lizzy.rs Git - rust.git/blob - tests/ui/associated-item/issue-105449.rs
Rollup merge of #106823 - m-ou-se:format-args-as-str-guarantees, r=dtolnay
[rust.git] / tests / ui / associated-item / issue-105449.rs
1 // check-pass
2 // compile-flags: -C debug_assertions=yes -Zunstable-options
3
4 #[allow(dead_code)]
5 fn problematic_function<Space>()
6 where
7     DefaultAlloc: FinAllok<R1, Space>,
8 {
9     let e = Edge2dElement;
10     let _ = Into::<Point>::into(e.map_reference_coords());
11 }
12 impl<N> Allocator<N, R0> for DefaultAlloc {
13     type Buffer = MStorage;
14 }
15 impl<N> Allocator<N, R1> for DefaultAlloc {
16     type Buffer = MStorage;
17 }
18 impl<N, D> From<VectorN<N, D>> for Point
19 where
20     DefaultAlloc: Allocator<N, D>,
21 {
22     fn from(_: VectorN<N, D>) -> Self {
23         unimplemented!()
24     }
25 }
26 impl<GeometryDim, NodalDim> FinAllok<GeometryDim, NodalDim> for DefaultAlloc
27 where
28     DefaultAlloc: Allocator<Ure, GeometryDim>,
29     DefaultAlloc: Allocator<Ure, NodalDim>
30 {
31 }
32 impl FiniteElement<R1> for Edge2dElement {
33     fn map_reference_coords(&self) -> VectorN<Ure, R1> {
34         unimplemented!()
35     }
36 }
37 type VectorN<N, R> = (N, R, <DefaultAlloc as Allocator<N, R>>::Buffer);
38 struct DefaultAlloc;
39 struct R0;
40 struct R1;
41 struct MStorage;
42 struct Point;
43 struct Edge2dElement;
44 struct Ure;
45 trait Allocator<N, R> {
46     type Buffer;
47 }
48 trait FinAllok<GeometryDim, NodalDim>:
49     Allocator<Ure, GeometryDim> +
50     Allocator<Ure, NodalDim> +
51 {
52 }
53 trait FiniteElement<Rau>
54 where
55     DefaultAlloc: FinAllok<Rau, Rau>,
56 {
57     fn map_reference_coords(&self) -> VectorN<Ure, Rau>;
58 }
59 fn main() {}