Skip to content

fix: traits with lifetimes#124

Open
matejcik wants to merge 1 commit intoZettaScaleLabs:mainfrom
matejcik:matejcik/traits-with-lifetimes
Open

fix: traits with lifetimes#124
matejcik wants to merge 1 commit intoZettaScaleLabs:mainfrom
matejcik:matejcik/traits-with-lifetimes

Conversation

@matejcik
Copy link
Contributor

i am honestly unsure about both changes here, but they look correct and allow the code to build.

  • do not name trait_lts in the for<> construct in the vtable entry -- because they are already named in the outer scope, in the impl of StabbyVtable[TraitName].

    Looks conceptually correct, but then, the definition of the extern fn is apparently fine with shadowing the same lifetime name, but the cast below it is not?? Like, should we be taking the lifetime from outer scope, or should we instead rename all the trait lifetimes to avoid the name collision?

  • bound all trait_lts with 'stabby_vt_lt in IConstConstructor.
    I failed to understand why IConstConstructor<'a> needs to be bounded by 'a (or 'stabby_vt_lt in the generated impl), but given that it is, all of StabbyVtable... lifetimes must also be bounded by 'stabby_vt_lt. Plus, all of its generic type parameters are already bounded by that, so it kinda comes to reason that the lifetimes would be too?

* do not name trait_lts in for<> expression in the vtable, because
  they are already parameters of the vtable-containing type
* add an appropriate lifetime bound for trait lifetimes to
  IConstConstructor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant