-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
/
generic-component-pass.rs
99 lines (86 loc) · 2.92 KB
/
generic-component-pass.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
#![no_implicit_prelude]
// Shadow primitives
#[allow(non_camel_case_types)]
pub struct bool;
#[allow(non_camel_case_types)]
pub struct char;
#[allow(non_camel_case_types)]
pub struct f32;
#[allow(non_camel_case_types)]
pub struct f64;
#[allow(non_camel_case_types)]
pub struct i128;
#[allow(non_camel_case_types)]
pub struct i16;
#[allow(non_camel_case_types)]
pub struct i32;
#[allow(non_camel_case_types)]
pub struct i64;
#[allow(non_camel_case_types)]
pub struct i8;
#[allow(non_camel_case_types)]
pub struct isize;
#[allow(non_camel_case_types)]
pub struct str;
#[allow(non_camel_case_types)]
pub struct u128;
#[allow(non_camel_case_types)]
pub struct u16;
#[allow(non_camel_case_types)]
pub struct u32;
#[allow(non_camel_case_types)]
pub struct u64;
#[allow(non_camel_case_types)]
pub struct u8;
#[allow(non_camel_case_types)]
pub struct usize;
pub struct Generic<T> {
marker: ::std::marker::PhantomData<T>,
}
impl<T> ::yew::Component for Generic<T>
where
T: 'static,
{
type Message = ();
type Properties = ();
fn create(_ctx: &::yew::Context<Self>) -> Self {
::std::unimplemented!()
}
fn view(&self, _ctx: &::yew::Context<Self>) -> ::yew::Html {
::std::unimplemented!()
}
}
pub struct Generic2<T1, T2> {
marker: ::std::marker::PhantomData<(T1, T2)>,
}
impl<T1, T2> ::yew::Component for Generic2<T1, T2>
where
T1: 'static,
T2: 'static,
{
type Message = ();
type Properties = ();
fn create(_ctx: &::yew::Context<Self>) -> Self {
::std::unimplemented!()
}
fn view(&self, _ctx: &::yew::Context<Self>) -> ::yew::Html {
::std::unimplemented!()
}
}
fn compile_pass() {
::yew::html! { <Generic<::std::string::String> /> };
::yew::html! { <Generic<(u8, bool)> /> };
::yew::html! { <Generic<(u8, bool)> ></Generic<(u8, bool)>> };
::yew::html! { <Generic<::std::string::String> ></Generic<::std::string::String>> };
::yew::html! { <Generic<::std::vec::Vec<::std::string::String>> /> };
::yew::html! { <Generic<::std::vec::Vec<::std::string::String>>></ Generic<::std::vec::Vec<::std::string::String>>> };
::yew::html! { <Generic<::std::primitive::usize> /> };
::yew::html! { <Generic<::std::primitive::usize>></Generic<::std::primitive::usize>> };
::yew::html! { <Generic<::std::string::String, > /> };
::yew::html! { <Generic<::std::string::String, >></Generic<::std::string::String,>> };
::yew::html! { <Generic2<::std::string::String, ::std::string::String> /> };
::yew::html! { <Generic2<::std::string::String, ::std::string::String>></Generic2<::std::string::String, ::std::string::String>> };
::yew::html! { <Generic2<::std::string::String, ::std::string::String, > /> };
::yew::html! { <Generic2<::std::string::String, ::std::string::String, >></Generic2<::std::string::String, ::std::string::String, >> };
}
fn main() {}