• lseif
    link
    fedilink
    arrow-up
    1
    ·
    9 months ago

    is that valid syntax in any context? i dont think it is

    • Ephera@lemmy.mlOP
      link
      fedilink
      arrow-up
      4
      ·
      9 months ago

      Pretty sure, it’s not. That’s why I included the error highlighting.

      To make it a valid struct field, you’d need to throw in a Box+dyn:

      pub pint: Box<dyn Sized>
      

      For a function parameter, you need an impl and can’t have the pub:

      pint: impl Sized
      

      Obviously, you could define your own struct or generic that also happens to be called Sized, but yeah, that’s cheating.

      • lseif
        link
        fedilink
        arrow-up
        2
        ·
        9 months ago

        thats what i figured. thanks :-)