Implement codegen testing on stable.

This commits migrates to 'trybuild' from 'compiletest' for codegen
diagnostic testing.
This commit is contained in:
Sergio Benitez 2020-07-20 15:02:10 -07:00
parent 95a4b442cc
commit 1858403203
94 changed files with 2687 additions and 484 deletions

View File

@ -20,13 +20,14 @@ proc-macro = true
[dependencies] [dependencies]
quote = "1.0" quote = "1.0"
devise = { git = "https://github.com/SergioBenitez/Devise.git", rev = "952866f" } devise = { git = "https://github.com/SergioBenitez/Devise.git", rev = "952866f7" }
[build-dependencies] [build-dependencies]
yansi = "0.5" yansi = "0.5"
version_check = "0.9.1" version_check = "0.9.1"
[dev-dependencies] [dev-dependencies]
compiletest_rs = "0.5"
rocket = { version = "0.5.0-dev", path = "../../core/lib" } rocket = { version = "0.5.0-dev", path = "../../core/lib" }
rocket_contrib = { version = "0.5.0-dev", path = "../lib", features = ["diesel_sqlite_pool"] } rocket_contrib = { version = "0.5.0-dev", path = "../lib", features = ["diesel_sqlite_pool"] }
trybuild = "1.0"
version_check = "0.9"

View File

@ -26,9 +26,7 @@ const NO_GENERIC_STRUCTS: &str = "`database` attribute cannot be applied to stru
fn parse_invocation(attr: TokenStream, input: TokenStream) -> Result<DatabaseInvocation> { fn parse_invocation(attr: TokenStream, input: TokenStream) -> Result<DatabaseInvocation> {
let attr_stream2 = crate::proc_macro2::TokenStream::from(attr); let attr_stream2 = crate::proc_macro2::TokenStream::from(attr);
let attr_span = attr_stream2.span(); let string_lit = crate::syn::parse2::<LitStr>(attr_stream2)?;
let string_lit = crate::syn::parse2::<LitStr>(attr_stream2)
.map_err(|_| attr_span.error("expected string literal"))?;
let input = crate::syn::parse::<DeriveInput>(input).unwrap(); let input = crate::syn::parse::<DeriveInput>(input).unwrap();
if !input.generics.params.is_empty() { if !input.generics.params.is_empty() {

View File

@ -1,102 +0,0 @@
extern crate compiletest_rs as compiletest;
use std::path::{Path, PathBuf};
use std::{io, fs::Metadata, time::SystemTime};
#[derive(Copy, Clone)]
enum Kind {
#[allow(dead_code)]
Dynamic,
Static
}
impl Kind {
fn extension(self) -> &'static str {
match self {
#[cfg(windows)] Kind::Dynamic => ".dll",
#[cfg(all(unix, target_os = "macos"))] Kind::Dynamic => ".dylib",
#[cfg(all(unix, not(target_os = "macos")))] Kind::Dynamic => ".so",
Kind::Static => ".rlib"
}
}
}
fn target_path() -> PathBuf {
#[cfg(debug_assertions)] const ENVIRONMENT: &str = "debug";
#[cfg(not(debug_assertions))] const ENVIRONMENT: &str = "release";
Path::new(env!("CARGO_MANIFEST_DIR"))
.parent().unwrap().parent().unwrap()
.join("target")
.join(ENVIRONMENT)
}
fn link_flag(flag: &str, lib: &str, rel_path: &[&str]) -> String {
let mut path = target_path();
for component in rel_path {
path = path.join(component);
}
format!("{} {}={}", flag, lib, path.display())
}
fn best_time_for(metadata: &Metadata) -> SystemTime {
metadata.created()
.or_else(|_| metadata.modified())
.or_else(|_| metadata.accessed())
.unwrap_or_else(|_| SystemTime::now())
}
fn extern_dep(name: &str, kind: Kind) -> io::Result<String> {
let deps_root = target_path().join("deps");
let dep_name = format!("lib{}", name);
let mut dep_path: Option<PathBuf> = None;
for entry in deps_root.read_dir().expect("read_dir call failed") {
let entry = match entry {
Ok(entry) => entry,
Err(_) => continue
};
let filename = entry.file_name();
let filename = filename.to_string_lossy();
let lib_name = filename.split('.').next().unwrap().split('-').next().unwrap();
if lib_name == dep_name && filename.ends_with(kind.extension()) {
if let Some(ref mut existing) = dep_path {
if best_time_for(&entry.metadata()?) > best_time_for(&existing.metadata()?) {
*existing = entry.path().into();
}
} else {
dep_path = Some(entry.path().into());
}
}
}
let dep = dep_path.ok_or_else(|| io::Error::from(io::ErrorKind::NotFound))?;
let filename = dep.file_name().ok_or_else(|| io::Error::from(io::ErrorKind::InvalidData))?;
Ok(link_flag("--extern", name, &["deps", &filename.to_string_lossy()]))
}
fn run_mode(mode: &'static str, path: &'static str) {
let mut config = compiletest::Config::default();
config.mode = mode.parse().expect("invalid mode");
config.src_base = format!("tests/{}", path).into();
config.clean_rmeta();
config.target_rustcflags = Some([
link_flag("-L", "crate", &[]),
link_flag("-L", "dependency", &["deps"]),
extern_dep("rocket_http", Kind::Static).expect("find http dep"),
extern_dep("rocket", Kind::Static).expect("find core dep"),
extern_dep("rocket_contrib", Kind::Static).expect("find contrib dep"),
].join(" "));
compiletest::run_tests(&config);
}
#[test]
fn compile_test() {
run_mode("ui", "ui-fail");
run_mode("compile-fail", "ui-fail");
}

View File

@ -0,0 +1 @@
../ui-fail/database-syntax.rs

View File

@ -1,60 +1,57 @@
error: expected string literal error: unexpected end of input, expected literal
--> $DIR/database-syntax.rs:5:1 --> $DIR/database-syntax.rs:6:1
| |
5 | #[database] 6 | #[database]
| ^^^^^^^^^^^ | ^^^^^^^^^^^
| |
= note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info) = note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: expected string literal error: expected string literal
--> $DIR/database-syntax.rs:9:12 --> $DIR/database-syntax.rs:10:12
| |
9 | #[database(1)] 10 | #[database(1)]
| ^ | ^
error: expected string literal error: expected string literal
--> $DIR/database-syntax.rs:13:12 --> $DIR/database-syntax.rs:14:12
| |
13 | #[database(123)] 14 | #[database(123)]
| ^^^ | ^^^
error: expected string literal error: unexpected token
--> $DIR/database-syntax.rs:17:12 --> $DIR/database-syntax.rs:18:20
| |
17 | #[database("hello" "hi")] 18 | #[database("hello" "hi")]
| ^^^^^^^^^^^^ | ^^^^
error: `database` attribute can only be used on structs error: `database` attribute can only be used on structs
--> $DIR/database-syntax.rs:22:1 --> $DIR/database-syntax.rs:23:1
| |
22 | enum Foo { } 23 | enum Foo { }
| ^^^^^^^^^^^^^ | ^^^^^^^^^^^^^
error: `database` attribute can only be applied to structs with exactly one unnamed field error: `database` attribute can only be applied to structs with exactly one unnamed field
--> $DIR/database-syntax.rs:26:11 --> $DIR/database-syntax.rs:27:11
| |
26 | struct Bar(diesel::SqliteConnection, diesel::SqliteConnection); 27 | struct Bar(diesel::SqliteConnection, diesel::SqliteConnection);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
= help: example: `struct MyDatabase(diesel::SqliteConnection);` = help: example: `struct MyDatabase(diesel::SqliteConnection);`
error: `database` attribute can only be used on structs error: `database` attribute can only be used on structs
--> $DIR/database-syntax.rs:30:1 --> $DIR/database-syntax.rs:31:1
| |
30 | union Baz { } 31 | union Baz { }
| ^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^
error: `database` attribute cannot be applied to structs with generics error: `database` attribute cannot be applied to structs with generics
--> $DIR/database-syntax.rs:34:9 --> $DIR/database-syntax.rs:35:9
| |
34 | struct E<'r>(&'r str); 35 | struct E<'r>(&'r str);
| ^^^^ | ^^^^
error: `database` attribute cannot be applied to structs with generics error: `database` attribute cannot be applied to structs with generics
--> $DIR/database-syntax.rs:38:9 --> $DIR/database-syntax.rs:39:9
| |
38 | struct F<T>(T); 39 | struct F<T>(T);
| ^^^ | ^^^
error: aborting due to 9 previous errors

View File

@ -0,0 +1 @@
../ui-fail/database-types.rs

View File

@ -9,7 +9,3 @@ error[E0277]: the trait bound `std::vec::Vec<i32>: rocket_contrib::databases::Po
| |
11 | struct B(Vec<i32>); 11 | struct B(Vec<i32>);
| ^^^^^^^^ the trait `rocket_contrib::databases::Poolable` is not implemented for `std::vec::Vec<i32>` | ^^^^^^^^ the trait `rocket_contrib::databases::Poolable` is not implemented for `std::vec::Vec<i32>`
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0277`.

View File

@ -0,0 +1 @@
../ui-fail/database-syntax.rs

View File

@ -0,0 +1,56 @@
error: unexpected end of input, expected literal
--> $DIR/database-syntax.rs:6:1
|
6 | #[database]
| ^^^^^^^^^^^
|
= note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: expected string literal
--> $DIR/database-syntax.rs:10:12
|
10 | #[database(1)]
| ^
error: expected string literal
--> $DIR/database-syntax.rs:14:12
|
14 | #[database(123)]
| ^^^
error: unexpected token
--> $DIR/database-syntax.rs:18:20
|
18 | #[database("hello" "hi")]
| ^^^^
error: `database` attribute can only be used on structs
--> $DIR/database-syntax.rs:23:1
|
23 | enum Foo { }
| ^^^^
error: `database` attribute can only be applied to structs with exactly one unnamed field
--- help: example: `struct MyDatabase(diesel::SqliteConnection);`
--> $DIR/database-syntax.rs:27:11
|
27 | struct Bar(diesel::SqliteConnection, diesel::SqliteConnection);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: `database` attribute can only be used on structs
--> $DIR/database-syntax.rs:31:1
|
31 | union Baz { }
| ^^^^^
error: `database` attribute cannot be applied to structs with generics
--> $DIR/database-syntax.rs:35:9
|
35 | struct E<'r>(&'r str);
| ^
error: `database` attribute cannot be applied to structs with generics
--> $DIR/database-syntax.rs:39:9
|
39 | struct F<T>(T);
| ^

View File

@ -0,0 +1 @@
../ui-fail/database-types.rs

View File

@ -0,0 +1,11 @@
error[E0277]: the trait bound `Unknown: rocket_contrib::databases::Poolable` is not satisfied
--> $DIR/database-types.rs:7:10
|
7 | struct A(Unknown);
| ^^^^^^^ the trait `rocket_contrib::databases::Poolable` is not implemented for `Unknown`
error[E0277]: the trait bound `std::vec::Vec<i32>: rocket_contrib::databases::Poolable` is not satisfied
--> $DIR/database-types.rs:11:10
|
11 | struct B(Vec<i32>);
| ^^^ the trait `rocket_contrib::databases::Poolable` is not implemented for `std::vec::Vec<i32>`

View File

@ -0,0 +1,10 @@
#[test]
fn ui() {
let path = match version_check::is_feature_flaggable() {
Some(true) => "ui-fail-nightly",
_ => "ui-fail-stable"
};
let t = trybuild::TestCases::new();
t.compile_fail(format!("tests/{}/*.rs", path));
}

View File

@ -1,5 +1,6 @@
#[macro_use] extern crate rocket_contrib; #[macro_use] extern crate rocket_contrib;
#[allow(unused_imports)]
use rocket_contrib::databases::diesel; use rocket_contrib::databases::diesel;
#[database] #[database]

View File

@ -1,48 +0,0 @@
#!/usr/bin/env bash
#
# Copyright 2015 The Rust Project Developers. See the COPYRIGHT
# file at the top-level directory of this distribution and at
# http://rust-lang.org/COPYRIGHT.
#
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
# option. This file may not be copied, modified, or distributed
# except according to those terms.
# A script to update the references for particular tests. The idea is
# that you do a run, which will generate files in the build directory
# containing the (normalized) actual output of the compiler. This
# script will then copy that output and replace the "expected output"
# files. You can then commit the changes.
#
# If you find yourself manually editing a foo.stderr file, you're
# doing it wrong.
if [[ "$1" == "--help" || "$1" == "-h" || "$1" == "" || "$2" == "" ]]; then
echo "usage: $0 <build-directory> <relative-path-to-rs-files>"
echo ""
echo "For example:"
echo " $0 ../../../build/x86_64-apple-darwin/test/ui *.rs */*.rs"
fi
MYDIR=$(dirname $0)
BUILD_DIR="$1"
shift
shopt -s nullglob
while [[ "$1" != "" ]]; do
for EXT in "stderr" "fixed"; do
for OUT_NAME in $BUILD_DIR/${1%.rs}.*$EXT; do
OUT_DIR=`dirname "$1"`
OUT_BASE=`basename "$OUT_NAME"`
if ! (diff $OUT_NAME $MYDIR/$OUT_DIR/$OUT_BASE >& /dev/null); then
echo updating $MYDIR/$OUT_DIR/$OUT_BASE
cp $OUT_NAME $MYDIR/$OUT_DIR
fi
done
done
shift
done

View File

@ -19,7 +19,7 @@ proc-macro = true
indexmap = "1.0" indexmap = "1.0"
quote = "1.0" quote = "1.0"
rocket_http = { version = "0.5.0-dev", path = "../http/" } rocket_http = { version = "0.5.0-dev", path = "../http/" }
devise = { git = "https://github.com/SergioBenitez/Devise.git", rev = "952866f" } devise = { git = "https://github.com/SergioBenitez/Devise.git", rev = "952866f7" }
glob = "0.3" glob = "0.3"
[build-dependencies] [build-dependencies]
@ -28,4 +28,5 @@ version_check = "0.9.1"
[dev-dependencies] [dev-dependencies]
rocket = { version = "0.5.0-dev", path = "../lib" } rocket = { version = "0.5.0-dev", path = "../lib" }
compiletest_rs = "0.5" version_check = "0.9"
trybuild = "1.0"

View File

@ -1,102 +0,0 @@
extern crate compiletest_rs as compiletest;
use std::path::{Path, PathBuf};
use std::{io, fs::Metadata, time::SystemTime};
#[derive(Copy, Clone)]
enum Kind {
#[allow(dead_code)]
Dynamic,
Static
}
impl Kind {
fn extension(self) -> &'static str {
match self {
#[cfg(windows)] Kind::Dynamic => ".dll",
#[cfg(all(unix, target_os = "macos"))] Kind::Dynamic => ".dylib",
#[cfg(all(unix, not(target_os = "macos")))] Kind::Dynamic => ".so",
Kind::Static => ".rlib"
}
}
}
fn target_path() -> PathBuf {
#[cfg(debug_assertions)] const ENVIRONMENT: &str = "debug";
#[cfg(not(debug_assertions))] const ENVIRONMENT: &str = "release";
Path::new(env!("CARGO_MANIFEST_DIR"))
.parent().unwrap().parent().unwrap()
.join("target")
.join(ENVIRONMENT)
}
fn link_flag(flag: &str, lib: &str, rel_path: &[&str]) -> String {
let mut path = target_path();
for component in rel_path {
path = path.join(component);
}
format!("{} {}={}", flag, lib, path.display())
}
fn best_time_for(metadata: &Metadata) -> SystemTime {
metadata.created()
.or_else(|_| metadata.modified())
.or_else(|_| metadata.accessed())
.unwrap_or_else(|_| SystemTime::now())
}
fn extern_dep(name: &str, kind: Kind) -> io::Result<String> {
let deps_root = target_path().join("deps");
let dep_name = format!("lib{}", name);
let mut dep_path: Option<PathBuf> = None;
for entry in deps_root.read_dir().expect("read_dir call failed") {
let entry = match entry {
Ok(entry) => entry,
Err(_) => continue
};
let filename = entry.file_name();
let filename = filename.to_string_lossy();
let lib_name = filename.split('.').next().unwrap().split('-').next().unwrap();
if lib_name == dep_name && filename.ends_with(kind.extension()) {
if let Some(ref mut existing) = dep_path {
if best_time_for(&entry.metadata()?) > best_time_for(&existing.metadata()?) {
*existing = entry.path().into();
}
} else {
dep_path = Some(entry.path().into());
}
}
}
let dep = dep_path.ok_or_else(|| io::Error::from(io::ErrorKind::NotFound))?;
let filename = dep.file_name().ok_or_else(|| io::Error::from(io::ErrorKind::InvalidData))?;
Ok(link_flag("--extern", name, &["deps", &filename.to_string_lossy()]))
}
fn run_mode(mode: &'static str, path: &'static str) {
let mut config = compiletest::Config::default();
config.mode = mode.parse().expect("invalid mode");
config.src_base = format!("tests/{}", path).into();
config.clean_rmeta();
config.target_rustcflags = Some([
String::from("--edition=2018"),
link_flag("-L", "crate", &[]),
link_flag("-L", "dependency", &["deps"]),
extern_dep("rocket_http", Kind::Static).expect("find http dep"),
extern_dep("rocket", Kind::Static).expect("find core dep"),
].join(" "));
compiletest::run_tests(&config);
}
#[test]
fn compile_test() {
run_mode("ui", "ui-fail");
run_mode("compile-fail", "ui-fail");
}

View File

@ -0,0 +1 @@
../ui-fail/async-entry.rs

View File

@ -155,8 +155,3 @@ error[E0277]: `main` has invalid return type `rocket::Rocket`
| ^^^^^^^^^^^^^^ `main` can only return types that implement `std::process::Termination` | ^^^^^^^^^^^^^^ `main` can only return types that implement `std::process::Termination`
| |
= help: consider using `()`, or a `Result` = help: consider using `()`, or a `Result`
error: aborting due to 13 previous errors; 1 warning emitted
Some errors have detailed explanations: E0277, E0308, E0728.
For more information about an error, try `rustc --explain E0277`.

View File

@ -0,0 +1 @@
../ui-fail/catch.rs

View File

@ -70,5 +70,10 @@ error: invalid number of arguments: must be zero or one
| |
= help: catchers may optionally take an argument of type `&Request` = help: catchers may optionally take an argument of type `&Request`
error: aborting due to 9 previous errors warning: unused import: `rocket::Request`
--> $DIR/catch.rs:3:5
|
3 | use rocket::Request;
| ^^^^^^^^^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default

View File

@ -0,0 +1 @@
../ui-fail/catch_type_errors.rs

View File

