Skip to content

Commit ccbbbe2

Browse files
committed
EXPECTORATE=overwrite
1 parent 8f6d70e commit ccbbbe2

11 files changed

+45
-30
lines changed

dropshot/tests/fail/bad_trait_channel17.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ error[E0277]: the trait bound `dropshot::WebsocketConnection: SharedExtractor` i
1111
note: required by a bound in `ApiEndpoint::<StubContext>::new_for_types`
1212
--> src/api_description.rs
1313
|
14-
| pub fn new_for_types<FuncParams, ResultType>(
14+
| pub fn new_for_types<FuncParams, ReturnType>(
1515
| ------------- required by a bound in this associated function
1616
...
1717
| FuncParams: RequestExtractor + 'static,

dropshot/tests/fail/bad_trait_channel18.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ error[E0277]: the trait bound `dropshot::WebsocketConnection: SharedExtractor` i
5050
note: required by a bound in `ApiEndpoint::<StubContext>::new_for_types`
5151
--> src/api_description.rs
5252
|
53-
| pub fn new_for_types<FuncParams, ResultType>(
53+
| pub fn new_for_types<FuncParams, ReturnType>(
5454
| ------------- required by a bound in this associated function
5555
...
5656
| FuncParams: RequestExtractor + 'static,

dropshot/tests/fail/bad_trait_channel19.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ error[E0277]: the trait bound `std::string::String: SharedExtractor` is not sati
1111
note: required by a bound in `ApiEndpoint::<StubContext>::new_for_types`
1212
--> src/api_description.rs
1313
|
14-
| pub fn new_for_types<FuncParams, ResultType>(
14+
| pub fn new_for_types<FuncParams, ReturnType>(
1515
| ------------- required by a bound in this associated function
1616
...
1717
| FuncParams: RequestExtractor + 'static,

dropshot/tests/fail/bad_trait_endpoint10.stderr

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
1-
error[E0277]: the trait bound `Result<dropshot::HttpResponseUpdatedNoContent, String>: dropshot::api_description::HttpResultType` is not satisfied
1+
error[E0277]: endpoint handler functions must return a value that implements `dropshot::HttpResponse`
22
--> tests/fail/bad_trait_endpoint10.rs:19:10
33
|
44
19 | ) -> Result<HttpResponseUpdatedNoContent, String>;
5-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `dropshot::api_description::HttpResultType` is not implemented for `Result<dropshot::HttpResponseUpdatedNoContent, String>`
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `HttpResponse` is not implemented for `Result<dropshot::HttpResponseUpdatedNoContent, String>`
66
|
7-
= help: the trait `dropshot::api_description::HttpResultType` is implemented for `Result<T, HttpError>`
7+
= note: `HttpResponse` is implemented for `Result<T, E>` where `T: HttpResponse` and `E: HttpResponseError`
8+
= note: `HttpResponse` is implemented for `http::Response<dropshot::Body>`
9+
= help: the trait `HttpResponse` is implemented for `Result<T, E>`
810
note: required by a bound in `ApiEndpoint::<StubContext>::new_for_types`
911
--> src/api_description.rs
1012
|
11-
| pub fn new_for_types<FuncParams, ResultType>(
13+
| pub fn new_for_types<FuncParams, ReturnType>(
1214
| ------------- required by a bound in this associated function
1315
...
14-
| ResultType: HttpResultType,
15-
| ^^^^^^^^^^^^^^ required by this bound in `ApiEndpoint::<StubContext>::new_for_types`
16+
| ReturnType: HttpResponse + Send + Sync + 'static,
17+
| ^^^^^^^^^^^^ required by this bound in `ApiEndpoint::<StubContext>::new_for_types`
1618

1719
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
1820
--> tests/fail/bad_trait_endpoint10.rs:13:5

dropshot/tests/fail/bad_trait_endpoint12.stderr

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,20 @@
1-
error[E0277]: the trait bound `std::string::String: HttpCodedResponse` is not satisfied
1+
error[E0277]: endpoint handler functions must return a value that implements `dropshot::HttpResponse`
22
--> tests/fail/bad_trait_endpoint12.rs:24:10
33
|
44
24 | ) -> Result<String, HttpError>;
5-
| ^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `HttpCodedResponse` is not implemented for `std::string::String`, which is required by `Result<std::string::String, dropshot::HttpError>: dropshot::api_description::HttpResultType`
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `HttpResponse` is not implemented for `Result<std::string::String, dropshot::HttpError>`
66
|
7-
= help: the following other types implement trait `HttpCodedResponse`:
8-
HttpResponseAccepted<T>
9-
HttpResponseCreated<T>
10-
HttpResponseDeleted
11-
HttpResponseOk<T>
12-
HttpResponseUpdatedNoContent
13-
dropshot::handler::HttpResponseFoundStatus
14-
dropshot::handler::HttpResponseSeeOtherStatus
15-
dropshot::handler::HttpResponseTemporaryRedirectStatus
16-
= note: required for `std::string::String` to implement `HttpResponse`
17-
= note: required for `Result<std::string::String, dropshot::HttpError>` to implement `dropshot::api_description::HttpResultType`
7+
= note: `HttpResponse` is implemented for `Result<T, E>` where `T: HttpResponse` and `E: HttpResponseError`
8+
= note: `HttpResponse` is implemented for `http::Response<dropshot::Body>`
9+
= help: the trait `HttpResponse` is implemented for `Result<T, E>`
1810
note: required by a bound in `ApiEndpoint::<StubContext>::new_for_types`
1911
--> src/api_description.rs
2012
|
21-
| pub fn new_for_types<FuncParams, ResultType>(
13+
| pub fn new_for_types<FuncParams, ReturnType>(
2214
| ------------- required by a bound in this associated function
2315
...
24-
| ResultType: HttpResultType,
25-
| ^^^^^^^^^^^^^^ required by this bound in `ApiEndpoint::<StubContext>::new_for_types`
16+
| ReturnType: HttpResponse + Send + Sync + 'static,
17+
| ^^^^^^^^^^^^ required by this bound in `ApiEndpoint::<StubContext>::new_for_types`
2618

2719
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
2820
--> tests/fail/bad_trait_endpoint12.rs:18:5

dropshot/tests/fail/bad_trait_endpoint17.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ error[E0277]: the trait bound `dropshot::TypedBody<Stuff>: SharedExtractor` is n
1111
note: required by a bound in `ApiEndpoint::<StubContext>::new_for_types`
1212
--> src/api_description.rs
1313
|
14-
| pub fn new_for_types<FuncParams, ResultType>(
14+
| pub fn new_for_types<FuncParams, ReturnType>(
1515
| ------------- required by a bound in this associated function
1616
...
1717
| FuncParams: RequestExtractor + 'static,

dropshot/tests/fail/bad_trait_endpoint18.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ error[E0277]: the trait bound `dropshot::TypedBody<Stuff>: SharedExtractor` is n
1111
note: required by a bound in `ApiEndpoint::<StubContext>::new_for_types`
1212
--> src/api_description.rs
1313
|
14-
| pub fn new_for_types<FuncParams, ResultType>(
14+
| pub fn new_for_types<FuncParams, ReturnType>(
1515
| ------------- required by a bound in this associated function
1616
...
1717
| FuncParams: RequestExtractor + 'static,

dropshot/tests/fail/bad_trait_endpoint19.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ error[E0277]: the trait bound `std::string::String: SharedExtractor` is not sati
1111
note: required by a bound in `ApiEndpoint::<StubContext>::new_for_types`
1212
--> src/api_description.rs
1313
|
14-
| pub fn new_for_types<FuncParams, ResultType>(
14+
| pub fn new_for_types<FuncParams, ReturnType>(
1515
| ------------- required by a bound in this associated function
1616
...
1717
| FuncParams: RequestExtractor + 'static,

dropshot/tests/fail/bad_trait_endpoint3.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ error[E0277]: the trait bound `String: SharedExtractor` is not satisfied
1212
note: required by a bound in `ApiEndpoint::<StubContext>::new_for_types`
1313
--> src/api_description.rs
1414
|
15-
| pub fn new_for_types<FuncParams, ResultType>(
15+
| pub fn new_for_types<FuncParams, ReturnType>(
1616
| ------------- required by a bound in this associated function
1717
...
1818
| FuncParams: RequestExtractor + 'static,

dropshot/tests/fail/bad_trait_endpoint7.stderr

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,24 @@ note: required by a bound in `dropshot::HttpResponseOk`
123123
| pub struct HttpResponseOk<T: HttpResponseContent + Send + Sync + 'static>(
124124
| ^^^^^^^^^^^^^^^^^^^ required by this bound in `HttpResponseOk`
125125

126+
error[E0277]: endpoint handler functions must return a value that implements `dropshot::HttpResponse`
127+
--> tests/fail/bad_trait_endpoint7.rs:28:10
128+
|
129+
28 | ) -> Result<HttpResponseOk<Ret>, HttpError>;
130+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `HttpResponse` is not implemented for `Result<dropshot::HttpResponseOk<Ret>, dropshot::HttpError>`
131+
|
132+
= note: `HttpResponse` is implemented for `Result<T, E>` where `T: HttpResponse` and `E: HttpResponseError`
133+
= note: `HttpResponse` is implemented for `http::Response<dropshot::Body>`
134+
= help: the trait `HttpResponse` is implemented for `Result<T, E>`
135+
note: required by a bound in `ApiEndpoint::<StubContext>::new_for_types`
136+
--> src/api_description.rs
137+
|
138+
| pub fn new_for_types<FuncParams, ReturnType>(
139+
| ------------- required by a bound in this associated function
140+
...
141+
| ReturnType: HttpResponse + Send + Sync + 'static,
142+
| ^^^^^^^^^^^^ required by this bound in `ApiEndpoint::<StubContext>::new_for_types`
143+
126144
error[E0277]: the trait bound `Ret: serde::ser::Serialize` is not satisfied
127145
--> tests/fail/bad_trait_endpoint7.rs:28:10
128146
|

dropshot/tests/integration-tests/versions.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,10 @@ fn test_versions_openapi_same_names() {
467467
);
468468

469469
assert_eq!(func_mods_v1, func_overrides_v1);
470-
assert_eq!(func_mods_v1, traits_v1);
470+
assert_eq!(
471+
func_mods_v1, traits_v1,
472+
"\n --- left ---\n{func_mods_v1}\n\n--- right ---\n\n{traits_v1}\n"
473+
);
471474
assert_eq!(func_mods_v2, func_overrides_v2);
472475
assert_eq!(func_mods_v2, traits_v2);
473476
}

0 commit comments

Comments
 (0)