Fix tests for latest nightly.

This commit is contained in:
Sergio Benitez 2020-02-09 01:52:47 -08:00
parent fe4ac8e74d
commit 368f387c21
8 changed files with 73 additions and 59 deletions

View File

@ -4,25 +4,25 @@ use rocket::Request;
#[catch(404)]
fn f1(_request: &Request) -> usize {
//~^ ERROR usize: rocket::response::Responder
//~^^ ERROR usize: rocket::response::Responder
10
}
#[catch(404)]
fn f2(_request: &Request) -> bool {
//~^ ERROR bool: rocket::response::Responder
//~^^ ERROR bool: rocket::response::Responder
false
}
#[catch(404)]
fn f3(_request: bool) -> usize {
//~^ ERROR mismatched types
//~^ ERROR
10
}
#[catch(404)]
fn f4() -> usize {
//~^ ERROR usize: rocket::response::Responder
//~^^ ERROR usize: rocket::response::Responder
10
}

View File

@ -1,33 +1,35 @@
error[E0277]: the trait bound `usize: rocket::response::Responder<'_>` is not satisfied
--> $DIR/catch_type_errors.rs:6:30
--> $DIR/catch_type_errors.rs:5:1
|
6 | fn f1(_request: &Request) -> usize {
| ^^^^^ the trait `rocket::response::Responder<'_>` is not implemented for `usize`
5 | #[catch(404)]
| ^^^^^^^^^^^^^ the trait `rocket::response::Responder<'_>` is not implemented for `usize`
|
= note: required by `rocket::response::Responder::respond_to`
error[E0277]: the trait bound `bool: rocket::response::Responder<'_>` is not satisfied
--> $DIR/catch_type_errors.rs:12:30
--> $DIR/catch_type_errors.rs:11:1
|
12 | fn f2(_request: &Request) -> bool {
| ^^^^ the trait `rocket::response::Responder<'_>` is not implemented for `bool`
11 | #[catch(404)]
| ^^^^^^^^^^^^^ the trait `rocket::response::Responder<'_>` is not implemented for `bool`
|
= note: required by `rocket::response::Responder::respond_to`
error[E0308]: mismatched types
--> $DIR/catch_type_errors.rs:18:7
|
17 | #[catch(404)]
| ------------- expected due to this
18 | fn f3(_request: bool) -> usize {
| ^^^^^^^^^^^^^^ expected reference, found bool
| ^^^^^^^^^^^^^^ expected `&rocket::Request<'_>`, found `bool`
|
= note: expected type `for<'r, 's> fn(&'r rocket::Request<'s>) -> _`
found type `fn(bool) -> usize {f3}`
= note: expected fn pointer `for<'r, 's> fn(&'r rocket::Request<'s>) -> _`
found fn item `fn(bool) -> usize {f3}`
error[E0277]: the trait bound `usize: rocket::response::Responder<'_>` is not satisfied
--> $DIR/catch_type_errors.rs:24:12
--> $DIR/catch_type_errors.rs:23:1
|
24 | fn f4() -> usize {
| ^^^^^ the trait `rocket::response::Responder<'_>` is not implemented for `usize`
23 | #[catch(404)]
| ^^^^^^^^^^^^^ the trait `rocket::response::Responder<'_>` is not implemented for `usize`
|
= note: required by `rocket::response::Responder::respond_to`

View File

@ -14,7 +14,7 @@ error: unexpected end of input, expected identifier
--> $DIR/catchers.rs:9:13
|
9 | let _ = catchers![a::]; //~ ERROR expected identifier
| ^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^ in this macro invocation
error: aborting due to 3 previous errors

View File

@ -14,7 +14,7 @@ error: unexpected end of input, expected identifier
--> $DIR/routes.rs:9:13
|
9 | let _ = routes![a::]; //~ ERROR expected identifier
| ^^^^^^^^^^^^
| ^^^^^^^^^^^^ in this macro invocation
error: aborting due to 3 previous errors

View File

@ -39,7 +39,9 @@ fn simple_q(id: isize) { }
#[post("/?<id>&<rest..>")]
fn other_q(id: usize, rest: S) { }
//~^ ERROR S: rocket::http::uri::Ignorable<rocket::http::uri::Query>
//~^^ ERROR usize: rocket::http::uri::Ignorable<rocket::http::uri::Query>
//
#[post("/?<id>&<name>")]
fn optionals_q(id: Option<i32>, name: Result<String, &RawStr>) { }
@ -76,11 +78,9 @@ fn main() {
//~^ ERROR S: rocket::http::uri::FromUriParam<rocket::http::uri::Query, _>
uri!(other_q: rest = _, id = 100);
//~^ ERROR S: rocket::http::uri::Ignorable<rocket::http::uri::Query>
uri!(other_q: rest = S, id = _);
//~^ ERROR S: rocket::http::uri::FromUriParam<rocket::http::uri::Query, _>
//~^^ ERROR usize: rocket::http::uri::Ignorable<rocket::http::uri::Query>
// These are all okay.
uri!(optionals_q: _, _);

View File

@ -1,7 +1,7 @@
error[E0277]: the trait bound `usize: rocket::http::uri::FromUriParam<rocket::http::uri::Path, &str>` is not satisfied
--> $DIR/typed-uri-bad-type.rs:47:23
--> $DIR/typed-uri-bad-type.rs:49:23
|
47 | uri!(simple: id = "hi");
49 | uri!(simple: id = "hi");
| ^^^^ the trait `rocket::http::uri::FromUriParam<rocket::http::uri::Path, &str>` is not implemented for `usize`
|
= help: the following implementations were found:
@ -11,9 +11,9 @@ error[E0277]: the trait bound `usize: rocket::http::uri::FromUriParam<rocket::ht
= note: required by `rocket::http::uri::FromUriParam::from_uri_param`
error[E0277]: the trait bound `usize: rocket::http::uri::FromUriParam<rocket::http::uri::Path, &str>` is not satisfied
--> $DIR/typed-uri-bad-type.rs:50:18
--> $DIR/typed-uri-bad-type.rs:52:18
|
50 | uri!(simple: "hello");
52 | uri!(simple: "hello");
| ^^^^^^^ the trait `rocket::http::uri::FromUriParam<rocket::http::uri::Path, &str>` is not implemented for `usize`
|
= help: the following implementations were found:
@ -23,9 +23,9 @@ error[E0277]: the trait bound `usize: rocket::http::uri::FromUriParam<rocket::ht
= note: required by `rocket::http::uri::FromUriParam::from_uri_param`
error[E0277]: the trait bound `usize: rocket::http::uri::FromUriParam<rocket::http::uri::Path, i64>` is not satisfied
--> $DIR/typed-uri-bad-type.rs:53:23
--> $DIR/typed-uri-bad-type.rs:55:23
|
53 | uri!(simple: id = 239239i64);
55 | uri!(simple: id = 239239i64);
| ^^^^^^^^^ the trait `rocket::http::uri::FromUriParam<rocket::http::uri::Path, i64>` is not implemented for `usize`
|
= help: the following implementations were found:
@ -35,15 +35,15 @@ error[E0277]: the trait bound `usize: rocket::http::uri::FromUriParam<rocket::ht
= note: required by `rocket::http::uri::FromUriParam::from_uri_param`
error[E0277]: the trait bound `S: rocket::http::uri::FromUriParam<rocket::http::uri::Path, _>` is not satisfied
--> $DIR/typed-uri-bad-type.rs:56:31
--> $DIR/typed-uri-bad-type.rs:58:31
|
56 | uri!(not_uri_display: 10, S);
58 | uri!(not_uri_display: 10, S);
| ^ the trait `rocket::http::uri::FromUriParam<rocket::http::uri::Path, _>` is not implemented for `S`
error[E0277]: the trait bound `i32: rocket::http::uri::FromUriParam<rocket::http::uri::Path, std::option::Option<{integer}>>` is not satisfied
--> $DIR/typed-uri-bad-type.rs:62:26
--> $DIR/typed-uri-bad-type.rs:64:26
|
62 | uri!(optionals: id = Some(10), name = Ok("bob".into()));
64 | uri!(optionals: id = Some(10), name = Ok("bob".into()));
| ^^^^ the trait `rocket::http::uri::FromUriParam<rocket::http::uri::Path, std::option::Option<{integer}>>` is not implemented for `i32`
|
= help: the following implementations were found:
@ -53,9 +53,9 @@ error[E0277]: the trait bound `i32: rocket::http::uri::FromUriParam<rocket::http
= note: required because of the requirements on the impl of `rocket::http::uri::FromUriParam<rocket::http::uri::Path, std::option::Option<{integer}>>` for `std::option::Option<i32>`
error[E0277]: the trait bound `std::string::String: rocket::http::uri::FromUriParam<rocket::http::uri::Path, std::result::Result<_, _>>` is not satisfied
--> $DIR/typed-uri-bad-type.rs:62:43
--> $DIR/typed-uri-bad-type.rs:64:43
|
62 | uri!(optionals: id = Some(10), name = Ok("bob".into()));
64 | uri!(optionals: id = Some(10), name = Ok("bob".into()));
| ^^ the trait `rocket::http::uri::FromUriParam<rocket::http::uri::Path, std::result::Result<_, _>>` is not implemented for `std::string::String`
|
= help: the following implementations were found:
@ -67,9 +67,9 @@ error[E0277]: the trait bound `std::string::String: rocket::http::uri::FromUriPa
= note: required because of the requirements on the impl of `rocket::http::uri::FromUriParam<rocket::http::uri::Path, std::result::Result<_, _>>` for `std::result::Result<std::string::String, &rocket::http::RawStr>`
error[E0277]: the trait bound `isize: rocket::http::uri::FromUriParam<rocket::http::uri::Query, &str>` is not satisfied
--> $DIR/typed-uri-bad-type.rs:66:20
--> $DIR/typed-uri-bad-type.rs:68:20
|
66 | uri!(simple_q: "hi");
68 | uri!(simple_q: "hi");
| ^^^^ the trait `rocket::http::uri::FromUriParam<rocket::http::uri::Query, &str>` is not implemented for `isize`
|
= help: the following implementations were found:
@ -79,9 +79,9 @@ error[E0277]: the trait bound `isize: rocket::http::uri::FromUriParam<rocket::ht
= note: required by `rocket::http::uri::FromUriParam::from_uri_param`
error[E0277]: the trait bound `isize: rocket::http::uri::FromUriParam<rocket::http::uri::Query, &str>` is not satisfied
--> $DIR/typed-uri-bad-type.rs:69:25
--> $DIR/typed-uri-bad-type.rs:71:25
|
69 | uri!(simple_q: id = "hi");
71 | uri!(simple_q: id = "hi");
| ^^^^ the trait `rocket::http::uri::FromUriParam<rocket::http::uri::Query, &str>` is not implemented for `isize`
|
= help: the following implementations were found:
@ -91,37 +91,49 @@ error[E0277]: the trait bound `isize: rocket::http::uri::FromUriParam<rocket::ht
= note: required by `rocket::http::uri::FromUriParam::from_uri_param`
error[E0277]: the trait bound `S: rocket::http::uri::FromUriParam<rocket::http::uri::Query, _>` is not satisfied
--> $DIR/typed-uri-bad-type.rs:72:24
--> $DIR/typed-uri-bad-type.rs:74:24
|
72 | uri!(other_q: 100, S);
74 | uri!(other_q: 100, S);
| ^ the trait `rocket::http::uri::FromUriParam<rocket::http::uri::Query, _>` is not implemented for `S`
error[E0277]: the trait bound `S: rocket::http::uri::FromUriParam<rocket::http::uri::Query, _>` is not satisfied
--> $DIR/typed-uri-bad-type.rs:75:26
--> $DIR/typed-uri-bad-type.rs:77:26
|
75 | uri!(other_q: rest = S, id = 100);
77 | uri!(other_q: rest = S, id = 100);
| ^ the trait `rocket::http::uri::FromUriParam<rocket::http::uri::Query, _>` is not implemented for `S`
error[E0277]: the trait bound `S: rocket::http::uri::Ignorable<rocket::http::uri::Query>` is not satisfied
--> $DIR/typed-uri-bad-type.rs:78:26
|
78 | uri!(other_q: rest = _, id = 100);
| ^ the trait `rocket::http::uri::Ignorable<rocket::http::uri::Query>` is not implemented for `S`
|
= note: required by `rocket::http::uri::assert_ignorable`
--> $DIR/typed-uri-bad-type.rs:41:29
|
41 | fn other_q(id: usize, rest: S) { }
| ^ the trait `rocket::http::uri::Ignorable<rocket::http::uri::Query>` is not implemented for `S`
...
80 | uri!(other_q: rest = _, id = 100);
| ---------------------------------- in this macro invocation
|
::: /Users/sbenitez/Sync/Data/Projects/Personal/Rocket/core/http/src/uri/uri_display.rs:467:40
|
467 | pub fn assert_ignorable<P: UriPart, T: Ignorable<P>>() { }
| ------------ required by this bound in `rocket::http::uri::assert_ignorable`
error[E0277]: the trait bound `usize: rocket::http::uri::Ignorable<rocket::http::uri::Query>` is not satisfied
--> $DIR/typed-uri-bad-type.rs:81:34
|
81 | uri!(other_q: rest = S, id = _);
| ^ the trait `rocket::http::uri::Ignorable<rocket::http::uri::Query>` is not implemented for `usize`
|
= note: required by `rocket::http::uri::assert_ignorable`
--> $DIR/typed-uri-bad-type.rs:41:16
|
41 | fn other_q(id: usize, rest: S) { }
| ^^^^^ the trait `rocket::http::uri::Ignorable<rocket::http::uri::Query>` is not implemented for `usize`
...
82 | uri!(other_q: rest = S, id = _);
| -------------------------------- in this macro invocation
|
::: /Users/sbenitez/Sync/Data/Projects/Personal/Rocket/core/http/src/uri/uri_display.rs:467:40
|
467 | pub fn assert_ignorable<P: UriPart, T: Ignorable<P>>() { }
| ------------ required by this bound in `rocket::http::uri::assert_ignorable`
error[E0277]: the trait bound `S: rocket::http::uri::FromUriParam<rocket::http::uri::Query, _>` is not satisfied
--> $DIR/typed-uri-bad-type.rs:81:26
--> $DIR/typed-uri-bad-type.rs:82:26
|
81 | uri!(other_q: rest = S, id = _);
82 | uri!(other_q: rest = S, id = _);
| ^ the trait `rocket::http::uri::FromUriParam<rocket::http::uri::Query, _>` is not implemented for `S`
error: aborting due to 13 previous errors

View File

@ -32,7 +32,7 @@ error: unexpected end of input, expected identifier
--> $DIR/typed-uris-invalid-syntax.rs:14:5
|
14 | uri!("/mount",); //~ ERROR expected identifier
| ^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^ in this macro invocation
error: invalid mount point; mount points must be static, absolute URIs: `/example`
--> $DIR/typed-uris-invalid-syntax.rs:15:10
@ -50,13 +50,13 @@ error: unexpected end of input, call to `uri!` cannot be empty
--> $DIR/typed-uris-invalid-syntax.rs:17:5
|
17 | uri!(); //~ unexpected end of input
| ^^^^^^^
| ^^^^^^^ in this macro invocation
error: unexpected end of input, expected expression
--> $DIR/typed-uris-invalid-syntax.rs:18:5
|
18 | uri!(simple: id = ); //~ expected expression
| ^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^ in this macro invocation
error: aborting due to 10 previous errors

View File

@ -41,7 +41,7 @@ function ensure_tab_free() {
# Ensures there are no files with trailing whitespace.
function ensure_trailing_whitespace_free() {
local matches=$(git grep -E -I "\s+$" "${PROJECT_ROOT}")
local matches=$(git grep -E -I "\s+$" "${PROJECT_ROOT}" | grep -v '.stderr:')
if ! [ -z "${matches}" ]; then
echo "Trailing whitespace was found in the following:"
echo "${matches}"