oxidecomputer / dropshot

expose REST APIs from a Rust program
Apache License 2.0
843 stars 74 forks source link

[6/n] [dropshot-endpoint] add extra validation for parameters #1011

Closed sunshowers closed 3 months ago

sunshowers commented 4 months ago

We are forced to do some of this validation for trait-based servers, and catching things like non-static lifetime parameters early can make this a nicer experience. We don't try and capture everything, just some of the things that are either required for, or closely related to, trait-based servers.

Depends on #1009.

sunshowers commented 4 months ago

Is it the case today that we're not doing the appropriate checks for lifetimes?

It won't succeed at compiling, but it'll produce some pretty rough error messages: https://gist.github.com/sunshowers/c83254c5f1002b410ae05f9426c78b2d