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

Ephera
creator
link
fedilink
110M

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.

Create a post

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

  • Posts must be relevant to programming, programmers, or computer science.
  • No NSFW content.
  • Jokes must be in good taste. No hate speech, bigotry, etc.
  • 1 user online
  • 78 users / day
  • 212 users / week
  • 414 users / month
  • 2.93K users / 6 months
  • 1 subscriber
  • 1.53K Posts
  • 33.8K Comments
  • Modlog