@ -35,8 +35,3 @@ error[E0277]: the trait bound `usize: rocket::response::Responder<'_, '_>` is no
| ^^^^^ the trait `rocket::response::Responder<'_, '_>` is not implemented for `usize` | ^^^^^ the trait `rocket::response::Responder<'_, '_>` is not implemented for `usize`
| |
= note: required by `rocket::response::Responder::respond_to` = note: required by `rocket::response::Responder::respond_to`
error: aborting due to 5 previous errors
Some errors have detailed explanations: E0277, E0308.
For more information about an error, try `rustc --explain E0277`.

View File

@ -0,0 +1 @@
../ui-fail/catchers.rs

View File

@ -17,6 +17,3 @@ error: unexpected end of input, expected identifier
| ^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^
| |
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to 3 previous errors

View File

@ -0,0 +1 @@
../ui-fail/from_form.rs

View File

@ -325,6 +325,3 @@ note: error occurred while deriving `FromForm`
161 | #[derive(FromForm)] 161 | #[derive(FromForm)]
| ^^^^^^^^ | ^^^^^^^^
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to 24 previous errors

View File

@ -0,0 +1 @@
../ui-fail/from_form_type_errors.rs

View File

@ -9,7 +9,3 @@ error[E0277]: the trait bound `Foo<usize>: rocket::request::FromFormValue<'_>` i
| |
15 | field: Foo<usize>, 15 | field: Foo<usize>,
| ^^^^^^^^^^^^^^^^^ the trait `rocket::request::FromFormValue<'_>` is not implemented for `Foo<usize>` | ^^^^^^^^^^^^^^^^^ the trait `rocket::request::FromFormValue<'_>` is not implemented for `Foo<usize>`
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0277`.

View File

@ -0,0 +1 @@
../ui-fail/from_form_value.rs

View File

@ -104,6 +104,3 @@ note: error occurred while deriving `FromFormValue`
40 | #[derive(FromFormValue)] 40 | #[derive(FromFormValue)]
| ^^^^^^^^^^^^^ | ^^^^^^^^^^^^^
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to 8 previous errors

View File

@ -0,0 +1 @@
../ui-fail/responder-types.rs

View File

@ -13,8 +13,8 @@ error[E0277]: the trait bound `rocket::http::Header<'_>: std::convert::From<u8>`
| ^^^^^^^^^ the trait `std::convert::From<u8>` is not implemented for `rocket::http::Header<'_>` | ^^^^^^^^^ the trait `std::convert::From<u8>` is not implemented for `rocket::http::Header<'_>`
| |
= help: the following implementations were found: = help: the following implementations were found:
rocket::http::Header<'static> as $TRAIT <rocket::http::Header<'static> as std::convert::From<&rocket::http::Cookie<'_>>>
rocket::http::Header<'static> as $TRAIT <rocket::http::Header<'static> as std::convert::From<rocket::http::Cookie<'_>>>
= note: required because of the requirements on the impl of `std::convert::Into<rocket::http::Header<'_>>` for `u8` = note: required because of the requirements on the impl of `std::convert::Into<rocket::http::Header<'_>>` for `u8`
error[E0277]: the trait bound `u8: rocket::response::Responder<'_, '_>` is not satisfied error[E0277]: the trait bound `u8: rocket::response::Responder<'_, '_>` is not satisfied
@ -32,8 +32,8 @@ error[E0277]: the trait bound `rocket::http::Header<'_>: std::convert::From<u8>`
| ^^^^^^^^^ the trait `std::convert::From<u8>` is not implemented for `rocket::http::Header<'_>` | ^^^^^^^^^ the trait `std::convert::From<u8>` is not implemented for `rocket::http::Header<'_>`
| |
= help: the following implementations were found: = help: the following implementations were found:
rocket::http::Header<'static> as $TRAIT <rocket::http::Header<'static> as std::convert::From<&rocket::http::Cookie<'_>>>
rocket::http::Header<'static> as $TRAIT <rocket::http::Header<'static> as std::convert::From<rocket::http::Cookie<'_>>>
= note: required because of the requirements on the impl of `std::convert::Into<rocket::http::Header<'_>>` for `u8` = note: required because of the requirements on the impl of `std::convert::Into<rocket::http::Header<'_>>` for `u8`
error[E0277]: the trait bound `rocket::http::Header<'_>: std::convert::From<std::string::String>` is not satisfied error[E0277]: the trait bound `rocket::http::Header<'_>: std::convert::From<std::string::String>` is not satisfied
@ -43,8 +43,8 @@ error[E0277]: the trait bound `rocket::http::Header<'_>: std::convert::From<std:
| ^^^^^^^^^^^^ the trait `std::convert::From<std::string::String>` is not implemented for `rocket::http::Header<'_>` | ^^^^^^^^^^^^ the trait `std::convert::From<std::string::String>` is not implemented for `rocket::http::Header<'_>`
| |
= help: the following implementations were found: = help: the following implementations were found:
rocket::http::Header<'static> as $TRAIT <rocket::http::Header<'static> as std::convert::From<&rocket::http::Cookie<'_>>>
rocket::http::Header<'static> as $TRAIT <rocket::http::Header<'static> as std::convert::From<rocket::http::Cookie<'_>>>
= note: required because of the requirements on the impl of `std::convert::Into<rocket::http::Header<'_>>` for `std::string::String` = note: required because of the requirements on the impl of `std::convert::Into<rocket::http::Header<'_>>` for `std::string::String`
error[E0277]: the trait bound `usize: rocket::response::Responder<'_, '_>` is not satisfied error[E0277]: the trait bound `usize: rocket::response::Responder<'_, '_>` is not satisfied
@ -54,7 +54,3 @@ error[E0277]: the trait bound `usize: rocket::response::Responder<'_, '_>` is no
| ^^^^^ the trait `rocket::response::Responder<'_, '_>` is not implemented for `usize` | ^^^^^ the trait `rocket::response::Responder<'_, '_>` is not implemented for `usize`
| |
= note: required by `rocket::handler::<impl rocket::Outcome<rocket::Response<'o>, rocket::http::Status, rocket::Data>>::from` = note: required by `rocket::handler::<impl rocket::Outcome<rocket::Response<'o>, rocket::http::Status, rocket::Data>>::from`
error: aborting due to 6 previous errors
For more information about this error, try `rustc --explain E0277`.

View File

@ -0,0 +1 @@
../ui-fail/route-attribute-general-syntax.rs

View File

@ -214,6 +214,3 @@ error: expected identifier, found integer literal
| ^^^ | ^^^
| |
= help: method must be one of: `GET`, `PUT`, `POST`, `DELETE`, `HEAD`, `PATCH`, `OPTIONS` = help: method must be one of: `GET`, `PUT`, `POST`, `DELETE`, `HEAD`, `PATCH`, `OPTIONS`
error: aborting due to 32 previous errors

View File

@ -0,0 +1 @@
../ui-fail/route-path-bad-syntax.rs

View File

@ -261,6 +261,3 @@ error: malformed parameter or identifier
| |
= help: parameters must be of the form '<param>' = help: parameters must be of the form '<param>'
= help: identifiers cannot contain '<' or '>' = help: identifiers cannot contain '<' or '>'
error: aborting due to 30 previous errors

View File

@ -0,0 +1 @@
../ui-fail/route-type-errors.rs

View File

@ -59,7 +59,3 @@ error[E0277]: the trait bound `Q: rocket::request::FromParam<'_>` is not satisfi
| |
26 | fn f6(a: Q, foo: Q, good: usize, bar: Q) {} 26 | fn f6(a: Q, foo: Q, good: usize, bar: Q) {}
| ^^^^^^ the trait `rocket::request::FromParam<'_>` is not implemented for `Q` | ^^^^^^ the trait `rocket::request::FromParam<'_>` is not implemented for `Q`
error: aborting due to 10 previous errors
For more information about this error, try `rustc --explain E0277`.

View File

@ -0,0 +1 @@
../ui-fail/route-warnings.rs

View File

@ -42,5 +42,8 @@ note: 'HEAD' does not typically support payloads
| ^^^^ | ^^^^
= note: this warning originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info) = note: this warning originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info)
warning: 5 warnings emitted error: checking for warnings!
--> $DIR/route-warnings.rs:25:5
|
25 | compile_error!("checking for warnings!")
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

View File

@ -0,0 +1 @@
../ui-fail/routes.rs

View File

@ -17,6 +17,3 @@ error: unexpected end of input, expected identifier
| ^^^^^^^^^^^^ | ^^^^^^^^^^^^
| |
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to 3 previous errors

View File

@ -0,0 +1 @@
../ui-fail/typed-uri-bad-type.rs

View File

@ -5,9 +5,9 @@ error[E0277]: the trait bound `usize: rocket::http::uri::FromUriParam<rocket::ht
| ^^^^ the trait `rocket::http::uri::FromUriParam<rocket::http::uri::Path, &str>` is not implemented for `usize` | ^^^^ the trait `rocket::http::uri::FromUriParam<rocket::http::uri::Path, &str>` is not implemented for `usize`
| |
= help: the following implementations were found: = help: the following implementations were found:
usize as $TRAIT <usize as rocket::http::uri::FromUriParam<P, &'x mut usize>>
usize as $TRAIT <usize as rocket::http::uri::FromUriParam<P, &'x usize>>
usize as $TRAIT <usize as rocket::http::uri::FromUriParam<P, usize>>
= note: required by `rocket::http::uri::FromUriParam::from_uri_param` = 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 error[E0277]: the trait bound `usize: rocket::http::uri::FromUriParam<rocket::http::uri::Path, &str>` is not satisfied
@ -17,9 +17,9 @@ error[E0277]: the trait bound `usize: rocket::http::uri::FromUriParam<rocket::ht
| ^^^^^^^ the trait `rocket::http::uri::FromUriParam<rocket::http::uri::Path, &str>` is not implemented for `usize` | ^^^^^^^ the trait `rocket::http::uri::FromUriParam<rocket::http::uri::Path, &str>` is not implemented for `usize`
| |
= help: the following implementations were found: = help: the following implementations were found:
usize as $TRAIT <usize as rocket::http::uri::FromUriParam<P, &'x mut usize>>
usize as $TRAIT <usize as rocket::http::uri::FromUriParam<P, &'x usize>>
usize as $TRAIT <usize as rocket::http::uri::FromUriParam<P, usize>>
= note: required by `rocket::http::uri::FromUriParam::from_uri_param` = 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 error[E0277]: the trait bound `usize: rocket::http::uri::FromUriParam<rocket::http::uri::Path, i64>` is not satisfied
@ -29,9 +29,9 @@ error[E0277]: the trait bound `usize: rocket::http::uri::FromUriParam<rocket::ht
| ^^^^^^^^^ the trait `rocket::http::uri::FromUriParam<rocket::http::uri::Path, i64>` is not implemented for `usize` | ^^^^^^^^^ the trait `rocket::http::uri::FromUriParam<rocket::http::uri::Path, i64>` is not implemented for `usize`
| |
= help: the following implementations were found: = help: the following implementations were found:
usize as $TRAIT <usize as rocket::http::uri::FromUriParam<P, &'x mut usize>>
usize as $TRAIT <usize as rocket::http::uri::FromUriParam<P, &'x usize>>
usize as $TRAIT <usize as rocket::http::uri::FromUriParam<P, usize>>
= note: required by `rocket::http::uri::FromUriParam::from_uri_param` = 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 error[E0277]: the trait bound `S: rocket::http::uri::FromUriParam<rocket::http::uri::Path, _>` is not satisfied
@ -47,9 +47,9 @@ error[E0277]: the trait bound `i32: rocket::http::uri::FromUriParam<rocket::http
| ^^^^^^^^ the trait `rocket::http::uri::FromUriParam<rocket::http::uri::Path, std::option::Option<{integer}>>` is not implemented for `i32` | ^^^^^^^^ 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: = help: the following implementations were found:
i32 as $TRAIT <i32 as rocket::http::uri::FromUriParam<P, &'x i32>>
i32 as $TRAIT <i32 as rocket::http::uri::FromUriParam<P, &'x mut i32>>
i32 as $TRAIT <i32 as rocket::http::uri::FromUriParam<P, i32>>
= 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>` = 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 error[E0277]: the trait bound `std::string::String: rocket::http::uri::FromUriParam<rocket::http::uri::Path, std::result::Result<_, _>>` is not satisfied
@ -59,11 +59,11 @@ error[E0277]: the trait bound `std::string::String: rocket::http::uri::FromUriPa
| ^^^^^^^^^^^^^^^^ the trait `rocket::http::uri::FromUriParam<rocket::http::uri::Path, std::result::Result<_, _>>` is not implemented for `std::string::String` | ^^^^^^^^^^^^^^^^ 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: = help: the following implementations were found:
std::string::String as $TRAIT <std::string::String as rocket::http::uri::FromUriParam<P, &'a str>>
std::string::String as $TRAIT <std::string::String as rocket::http::uri::FromUriParam<P, &'x &'a str>>
std::string::String as $TRAIT <std::string::String as rocket::http::uri::FromUriParam<P, &'x mut &'a str>>
std::string::String as $TRAIT <std::string::String as rocket::http::uri::FromUriParam<P, &'x mut std::string::String>>
and $N others and 2 others
= 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>` = 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 error[E0277]: the trait bound `isize: rocket::http::uri::FromUriParam<rocket::http::uri::Query, &str>` is not satisfied
@ -73,9 +73,9 @@ error[E0277]: the trait bound `isize: rocket::http::uri::FromUriParam<rocket::ht
| ^^^^ the trait `rocket::http::uri::FromUriParam<rocket::http::uri::Query, &str>` is not implemented for `isize` | ^^^^ the trait `rocket::http::uri::FromUriParam<rocket::http::uri::Query, &str>` is not implemented for `isize`
| |
= help: the following implementations were found: = help: the following implementations were found:
isize as $TRAIT <isize as rocket::http::uri::FromUriParam<P, &'x isize>>
isize as $TRAIT <isize as rocket::http::uri::FromUriParam<P, &'x mut isize>>
isize as $TRAIT <isize as rocket::http::uri::FromUriParam<P, isize>>
= note: required by `rocket::http::uri::FromUriParam::from_uri_param` = 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 error[E0277]: the trait bound `isize: rocket::http::uri::FromUriParam<rocket::http::uri::Query, &str>` is not satisfied
@ -85,9 +85,9 @@ error[E0277]: the trait bound `isize: rocket::http::uri::FromUriParam<rocket::ht
| ^^^^ the trait `rocket::http::uri::FromUriParam<rocket::http::uri::Query, &str>` is not implemented for `isize` | ^^^^ the trait `rocket::http::uri::FromUriParam<rocket::http::uri::Query, &str>` is not implemented for `isize`
| |
= help: the following implementations were found: = help: the following implementations were found:
isize as $TRAIT <isize as rocket::http::uri::FromUriParam<P, &'x isize>>
isize as $TRAIT <isize as rocket::http::uri::FromUriParam<P, &'x mut isize>>
isize as $TRAIT <isize as rocket::http::uri::FromUriParam<P, isize>>
= note: required by `rocket::http::uri::FromUriParam::from_uri_param` = 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 error[E0277]: the trait bound `S: rocket::http::uri::FromUriParam<rocket::http::uri::Query, _>` is not satisfied
@ -110,8 +110,8 @@ error[E0277]: the trait bound `S: rocket::http::uri::Ignorable<rocket::http::uri
... ...
79 | uri!(other_q: rest = _, id = 100); 79 | uri!(other_q: rest = _, id = 100);
| ---------------------------------- in this macro invocation | ---------------------------------- in this macro invocation
| |
::: $ROCKET/core/http/src/uri/uri_display.rs:465:40 ::: $WORKSPACE/core/http/src/uri/uri_display.rs:465:40
| |
465 | pub fn assert_ignorable<P: UriPart, T: Ignorable<P>>() { } 465 | pub fn assert_ignorable<P: UriPart, T: Ignorable<P>>() { }
| ------------ required by this bound in `rocket::http::uri::assert_ignorable` | ------------ required by this bound in `rocket::http::uri::assert_ignorable`
@ -126,8 +126,8 @@ error[E0277]: the trait bound `usize: rocket::http::uri::Ignorable<rocket::http:
... ...
81 | uri!(other_q: rest = S, id = _); 81 | uri!(other_q: rest = S, id = _);
| -------------------------------- in this macro invocation | -------------------------------- in this macro invocation
| |
::: $ROCKET/core/http/src/uri/uri_display.rs:465:40 ::: $WORKSPACE/core/http/src/uri/uri_display.rs:465:40
| |
465 | pub fn assert_ignorable<P: UriPart, T: Ignorable<P>>() { } 465 | pub fn assert_ignorable<P: UriPart, T: Ignorable<P>>() { }
| ------------ required by this bound in `rocket::http::uri::assert_ignorable` | ------------ required by this bound in `rocket::http::uri::assert_ignorable`
@ -139,7 +139,3 @@ error[E0277]: the trait bound `S: rocket::http::uri::FromUriParam<rocket::http::
| |
81 | uri!(other_q: rest = S, id = _); 81 | uri!(other_q: rest = S, id = _);
| ^ the trait `rocket::http::uri::FromUriParam<rocket::http::uri::Query, _>` is not implemented for `S` | ^ the trait `rocket::http::uri::FromUriParam<rocket::http::uri::Query, _>` is not implemented for `S`
error: aborting due to 13 previous errors
For more information about this error, try `rustc --explain E0277`.

View File

@ -0,0 +1 @@
../ui-fail/typed-uris-bad-params.rs

View File

@ -237,5 +237,10 @@ error: `has_one` route uri expects 1 parameter but 0 were supplied
| |
= note: expected parameter: id: i32 = note: expected parameter: id: i32
error: aborting due to 21 previous errors warning: unused import: `std::fmt`
--> $DIR/typed-uris-bad-params.rs:3:5
|
3 | use std::fmt;
| ^^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default

View File

@ -0,0 +1 @@
../ui-fail/typed-uris-invalid-syntax.rs

View File

@ -63,6 +63,3 @@ error: unexpected end of input, expected expression
| ^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^
| |
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to 10 previous errors

View File

@ -0,0 +1 @@
../ui-fail/update-references.sh

View File

@ -0,0 +1 @@
../ui-fail/uri_display.rs

View File

