-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[6/n] [dropshot-endpoint] add extra validation for parameters #1011
base: sunshowers/spr/main.dropshot-endpoint-add-extra-validation-for-parameters
Are you sure you want to change the base?
Conversation
Created using spr 1.3.6-beta.1
Created using spr 1.3.6-beta.1
Created using spr 1.3.6-beta.1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it the case today that we're not doing the appropriate checks for lifetimes?
|
||
/// A representation of the RequestContext type. | ||
#[derive(Clone, Eq, PartialEq)] | ||
enum RqctxTy<'ast> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is what we're going to add to for the trait-based approach?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is what we're going to add to for the trait-based approach?
Yeah.
dropshot_endpoint/src/endpoint.rs
Outdated
@@ -834,6 +1044,57 @@ mod tests { | |||
); | |||
} | |||
|
|||
// These argument types are close to being invalid, but are actually valid. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it that these are odd but valid types? or could you elaborate on this proximity to invalidity?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expanded the comment here to describe the changes which would make these types invalid.
It won't succeed at compiling, but it'll produce some pretty rough error messages: https://gist.github.com/sunshowers/c83254c5f1002b410ae05f9426c78b2d |
Created using spr 1.3.6-beta.1
Created using spr 1.3.6-beta.1
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.