Skip to content

Commit

Permalink
EXPECTORATE=overwrite
Browse files Browse the repository at this point in the history
  • Loading branch information
hawkw committed Nov 21, 2024
1 parent 8f6d70e commit ccbbbe2
Show file tree
Hide file tree
Showing 11 changed files with 45 additions and 30 deletions.
2 changes: 1 addition & 1 deletion dropshot/tests/fail/bad_trait_channel17.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ error[E0277]: the trait bound `dropshot::WebsocketConnection: SharedExtractor` i
note: required by a bound in `ApiEndpoint::<StubContext>::new_for_types`
--> src/api_description.rs
|
| pub fn new_for_types<FuncParams, ResultType>(
| pub fn new_for_types<FuncParams, ReturnType>(
| ------------- required by a bound in this associated function
...
| FuncParams: RequestExtractor + 'static,
Expand Down
2 changes: 1 addition & 1 deletion dropshot/tests/fail/bad_trait_channel18.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ error[E0277]: the trait bound `dropshot::WebsocketConnection: SharedExtractor` i
note: required by a bound in `ApiEndpoint::<StubContext>::new_for_types`
--> src/api_description.rs
|
| pub fn new_for_types<FuncParams, ResultType>(
| pub fn new_for_types<FuncParams, ReturnType>(
| ------------- required by a bound in this associated function
...
| FuncParams: RequestExtractor + 'static,
Expand Down
2 changes: 1 addition & 1 deletion dropshot/tests/fail/bad_trait_channel19.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ error[E0277]: the trait bound `std::string::String: SharedExtractor` is not sati
note: required by a bound in `ApiEndpoint::<StubContext>::new_for_types`
--> src/api_description.rs
|
| pub fn new_for_types<FuncParams, ResultType>(
| pub fn new_for_types<FuncParams, ReturnType>(
| ------------- required by a bound in this associated function
...
| FuncParams: RequestExtractor + 'static,
Expand Down
14 changes: 8 additions & 6 deletions dropshot/tests/fail/bad_trait_endpoint10.stderr
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
error[E0277]: the trait bound `Result<dropshot::HttpResponseUpdatedNoContent, String>: dropshot::api_description::HttpResultType` is not satisfied
error[E0277]: endpoint handler functions must return a value that implements `dropshot::HttpResponse`
--> tests/fail/bad_trait_endpoint10.rs:19:10
|
19 | ) -> Result<HttpResponseUpdatedNoContent, String>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `dropshot::api_description::HttpResultType` is not implemented for `Result<dropshot::HttpResponseUpdatedNoContent, String>`
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `HttpResponse` is not implemented for `Result<dropshot::HttpResponseUpdatedNoContent, String>`
|
= help: the trait `dropshot::api_description::HttpResultType` is implemented for `Result<T, HttpError>`
= note: `HttpResponse` is implemented for `Result<T, E>` where `T: HttpResponse` and `E: HttpResponseError`
= note: `HttpResponse` is implemented for `http::Response<dropshot::Body>`
= help: the trait `HttpResponse` is implemented for `Result<T, E>`
note: required by a bound in `ApiEndpoint::<StubContext>::new_for_types`
--> src/api_description.rs
|
| pub fn new_for_types<FuncParams, ResultType>(
| pub fn new_for_types<FuncParams, ReturnType>(
| ------------- required by a bound in this associated function
...
| ResultType: HttpResultType,
| ^^^^^^^^^^^^^^ required by this bound in `ApiEndpoint::<StubContext>::new_for_types`
| ReturnType: HttpResponse + Send + Sync + 'static,
| ^^^^^^^^^^^^ required by this bound in `ApiEndpoint::<StubContext>::new_for_types`

error[E0277]: the trait bound `fn(RequestContext<<ServerImpl as MyApi>::Context>) -> impl Future<Output = Result<dropshot::HttpResponseUpdatedNoContent, String>> + Send + 'static {<ServerImpl as MyApi>::bad_error_type}: dropshot::handler::HttpHandlerFunc<_, _, _>` is not satisfied
--> tests/fail/bad_trait_endpoint10.rs:13:5
Expand Down
24 changes: 8 additions & 16 deletions dropshot/tests/fail/bad_trait_endpoint12.stderr
Original file line number Diff line number Diff line change
@@ -1,28 +1,20 @@
error[E0277]: the trait bound `std::string::String: HttpCodedResponse` is not satisfied
error[E0277]: endpoint handler functions must return a value that implements `dropshot::HttpResponse`
--> tests/fail/bad_trait_endpoint12.rs:24:10
|
24 | ) -> Result<String, HttpError>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `HttpCodedResponse` is not implemented for `std::string::String`, which is required by `Result<std::string::String, dropshot::HttpError>: dropshot::api_description::HttpResultType`
| ^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `HttpResponse` is not implemented for `Result<std::string::String, dropshot::HttpError>`
|
= help: the following other types implement trait `HttpCodedResponse`:
HttpResponseAccepted<T>
HttpResponseCreated<T>
HttpResponseDeleted
HttpResponseOk<T>
HttpResponseUpdatedNoContent
dropshot::handler::HttpResponseFoundStatus
dropshot::handler::HttpResponseSeeOtherStatus
dropshot::handler::HttpResponseTemporaryRedirectStatus
= note: required for `std::string::String` to implement `HttpResponse`
= note: required for `Result<std::string::String, dropshot::HttpError>` to implement `dropshot::api_description::HttpResultType`
= note: `HttpResponse` is implemented for `Result<T, E>` where `T: HttpResponse` and `E: HttpResponseError`
= note: `HttpResponse` is implemented for `http::Response<dropshot::Body>`
= help: the trait `HttpResponse` is implemented for `Result<T, E>`
note: required by a bound in `ApiEndpoint::<StubContext>::new_for_types`
--> src/api_description.rs
|
| pub fn new_for_types<FuncParams, ResultType>(
| pub fn new_for_types<FuncParams, ReturnType>(
| ------------- required by a bound in this associated function
...
| ResultType: HttpResultType,
| ^^^^^^^^^^^^^^ required by this bound in `ApiEndpoint::<StubContext>::new_for_types`
| ReturnType: HttpResponse + Send + Sync + 'static,
| ^^^^^^^^^^^^ required by this bound in `ApiEndpoint::<StubContext>::new_for_types`

error[E0277]: the trait bound `fn(RequestContext<<ServerImpl as MyApi>::Context>) -> impl Future<Output = Result<std::string::String, dropshot::HttpError>> + Send + 'static {<ServerImpl as MyApi>::bad_response_type}: dropshot::handler::HttpHandlerFunc<_, _, _>` is not satisfied
--> tests/fail/bad_trait_endpoint12.rs:18:5
Expand Down
2 changes: 1 addition & 1 deletion dropshot/tests/fail/bad_trait_endpoint17.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ error[E0277]: the trait bound `dropshot::TypedBody<Stuff>: SharedExtractor` is n
note: required by a bound in `ApiEndpoint::<StubContext>::new_for_types`
--> src/api_description.rs
|
| pub fn new_for_types<FuncParams, ResultType>(
| pub fn new_for_types<FuncParams, ReturnType>(
| ------------- required by a bound in this associated function
...
| FuncParams: RequestExtractor + 'static,
Expand Down
2 changes: 1 addition & 1 deletion dropshot/tests/fail/bad_trait_endpoint18.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ error[E0277]: the trait bound `dropshot::TypedBody<Stuff>: SharedExtractor` is n
note: required by a bound in `ApiEndpoint::<StubContext>::new_for_types`
--> src/api_description.rs
|
| pub fn new_for_types<FuncParams, ResultType>(
| pub fn new_for_types<FuncParams, ReturnType>(
| ------------- required by a bound in this associated function
...
| FuncParams: RequestExtractor + 'static,
Expand Down
2 changes: 1 addition & 1 deletion dropshot/tests/fail/bad_trait_endpoint19.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ error[E0277]: the trait bound `std::string::String: SharedExtractor` is not sati
note: required by a bound in `ApiEndpoint::<StubContext>::new_for_types`
--> src/api_description.rs
|
| pub fn new_for_types<FuncParams, ResultType>(
| pub fn new_for_types<FuncParams, ReturnType>(
| ------------- required by a bound in this associated function
...
| FuncParams: RequestExtractor + 'static,
Expand Down
2 changes: 1 addition & 1 deletion dropshot/tests/fail/bad_trait_endpoint3.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ error[E0277]: the trait bound `String: SharedExtractor` is not satisfied
note: required by a bound in `ApiEndpoint::<StubContext>::new_for_types`
--> src/api_description.rs
|
| pub fn new_for_types<FuncParams, ResultType>(
| pub fn new_for_types<FuncParams, ReturnType>(
| ------------- required by a bound in this associated function
...
| FuncParams: RequestExtractor + 'static,
Expand Down
18 changes: 18 additions & 0 deletions dropshot/tests/fail/bad_trait_endpoint7.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,24 @@ note: required by a bound in `dropshot::HttpResponseOk`
| pub struct HttpResponseOk<T: HttpResponseContent + Send + Sync + 'static>(
| ^^^^^^^^^^^^^^^^^^^ required by this bound in `HttpResponseOk`

error[E0277]: endpoint handler functions must return a value that implements `dropshot::HttpResponse`
--> tests/fail/bad_trait_endpoint7.rs:28:10
|
28 | ) -> Result<HttpResponseOk<Ret>, HttpError>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `HttpResponse` is not implemented for `Result<dropshot::HttpResponseOk<Ret>, dropshot::HttpError>`
|
= note: `HttpResponse` is implemented for `Result<T, E>` where `T: HttpResponse` and `E: HttpResponseError`
= note: `HttpResponse` is implemented for `http::Response<dropshot::Body>`
= help: the trait `HttpResponse` is implemented for `Result<T, E>`
note: required by a bound in `ApiEndpoint::<StubContext>::new_for_types`
--> src/api_description.rs
|
| pub fn new_for_types<FuncParams, ReturnType>(
| ------------- required by a bound in this associated function
...
| ReturnType: HttpResponse + Send + Sync + 'static,
| ^^^^^^^^^^^^ required by this bound in `ApiEndpoint::<StubContext>::new_for_types`

error[E0277]: the trait bound `Ret: serde::ser::Serialize` is not satisfied
--> tests/fail/bad_trait_endpoint7.rs:28:10
|
Expand Down
5 changes: 4 additions & 1 deletion dropshot/tests/integration-tests/versions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,10 @@ fn test_versions_openapi_same_names() {
);

assert_eq!(func_mods_v1, func_overrides_v1);
assert_eq!(func_mods_v1, traits_v1);
assert_eq!(
func_mods_v1, traits_v1,
"\n --- left ---\n{func_mods_v1}\n\n--- right ---\n\n{traits_v1}\n"
);
assert_eq!(func_mods_v2, func_overrides_v2);
assert_eq!(func_mods_v2, traits_v2);
}
Expand Down

0 comments on commit ccbbbe2

Please sign in to comment.