@ -136,8 +136,8 @@ error[E0277]: the trait bound `Foo1: rocket::http::uri::UriDisplay<rocket::http:
| |
5 | #[derive(UriDisplayQuery)] 5 | #[derive(UriDisplayQuery)]
| ^^^^^^^^^^^^^^^ the trait `rocket::http::uri::UriDisplay<rocket::http::uri::Query>` is not implemented for `Foo1` | ^^^^^^^^^^^^^^^ the trait `rocket::http::uri::UriDisplay<rocket::http::uri::Query>` is not implemented for `Foo1`
| |
::: $ROCKET/core/http/src/uri/from_uri_param.rs:195:18 ::: $WORKSPACE/core/http/src/uri/from_uri_param.rs:195:18
| |
195 | type Target: UriDisplay<P>; 195 | type Target: UriDisplay<P>;
| ------------- required by this bound in `rocket::http::uri::FromUriParam` | ------------- required by this bound in `rocket::http::uri::FromUriParam`
@ -149,8 +149,8 @@ error[E0277]: the trait bound `Foo1: rocket::http::uri::UriDisplay<rocket::http:
| |
5 | #[derive(UriDisplayQuery)] 5 | #[derive(UriDisplayQuery)]
| ^^^^^^^^^^^^^^^ the trait `rocket::http::uri::UriDisplay<rocket::http::uri::Query>` is not implemented for `Foo1` | ^^^^^^^^^^^^^^^ the trait `rocket::http::uri::UriDisplay<rocket::http::uri::Query>` is not implemented for `Foo1`
| |
::: $ROCKET/core/http/src/uri/from_uri_param.rs:195:18 ::: $WORKSPACE/core/http/src/uri/from_uri_param.rs:195:18
| |
195 | type Target: UriDisplay<P>; 195 | type Target: UriDisplay<P>;
| ------------- required by this bound in `rocket::http::uri::FromUriParam` | ------------- required by this bound in `rocket::http::uri::FromUriParam`
@ -163,8 +163,8 @@ error[E0277]: the trait bound `Foo1: rocket::http::uri::UriDisplay<rocket::http:
| |
5 | #[derive(UriDisplayQuery)] 5 | #[derive(UriDisplayQuery)]
| ^^^^^^^^^^^^^^^ the trait `rocket::http::uri::UriDisplay<rocket::http::uri::Query>` is not implemented for `Foo1` | ^^^^^^^^^^^^^^^ the trait `rocket::http::uri::UriDisplay<rocket::http::uri::Query>` is not implemented for `Foo1`
| |
::: $ROCKET/core/http/src/uri/from_uri_param.rs:195:18 ::: $WORKSPACE/core/http/src/uri/from_uri_param.rs:195:18
| |
195 | type Target: UriDisplay<P>; 195 | type Target: UriDisplay<P>;
| ------------- required by this bound in `rocket::http::uri::FromUriParam` | ------------- required by this bound in `rocket::http::uri::FromUriParam`
@ -177,8 +177,8 @@ error[E0277]: the trait bound `Foo2: rocket::http::uri::UriDisplay<rocket::http:
| |
12 | #[derive(UriDisplayQuery)] 12 | #[derive(UriDisplayQuery)]
| ^^^^^^^^^^^^^^^ the trait `rocket::http::uri::UriDisplay<rocket::http::uri::Query>` is not implemented for `Foo2` | ^^^^^^^^^^^^^^^ the trait `rocket::http::uri::UriDisplay<rocket::http::uri::Query>` is not implemented for `Foo2`
| |
::: $ROCKET/core/http/src/uri/from_uri_param.rs:195:18 ::: $WORKSPACE/core/http/src/uri/from_uri_param.rs:195:18
| |
195 | type Target: UriDisplay<P>; 195 | type Target: UriDisplay<P>;
| ------------- required by this bound in `rocket::http::uri::FromUriParam` | ------------- required by this bound in `rocket::http::uri::FromUriParam`
@ -190,8 +190,8 @@ error[E0277]: the trait bound `Foo2: rocket::http::uri::UriDisplay<rocket::http:
| |
12 | #[derive(UriDisplayQuery)] 12 | #[derive(UriDisplayQuery)]
| ^^^^^^^^^^^^^^^ the trait `rocket::http::uri::UriDisplay<rocket::http::uri::Query>` is not implemented for `Foo2` | ^^^^^^^^^^^^^^^ the trait `rocket::http::uri::UriDisplay<rocket::http::uri::Query>` is not implemented for `Foo2`
| |
::: $ROCKET/core/http/src/uri/from_uri_param.rs:195:18 ::: $WORKSPACE/core/http/src/uri/from_uri_param.rs:195:18
| |
195 | type Target: UriDisplay<P>; 195 | type Target: UriDisplay<P>;
| ------------- required by this bound in `rocket::http::uri::FromUriParam` | ------------- required by this bound in `rocket::http::uri::FromUriParam`
@ -204,8 +204,8 @@ error[E0277]: the trait bound `Foo2: rocket::http::uri::UriDisplay<rocket::http:
| |
12 | #[derive(UriDisplayQuery)] 12 | #[derive(UriDisplayQuery)]
| ^^^^^^^^^^^^^^^ the trait `rocket::http::uri::UriDisplay<rocket::http::uri::Query>` is not implemented for `Foo2` | ^^^^^^^^^^^^^^^ the trait `rocket::http::uri::UriDisplay<rocket::http::uri::Query>` is not implemented for `Foo2`
| |
::: $ROCKET/core/http/src/uri/from_uri_param.rs:195:18 ::: $WORKSPACE/core/http/src/uri/from_uri_param.rs:195:18
| |
195 | type Target: UriDisplay<P>; 195 | type Target: UriDisplay<P>;
| ------------- required by this bound in `rocket::http::uri::FromUriParam` | ------------- required by this bound in `rocket::http::uri::FromUriParam`
@ -218,8 +218,8 @@ error[E0277]: the trait bound `Foo3: rocket::http::uri::UriDisplay<rocket::http:
| |
19 | #[derive(UriDisplayQuery)] 19 | #[derive(UriDisplayQuery)]
| ^^^^^^^^^^^^^^^ the trait `rocket::http::uri::UriDisplay<rocket::http::uri::Query>` is not implemented for `Foo3` | ^^^^^^^^^^^^^^^ the trait `rocket::http::uri::UriDisplay<rocket::http::uri::Query>` is not implemented for `Foo3`
| |
::: $ROCKET/core/http/src/uri/from_uri_param.rs:195:18 ::: $WORKSPACE/core/http/src/uri/from_uri_param.rs:195:18
| |
195 | type Target: UriDisplay<P>; 195 | type Target: UriDisplay<P>;
| ------------- required by this bound in `rocket::http::uri::FromUriParam` | ------------- required by this bound in `rocket::http::uri::FromUriParam`
@ -231,8 +231,8 @@ error[E0277]: the trait bound `Foo3: rocket::http::uri::UriDisplay<rocket::http:
| |
19 | #[derive(UriDisplayQuery)] 19 | #[derive(UriDisplayQuery)]
| ^^^^^^^^^^^^^^^ the trait `rocket::http::uri::UriDisplay<rocket::http::uri::Query>` is not implemented for `Foo3` | ^^^^^^^^^^^^^^^ the trait `rocket::http::uri::UriDisplay<rocket::http::uri::Query>` is not implemented for `Foo3`
| |
::: $ROCKET/core/http/src/uri/from_uri_param.rs:195:18 ::: $WORKSPACE/core/http/src/uri/from_uri_param.rs:195:18
| |
195 | type Target: UriDisplay<P>; 195 | type Target: UriDisplay<P>;
| ------------- required by this bound in `rocket::http::uri::FromUriParam` | ------------- required by this bound in `rocket::http::uri::FromUriParam`
@ -245,8 +245,8 @@ error[E0277]: the trait bound `Foo3: rocket::http::uri::UriDisplay<rocket::http:
| |
19 | #[derive(UriDisplayQuery)] 19 | #[derive(UriDisplayQuery)]
| ^^^^^^^^^^^^^^^ the trait `rocket::http::uri::UriDisplay<rocket::http::uri::Query>` is not implemented for `Foo3` | ^^^^^^^^^^^^^^^ the trait `rocket::http::uri::UriDisplay<rocket::http::uri::Query>` is not implemented for `Foo3`
| |
::: $ROCKET/core/http/src/uri/from_uri_param.rs:195:18 ::: $WORKSPACE/core/http/src/uri/from_uri_param.rs:195:18
| |
195 | type Target: UriDisplay<P>; 195 | type Target: UriDisplay<P>;
| ------------- required by this bound in `rocket::http::uri::FromUriParam` | ------------- required by this bound in `rocket::http::uri::FromUriParam`
@ -259,8 +259,8 @@ error[E0277]: the trait bound `Foo4: rocket::http::uri::UriDisplay<rocket::http:
| |
26 | #[derive(UriDisplayQuery)] 26 | #[derive(UriDisplayQuery)]
| ^^^^^^^^^^^^^^^ the trait `rocket::http::uri::UriDisplay<rocket::http::uri::Query>` is not implemented for `Foo4` | ^^^^^^^^^^^^^^^ the trait `rocket::http::uri::UriDisplay<rocket::http::uri::Query>` is not implemented for `Foo4`
| |
::: $ROCKET/core/http/src/uri/from_uri_param.rs:195:18 ::: $WORKSPACE/core/http/src/uri/from_uri_param.rs:195:18
| |
195 | type Target: UriDisplay<P>; 195 | type Target: UriDisplay<P>;
| ------------- required by this bound in `rocket::http::uri::FromUriParam` | ------------- required by this bound in `rocket::http::uri::FromUriParam`
@ -272,8 +272,8 @@ error[E0277]: the trait bound `Foo4: rocket::http::uri::UriDisplay<rocket::http:
| |
26 | #[derive(UriDisplayQuery)] 26 | #[derive(UriDisplayQuery)]
| ^^^^^^^^^^^^^^^ the trait `rocket::http::uri::UriDisplay<rocket::http::uri::Query>` is not implemented for `Foo4` | ^^^^^^^^^^^^^^^ the trait `rocket::http::uri::UriDisplay<rocket::http::uri::Query>` is not implemented for `Foo4`
| |
::: $ROCKET/core/http/src/uri/from_uri_param.rs:195:18 ::: $WORKSPACE/core/http/src/uri/from_uri_param.rs:195:18
| |
195 | type Target: UriDisplay<P>; 195 | type Target: UriDisplay<P>;
| ------------- required by this bound in `rocket::http::uri::FromUriParam` | ------------- required by this bound in `rocket::http::uri::FromUriParam`
@ -286,8 +286,8 @@ error[E0277]: the trait bound `Foo4: rocket::http::uri::UriDisplay<rocket::http:
| |
26 | #[derive(UriDisplayQuery)] 26 | #[derive(UriDisplayQuery)]
| ^^^^^^^^^^^^^^^ the trait `rocket::http::uri::UriDisplay<rocket::http::uri::Query>` is not implemented for `Foo4` | ^^^^^^^^^^^^^^^ the trait `rocket::http::uri::UriDisplay<rocket::http::uri::Query>` is not implemented for `Foo4`
| |
::: $ROCKET/core/http/src/uri/from_uri_param.rs:195:18 ::: $WORKSPACE/core/http/src/uri/from_uri_param.rs:195:18
| |
195 | type Target: UriDisplay<P>; 195 | type Target: UriDisplay<P>;
| ------------- required by this bound in `rocket::http::uri::FromUriParam` | ------------- required by this bound in `rocket::http::uri::FromUriParam`
@ -300,8 +300,8 @@ error[E0277]: the trait bound `Foo5: rocket::http::uri::UriDisplay<rocket::http:
| |
35 | #[derive(UriDisplayQuery)] 35 | #[derive(UriDisplayQuery)]
| ^^^^^^^^^^^^^^^ the trait `rocket::http::uri::UriDisplay<rocket::http::uri::Query>` is not implemented for `Foo5` | ^^^^^^^^^^^^^^^ the trait `rocket::http::uri::UriDisplay<rocket::http::uri::Query>` is not implemented for `Foo5`
| |
::: $ROCKET/core/http/src/uri/from_uri_param.rs:195:18 ::: $WORKSPACE/core/http/src/uri/from_uri_param.rs:195:18
| |
195 | type Target: UriDisplay<P>; 195 | type Target: UriDisplay<P>;
| ------------- required by this bound in `rocket::http::uri::FromUriParam` | ------------- required by this bound in `rocket::http::uri::FromUriParam`
@ -313,8 +313,8 @@ error[E0277]: the trait bound `Foo5: rocket::http::uri::UriDisplay<rocket::http:
| |
35 | #[derive(UriDisplayQuery)] 35 | #[derive(UriDisplayQuery)]
| ^^^^^^^^^^^^^^^ the trait `rocket::http::uri::UriDisplay<rocket::http::uri::Query>` is not implemented for `Foo5` | ^^^^^^^^^^^^^^^ the trait `rocket::http::uri::UriDisplay<rocket::http::uri::Query>` is not implemented for `Foo5`
| |
::: $ROCKET/core/http/src/uri/from_uri_param.rs:195:18 ::: $WORKSPACE/core/http/src/uri/from_uri_param.rs:195:18
| |
195 | type Target: UriDisplay<P>; 195 | type Target: UriDisplay<P>;
| ------------- required by this bound in `rocket::http::uri::FromUriParam` | ------------- required by this bound in `rocket::http::uri::FromUriParam`
@ -327,8 +327,8 @@ error[E0277]: the trait bound `Foo5: rocket::http::uri::UriDisplay<rocket::http:
| |
35 | #[derive(UriDisplayQuery)] 35 | #[derive(UriDisplayQuery)]
| ^^^^^^^^^^^^^^^ the trait `rocket::http::uri::UriDisplay<rocket::http::uri::Query>` is not implemented for `Foo5` | ^^^^^^^^^^^^^^^ the trait `rocket::http::uri::UriDisplay<rocket::http::uri::Query>` is not implemented for `Foo5`
| |
::: $ROCKET/core/http/src/uri/from_uri_param.rs:195:18 ::: $WORKSPACE/core/http/src/uri/from_uri_param.rs:195:18
| |
195 | type Target: UriDisplay<P>; 195 | type Target: UriDisplay<P>;
| ------------- required by this bound in `rocket::http::uri::FromUriParam` | ------------- required by this bound in `rocket::http::uri::FromUriParam`
@ -341,8 +341,8 @@ error[E0277]: the trait bound `Foo6: rocket::http::uri::UriDisplay<rocket::http:
| |
42 | #[derive(UriDisplayQuery)] 42 | #[derive(UriDisplayQuery)]
| ^^^^^^^^^^^^^^^ the trait `rocket::http::uri::UriDisplay<rocket::http::uri::Query>` is not implemented for `Foo6` | ^^^^^^^^^^^^^^^ the trait `rocket::http::uri::UriDisplay<rocket::http::uri::Query>` is not implemented for `Foo6`
| |
::: $ROCKET/core/http/src/uri/from_uri_param.rs:195:18 ::: $WORKSPACE/core/http/src/uri/from_uri_param.rs:195:18
| |
195 | type Target: UriDisplay<P>; 195 | type Target: UriDisplay<P>;
| ------------- required by this bound in `rocket::http::uri::FromUriParam` | ------------- required by this bound in `rocket::http::uri::FromUriParam`
@ -354,8 +354,8 @@ error[E0277]: the trait bound `Foo6: rocket::http::uri::UriDisplay<rocket::http:
| |
42 | #[derive(UriDisplayQuery)] 42 | #[derive(UriDisplayQuery)]
| ^^^^^^^^^^^^^^^ the trait `rocket::http::uri::UriDisplay<rocket::http::uri::Query>` is not implemented for `Foo6` | ^^^^^^^^^^^^^^^ the trait `rocket::http::uri::UriDisplay<rocket::http::uri::Query>` is not implemented for `Foo6`
| |
::: $ROCKET/core/http/src/uri/from_uri_param.rs:195:18 ::: $WORKSPACE/core/http/src/uri/from_uri_param.rs:195:18
| |
195 | type Target: UriDisplay<P>; 195 | type Target: UriDisplay<P>;
| ------------- required by this bound in `rocket::http::uri::FromUriParam` | ------------- required by this bound in `rocket::http::uri::FromUriParam`
@ -368,8 +368,8 @@ error[E0277]: the trait bound `Foo6: rocket::http::uri::UriDisplay<rocket::http:
| |
42 | #[derive(UriDisplayQuery)] 42 | #[derive(UriDisplayQuery)]
| ^^^^^^^^^^^^^^^ the trait `rocket::http::uri::UriDisplay<rocket::http::uri::Query>` is not implemented for `Foo6` | ^^^^^^^^^^^^^^^ the trait `rocket::http::uri::UriDisplay<rocket::http::uri::Query>` is not implemented for `Foo6`
| |
::: $ROCKET/core/http/src/uri/from_uri_param.rs:195:18 ::: $WORKSPACE/core/http/src/uri/from_uri_param.rs:195:18
| |
195 | type Target: UriDisplay<P>; 195 | type Target: UriDisplay<P>;
| ------------- required by this bound in `rocket::http::uri::FromUriParam` | ------------- required by this bound in `rocket::http::uri::FromUriParam`
@ -382,8 +382,8 @@ error[E0277]: the trait bound `Foo7: rocket::http::uri::UriDisplay<rocket::http:
| |
52 | #[derive(UriDisplayPath)] 52 | #[derive(UriDisplayPath)]
| ^^^^^^^^^^^^^^ the trait `rocket::http::uri::UriDisplay<rocket::http::uri::Path>` is not implemented for `Foo7` | ^^^^^^^^^^^^^^ the trait `rocket::http::uri::UriDisplay<rocket::http::uri::Path>` is not implemented for `Foo7`
| |
::: $ROCKET/core/http/src/uri/from_uri_param.rs:195:18 ::: $WORKSPACE/core/http/src/uri/from_uri_param.rs:195:18
| |
195 | type Target: UriDisplay<P>; 195 | type Target: UriDisplay<P>;
| ------------- required by this bound in `rocket::http::uri::FromUriParam` | ------------- required by this bound in `rocket::http::uri::FromUriParam`
@ -395,8 +395,8 @@ error[E0277]: the trait bound `Foo7: rocket::http::uri::UriDisplay<rocket::http:
| |
52 | #[derive(UriDisplayPath)] 52 | #[derive(UriDisplayPath)]
| ^^^^^^^^^^^^^^ the trait `rocket::http::uri::UriDisplay<rocket::http::uri::Path>` is not implemented for `Foo7` | ^^^^^^^^^^^^^^ the trait `rocket::http::uri::UriDisplay<rocket::http::uri::Path>` is not implemented for `Foo7`
| |
::: $ROCKET/core/http/src/uri/from_uri_param.rs:195:18 ::: $WORKSPACE/core/http/src/uri/from_uri_param.rs:195:18
| |
195 | type Target: UriDisplay<P>; 195 | type Target: UriDisplay<P>;
| ------------- required by this bound in `rocket::http::uri::FromUriParam` | ------------- required by this bound in `rocket::http::uri::FromUriParam`
@ -409,8 +409,8 @@ error[E0277]: the trait bound `Foo8: rocket::http::uri::UriDisplay<rocket::http:
| |
58 | #[derive(UriDisplayPath)] 58 | #[derive(UriDisplayPath)]
| ^^^^^^^^^^^^^^ the trait `rocket::http::uri::UriDisplay<rocket::http::uri::Path>` is not implemented for `Foo8` | ^^^^^^^^^^^^^^ the trait `rocket::http::uri::UriDisplay<rocket::http::uri::Path>` is not implemented for `Foo8`
| |
::: $ROCKET/core/http/src/uri/from_uri_param.rs:195:18 ::: $WORKSPACE/core/http/src/uri/from_uri_param.rs:195:18
| |
195 | type Target: UriDisplay<P>; 195 | type Target: UriDisplay<P>;
| ------------- required by this bound in `rocket::http::uri::FromUriParam` | ------------- required by this bound in `rocket::http::uri::FromUriParam`
@ -422,8 +422,8 @@ error[E0277]: the trait bound `Foo8: rocket::http::uri::UriDisplay<rocket::http:
| |
58 | #[derive(UriDisplayPath)] 58 | #[derive(UriDisplayPath)]
| ^^^^^^^^^^^^^^ the trait `rocket::http::uri::UriDisplay<rocket::http::uri::Path>` is not implemented for `Foo8` | ^^^^^^^^^^^^^^ the trait `rocket::http::uri::UriDisplay<rocket::http::uri::Path>` is not implemented for `Foo8`
| |
::: $ROCKET/core/http/src/uri/from_uri_param.rs:195:18 ::: $WORKSPACE/core/http/src/uri/from_uri_param.rs:195:18
| |
195 | type Target: UriDisplay<P>; 195 | type Target: UriDisplay<P>;
| ------------- required by this bound in `rocket::http::uri::FromUriParam` | ------------- required by this bound in `rocket::http::uri::FromUriParam`
@ -436,8 +436,8 @@ error[E0277]: the trait bound `Foo9: rocket::http::uri::UriDisplay<rocket::http:
| |
64 | #[derive(UriDisplayPath)] 64 | #[derive(UriDisplayPath)]
| ^^^^^^^^^^^^^^ the trait `rocket::http::uri::UriDisplay<rocket::http::uri::Path>` is not implemented for `Foo9` | ^^^^^^^^^^^^^^ the trait `rocket::http::uri::UriDisplay<rocket::http::uri::Path>` is not implemented for `Foo9`
| |
::: $ROCKET/core/http/src/uri/from_uri_param.rs:195:18 ::: $WORKSPACE/core/http/src/uri/from_uri_param.rs:195:18
| |
195 | type Target: UriDisplay<P>; 195 | type Target: UriDisplay<P>;
| ------------- required by this bound in `rocket::http::uri::FromUriParam` | ------------- required by this bound in `rocket::http::uri::FromUriParam`
@ -449,8 +449,8 @@ error[E0277]: the trait bound `Foo9: rocket::http::uri::UriDisplay<rocket::http:
| |
64 | #[derive(UriDisplayPath)] 64 | #[derive(UriDisplayPath)]
| ^^^^^^^^^^^^^^ the trait `rocket::http::uri::UriDisplay<rocket::http::uri::Path>` is not implemented for `Foo9` | ^^^^^^^^^^^^^^ the trait `rocket::http::uri::UriDisplay<rocket::http::uri::Path>` is not implemented for `Foo9`
| |
::: $ROCKET/core/http/src/uri/from_uri_param.rs:195:18 ::: $WORKSPACE/core/http/src/uri/from_uri_param.rs:195:18
| |
195 | type Target: UriDisplay<P>; 195 | type Target: UriDisplay<P>;
| ------------- required by this bound in `rocket::http::uri::FromUriParam` | ------------- required by this bound in `rocket::http::uri::FromUriParam`
@ -463,8 +463,8 @@ error[E0277]: the trait bound `Foo10: rocket::http::uri::UriDisplay<rocket::http
| |
70 | #[derive(UriDisplayPath)] 70 | #[derive(UriDisplayPath)]
| ^^^^^^^^^^^^^^ the trait `rocket::http::uri::UriDisplay<rocket::http::uri::Path>` is not implemented for `Foo10` | ^^^^^^^^^^^^^^ the trait `rocket::http::uri::UriDisplay<rocket::http::uri::Path>` is not implemented for `Foo10`
| |
::: $ROCKET/core/http/src/uri/from_uri_param.rs:195:18 ::: $WORKSPACE/core/http/src/uri/from_uri_param.rs:195:18
| |
195 | type Target: UriDisplay<P>; 195 | type Target: UriDisplay<P>;
| ------------- required by this bound in `rocket::http::uri::FromUriParam` | ------------- required by this bound in `rocket::http::uri::FromUriParam`
@ -476,15 +476,11 @@ error[E0277]: the trait bound `Foo10: rocket::http::uri::UriDisplay<rocket::http
| |
70 | #[derive(UriDisplayPath)] 70 | #[derive(UriDisplayPath)]
| ^^^^^^^^^^^^^^ the trait `rocket::http::uri::UriDisplay<rocket::http::uri::Path>` is not implemented for `Foo10` | ^^^^^^^^^^^^^^ the trait `rocket::http::uri::UriDisplay<rocket::http::uri::Path>` is not implemented for `Foo10`
| |
::: $ROCKET/core/http/src/uri/from_uri_param.rs:195:18 ::: $WORKSPACE/core/http/src/uri/from_uri_param.rs:195:18
| |
195 | type Target: UriDisplay<P>; 195 | type Target: UriDisplay<P>;
| ------------- required by this bound in `rocket::http::uri::FromUriParam` | ------------- required by this bound in `rocket::http::uri::FromUriParam`
| |
= note: required because of the requirements on the impl of `rocket::http::uri::UriDisplay<rocket::http::uri::Path>` for `&Foo10` = note: required because of the requirements on the impl of `rocket::http::uri::UriDisplay<rocket::http::uri::Path>` for `&Foo10`
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to 36 previous errors
For more information about this error, try `rustc --explain E0277`.

