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
//! Compile-only regressions for exact payload/schema brands after type erasure.
//! A function accepting any string lifetime is a Rust subtype of one accepting
//! only static strings, but these VM registrations must never change brands.
/// ```compile_fail
/// fn rebrand(value: rustia::Object<fn(&str)>) -> rustia::Object<fn(&'static str)> {
/// value
/// }
/// ```
/// ```compile_fail
/// fn rebrand(value: rustia::ObjectType<fn(&str)>) -> rustia::ObjectType<fn(&'static str)> {
/// value
/// }
/// ```
/// ```compile_fail
/// use rustia::HostSchema;
/// struct Schema<T>(std::marker::PhantomData<T>);
/// impl<T: 'static> HostSchema for Schema<T> {
/// type Input = (); type Slots = (); type External = ();
/// type Effect = (); type SlotWrite = (); type Record = ();
/// }
/// fn rebrand(value: rustia::HostFunction<Schema<fn(&str)>>) -> rustia::HostFunction<Schema<fn(&'static str)>> {
/// value
/// }
/// ```
/// ```compile_fail
/// use rustia::HostSchema;
/// struct Schema<T>(std::marker::PhantomData<T>);
/// impl<T: 'static> HostSchema for Schema<T> {
/// type Input = (); type Slots = (); type External = ();
/// type Effect = (); type SlotWrite = (); type Record = ();
/// }
/// fn rebrand(value: rustia::HostModule<Schema<fn(&str)>>) -> rustia::HostModule<Schema<fn(&'static str)>> {
/// value
/// }
/// ```
/// ```compile_fail
/// use rustia::HostSchema;
/// struct Schema<T>(std::marker::PhantomData<T>);
/// impl<T: 'static> HostSchema for Schema<T> {
/// type Input = (); type Slots = (); type External = ();
/// type Effect = (); type SlotWrite = (); type Record = ();
/// }
/// fn rebrand(value: rustia::ObjectType<(), Schema<fn(&str)>>) -> rustia::ObjectType<(), Schema<fn(&'static str)>> {
/// value
/// }
/// ```
pub const EXACT_ERASED_BRANDS: = ;