aboutsummaryrefslogtreecommitdiffhomepage
path: root/notes/lifetimes_on_type_params.txt
blob: 9a640fe409a0f068f549d6f28192324092313611 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21

Lifetime specifications on type parameters
==========================================

Should it be possible to...

* Specify lifetimes involving type parameters?
* Specify that two type parameters have the same type,
   but different lifetimes or different qualifiers (var/threaded/etc)?

My guess is that the answer is NO to both questions,
or at least that it would complicate the compiler implementation
to support either (or both) of these two features.

Examples:

    # Would it be meaningful to specify a lifetime constraint involving T?
    type Thing<T>

    # Would it be meaningful to specify lifetimes on a and/or b?
    # Would it be meaningful to specify qualfiers on a and/or b?
    func Thing<T>.do_stuff(slot T a, slot T b)