View File

@ -0,0 +1 @@
../ui-fail/uri_display_type_errors.rs

View File

@ -56,7 +56,3 @@ error[E0277]: the trait bound `BadType: rocket::http::uri::UriDisplay<rocket::ht
| ^^^^^^^ the trait `rocket::http::uri::UriDisplay<rocket::http::uri::Path>` is not implemented for `BadType` | ^^^^^^^ the trait `rocket::http::uri::UriDisplay<rocket::http::uri::Path>` is not implemented for `BadType`
| |
= note: required because of the requirements on the impl of `rocket::http::uri::UriDisplay<rocket::http::uri::Path>` for `&BadType` = note: required because of the requirements on the impl of `rocket::http::uri::UriDisplay<rocket::http::uri::Path>` for `&BadType`
error: aborting due to 7 previous errors
For more information about this error, try `rustc --explain E0277`.

View File

@ -0,0 +1 @@
../ui-fail/async-entry.rs

View File

@ -0,0 +1,165 @@
error: attribute can only be applied to `async` functions
--> $DIR/async-entry.rs:6:5
|
6 | #[rocket::main]
| ^^^^^^^^^^^^^^^
|
= note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: [note] this function must be `async`
--> $DIR/async-entry.rs:7:5
|
7 | fn foo() { }
| ^^
error: [warning] attribute is typically applied to `main` function
--> $DIR/async-entry.rs:12:5
|
12 | #[rocket::main]
| ^^^^^^^^^^^^^^^
|
= note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: [note] this function is not `main`
--> $DIR/async-entry.rs:13:5
|
13 | async fn foo() { }
| ^^^^^
error: attribute can only be applied to `async` functions
--> $DIR/async-entry.rs:18:5
|
18 | #[rocket::main]
| ^^^^^^^^^^^^^^^
|
= note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: [note] this function must be `async`
--> $DIR/async-entry.rs:19:5
|
19 | fn main() {
| ^^
error: attribute cannot be applied to `main` function
--- note: this attribute generates a `main` function
--> $DIR/async-entry.rs:55:5
|
55 | #[rocket::launch]
| ^^^^^^^^^^^^^^^^^
|
= note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: [note] this function cannot be `main`
--> $DIR/async-entry.rs:56:5
|
56 | fn main() -> rocket::Rocket {
| ^^
error: attribute can only be applied to functions that return a value
--> $DIR/async-entry.rs:63:5
|
63 | #[rocket::launch]
| ^^^^^^^^^^^^^^^^^
|
= note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: [note] this function must return a value
--> $DIR/async-entry.rs:64:5
|
64 | async fn rocket() {
| ^^^^^
error: attribute can only be applied to functions that return a value
--> $DIR/async-entry.rs:72:5
|
72 | #[rocket::launch]
| ^^^^^^^^^^^^^^^^^
|
= note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: [note] this function must return a value
--> $DIR/async-entry.rs:73:5
|
73 | fn rocket() {
| ^^
error: attribute cannot be applied to `main` function
--- note: this attribute generates a `main` function
--> $DIR/async-entry.rs:89:5
|
89 | #[rocket::launch]
| ^^^^^^^^^^^^^^^^^
|
= note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: [note] this function cannot be `main`
--> $DIR/async-entry.rs:90:5
|
90 | fn main() -> &'static str {
| ^^
error: attribute cannot be applied to `main` function
--- note: this attribute generates a `main` function
--> $DIR/async-entry.rs:98:5
|
98 | #[rocket::launch]
| ^^^^^^^^^^^^^^^^^
|
= note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: [note] this function cannot be `main`
--> $DIR/async-entry.rs:99:5
|
99 | async fn main() -> rocket::Rocket {
| ^^^^^
error[E0728]: `await` is only allowed inside `async` functions and blocks
--> $DIR/async-entry.rs:82:17
|
81 | fn rocket() -> rocket::Rocket {
| ------ this is not `async`
82 | let _ = rocket::ignite().launch().await;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ only allowed inside `async` functions and blocks
error[E0308]: mismatched types
--> $DIR/async-entry.rs:40:9
|
40 | rocket::ignite()
| ^^^^^^^^^^^^^^^^ expected struct `std::string::String`, found struct `rocket::rocket::Rocket`
error[E0308]: mismatched types
--> $DIR/async-entry.rs:49:9
|
49 | "hi".to_string()
| ^^^^^^^^^^^^^^^^ expected struct `rocket::rocket::Rocket`, found struct `std::string::String`
error[E0308]: mismatched types
--> $DIR/async-entry.rs:27:21
|
27 | async fn main() {
| ^ expected `()` because of default return type
| _____________________|
| |
28 | | //~^ ERROR mismatched types
29 | | rocket::ignite()
30 | | }
| | ^- help: try adding a semicolon: `;`
| |_____|
| expected `()`, found struct `rocket::rocket::Rocket`
error[E0308]: mismatched types
--> $DIR/async-entry.rs:37:26
|
37 | async fn rocket() -> String {
| ^^^^^^
| |
| expected struct `rocket::rocket::Rocket`, found struct `std::string::String`
| expected due to this
error[E0277]: `main` has invalid return type `rocket::rocket::Rocket`
--> $DIR/async-entry.rs:106:20
|
106 | async fn main() -> rocket::Rocket {
| ^^^^^^^^^^^^^^ `main` can only return types that implement `std::process::Termination`
|
= help: consider using `()`, or a `Result`

View File

@ -0,0 +1 @@
../ui-fail/catch.rs

View File

@ -0,0 +1,70 @@
error: expected `fn`
--- help: `#[catch]` can only be used on functions
--> $DIR/catch.rs:6:1
|
6 | struct Catcher(String);
| ^^^^^^
error: expected `fn`
--- help: `#[catch]` can only be used on functions
--> $DIR/catch.rs:11:7
|
11 | const CATCH: &str = "Catcher";
| ^^^^^
error: invalid value: expected unsigned integer literal
--- help: `#[catch]` expects a single status integer, e.g.: #[catch(404)]
--> $DIR/catch.rs:15:9
|
15 | #[catch("404")] //~ ERROR expected unsigned integer literal
| ^^^^^
error: unexpected keyed parameter: expected literal or identifier
--- help: `#[catch]` expects a single status integer, e.g.: #[catch(404)]
--> $DIR/catch.rs:19:9
|
19 | #[catch(code = "404")] //~ ERROR unexpected keyed parameter
| ^^^^
error: unexpected keyed parameter: expected literal or identifier
--- help: `#[catch]` expects a single status integer, e.g.: #[catch(404)]
--> $DIR/catch.rs:23:9
|
23 | #[catch(code = 404)] //~ ERROR unexpected keyed parameter
| ^^^^
error: status must be in range [100, 599]
--- help: `#[catch]` expects a single status integer, e.g.: #[catch(404)]
--> $DIR/catch.rs:27:9
|
27 | #[catch(99)] //~ ERROR in range [100, 599]
| ^^
error: status must be in range [100, 599]
--- help: `#[catch]` expects a single status integer, e.g.: #[catch(404)]
--> $DIR/catch.rs:31:9
|
31 | #[catch(600)] //~ ERROR in range [100, 599]
| ^^^
error: unexpected attribute parameter: `message`
--- help: `#[catch]` expects a single status integer, e.g.: #[catch(404)]
--> $DIR/catch.rs:35:14
|
35 | #[catch(400, message = "foo")] //~ ERROR unexpected attribute parameter: `message`
| ^^^^^^^
error: invalid number of arguments: must be zero or one
--- help: catchers may optionally take an argument of type `&Request`
--> $DIR/catch.rs:40:7
|
40 | fn f3(_request: &Request, other: bool) {
| ^^^^^^^^
warning: unused import: `rocket::Request`
--> $DIR/catch.rs:3:5
|
3 | use rocket::Request;
| ^^^^^^^^^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default

View File

@ -0,0 +1 @@
../ui-fail/catch_type_errors.rs

View File

@ -0,0 +1,37 @@
error[E0277]: the trait bound `usize: rocket::response::Responder<'_, '_>` is not satisfied
--> $DIR/catch_type_errors.rs:6:30
|
6 | fn f1(_request: &Request) -> usize {
| ^^^^^ 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
|
12 | fn f2(_request: &Request) -> bool {
| ^^^^ 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
|
18 | fn f3(_request: bool) -> usize {
| ^^^^^^^^ expected `bool`, found `&rocket::Request<'_>`
error[E0277]: the trait bound `usize: rocket::response::Responder<'_, '_>` is not satisfied
--> $DIR/catch_type_errors.rs:18:26
|
18 | fn f3(_request: bool) -> usize {
| ^^^^^ the trait `rocket::response::Responder<'_, '_>` is not implemented for `usize`
|
= note: required by `rocket::response::Responder::respond_to`
error[E0277]: the trait bound `usize: rocket::response::Responder<'_, '_>` is not satisfied
--> $DIR/catch_type_errors.rs:25:12
|
25 | fn f4() -> usize {
| ^^^^^ the trait `rocket::response::Responder<'_, '_>` is not implemented for `usize`
|
= note: required by `rocket::response::Responder::respond_to`

View File

@ -0,0 +1 @@
../ui-fail/catchers.rs

View File

@ -0,0 +1,19 @@
error: expected `,`
--> $DIR/catchers.rs:4:25
|
4 | let _ = catchers![a b]; //~ ERROR expected
| ^
error: expected identifier
--> $DIR/catchers.rs:6:26
|
6 | let _ = catchers![a::, ]; //~ ERROR expected identifier
| ^
error: unexpected end of input, expected identifier
--> $DIR/catchers.rs:7:13
|
7 | let _ = catchers![a::]; //~ ERROR expected identifier
| ^^^^^^^^^^^^^^
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

View File

@ -0,0 +1 @@
../ui-fail/from_form.rs

View File

@ -0,0 +1,354 @@
error: enums are not supported
--> $DIR/from_form.rs:6:1
|
6 | enum Thing { }
| ^^^^
error: [note] error occurred while deriving `FromForm`
--> $DIR/from_form.rs:5:10
|
5 | #[derive(FromForm)]
| ^^^^^^^^
|
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: tuple structs are not supported
--> $DIR/from_form.rs:10:1
|
10 | struct Foo1;
| ^^^^^^
error: [note] error occurred while deriving `FromForm`
--> $DIR/from_form.rs:9:10
|
9 | #[derive(FromForm)]
| ^^^^^^^^
|
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: at least one field is required
--> $DIR/from_form.rs:14:1
|
14 | struct Foo2 { }
| ^^^^^^
error: [note] error occurred while deriving `FromForm`
--> $DIR/from_form.rs:13:10
|
13 | #[derive(FromForm)]
| ^^^^^^^^
|
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: tuple structs are not supported
--> $DIR/from_form.rs:18:1
|
18 | struct Foo3(usize);
| ^^^^^^
error: [note] error occurred while deriving `FromForm`
--> $DIR/from_form.rs:17:10
|
17 | #[derive(FromForm)]
| ^^^^^^^^
|
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: only one lifetime is supported
--> $DIR/from_form.rs:22:20
|
22 | struct NextTodoTask<'f, 'a> {
| ^
error: [note] error occurred while deriving `FromForm`
--> $DIR/from_form.rs:21:10
|
21 | #[derive(FromForm)]
| ^^^^^^^^
|
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: invalid form field name
--> $DIR/from_form.rs:32:20
|
32 | #[form(field = "isindex")]
| ^^^^^^^^^
error: [note] error occurred while deriving `FromForm`
--> $DIR/from_form.rs:30:10
|
30 | #[derive(FromForm)]
| ^^^^^^^^
|
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: duplicate field name
--> $DIR/from_form.rs:41:5
|
41 | foo: usize,
| ^^^
error: [note] previous definition here
--> $DIR/from_form.rs:39:20
|
39 | #[form(field = "foo")]
| ^^^^^
error: [note] error occurred while deriving `FromForm`
--> $DIR/from_form.rs:37:10
|
37 | #[derive(FromForm)]
| ^^^^^^^^
|
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: duplicate field name
--> $DIR/from_form.rs:49:20
|
49 | #[form(field = "hello")]
| ^^^^^^^
error: [note] previous definition here
--> $DIR/from_form.rs:47:20
|
47 | #[form(field = "hello")]
| ^^^^^^^
error: [note] error occurred while deriving `FromForm`
--> $DIR/from_form.rs:45:10
|
45 | #[derive(FromForm)]
| ^^^^^^^^
|
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: duplicate field name
--> $DIR/from_form.rs:57:20
|
57 | #[form(field = "first")]
| ^^^^^^^
error: [note] previous definition here
--> $DIR/from_form.rs:56:5
|
56 | first: String,
| ^^^^^
error: [note] error occurred while deriving `FromForm`
--> $DIR/from_form.rs:54:10
|
54 | #[derive(FromForm)]
| ^^^^^^^^
|
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: duplicate attribute parameter: field
--> $DIR/from_form.rs:64:28
|
64 | #[form(field = "blah", field = "bloo")]
| ^^^^^
error: [note] error occurred while deriving `FromForm`
--> $DIR/from_form.rs:62:10
|
62 | #[derive(FromForm)]
| ^^^^^^^^
|
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: malformed attribute: expected list
--- help: expected syntax: #[form(key = value, ..)]
--> $DIR/from_form.rs:71:7
|
71 | #[form]
| ^^^^
error: [note] error occurred while deriving `FromForm`
--> $DIR/from_form.rs:69:10
|
69 | #[derive(FromForm)]
| ^^^^^^^^
|
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: expected key/value pair
--> $DIR/from_form.rs:78:12
|
78 | #[form("blah")]
| ^^^^^^
error: [note] error occurred while deriving `FromForm`
--> $DIR/from_form.rs:76:10
|
76 | #[derive(FromForm)]
| ^^^^^^^^
|
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: expected key/value pair
--> $DIR/from_form.rs:85:12
|
85 | #[form(123)]
| ^^^
error: [note] error occurred while deriving `FromForm`
--> $DIR/from_form.rs:83:10
|
83 | #[derive(FromForm)]
| ^^^^^^^^
|
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: unexpected attribute parameter: `beep`
--> $DIR/from_form.rs:92:12
|
92 | #[form(beep = "bop")]
| ^^^^
error: [note] error occurred while deriving `FromForm`
--> $DIR/from_form.rs:90:10
|
90 | #[derive(FromForm)]
| ^^^^^^^^
|
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: duplicate invocation of `form` attribute
--> $DIR/from_form.rs:100:5
|
100 | #[form(field = "bleh")]
| ^
error: [note] error occurred while deriving `FromForm`
--> $DIR/from_form.rs:97:10
|
97 | #[derive(FromForm)]
| ^^^^^^^^
|
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: invalid value: expected string literal
--> $DIR/from_form.rs:107:20
|
107 | #[form(field = true)]
| ^^^^
error: [note] error occurred while deriving `FromForm`
--> $DIR/from_form.rs:105:10
|
105 | #[derive(FromForm)]
| ^^^^^^^^
|
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: expected literal or key/value pair
--> $DIR/from_form.rs:114:12
|
114 | #[form(field)]
| ^^^^^
error: [note] error occurred while deriving `FromForm`
--> $DIR/from_form.rs:112:10
|
112 | #[derive(FromForm)]
| ^^^^^^^^
|
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: invalid value: expected string literal
--> $DIR/from_form.rs:121:20
|
121 | #[form(field = 123)]
| ^^^
error: [note] error occurred while deriving `FromForm`
--> $DIR/from_form.rs:119:10
|
119 | #[derive(FromForm)]
| ^^^^^^^^
|
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: invalid form field name
--> $DIR/from_form.rs:128:20
|
128 | #[form(field = "hello&world")]
| ^^^^^^^^^^^^^
error: [note] error occurred while deriving `FromForm`
--> $DIR/from_form.rs:126:10
|
126 | #[derive(FromForm)]
| ^^^^^^^^
|
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: invalid form field name
--> $DIR/from_form.rs:135:20
|
135 | #[form(field = "!@#$%^&*()_")]
| ^^^^^^^^^^^^^
error: [note] error occurred while deriving `FromForm`
--> $DIR/from_form.rs:133:10
|
133 | #[derive(FromForm)]
| ^^^^^^^^
|
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: invalid form field name
--> $DIR/from_form.rs:142:20
|
142 | #[form(field = "?")]
| ^^^
error: [note] error occurred while deriving `FromForm`
--> $DIR/from_form.rs:140:10
|
140 | #[derive(FromForm)]
| ^^^^^^^^
|
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: invalid form field name
--> $DIR/from_form.rs:149:20
|
149 | #[form(field = "")]
| ^^
error: [note] error occurred while deriving `FromForm`
--> $DIR/from_form.rs:147:10
|
147 | #[derive(FromForm)]
| ^^^^^^^^
|
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: invalid form field name
--> $DIR/from_form.rs:156:20
|
156 | #[form(field = "a&b")]
| ^^^^^
error: [note] error occurred while deriving `FromForm`
--> $DIR/from_form.rs:154:10
|
154 | #[derive(FromForm)]
| ^^^^^^^^
|
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: invalid form field name
--> $DIR/from_form.rs:163:20
|
163 | #[form(field = "a=")]
| ^^^^
error: [note] error occurred while deriving `FromForm`
--> $DIR/from_form.rs:161:10
|
161 | #[derive(FromForm)]
| ^^^^^^^^
|
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)

View File

@ -0,0 +1 @@
../ui-fail/from_form_type_errors.rs

View File

@ -0,0 +1,11 @@
error[E0277]: the trait bound `Unknown: rocket::request::FromFormValue<'_>` is not satisfied
--> $DIR/from_form_type_errors.rs:7:5
|
7 | field: Unknown,
| ^^^^^ the trait `rocket::request::FromFormValue<'_>` is not implemented for `Unknown`
error[E0277]: the trait bound `Foo<usize>: rocket::request::FromFormValue<'_>` is not satisfied
--> $DIR/from_form_type_errors.rs:15:5
|
15 | field: Foo<usize>,
| ^^^^^ the trait `rocket::request::FromFormValue<'_>` is not implemented for `Foo<usize>`

View File

@ -0,0 +1 @@
../ui-fail/from_form_value.rs

View File

@ -0,0 +1,111 @@
error: tuple structs are not supported
--> $DIR/from_form_value.rs:4:1
|
4 | struct Foo1;
| ^^^^^^
error: [note] error occurred while deriving `FromFormValue`
--> $DIR/from_form_value.rs:3:10
|
3 | #[derive(FromFormValue)]
| ^^^^^^^^^^^^^
|
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: tuple structs are not supported
--> $DIR/from_form_value.rs:8:1
|
8 | struct Foo2(usize);
| ^^^^^^
error: [note] error occurred while deriving `FromFormValue`
--> $DIR/from_form_value.rs:7:10
|
7 | #[derive(FromFormValue)]
| ^^^^^^^^^^^^^
|
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: named structs are not supported
--> $DIR/from_form_value.rs:12:1
|
12 | struct Foo3 {
| ^^^^^^
error: [note] error occurred while deriving `FromFormValue`
--> $DIR/from_form_value.rs:11:10
|
11 | #[derive(FromFormValue)]
| ^^^^^^^^^^^^^
|
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: variants cannot have fields
--> $DIR/from_form_value.rs:19:5
|
19 | A(usize),
| ^
error: [note] error occurred while deriving `FromFormValue`
--> $DIR/from_form_value.rs:17:10
|
17 | #[derive(FromFormValue)]
| ^^^^^^^^^^^^^
|
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: enum must have at least one field
--> $DIR/from_form_value.rs:24:1
|
24 | enum Foo5 { }
| ^^^^
error: [note] error occurred while deriving `FromFormValue`
--> $DIR/from_form_value.rs:23:10
|
23 | #[derive(FromFormValue)]
| ^^^^^^^^^^^^^
|
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: type generics are not supported
--> $DIR/from_form_value.rs:28:11
|
28 | enum Foo6<T> {
| ^
error: [note] error occurred while deriving `FromFormValue`
--> $DIR/from_form_value.rs:27:10
|
27 | #[derive(FromFormValue)]
| ^^^^^^^^^^^^^
|
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: invalid value: expected string literal
--> $DIR/from_form_value.rs:35:20
|
35 | #[form(value = 123)]
| ^^^
error: [note] error occurred while deriving `FromFormValue`
--> $DIR/from_form_value.rs:33:10
|
33 | #[derive(FromFormValue)]
| ^^^^^^^^^^^^^
|
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: expected literal or key/value pair
--> $DIR/from_form_value.rs:42:12
|
42 | #[form(value)]
| ^^^^^
error: [note] error occurred while deriving `FromFormValue`
--> $DIR/from_form_value.rs:40:10
|
40 | #[derive(FromFormValue)]
| ^^^^^^^^^^^^^
|
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)

View File

@ -0,0 +1 @@
../ui-fail/responder-types.rs

View File

@ -0,0 +1,56 @@
error[E0277]: the trait bound `u8: rocket::response::Responder<'_, '_>` is not satisfied
--> $DIR/responder-types.rs:9:5
|
9 | thing: u8,
| ^^^^^ the trait `rocket::response::Responder<'_, '_>` is not implemented for `u8`
|
= note: required by `rocket::response::Responder::respond_to`
error[E0277]: the trait bound `rocket::http::Header<'_>: std::convert::From<u8>` is not satisfied
--> $DIR/responder-types.rs:16:5
|
16 | other: u8,
| ^^^^^ the trait `std::convert::From<u8>` is not implemented for `rocket::http::Header<'_>`
|
= help: the following implementations were found:
<rocket::http::Header<'static> as std::convert::From<&rocket::http::Cookie<'_>>>
<rocket::http::Header<'static> as std::convert::From<rocket::http::Cookie<'_>>>
= note: required because of the requirements on the impl of `std::convert::Into<rocket::http::Header<'_>>` for `u8`
error[E0277]: the trait bound `u8: rocket::response::Responder<'_, '_>` is not satisfied
--> $DIR/responder-types.rs:22:5
|
22 | thing: u8,
| ^^^^^ the trait `rocket::response::Responder<'_, '_>` is not implemented for `u8`
|
= note: required by `rocket::response::Responder::respond_to`
error[E0277]: the trait bound `rocket::http::Header<'_>: std::convert::From<u8>` is not satisfied
--> $DIR/responder-types.rs:24:5
|
24 | other: u8,
| ^^^^^ the trait `std::convert::From<u8>` is not implemented for `rocket::http::Header<'_>`
|
= help: the following implementations were found:
<rocket::http::Header<'static> as std::convert::From<&rocket::http::Cookie<'_>>>
<rocket::http::Header<'static> as std::convert::From<rocket::http::Cookie<'_>>>
= note: required because of the requirements on the impl of `std::convert::Into<rocket::http::Header<'_>>` for `u8`
error[E0277]: the trait bound `rocket::http::Header<'_>: std::convert::From<std::string::String>` is not satisfied
--> $DIR/responder-types.rs:32:5
|
32 | then: String,
| ^^^^ the trait `std::convert::From<std::string::String>` is not implemented for `rocket::http::Header<'_>`
|
= help: the following implementations were found:
<rocket::http::Header<'static> as std::convert::From<&rocket::http::Cookie<'_>>>
<rocket::http::Header<'static> as std::convert::From<rocket::http::Cookie<'_>>>
= note: required because of the requirements on the impl of `std::convert::Into<rocket::http::Header<'_>>` for `std::string::String`
error[E0277]: the trait bound `usize: rocket::response::Responder<'_, '_>` is not satisfied
--> $DIR/responder-types.rs:37:13
|
37 | fn foo() -> usize { 0 }
| ^^^^^ the trait `rocket::response::Responder<'_, '_>` is not implemented for `usize`
|
= note: required by `rocket::handler::<impl rocket::Outcome<rocket::Response<'o>, rocket::http::Status, rocket::Data>>::from`

View File

@ -0,0 +1 @@
../ui-fail/route-attribute-general-syntax.rs

View File

@ -0,0 +1,206 @@
error: missing expected parameter: `path`
--> $DIR/route-attribute-general-syntax.rs:5:1
|
5 | #[get()] //~ ERROR missing expected parameter
| ^^^^^^^^
|
= note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: expected `fn`
--- help: #[get] can only be used on functions
--> $DIR/route-attribute-general-syntax.rs:11:1
|
11 | struct S;
| ^^^^^^
error: expected `fn`
--- help: #[get] can only be used on functions
--> $DIR/route-attribute-general-syntax.rs:16:1
|
16 | enum A { }
| ^^^^
error: expected `fn`
--- help: #[get] can only be used on functions
--> $DIR/route-attribute-general-syntax.rs:21:1
|
21 | trait Foo { }
| ^^^^^
error: expected `fn`
--- help: #[get] can only be used on functions
--> $DIR/route-attribute-general-syntax.rs:26:1
|
26 | impl S { }
| ^^^^
error: expected key/value pair
--> $DIR/route-attribute-general-syntax.rs:32:12
|
32 | #[get("/", 123)] //~ ERROR expected
| ^^^
error: expected key/value pair
--> $DIR/route-attribute-general-syntax.rs:35:12
|
35 | #[get("/", "/")] //~ ERROR expected
| ^^^
error: unexpected keyed parameter: expected literal or identifier
--> $DIR/route-attribute-general-syntax.rs:38:7
|
38 | #[get(data = "<foo>", "/")] //~ ERROR unexpected keyed parameter
| ^^^^
error: unexpected attribute parameter: `unknown`
--> $DIR/route-attribute-general-syntax.rs:41:12
|
41 | #[get("/", unknown = "foo")] //~ ERROR unexpected
| ^^^^^^^
error: malformed attribute
--- help: expected syntax: #[get(key = value, ..)]
--> $DIR/route-attribute-general-syntax.rs:44:1
|
44 | #[get("/", ...)] //~ ERROR malformed
| ^^^^^^^^^^^^^^^^
|
= note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: handler arguments cannot be ignored
--- help: all handler arguments must be of the form: `ident: Type`
--> $DIR/route-attribute-general-syntax.rs:51:7
|
51 | fn c1(_: usize) {} //~ ERROR cannot be ignored
| ^
error: invalid value: expected string literal
--> $DIR/route-attribute-general-syntax.rs:56:7
|
56 | #[get(100)] //~ ERROR expected string
| ^^^
error: invalid value: expected string literal
--> $DIR/route-attribute-general-syntax.rs:59:7
|
59 | #[get('/')] //~ ERROR expected string
| ^^^
error: invalid value: expected integer literal
--> $DIR/route-attribute-general-syntax.rs:62:19
|
62 | #[get("/", rank = "1")] //~ ERROR expected integer
| ^^^
error: invalid value: expected integer literal
--> $DIR/route-attribute-general-syntax.rs:65:19
|
65 | #[get("/", rank = '1')] //~ ERROR expected integer
| ^^^
error: invalid or unknown media type
--> $DIR/route-attribute-general-syntax.rs:70:21
|
70 | #[get("/", format = "applicationx-custom")] //~ ERROR invalid or unknown media type
| ^^^^^^^^^^^^^^^^^^^^^
error: invalid or unknown media type
--> $DIR/route-attribute-general-syntax.rs:73:21
|
73 | #[get("/", format = "")] //~ ERROR invalid or unknown media type
| ^^
error: invalid or unknown media type
--> $DIR/route-attribute-general-syntax.rs:76:21
|
76 | #[get("/", format = "//")] //~ ERROR invalid or unknown media type
| ^^^^
error: invalid or unknown media type
--> $DIR/route-attribute-general-syntax.rs:79:21
|
79 | #[get("/", format = "/")] //~ ERROR invalid or unknown media type
| ^^^
error: invalid or unknown media type
--> $DIR/route-attribute-general-syntax.rs:82:21
|
82 | #[get("/", format = "a/")] //~ ERROR invalid or unknown media type
| ^^^^
error: invalid or unknown media type
--> $DIR/route-attribute-general-syntax.rs:85:21
|
85 | #[get("/", format = "/a")] //~ ERROR invalid or unknown media type
| ^^^^
error: invalid or unknown media type
--> $DIR/route-attribute-general-syntax.rs:88:21
|
88 | #[get("/", format = "/a/")] //~ ERROR invalid or unknown media type
| ^^^^^
error: invalid or unknown media type
--> $DIR/route-attribute-general-syntax.rs:91:21
|
91 | #[get("/", format = "a/b/")] //~ ERROR invalid or unknown media type
| ^^^^^^
error: invalid or unknown media type
--> $DIR/route-attribute-general-syntax.rs:94:21
|
94 | #[get("/", format = "unknown")] //~ ERROR unknown media type
| ^^^^^^^^^
error: invalid value: expected string literal
--> $DIR/route-attribute-general-syntax.rs:97:21
|
97 | #[get("/", format = 12)] //~ ERROR expected string
| ^^
error: invalid value: expected string literal
--> $DIR/route-attribute-general-syntax.rs:100:21
|
100 | #[get("/", format = 'j')] //~ ERROR expected string
| ^^^
error: invalid or unknown media type
--> $DIR/route-attribute-general-syntax.rs:103:21
|
103 | #[get("/", format = "text//foo")] //~ ERROR invalid or unknown media type
| ^^^^^^^^^^^
error: invalid HTTP method for route handlers
--- help: method must be one of: `GET`, `PUT`, `POST`, `DELETE`, `HEAD`, `PATCH`, `OPTIONS`
--> $DIR/route-attribute-general-syntax.rs:108:9
|
108 | #[route(CONNECT, "/")] //~ ERROR invalid HTTP method for route
| ^^^^^^^
error: invalid HTTP method
--- help: method must be one of: `GET`, `PUT`, `POST`, `DELETE`, `HEAD`, `PATCH`, `OPTIONS`
--> $DIR/route-attribute-general-syntax.rs:112:9
|
112 | #[route(FIX, "/")] //~ ERROR invalid HTTP method
| ^^^
error: expected identifier, found string literal
--- help: method must be one of: `GET`, `PUT`, `POST`, `DELETE`, `HEAD`, `PATCH`, `OPTIONS`
--> $DIR/route-attribute-general-syntax.rs:116:9
|
116 | #[route("hi", "/")] //~ ERROR expected identifier
| ^^^^
error: expected identifier, found string literal
--- help: method must be one of: `GET`, `PUT`, `POST`, `DELETE`, `HEAD`, `PATCH`, `OPTIONS`
--> $DIR/route-attribute-general-syntax.rs:120:9
|
120 | #[route("GET", "/")] //~ ERROR expected identifier
| ^^^^^
error: expected identifier, found integer literal
--- help: method must be one of: `GET`, `PUT`, `POST`, `DELETE`, `HEAD`, `PATCH`, `OPTIONS`
--> $DIR/route-attribute-general-syntax.rs:124:9
|
124 | #[route(120, "/")] //~ ERROR expected identifier
| ^^^

View File

@ -0,0 +1 @@
../ui-fail/route-path-bad-syntax.rs

View File

@ -0,0 +1,230 @@
error: invalid path URI: expected token / but found a at index 0
--- help: expected path in origin form: "/path/<param>"
--> $DIR/route-path-bad-syntax.rs:5:7
|
5 | #[get("a")] //~ ERROR invalid path URI
| ^^^
error: invalid path URI: expected token / but none was found at index 0
--- help: expected path in origin form: "/path/<param>"
--> $DIR/route-path-bad-syntax.rs:9:7
|
9 | #[get("")] //~ ERROR invalid path URI
| ^^
error: invalid path URI: expected token / but found a at index 0
--- help: expected path in origin form: "/path/<param>"
--> $DIR/route-path-bad-syntax.rs:13:7
|
13 | #[get("a/b/c")] //~ ERROR invalid path URI
| ^^^^^^^
error: paths cannot contain empty segments
--- note: expected '/a/b', found '/a///b'
--> $DIR/route-path-bad-syntax.rs:17:7
|
17 | #[get("/a///b")] //~ ERROR empty segments
| ^^^^^^^^
error: query cannot contain empty segments
--> $DIR/route-path-bad-syntax.rs:21:7
|
21 | #[get("/?bat&&")] //~ ERROR empty segments
| ^^^^^^^^^
error: query cannot contain empty segments
--> $DIR/route-path-bad-syntax.rs:24:7
|
24 | #[get("/?bat&&")] //~ ERROR empty segments
| ^^^^^^^^^
error: paths cannot contain empty segments
--- note: expected '/a/b', found '/a/b//'
--> $DIR/route-path-bad-syntax.rs:27:7
|
27 | #[get("/a/b//")] //~ ERROR empty segments
| ^^^^^^^^
error: invalid path URI: expected EOF but found # at index 3
--- help: expected path in origin form: "/path/<param>"
--> $DIR/route-path-bad-syntax.rs:33:7
|
33 | #[get("/!@#$%^&*()")] //~ ERROR invalid path URI
| ^^^^^^^^^^^^^
error: component contains invalid URI characters
--- note: components cannot contain reserved characters
--- help: reserved characters include: '%', '+', '&', etc.
--> $DIR/route-path-bad-syntax.rs:37:7
|
37 | #[get("/a%20b")] //~ ERROR invalid URI characters
| ^^^^^^^^
error: component contains invalid URI characters
--- note: components cannot contain reserved characters
--- help: reserved characters include: '%', '+', '&', etc.
--> $DIR/route-path-bad-syntax.rs:42:7
|
42 | #[get("/a?a%20b")] //~ ERROR invalid URI characters
| ^^^^^^^^^^
error: component contains invalid URI characters
--- note: components cannot contain reserved characters
--- help: reserved characters include: '%', '+', '&', etc.
--> $DIR/route-path-bad-syntax.rs:47:7
|
47 | #[get("/a?a+b")] //~ ERROR invalid URI characters
| ^^^^^^^^
error: unused dynamic parameter
--> $DIR/route-path-bad-syntax.rs:54:7
|
54 | #[get("/<name>")] //~ ERROR unused dynamic parameter
| ^^^^^^^^^
error: [note] expected argument named `name` here
--> $DIR/route-path-bad-syntax.rs:55:7
|
55 | fn h0(_name: usize) {} //~ NOTE expected argument named `name` here
| ^^^^^
error: unused dynamic parameter
--> $DIR/route-path-bad-syntax.rs:57:7
|
57 | #[get("/a?<r>")] //~ ERROR unused dynamic parameter
| ^^^^^^^^
error: [note] expected argument named `r` here
--> $DIR/route-path-bad-syntax.rs:58:1
|
58 | fn h1() {} //~ NOTE expected argument named `r` here
| ^^
error: unused dynamic parameter
--> $DIR/route-path-bad-syntax.rs:60:21
|
60 | #[post("/a", data = "<test>")] //~ ERROR unused dynamic parameter
| ^^^^^^^^
error: [note] expected argument named `test` here
--> $DIR/route-path-bad-syntax.rs:61:1
|
61 | fn h2() {} //~ NOTE expected argument named `test` here
| ^^
error: unused dynamic parameter
--> $DIR/route-path-bad-syntax.rs:63:7
|
63 | #[get("/<_r>")] //~ ERROR unused dynamic parameter
| ^^^^^^^
error: [note] expected argument named `_r` here
--> $DIR/route-path-bad-syntax.rs:64:1
|
64 | fn h3() {} //~ NOTE expected argument named `_r` here
| ^^
error: unused dynamic parameter
--> $DIR/route-path-bad-syntax.rs:66:7
|
66 | #[get("/<_r>/<b>")] //~ ERROR unused dynamic parameter
| ^^^^^^^^^^^
error: [note] expected argument named `b` here
--> $DIR/route-path-bad-syntax.rs:68:1
|
68 | fn h4() {} //~ NOTE expected argument named `_r` here
| ^^
error: `foo_.` is not a valid identifier
--- help: parameter names must be valid identifiers
--> $DIR/route-path-bad-syntax.rs:73:7
|
73 | #[get("/<foo_.>")] //~ ERROR `foo_.` is not a valid identifier
| ^^^^^^^^^^
error: `foo*` is not a valid identifier
--- help: parameter names must be valid identifiers
--> $DIR/route-path-bad-syntax.rs:77:7
|
77 | #[get("/<foo*>")] //~ ERROR `foo*` is not a valid identifier
| ^^^^^^^^^
error: `!` is not a valid identifier
--- help: parameter names must be valid identifiers
--> $DIR/route-path-bad-syntax.rs:81:7
|
81 | #[get("/<!>")] //~ ERROR `!` is not a valid identifier
| ^^^^^^
error: `name>:<id` is not a valid identifier
--- help: parameter names must be valid identifiers
--> $DIR/route-path-bad-syntax.rs:85:7
|
85 | #[get("/<name>:<id>")] //~ ERROR `name>:<id` is not a valid identifier
| ^^^^^^^^^^^^^^
error: malformed parameter
--- help: parameter must be of the form '<param>'
--> $DIR/route-path-bad-syntax.rs:91:19
|
91 | #[get("/", data = "foo")] //~ ERROR malformed parameter
| ^^^^^
error: malformed parameter
--- help: parameter must be of the form '<param>'
--> $DIR/route-path-bad-syntax.rs:95:19
|
95 | #[get("/", data = "<foo..>")] //~ ERROR malformed parameter
| ^^^^^^^^^
error: parameter is missing a closing bracket
--- help: did you mean '<foo>'?
--> $DIR/route-path-bad-syntax.rs:99:19
|
99 | #[get("/", data = "<foo")] //~ ERROR missing a closing bracket
| ^^^^^^
error: `test ` is not a valid identifier
--- help: parameter names must be valid identifiers
--> $DIR/route-path-bad-syntax.rs:103:19
|
103 | #[get("/", data = "<test >")] //~ ERROR `test ` is not a valid identifier
| ^^^^^^^^^
error: parameters must be named
--- help: use a name such as `_guard` or `_param`
--> $DIR/route-path-bad-syntax.rs:109:7
|
109 | #[get("/<_>")] //~ ERROR must be named
| ^^^^^^
error: parameter names cannot be empty
--> $DIR/route-path-bad-syntax.rs:114:7
|
114 | #[get("/<>")] //~ ERROR cannot be empty
| ^^^^^
error: malformed parameter or identifier
--- help: parameters must be of the form '<param>'
--- help: identifiers cannot contain '<' or '>'
--> $DIR/route-path-bad-syntax.rs:117:7
|
117 | #[get("/<id><")] //~ ERROR malformed parameter
| ^^^^^^^^
error: malformed parameter or identifier
--- help: parameters must be of the form '<param>'
--- help: identifiers cannot contain '<' or '>'
--> $DIR/route-path-bad-syntax.rs:122:7
|
122 | #[get("/<<<<id><")] //~ ERROR malformed parameter
| ^^^^^^^^^^^
error: malformed parameter or identifier
--- help: parameters must be of the form '<param>'
--- help: identifiers cannot contain '<' or '>'
--> $DIR/route-path-bad-syntax.rs:127:7
|
127 | #[get("/<>name><")] //~ ERROR malformed parameter
| ^^^^^^^^^^^

View File

@ -0,0 +1 @@
../ui-fail/route-type-errors.rs

View File

@ -0,0 +1,67 @@
error[E0277]: the trait bound `Q: rocket::request::FromParam<'_>` is not satisfied
--> $DIR/route-type-errors.rs:6:12
|
6 | fn f0(foo: Q) {} //~ ERROR FromParam
| ^ the trait `rocket::request::FromParam<'_>` is not implemented for `Q`
error[E0277]: the trait bound `Q: rocket::request::FromSegments<'_>` is not satisfied
--> $DIR/route-type-errors.rs:9:12
|
9 | fn f1(foo: Q) {} //~ ERROR FromSegments
| ^ the trait `rocket::request::FromSegments<'_>` is not implemented for `Q`
error[E0277]: the trait bound `Q: rocket::request::FromFormValue<'_>` is not satisfied
--> $DIR/route-type-errors.rs:12:12
|
12 | fn f2(foo: Q) {} //~ ERROR FromFormValue
| ^ the trait `rocket::request::FromFormValue<'_>` is not implemented for `Q`
error[E0277]: the trait bound `Q: rocket::request::FromFormValue<'_>` is not satisfied
--> $DIR/route-type-errors.rs:12:7
|
12 | fn f2(foo: Q) {} //~ ERROR FromFormValue
| ^^^^^^ the trait `rocket::request::FromFormValue<'_>` is not implemented for `Q`
error[E0277]: the trait bound `Q: rocket::request::FromQuery<'_>` is not satisfied
--> $DIR/route-type-errors.rs:15:12
|
15 | fn f3(foo: Q) {} //~ ERROR FromQuery
| ^ the trait `rocket::request::FromQuery<'_>` is not implemented for `Q`
error[E0277]: the trait bound `Q: rocket::data::FromData` is not satisfied
--> $DIR/route-type-errors.rs:18:12
|
18 | fn f4(foo: Q) {} //~ ERROR FromData
| ^ the trait `rocket::data::FromData` is not implemented for `Q`
|
= note: required because of the requirements on the impl of `rocket::data::FromTransformedData<'_>` for `Q`
error[E0277]: the trait bound `Q: rocket::request::FromRequest<'_, '_>` is not satisfied
--> $DIR/route-type-errors.rs:21:10
|
21 | fn f5(a: Q, foo: Q) {}
| ^ the trait `rocket::request::FromRequest<'_, '_>` is not implemented for `Q`
error[E0277]: the trait bound `Q: rocket::request::FromParam<'_>` is not satisfied
--> $DIR/route-type-errors.rs:21:18
|
21 | fn f5(a: Q, foo: Q) {}
| ^ the trait `rocket::request::FromParam<'_>` is not implemented for `Q`
error[E0277]: the trait bound `Q: rocket::request::FromRequest<'_, '_>` is not satisfied
--> $DIR/route-type-errors.rs:26:10
|
26 | fn f6(a: Q, foo: Q, good: usize, bar: Q) {}
| ^ the trait `rocket::request::FromRequest<'_, '_>` is not implemented for `Q`
error[E0277]: the trait bound `Q: rocket::request::FromParam<'_>` is not satisfied
--> $DIR/route-type-errors.rs:26:18
|
26 | fn f6(a: Q, foo: Q, good: usize, bar: Q) {}
| ^ the trait `rocket::request::FromParam<'_>` is not implemented for `Q`
error[E0277]: the trait bound `Q: rocket::request::FromParam<'_>` is not satisfied
--> $DIR/route-type-errors.rs:26:39
|
26 | fn f6(a: Q, foo: Q, good: usize, bar: Q) {}
| ^ the trait `rocket::request::FromParam<'_>` is not implemented for `Q`

View File

@ -0,0 +1 @@
../ui-fail/route-warnings.rs

View File

@ -0,0 +1,5 @@
error: checking for warnings!
--> $DIR/route-warnings.rs:25:5
|
25 | compile_error!("checking for warnings!")
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

View File

@ -0,0 +1 @@
../ui-fail/routes.rs

View File

@ -0,0 +1,19 @@
error: expected `,`
--> $DIR/routes.rs:4:23
|
4 | let _ = routes![a b]; //~ ERROR expected `,`
| ^
error: expected identifier
--> $DIR/routes.rs:6:24
|
6 | let _ = routes![a::, ]; //~ ERROR expected identifier
| ^
error: unexpected end of input, expected identifier
--> $DIR/routes.rs:7:13
|
7 | let _ = routes![a::]; //~ ERROR expected identifier
| ^^^^^^^^^^^^
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

View File

@ -0,0 +1 @@
../ui-fail/typed-uri-bad-type.rs

View File

@ -0,0 +1,141 @@
error[E0277]: the trait bound `usize: rocket::http::uri::FromUriParam<rocket::http::uri::Path, &str>` is not satisfied
--> $DIR/typed-uri-bad-type.rs:48:23
|
48 | 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:
<usize as rocket::http::uri::FromUriParam<P, &'x mut usize>>
<usize as rocket::http::uri::FromUriParam<P, &'x usize>>
<usize as rocket::http::uri::FromUriParam<P, usize>>
= 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:51:18
|
51 | 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:
<usize as rocket::http::uri::FromUriParam<P, &'x mut usize>>
<usize as rocket::http::uri::FromUriParam<P, &'x usize>>
<usize as rocket::http::uri::FromUriParam<P, usize>>
= 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:54:23
|
54 | 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:
<usize as rocket::http::uri::FromUriParam<P, &'x mut usize>>
<usize as rocket::http::uri::FromUriParam<P, &'x usize>>
<usize as rocket::http::uri::FromUriParam<P, usize>>
= 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:57:31
|
57 | 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:63:26
|
63 | 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:
<i32 as rocket::http::uri::FromUriParam<P, &'x i32>>
<i32 as rocket::http::uri::FromUriParam<P, &'x mut i32>>
<i32 as rocket::http::uri::FromUriParam<P, i32>>
= 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:63:43
|
63 | 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:
<std::string::String as rocket::http::uri::FromUriParam<P, &'a str>>
<std::string::String as rocket::http::uri::FromUriParam<P, &'x &'a str>>
<std::string::String as rocket::http::uri::FromUriParam<P, &'x mut &'a str>>
<std::string::String as rocket::http::uri::FromUriParam<P, &'x mut std::string::String>>
and 2 others
= 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:67:20
|
67 | 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:
<isize as rocket::http::uri::FromUriParam<P, &'x isize>>
<isize as rocket::http::uri::FromUriParam<P, &'x mut isize>>
<isize as rocket::http::uri::FromUriParam<P, isize>>
= 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:70:25
|
70 | 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:
<isize as rocket::http::uri::FromUriParam<P, &'x isize>>
<isize as rocket::http::uri::FromUriParam<P, &'x mut isize>>
<isize as rocket::http::uri::FromUriParam<P, isize>>
= 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:73:24
|
73 | 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:76:26
|
76 | 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:40:29
|
40 | fn other_q(id: usize, rest: S) { }
| ^ the trait `rocket::http::uri::Ignorable<rocket::http::uri::Query>` is not implemented for `S`
...
79 | uri!(other_q: rest = _, id = 100);
| ---------------------------------- in this macro invocation
|
::: $WORKSPACE/core/http/src/uri/uri_display.rs:465:40
|
465 | pub fn assert_ignorable<P: UriPart, T: Ignorable<P>>() { }
| ------------ required by this bound in `rocket::http::uri::assert_ignorable`
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `usize: rocket::http::uri::Ignorable<rocket::http::uri::Query>` is not satisfied
--> $DIR/typed-uri-bad-type.rs:40:16
|
40 | fn other_q(id: usize, rest: S) { }
| ^^^^^ the trait `rocket::http::uri::Ignorable<rocket::http::uri::Query>` is not implemented for `usize`
...
81 | uri!(other_q: rest = S, id = _);
| -------------------------------- in this macro invocation
|
::: $WORKSPACE/core/http/src/uri/uri_display.rs:465:40
|
465 | pub fn assert_ignorable<P: UriPart, T: Ignorable<P>>() { }
| ------------ required by this bound in `rocket::http::uri::assert_ignorable`
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
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
|
81 | uri!(other_q: rest = S, id = _);
| ^ the trait `rocket::http::uri::FromUriParam<rocket::http::uri::Query, _>` is not implemented for `S`

View File

@ -0,0 +1 @@
../ui-fail/typed-uris-bad-params.rs

View File

@ -0,0 +1,313 @@
error: path parameters cannot be ignored
--> $DIR/typed-uris-bad-params.rs:77:37
|
77 | uri!(optionals: id = 10, name = _);
| ^
error: path parameters cannot be ignored
--> $DIR/typed-uris-bad-params.rs:74:26
|
74 | uri!(optionals: id = _, name = "bob".into());
| ^
error: macro expansion ignores token `compile_error` and any following
--> $DIR/typed-uris-bad-params.rs:70:29
|
13 | #[post("/<id>?<name>")]
| ------------------------ help: you might be missing a semicolon here: `;`
| |
| caused by the macro expansion here
...
70 | uri!(has_two: id = 100, cookies = "hi"); //~ ERROR invalid parameters
| ^^^^^^^
|
= note: the usage of `rocket::rocket_internal_uri!` is likely invalid in expression context
error: invalid parameters for `has_two` route uri
--- note: uri parameters are: id: i32, name: String
--- help: missing parameter: `name`
--> $DIR/typed-uris-bad-params.rs:70:19
|
70 | uri!(has_two: id = 100, cookies = "hi"); //~ ERROR invalid parameters
| ^^
error: macro expansion ignores token `compile_error` and any following
--> $DIR/typed-uris-bad-params.rs:65:19
|
13 | #[post("/<id>?<name>")]
| ------------------------ help: you might be missing a semicolon here: `;`
| |
| caused by the macro expansion here
...
65 | uri!(has_two: cookies = "hi", id = 100, id = 10, id = 10); //~ ERROR invalid parameters
| ^^^^^^^
|
= note: the usage of `rocket::rocket_internal_uri!` is likely invalid in expression context
error: invalid parameters for `has_two` route uri
--- note: uri parameters are: id: i32, name: String
--- help: missing parameter: `name`
--> $DIR/typed-uris-bad-params.rs:65:19
|
65 | uri!(has_two: cookies = "hi", id = 100, id = 10, id = 10); //~ ERROR invalid parameters
| ^^^^^^^
error: invalid parameters for `has_two` route uri
--- note: uri parameters are: id: i32, name: String
--- help: missing parameter: `id`
--> $DIR/typed-uris-bad-params.rs:62:19
|
62 | uri!(has_two: name = "hi"); //~ ERROR invalid parameters
| ^^^^
error: macro expansion ignores token `compile_error` and any following
--> $DIR/typed-uris-bad-params.rs:58:29
|
13 | #[post("/<id>?<name>")]
| ------------------------ help: you might be missing a semicolon here: `;`
| |
| caused by the macro expansion here
...
58 | uri!(has_two: id = 100, id = 100, ); //~ ERROR invalid parameters
| ^^
|
= note: the usage of `rocket::rocket_internal_uri!` is likely invalid in expression context
error: invalid parameters for `has_two` route uri
--- note: uri parameters are: id: i32, name: String
--- help: missing parameter: `name`
--> $DIR/typed-uris-bad-params.rs:58:19
|
58 | uri!(has_two: id = 100, id = 100, ); //~ ERROR invalid parameters
| ^^
error: macro expansion ignores token `compile_error` and any following
--> $DIR/typed-uris-bad-params.rs:55:37
|
10 | #[post("/<id>")]
| ----------------- help: you might be missing a semicolon here: `;`
| |
| caused by the macro expansion here
...
55 | uri!(has_one_guarded: id = 100, cookies = "hi"); //~ ERROR invalid parameters
| ^^^^^^^
|
= note: the usage of `rocket::rocket_internal_uri!` is likely invalid in expression context
error: invalid parameters for `has_one_guarded` route uri
--- note: uri parameters are: id: i32
--> $DIR/typed-uris-bad-params.rs:55:27
|
55 | uri!(has_one_guarded: id = 100, cookies = "hi"); //~ ERROR invalid parameters
| ^^
error: macro expansion ignores token `compile_error` and any following
--> $DIR/typed-uris-bad-params.rs:52:27
|
10 | #[post("/<id>")]
| ----------------- help: you might be missing a semicolon here: `;`
| |
| caused by the macro expansion here
...
52 | uri!(has_one_guarded: cookies = "hi", id = 100); //~ ERROR invalid parameters
| ^^^^^^^
|
= note: the usage of `rocket::rocket_internal_uri!` is likely invalid in expression context
error: invalid parameters for `has_one_guarded` route uri
--- note: uri parameters are: id: i32
--> $DIR/typed-uris-bad-params.rs:52:27
|
52 | uri!(has_one_guarded: cookies = "hi", id = 100); //~ ERROR invalid parameters
| ^^^^^^^
error: macro expansion ignores token `compile_error` and any following
--> $DIR/typed-uris-bad-params.rs:48:19
|
7 | #[post("/<id>")]
| ----------------- help: you might be missing a semicolon here: `;`
| |
| caused by the macro expansion here
...
48 | uri!(has_one: name = "hi"); //~ ERROR invalid parameters
| ^^^^
|
= note: the usage of `rocket::rocket_internal_uri!` is likely invalid in expression context
error: invalid parameters for `has_one` route uri
--- note: uri parameters are: id: i32
--- help: missing parameter: `id`
--> $DIR/typed-uris-bad-params.rs:48:19
|
48 | uri!(has_one: name = "hi"); //~ ERROR invalid parameters
| ^^^^
error: macro expansion ignores token `compile_error` and any following
--> $DIR/typed-uris-bad-params.rs:45:29
|
7 | #[post("/<id>")]
| ----------------- help: you might be missing a semicolon here: `;`
| |
| caused by the macro expansion here
...
45 | uri!(has_one: id = 100, id = 100, ); //~ ERROR invalid parameters
| ^^
|
= note: the usage of `rocket::rocket_internal_uri!` is likely invalid in expression context
error: invalid parameters for `has_one` route uri
--- note: uri parameters are: id: i32
--> $DIR/typed-uris-bad-params.rs:45:19
|
45 | uri!(has_one: id = 100, id = 100, ); //~ ERROR invalid parameters
| ^^
error: macro expansion ignores token `compile_error` and any following
--> $DIR/typed-uris-bad-params.rs:42:29
|
7 | #[post("/<id>")]
| ----------------- help: you might be missing a semicolon here: `;`
| |
| caused by the macro expansion here
...
42 | uri!(has_one: id = 100, id = 100); //~ ERROR invalid parameters
| ^^
|
= note: the usage of `rocket::rocket_internal_uri!` is likely invalid in expression context
error: invalid parameters for `has_one` route uri
--- note: uri parameters are: id: i32
--> $DIR/typed-uris-bad-params.rs:42:19
|
42 | uri!(has_one: id = 100, id = 100); //~ ERROR invalid parameters
| ^^
error: macro expansion ignores token `compile_error` and any following
--> $DIR/typed-uris-bad-params.rs:38:19
|
7 | #[post("/<id>")]
| ----------------- help: you might be missing a semicolon here: `;`
| |
| caused by the macro expansion here
...
38 | uri!(has_one: name = 100, age = 50, id = 100, id = 50); //~ ERROR invalid parameters
| ^^^^
|
= note: the usage of `rocket::rocket_internal_uri!` is likely invalid in expression context
error: invalid parameters for `has_one` route uri
--- note: uri parameters are: id: i32
--> $DIR/typed-uris-bad-params.rs:38:19
|
38 | uri!(has_one: name = 100, age = 50, id = 100, id = 50); //~ ERROR invalid parameters
| ^^^^
error: macro expansion ignores token `compile_error` and any following
--> $DIR/typed-uris-bad-params.rs:35:19
|
7 | #[post("/<id>")]
| ----------------- help: you might be missing a semicolon here: `;`
| |
| caused by the macro expansion here
...
35 | uri!(has_one: name = 100, age = 50, id = 100); //~ ERROR invalid parameters
| ^^^^
|
= note: the usage of `rocket::rocket_internal_uri!` is likely invalid in expression context
error: invalid parameters for `has_one` route uri
--- note: uri parameters are: id: i32
--> $DIR/typed-uris-bad-params.rs:35:19
|
35 | uri!(has_one: name = 100, age = 50, id = 100); //~ ERROR invalid parameters
| ^^^^
error: macro expansion ignores token `compile_error` and any following
--> $DIR/typed-uris-bad-params.rs:32:19
|
7 | #[post("/<id>")]
| ----------------- help: you might be missing a semicolon here: `;`
| |
| caused by the macro expansion here
...
32 | uri!(has_one: name = 100, id = 100); //~ ERROR invalid parameters
| ^^^^
|
= note: the usage of `rocket::rocket_internal_uri!` is likely invalid in expression context
error: invalid parameters for `has_one` route uri
--- note: uri parameters are: id: i32
--> $DIR/typed-uris-bad-params.rs:32:19
|
32 | uri!(has_one: name = 100, id = 100); //~ ERROR invalid parameters
| ^^^^
error: macro expansion ignores token `compile_error` and any following
--> $DIR/typed-uris-bad-params.rs:29:29
|
7 | #[post("/<id>")]
| ----------------- help: you might be missing a semicolon here: `;`
| |
| caused by the macro expansion here
...
29 | uri!(has_one: id = 100, name = "hi"); //~ ERROR invalid parameters
| ^^^^
|
= note: the usage of `rocket::rocket_internal_uri!` is likely invalid in expression context
error: invalid parameters for `has_one` route uri
--- note: uri parameters are: id: i32
--> $DIR/typed-uris-bad-params.rs:29:19
|
29 | uri!(has_one: id = 100, name = "hi"); //~ ERROR invalid parameters
| ^^
error: `has_two` route uri expects 2 parameters but 1 was supplied
--- note: expected parameters: id: i32, name: String
--> $DIR/typed-uris-bad-params.rs:27:19
|
27 | uri!(has_two: 10); //~ ERROR expects 2 parameters but 1
| ^^
error: `has_two` route uri expects 2 parameters but 3 were supplied
--- note: expected parameters: id: i32, name: String
--> $DIR/typed-uris-bad-params.rs:26:19
|
26 | uri!(has_two: 10, "hi", "there"); //~ ERROR expects 2 parameters but 3
| ^^
error: `has_one_guarded` route uri expects 1 parameter but 2 were supplied
--- note: expected parameter: id: i32
--> $DIR/typed-uris-bad-params.rs:24:27
|
24 | uri!(has_one_guarded: "hi", 100); //~ ERROR expects 1 parameter but 2
| ^^^^
error: `has_one` route uri expects 1 parameter but 2 were supplied
--- note: expected parameter: id: i32
--> $DIR/typed-uris-bad-params.rs:23:19
|
23 | uri!(has_one: "Hello", 23, ); //~ ERROR expects 1 parameter but 2
| ^^^^^^^
error: `has_one` route uri expects 1 parameter but 2 were supplied
--- note: expected parameter: id: i32
--> $DIR/typed-uris-bad-params.rs:22:19
|
22 | uri!(has_one: 1, 23); //~ ERROR expects 1 parameter but 2
| ^
error: `has_one` route uri expects 1 parameter but 0 were supplied
--- note: expected parameter: id: i32
--> $DIR/typed-uris-bad-params.rs:20:10
|
20 | uri!(has_one); //~ ERROR expects 1 parameter but 0
| ^^^^^^^
warning: unused import: `std::fmt`
--> $DIR/typed-uris-bad-params.rs:3:5
|
3 | use std::fmt;
| ^^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default

View File

@ -0,0 +1 @@
../ui-fail/typed-uris-invalid-syntax.rs

View File

@ -0,0 +1,65 @@
error: named and unnamed parameters cannot be mixed
--> $DIR/typed-uris-invalid-syntax.rs:7:18
|
7 | uri!(simple: id = 100, "Hello"); //~ ERROR named and unnamed
| ^^
error: named and unnamed parameters cannot be mixed
--> $DIR/typed-uris-invalid-syntax.rs:8:18
|
8 | uri!(simple: "Hello", id = 100); //~ ERROR named and unnamed
| ^^^^^^^
error: expected `:`
--> $DIR/typed-uris-invalid-syntax.rs:9:16
|
9 | uri!(simple,); //~ ERROR expected `:`
| ^
error: expected argument list after `:`
--> $DIR/typed-uris-invalid-syntax.rs:10:16
|
10 | uri!(simple:); //~ ERROR argument list
| ^
error: unexpected end of input: expected ',' followed by route path
--> $DIR/typed-uris-invalid-syntax.rs:11:10
|
11 | uri!("/mount"); //~ ERROR route path
| ^^^^^^^^
error: unexpected end of input, expected identifier
--> $DIR/typed-uris-invalid-syntax.rs:12:5
|
12 | uri!("/mount",); //~ ERROR expected identifier
| ^^^^^^^^^^^^^^^^
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: invalid mount point; mount points must be static, absolute URIs: `/example`
--> $DIR/typed-uris-invalid-syntax.rs:13:10
|
13 | uri!("mount", simple); //~ invalid mount point
| ^^^^^^^
error: invalid mount point; mount points must be static, absolute URIs: `/example`
--> $DIR/typed-uris-invalid-syntax.rs:14:10
|
14 | uri!("/mount/<id>", simple); //~ invalid mount point
| ^^^^^^^^^^^^^
error: unexpected end of input, call to `uri!` cannot be empty
--> $DIR/typed-uris-invalid-syntax.rs:15:5
|
15 | uri!(); //~ unexpected end of input
| ^^^^^^^
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: unexpected end of input, expected expression
--> $DIR/typed-uris-invalid-syntax.rs:16:5
|
16 | uri!(simple: id = ); //~ expected expression
| ^^^^^^^^^^^^^^^^^^^^
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

View File

@ -0,0 +1 @@
../ui-fail/update-references.sh

View File

@ -0,0 +1 @@
../ui-fail/uri_display.rs

View File

@ -0,0 +1,493 @@
error: fieldless structs or variants are not supported
--> $DIR/uri_display.rs:9:1
|
9 | struct Foo1;
| ^^^^^^
error: [note] error occurred while deriving `UriDisplay`
--> $DIR/uri_display.rs:5:10
|
5 | #[derive(UriDisplayQuery)]
| ^^^^^^^^^^^^^^^
|
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: fieldless structs or variants are not supported
--> $DIR/uri_display.rs:16:1
|
16 | struct Foo2();
| ^^^^^^
error: [note] error occurred while deriving `UriDisplay`
--> $DIR/uri_display.rs:12:10
|
12 | #[derive(UriDisplayQuery)]
| ^^^^^^^^^^^^^^^
|
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: empty enums are not supported
--> $DIR/uri_display.rs:23:1
|
23 | enum Foo3 { }
| ^^^^
error: [note] error occurred while deriving `UriDisplay`
--> $DIR/uri_display.rs:19:10
|
19 | #[derive(UriDisplayQuery)]
| ^^^^^^^^^^^^^^^
|
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: fieldless structs or variants are not supported
--> $DIR/uri_display.rs:31:5
|
31 | Variant,
| ^^^^^^^
error: [note] error occurred while deriving `UriDisplay`
--> $DIR/uri_display.rs:26:10
|
26 | #[derive(UriDisplayQuery)]
| ^^^^^^^^^^^^^^^
|
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: tuple structs or variants must have exactly one field
--> $DIR/uri_display.rs:39:13
|
39 | struct Foo5(String, String);
| ^^^^^^
error: [note] error occurred while deriving `UriDisplay`
--> $DIR/uri_display.rs:35:10
|
35 | #[derive(UriDisplayQuery)]
| ^^^^^^^^^^^^^^^
|
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: invalid value: expected string literal
--> $DIR/uri_display.rs:47:20
|
47 | #[form(field = 123)]
| ^^^
error: [note] error occurred while deriving `UriDisplay`
--> $DIR/uri_display.rs:42:10
|
42 | #[derive(UriDisplayQuery)]
| ^^^^^^^^^^^^^^^
|
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: struct must have exactly one field
--> $DIR/uri_display.rs:55:13
|
55 | struct Foo7(String, usize);
| ^^^^^^
error: [note] error occurred while deriving `UriDisplay`
--> $DIR/uri_display.rs:52:10
|
52 | #[derive(UriDisplayPath)]
| ^^^^^^^^^^^^^^
|
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: struct must have exactly one field
--> $DIR/uri_display.rs:61:1
|
61 | struct Foo8;
| ^^^^^^
error: [note] error occurred while deriving `UriDisplay`
--> $DIR/uri_display.rs:58:10
|
58 | #[derive(UriDisplayPath)]
| ^^^^^^^^^^^^^^
|
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: enums are not supported
--> $DIR/uri_display.rs:67:1
|
67 | enum Foo9 { }
| ^^^^
error: [note] error occurred while deriving `UriDisplay`
--> $DIR/uri_display.rs:64:10
|
64 | #[derive(UriDisplayPath)]
| ^^^^^^^^^^^^^^
|
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: named structs are not supported
--> $DIR/uri_display.rs:73:1
|
73 | struct Foo10 {
| ^^^^^^
error: [note] error occurred while deriving `UriDisplay`
--> $DIR/uri_display.rs:70:10
|
70 | #[derive(UriDisplayPath)]
| ^^^^^^^^^^^^^^
|
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `Foo1: rocket::http::uri::UriDisplay<rocket::http::uri::Query>` is not satisfied
--> $DIR/uri_display.rs:5:10
|
5 | #[derive(UriDisplayQuery)]
| ^^^^^^^^^^^^^^^ the trait `rocket::http::uri::UriDisplay<rocket::http::uri::Query>` is not implemented for `Foo1`
|
::: $WORKSPACE/core/http/src/uri/from_uri_param.rs:195:18
|
195 | type Target: UriDisplay<P>;
| ------------- required by this bound in `rocket::http::uri::FromUriParam`
|
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `Foo1: rocket::http::uri::UriDisplay<rocket::http::uri::Query>` is not satisfied
--> $DIR/uri_display.rs:5:10
|
5 | #[derive(UriDisplayQuery)]
| ^^^^^^^^^^^^^^^ the trait `rocket::http::uri::UriDisplay<rocket::http::uri::Query>` is not implemented for `Foo1`
|
::: $WORKSPACE/core/http/src/uri/from_uri_param.rs:195:18
|
195 | type Target: UriDisplay<P>;
| ------------- required by this bound in `rocket::http::uri::FromUriParam`
|
= note: required because of the requirements on the impl of `rocket::http::uri::UriDisplay<rocket::http::uri::Query>` for `&Foo1`
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `Foo1: rocket::http::uri::UriDisplay<rocket::http::uri::Query>` is not satisfied
--> $DIR/uri_display.rs:5:10
|
5 | #[derive(UriDisplayQuery)]
| ^^^^^^^^^^^^^^^ the trait `rocket::http::uri::UriDisplay<rocket::http::uri::Query>` is not implemented for `Foo1`
|
::: $WORKSPACE/core/http/src/uri/from_uri_param.rs:195:18
|
195 | type Target: UriDisplay<P>;
| ------------- required by this bound in `rocket::http::uri::FromUriParam`
|
= note: required because of the requirements on the impl of `rocket::http::uri::UriDisplay<rocket::http::uri::Query>` for `&mut Foo1`
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `Foo2: rocket::http::uri::UriDisplay<rocket::http::uri::Query>` is not satisfied
--> $DIR/uri_display.rs:12:10
|
12 | #[derive(UriDisplayQuery)]
| ^^^^^^^^^^^^^^^ the trait `rocket::http::uri::UriDisplay<rocket::http::uri::Query>` is not implemented for `Foo2`
|
::: $WORKSPACE/core/http/src/uri/from_uri_param.rs:195:18
|
195 | type Target: UriDisplay<P>;
| ------------- required by this bound in `rocket::http::uri::FromUriParam`
|
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `Foo2: rocket::http::uri::UriDisplay<rocket::http::uri::Query>` is not satisfied
--> $DIR/uri_display.rs:12:10
|
12 | #[derive(UriDisplayQuery)]
| ^^^^^^^^^^^^^^^ the trait `rocket::http::uri::UriDisplay<rocket::http::uri::Query>` is not implemented for `Foo2`
|
::: $WORKSPACE/core/http/src/uri/from_uri_param.rs:195:18
|
195 | type Target: UriDisplay<P>;
| ------------- required by this bound in `rocket::http::uri::FromUriParam`
|
= note: required because of the requirements on the impl of `rocket::http::uri::UriDisplay<rocket::http::uri::Query>` for `&Foo2`
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `Foo2: rocket::http::uri::UriDisplay<rocket::http::uri::Query>` is not satisfied
--> $DIR/uri_display.rs:12:10
|
12 | #[derive(UriDisplayQuery)]
| ^^^^^^^^^^^^^^^ the trait `rocket::http::uri::UriDisplay<rocket::http::uri::Query>` is not implemented for `Foo2`
|
::: $WORKSPACE/core/http/src/uri/from_uri_param.rs:195:18
|
195 | type Target: UriDisplay<P>;
| ------------- required by this bound in `rocket::http::uri::FromUriParam`
|
= note: required because of the requirements on the impl of `rocket::http::uri::UriDisplay<rocket::http::uri::Query>` for `&mut Foo2`
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `Foo3: rocket::http::uri::UriDisplay<rocket::http::uri::Query>` is not satisfied
--> $DIR/uri_display.rs:19:10
|
19 | #[derive(UriDisplayQuery)]
| ^^^^^^^^^^^^^^^ the trait `rocket::http::uri::UriDisplay<rocket::http::uri::Query>` is not implemented for `Foo3`
|
::: $WORKSPACE/core/http/src/uri/from_uri_param.rs:195:18
|
195 | type Target: UriDisplay<P>;
| ------------- required by this bound in `rocket::http::uri::FromUriParam`
|
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `Foo3: rocket::http::uri::UriDisplay<rocket::http::uri::Query>` is not satisfied
--> $DIR/uri_display.rs:19:10
|
19 | #[derive(UriDisplayQuery)]
| ^^^^^^^^^^^^^^^ the trait `rocket::http::uri::UriDisplay<rocket::http::uri::Query>` is not implemented for `Foo3`
|
::: $WORKSPACE/core/http/src/uri/from_uri_param.rs:195:18
|
195 | type Target: UriDisplay<P>;
| ------------- required by this bound in `rocket::http::uri::FromUriParam`
|
= note: required because of the requirements on the impl of `rocket::http::uri::UriDisplay<rocket::http::uri::Query>` for `&Foo3`
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `Foo3: rocket::http::uri::UriDisplay<rocket::http::uri::Query>` is not satisfied
--> $DIR/uri_display.rs:19:10
|
19 | #[derive(UriDisplayQuery)]
| ^^^^^^^^^^^^^^^ the trait `rocket::http::uri::UriDisplay<rocket::http::uri::Query>` is not implemented for `Foo3`
|
::: $WORKSPACE/core/http/src/uri/from_uri_param.rs:195:18
|
195 | type Target: UriDisplay<P>;
| ------------- required by this bound in `rocket::http::uri::FromUriParam`
|
= note: required because of the requirements on the impl of `rocket::http::uri::UriDisplay<rocket::http::uri::Query>` for `&mut Foo3`
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `Foo4: rocket::http::uri::UriDisplay<rocket::http::uri::Query>` is not satisfied
--> $DIR/uri_display.rs:26:10
|
26 | #[derive(UriDisplayQuery)]
| ^^^^^^^^^^^^^^^ the trait `rocket::http::uri::UriDisplay<rocket::http::uri::Query>` is not implemented for `Foo4`
|
::: $WORKSPACE/core/http/src/uri/from_uri_param.rs:195:18
|
195 | type Target: UriDisplay<P>;
| ------------- required by this bound in `rocket::http::uri::FromUriParam`
|
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `Foo4: rocket::http::uri::UriDisplay<rocket::http::uri::Query>` is not satisfied
--> $DIR/uri_display.rs:26:10
|
26 | #[derive(UriDisplayQuery)]
| ^^^^^^^^^^^^^^^ the trait `rocket::http::uri::UriDisplay<rocket::http::uri::Query>` is not implemented for `Foo4`
|
::: $WORKSPACE/core/http/src/uri/from_uri_param.rs:195:18
|
195 | type Target: UriDisplay<P>;
| ------------- required by this bound in `rocket::http::uri::FromUriParam`
|
= note: required because of the requirements on the impl of `rocket::http::uri::UriDisplay<rocket::http::uri::Query>` for `&Foo4`
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `Foo4: rocket::http::uri::UriDisplay<rocket::http::uri::Query>` is not satisfied
--> $DIR/uri_display.rs:26:10
|
26 | #[derive(UriDisplayQuery)]
| ^^^^^^^^^^^^^^^ the trait `rocket::http::uri::UriDisplay<rocket::http::uri::Query>` is not implemented for `Foo4`
|
::: $WORKSPACE/core/http/src/uri/from_uri_param.rs:195:18
|
195 | type Target: UriDisplay<P>;
| ------------- required by this bound in `rocket::http::uri::FromUriParam`
|
= note: required because of the requirements on the impl of `rocket::http::uri::UriDisplay<rocket::http::uri::Query>` for `&mut Foo4`
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `Foo5: rocket::http::uri::UriDisplay<rocket::http::uri::Query>` is not satisfied
--> $DIR/uri_display.rs:35:10
|
35 | #[derive(UriDisplayQuery)]
| ^^^^^^^^^^^^^^^ the trait `rocket::http::uri::UriDisplay<rocket::http::uri::Query>` is not implemented for `Foo5`
|
::: $WORKSPACE/core/http/src/uri/from_uri_param.rs:195:18
|
195 | type Target: UriDisplay<P>;
| ------------- required by this bound in `rocket::http::uri::FromUriParam`
|
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `Foo5: rocket::http::uri::UriDisplay<rocket::http::uri::Query>` is not satisfied
--> $DIR/uri_display.rs:35:10
|
35 | #[derive(UriDisplayQuery)]
| ^^^^^^^^^^^^^^^ the trait `rocket::http::uri::UriDisplay<rocket::http::uri::Query>` is not implemented for `Foo5`
|
::: $WORKSPACE/core/http/src/uri/from_uri_param.rs:195:18
|
195 | type Target: UriDisplay<P>;
| ------------- required by this bound in `rocket::http::uri::FromUriParam`
|
= note: required because of the requirements on the impl of `rocket::http::uri::UriDisplay<rocket::http::uri::Query>` for `&Foo5`
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `Foo5: rocket::http::uri::UriDisplay<rocket::http::uri::Query>` is not satisfied
--> $DIR/uri_display.rs:35:10
|
35 | #[derive(UriDisplayQuery)]
| ^^^^^^^^^^^^^^^ the trait `rocket::http::uri::UriDisplay<rocket::http::uri::Query>` is not implemented for `Foo5`
|
::: $WORKSPACE/core/http/src/uri/from_uri_param.rs:195:18
|
195 | type Target: UriDisplay<P>;
| ------------- required by this bound in `rocket::http::uri::FromUriParam`
|
= note: required because of the requirements on the impl of `rocket::http::uri::UriDisplay<rocket::http::uri::Query>` for `&mut Foo5`
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `Foo6: rocket::http::uri::UriDisplay<rocket::http::uri::Query>` is not satisfied
--> $DIR/uri_display.rs:42:10
|
42 | #[derive(UriDisplayQuery)]
| ^^^^^^^^^^^^^^^ the trait `rocket::http::uri::UriDisplay<rocket::http::uri::Query>` is not implemented for `Foo6`
|
::: $WORKSPACE/core/http/src/uri/from_uri_param.rs:195:18
|
195 | type Target: UriDisplay<P>;
| ------------- required by this bound in `rocket::http::uri::FromUriParam`
|
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `Foo6: rocket::http::uri::UriDisplay<rocket::http::uri::Query>` is not satisfied
--> $DIR/uri_display.rs:42:10
|
42 | #[derive(UriDisplayQuery)]
| ^^^^^^^^^^^^^^^ the trait `rocket::http::uri::UriDisplay<rocket::http::uri::Query>` is not implemented for `Foo6`
|
::: $WORKSPACE/core/http/src/uri/from_uri_param.rs:195:18
|
195 | type Target: UriDisplay<P>;
| ------------- required by this bound in `rocket::http::uri::FromUriParam`
|
= note: required because of the requirements on the impl of `rocket::http::uri::UriDisplay<rocket::http::uri::Query>` for `&Foo6`
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `Foo6: rocket::http::uri::UriDisplay<rocket::http::uri::Query>` is not satisfied
--> $DIR/uri_display.rs:42:10
|
42 | #[derive(UriDisplayQuery)]
| ^^^^^^^^^^^^^^^ the trait `rocket::http::uri::UriDisplay<rocket::http::uri::Query>` is not implemented for `Foo6`
|
::: $WORKSPACE/core/http/src/uri/from_uri_param.rs:195:18
|
195 | type Target: UriDisplay<P>;
| ------------- required by this bound in `rocket::http::uri::FromUriParam`
|
= note: required because of the requirements on the impl of `rocket::http::uri::UriDisplay<rocket::http::uri::Query>` for `&mut Foo6`
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `Foo7: rocket::http::uri::UriDisplay<rocket::http::uri::Path>` is not satisfied
--> $DIR/uri_display.rs:52:10
|
52 | #[derive(UriDisplayPath)]
| ^^^^^^^^^^^^^^ the trait `rocket::http::uri::UriDisplay<rocket::http::uri::Path>` is not implemented for `Foo7`
|
::: $WORKSPACE/core/http/src/uri/from_uri_param.rs:195:18
|
195 | type Target: UriDisplay<P>;
| ------------- required by this bound in `rocket::http::uri::FromUriParam`
|
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `Foo7: rocket::http::uri::UriDisplay<rocket::http::uri::Path>` is not satisfied
--> $DIR/uri_display.rs:52:10
|
52 | #[derive(UriDisplayPath)]
| ^^^^^^^^^^^^^^ the trait `rocket::http::uri::UriDisplay<rocket::http::uri::Path>` is not implemented for `Foo7`
|
::: $WORKSPACE/core/http/src/uri/from_uri_param.rs:195:18
|
195 | type Target: UriDisplay<P>;
| ------------- required by this bound in `rocket::http::uri::FromUriParam`
|
= note: required because of the requirements on the impl of `rocket::http::uri::UriDisplay<rocket::http::uri::Path>` for `&Foo7`
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `Foo8: rocket::http::uri::UriDisplay<rocket::http::uri::Path>` is not satisfied
--> $DIR/uri_display.rs:58:10
|
58 | #[derive(UriDisplayPath)]
| ^^^^^^^^^^^^^^ the trait `rocket::http::uri::UriDisplay<rocket::http::uri::Path>` is not implemented for `Foo8`
|
::: $WORKSPACE/core/http/src/uri/from_uri_param.rs:195:18
|
195 | type Target: UriDisplay<P>;
| ------------- required by this bound in `rocket::http::uri::FromUriParam`
|
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `Foo8: rocket::http::uri::UriDisplay<rocket::http::uri::Path>` is not satisfied
--> $DIR/uri_display.rs:58:10
|
58 | #[derive(UriDisplayPath)]
| ^^^^^^^^^^^^^^ the trait `rocket::http::uri::UriDisplay<rocket::http::uri::Path>` is not implemented for `Foo8`
|
::: $WORKSPACE/core/http/src/uri/from_uri_param.rs:195:18
|
195 | type Target: UriDisplay<P>;
| ------------- required by this bound in `rocket::http::uri::FromUriParam`
|
= note: required because of the requirements on the impl of `rocket::http::uri::UriDisplay<rocket::http::uri::Path>` for `&Foo8`
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `Foo9: rocket::http::uri::UriDisplay<rocket::http::uri::Path>` is not satisfied
--> $DIR/uri_display.rs:64:10
|
64 | #[derive(UriDisplayPath)]
| ^^^^^^^^^^^^^^ the trait `rocket::http::uri::UriDisplay<rocket::http::uri::Path>` is not implemented for `Foo9`
|
::: $WORKSPACE/core/http/src/uri/from_uri_param.rs:195:18
|
195 | type Target: UriDisplay<P>;
| ------------- required by this bound in `rocket::http::uri::FromUriParam`
|
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `Foo9: rocket::http::uri::UriDisplay<rocket::http::uri::Path>` is not satisfied
--> $DIR/uri_display.rs:64:10
|
64 | #[derive(UriDisplayPath)]
| ^^^^^^^^^^^^^^ the trait `rocket::http::uri::UriDisplay<rocket::http::uri::Path>` is not implemented for `Foo9`
|
::: $WORKSPACE/core/http/src/uri/from_uri_param.rs:195:18
|
195 | type Target: UriDisplay<P>;
| ------------- required by this bound in `rocket::http::uri::FromUriParam`
|
= note: required because of the requirements on the impl of `rocket::http::uri::UriDisplay<rocket::http::uri::Path>` for `&Foo9`
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `Foo10: rocket::http::uri::UriDisplay<rocket::http::uri::Path>` is not satisfied
--> $DIR/uri_display.rs:70:10
|
70 | #[derive(UriDisplayPath)]
| ^^^^^^^^^^^^^^ the trait `rocket::http::uri::UriDisplay<rocket::http::uri::Path>` is not implemented for `Foo10`
|
::: $WORKSPACE/core/http/src/uri/from_uri_param.rs:195:18
|
195 | type Target: UriDisplay<P>;
| ------------- required by this bound in `rocket::http::uri::FromUriParam`
|
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `Foo10: rocket::http::uri::UriDisplay<rocket::http::uri::Path>` is not satisfied
--> $DIR/uri_display.rs:70:10
|
70 | #[derive(UriDisplayPath)]
| ^^^^^^^^^^^^^^ the trait `rocket::http::uri::UriDisplay<rocket::http::uri::Path>` is not implemented for `Foo10`
|
::: $WORKSPACE/core/http/src/uri/from_uri_param.rs:195:18
|
195 | type Target: UriDisplay<P>;
| ------------- required by this bound in `rocket::http::uri::FromUriParam`
|
= note: required because of the requirements on the impl of `rocket::http::uri::UriDisplay<rocket::http::uri::Path>` for `&Foo10`
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)

View File

@ -0,0 +1 @@
../ui-fail/uri_display_type_errors.rs

View File

@ -0,0 +1,58 @@
error[E0277]: the trait bound `BadType: rocket::http::uri::UriDisplay<rocket::http::uri::Query>` is not satisfied
--> $DIR/uri_display_type_errors.rs:6:13
|
6 | struct Bar1(BadType);
| ^^^^^^^ the trait `rocket::http::uri::UriDisplay<rocket::http::uri::Query>` is not implemented for `BadType`
|
= note: required because of the requirements on the impl of `rocket::http::uri::UriDisplay<rocket::http::uri::Query>` for `&BadType`
error[E0277]: the trait bound `BadType: rocket::http::uri::UriDisplay<rocket::http::uri::Query>` is not satisfied
--> $DIR/uri_display_type_errors.rs:11:5
|
11 | field: BadType,
| ^^^^^ the trait `rocket::http::uri::UriDisplay<rocket::http::uri::Query>` is not implemented for `BadType`
|
= note: required because of the requirements on the impl of `rocket::http::uri::UriDisplay<rocket::http::uri::Query>` for `&BadType`
error[E0277]: the trait bound `BadType: rocket::http::uri::UriDisplay<rocket::http::uri::Query>` is not satisfied
--> $DIR/uri_display_type_errors.rs:18:5
|
18 | bad: BadType,
| ^^^ the trait `rocket::http::uri::UriDisplay<rocket::http::uri::Query>` is not implemented for `BadType`
|
= note: required because of the requirements on the impl of `rocket::http::uri::UriDisplay<rocket::http::uri::Query>` for `&BadType`
error[E0277]: the trait bound `BadType: rocket::http::uri::UriDisplay<rocket::http::uri::Query>` is not satisfied
--> $DIR/uri_display_type_errors.rs:24:11
|
24 | Inner(BadType),
| ^^^^^^^ the trait `rocket::http::uri::UriDisplay<rocket::http::uri::Query>` is not implemented for `BadType`
|
= note: required because of the requirements on the impl of `rocket::http::uri::UriDisplay<rocket::http::uri::Query>` for `&BadType`
= note: required because of the requirements on the impl of `rocket::http::uri::UriDisplay<rocket::http::uri::Query>` for `&&BadType`
error[E0277]: the trait bound `BadType: rocket::http::uri::UriDisplay<rocket::http::uri::Query>` is not satisfied
--> $DIR/uri_display_type_errors.rs:31:9
|
31 | field: BadType,
| ^^^^^ the trait `rocket::http::uri::UriDisplay<rocket::http::uri::Query>` is not implemented for `BadType`
|
= note: required because of the requirements on the impl of `rocket::http::uri::UriDisplay<rocket::http::uri::Query>` for `&BadType`
= note: required because of the requirements on the impl of `rocket::http::uri::UriDisplay<rocket::http::uri::Query>` for `&&BadType`
error[E0277]: the trait bound `BadType: rocket::http::uri::UriDisplay<rocket::http::uri::Query>` is not satisfied
--> $DIR/uri_display_type_errors.rs:40:9
|
40 | other: BadType,
| ^^^^^ the trait `rocket::http::uri::UriDisplay<rocket::http::uri::Query>` is not implemented for `BadType`
|
= note: required because of the requirements on the impl of `rocket::http::uri::UriDisplay<rocket::http::uri::Query>` for `&BadType`
= note: required because of the requirements on the impl of `rocket::http::uri::UriDisplay<rocket::http::uri::Query>` for `&&BadType`
error[E0277]: the trait bound `BadType: rocket::http::uri::UriDisplay<rocket::http::uri::Path>` is not satisfied
--> $DIR/uri_display_type_errors.rs:46:12
|
46 | struct Baz(BadType);
| ^^^^^^^ the trait `rocket::http::uri::UriDisplay<rocket::http::uri::Path>` is not implemented for `BadType`
|
= note: required because of the requirements on the impl of `rocket::http::uri::UriDisplay<rocket::http::uri::Path>` for `&BadType`

View File

@ -0,0 +1,10 @@
#[test]
fn ui() {
let path = match version_check::is_feature_flaggable() {
Some(true) => "ui-fail-nightly",
_ => "ui-fail-stable"
};
let t = trybuild::TestCases::new();
t.compile_fail(format!("tests/{}/*.rs", path));
}

View File

@ -21,4 +21,6 @@ fn g0(_foo: rocket::Data) {}
#[head("/", data = "<_foo>")] //~ WARNING used with non-payload-supporting method #[head("/", data = "<_foo>")] //~ WARNING used with non-payload-supporting method
fn g1(_foo: rocket::Data) {} fn g1(_foo: rocket::Data) {}
fn main() { } fn main() {
compile_error!("checking for warnings!")
}

View File

@ -1,48 +0,0 @@
#!/usr/bin/env bash
#
# Copyright 2015 The Rust Project Developers. See the COPYRIGHT
# file at the top-level directory of this distribution and at
# http://rust-lang.org/COPYRIGHT.
#
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
# option. This file may not be copied, modified, or distributed
# except according to those terms.
# A script to update the references for particular tests. The idea is
# that you do a run, which will generate files in the build directory
# containing the (normalized) actual output of the compiler. This
# script will then copy that output and replace the "expected output"
# files. You can then commit the changes.
#
# If you find yourself manually editing a foo.stderr file, you're
# doing it wrong.
if [[ "$1" == "--help" || "$1" == "-h" || "$1" == "" || "$2" == "" ]]; then
echo "usage: $0 <build-directory> <relative-path-to-rs-files>"
echo ""
echo "For example:"
echo " $0 ../../../build/x86_64-apple-darwin/test/ui *.rs */*.rs"
fi
MYDIR=$(dirname $0)
BUILD_DIR="$1"
shift
shopt -s nullglob
while [[ "$1" != "" ]]; do
for EXT in "stderr" "fixed"; do
for OUT_NAME in $BUILD_DIR/${1%.rs}.*$EXT; do
OUT_DIR=`dirname "$1"`
OUT_BASE=`basename "$OUT_NAME"`
if ! (diff $OUT_NAME $MYDIR/$OUT_DIR/$OUT_BASE >& /dev/null); then
echo updating $MYDIR/$OUT_DIR/$OUT_BASE
cp $OUT_NAME $MYDIR/$OUT_DIR
fi
done
done
shift
done