Improve diagnostics, especially on stable.

This commit is contained in:
Sergio Benitez 2020-07-21 10:23:59 -07:00
parent 1858403203
commit 67efe143c5
75 changed files with 1678 additions and 2700 deletions

View File

@ -20,7 +20,7 @@ proc-macro = true
[dependencies] [dependencies]
quote = "1.0" quote = "1.0"
devise = { git = "https://github.com/SergioBenitez/Devise.git", rev = "952866f7" } devise = { git = "https://github.com/SergioBenitez/Devise.git", rev = "1e42a2691" }
[build-dependencies] [build-dependencies]
yansi = "0.5" yansi = "0.5"

View File

@ -42,5 +42,5 @@ use proc_macro::TokenStream;
#[proc_macro_attribute] #[proc_macro_attribute]
pub fn database(attr: TokenStream, input: TokenStream) -> TokenStream { pub fn database(attr: TokenStream, input: TokenStream) -> TokenStream {
crate::database::database_attr(attr, input) crate::database::database_attr(attr, input)
.unwrap_or_else(|diag| diag.emit_as_tokens().into()) .unwrap_or_else(|diag| diag.emit_as_item_tokens().into())
} }

View File

@ -7,51 +7,51 @@ error: unexpected end of input, expected literal
= 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:10:12 --> $DIR/database-syntax.rs:9:12
| |
10 | #[database(1)] 9 | #[database(1)]
| ^ | ^
error: expected string literal error: expected string literal
--> $DIR/database-syntax.rs:14:12 --> $DIR/database-syntax.rs:12:12
| |
14 | #[database(123)] 12 | #[database(123)]
| ^^^ | ^^^
error: unexpected token error: unexpected token
--> $DIR/database-syntax.rs:18:20 --> $DIR/database-syntax.rs:15:20
| |
18 | #[database("hello" "hi")] 15 | #[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:23:1 --> $DIR/database-syntax.rs:19:1
| |
23 | enum Foo { } 19 | 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:27:11 --> $DIR/database-syntax.rs:22:11
| |
27 | struct Bar(diesel::SqliteConnection, diesel::SqliteConnection); 22 | 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:31:1 --> $DIR/database-syntax.rs:25:1
| |
31 | union Baz { } 25 | 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:35:9 --> $DIR/database-syntax.rs:28:9
| |
35 | struct E<'r>(&'r str); 28 | 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:39:9 --> $DIR/database-syntax.rs:31:9
| |
39 | struct F<T>(T); 31 | struct F<T>(T);
| ^^^ | ^^^

View File

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

View File

@ -7,50 +7,50 @@ error: unexpected end of input, expected literal
= 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:10:12 --> $DIR/database-syntax.rs:9:12
| |
10 | #[database(1)] 9 | #[database(1)]
| ^ | ^
error: expected string literal error: expected string literal
--> $DIR/database-syntax.rs:14:12 --> $DIR/database-syntax.rs:12:12
| |
14 | #[database(123)] 12 | #[database(123)]
| ^^^ | ^^^
error: unexpected token error: unexpected token
--> $DIR/database-syntax.rs:18:20 --> $DIR/database-syntax.rs:15:20
| |
18 | #[database("hello" "hi")] 15 | #[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:23:1 --> $DIR/database-syntax.rs:19:1
| |
23 | enum Foo { } 19 | 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
--- help: example: `struct MyDatabase(diesel::SqliteConnection);` --- help: example: `struct MyDatabase(diesel::SqliteConnection);`
--> $DIR/database-syntax.rs:27:11 --> $DIR/database-syntax.rs:22:11
| |
27 | struct Bar(diesel::SqliteConnection, diesel::SqliteConnection); 22 | struct Bar(diesel::SqliteConnection, diesel::SqliteConnection);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: `database` attribute can only be used on structs error: `database` attribute can only be used on structs
--> $DIR/database-syntax.rs:31:1 --> $DIR/database-syntax.rs:25:1
| |
31 | union Baz { } 25 | 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:35:9 --> $DIR/database-syntax.rs:28:9
| |
35 | struct E<'r>(&'r str); 28 | 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:39:9 --> $DIR/database-syntax.rs:31:9
| |
39 | struct F<T>(T); 31 | struct F<T>(T);
| ^ | ^

View File

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

View File

@ -4,39 +4,30 @@
use rocket_contrib::databases::diesel; use rocket_contrib::databases::diesel;
#[database] #[database]
//~^ ERROR expected string literal
struct A(diesel::SqliteConnection); struct A(diesel::SqliteConnection);
#[database(1)] #[database(1)]
//~^ ERROR expected string literal
struct B(diesel::SqliteConnection); struct B(diesel::SqliteConnection);
#[database(123)] #[database(123)]
//~^ ERROR expected string literal
struct C(diesel::SqliteConnection); struct C(diesel::SqliteConnection);
#[database("hello" "hi")] #[database("hello" "hi")]
//~^ ERROR expected string literal
struct D(diesel::SqliteConnection); struct D(diesel::SqliteConnection);
#[database("test")] #[database("test")]
enum Foo { } enum Foo { }
//~^ ERROR on structs
#[database("test")] #[database("test")]
struct Bar(diesel::SqliteConnection, diesel::SqliteConnection); struct Bar(diesel::SqliteConnection, diesel::SqliteConnection);
//~^ ERROR one unnamed field
#[database("test")] #[database("test")]
union Baz { } union Baz { }
//~^ ERROR on structs
#[database("test")] #[database("test")]
struct E<'r>(&'r str); struct E<'r>(&'r str);
//~^ ERROR generics
#[database("test")] #[database("test")]
struct F<T>(T); struct F<T>(T);
//~^ ERROR generics
fn main() { } fn main() { }

View File

@ -5,10 +5,8 @@ struct Unknown;
#[database("foo")] #[database("foo")]
struct A(Unknown); struct A(Unknown);
//~^ ERROR Unknown: rocket_contrib::databases::Poolable
#[database("foo")] #[database("foo")]
struct B(Vec<i32>); struct B(Vec<i32>);
//~^ ERROR Vec<i32>: rocket_contrib::databases::Poolable
fn main() { } fn main() { }

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 = "952866f7" } devise = { git = "https://github.com/SergioBenitez/Devise.git", rev = "1e42a2691" }
glob = "0.3" glob = "0.3"
[build-dependencies] [build-dependencies]

View File

@ -18,9 +18,11 @@ impl EntryAttr for Main {
fn function(f: &syn::ItemFn, block: &syn::Block) -> Result<TokenStream> { fn function(f: &syn::ItemFn, block: &syn::Block) -> Result<TokenStream> {
let (attrs, vis, mut sig) = (&f.attrs, &f.vis, f.sig.clone()); let (attrs, vis, mut sig) = (&f.attrs, &f.vis, f.sig.clone());
if sig.ident != "main" { if sig.ident != "main" {
return Err(Span::call_site() // FIXME(diag): warning!
Span::call_site()
.warning("attribute is typically applied to `main` function") .warning("attribute is typically applied to `main` function")
.span_note(sig.span(), "this function is not `main`")); .span_note(sig.ident.span(), "this function is not `main`")
.emit_as_item_tokens();
} }
sig.asyncness = None; sig.asyncness = None;
@ -54,7 +56,7 @@ impl EntryAttr for Launch {
return Err(Span::call_site() return Err(Span::call_site()
.error("attribute cannot be applied to `main` function") .error("attribute cannot be applied to `main` function")
.note("this attribute generates a `main` function") .note("this attribute generates a `main` function")
.span_note(f.sig.span(), "this function cannot be `main`")); .span_note(f.sig.ident.span(), "this function cannot be `main`"));
} }
let ty = match &f.sig.output { let ty = match &f.sig.output {
@ -118,7 +120,7 @@ macro_rules! async_entry {
($name:ident, $kind:ty, $default:expr) => ( ($name:ident, $kind:ty, $default:expr) => (
pub fn $name(a: proc_macro::TokenStream, i: proc_macro::TokenStream) -> TokenStream { pub fn $name(a: proc_macro::TokenStream, i: proc_macro::TokenStream) -> TokenStream {
_async_entry::<$kind>(a, i).unwrap_or_else(|d| { _async_entry::<$kind>(a, i).unwrap_or_else(|d| {
let d = d.emit_as_tokens(); let d = d.emit_as_item_tokens();
let default = $default; let default = $default;
quote!(#d #default) quote!(#d #default)
}) })

View File

@ -63,7 +63,7 @@ pub fn _catch(
// Determine the number of parameters that will be passed in. // Determine the number of parameters that will be passed in.
if catch.function.sig.inputs.len() > 1 { if catch.function.sig.inputs.len() > 1 {
return Err(catch.function.sig.inputs.span() return Err(catch.function.sig.paren_token.span
.error("invalid number of arguments: must be zero or one") .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`"));
} }
@ -72,7 +72,7 @@ pub fn _catch(
// that prevents this from working (error on `Output` type of `Future`), or // that prevents this from working (error on `Output` type of `Future`), or
// this simply isn't possible with `async fn`. // this simply isn't possible with `async fn`.
// // Typecheck the catcher function if it has arguments. // // Typecheck the catcher function if it has arguments.
// user_catcher_fn_name.set_span(catch.function.sig.inputs.span().into()); // user_catcher_fn_name.set_span(catch.function.sig.paren_token.span.into());
// let user_catcher_fn_call = catch.function.sig.inputs.first() // let user_catcher_fn_call = catch.function.sig.inputs.first()
// .map(|arg| { // .map(|arg| {
// let ty = quote!(fn(&#Request) -> _).respanned(Span::call_site().into()); // let ty = quote!(fn(&#Request) -> _).respanned(Span::call_site().into());
@ -96,7 +96,10 @@ pub fn _catch(
// Set the `req` span to that of the arg for a correct `Wrong type` span. // Set the `req` span to that of the arg for a correct `Wrong type` span.
let input = catch.function.sig.inputs.first() let input = catch.function.sig.inputs.first()
.map(|arg| req.respanned(arg.span().into())); .map(|arg| match arg {
syn::FnArg::Receiver(_) => req.respanned(arg.span()),
syn::FnArg::Typed(a) => req.respanned(a.ty.span())
});
// We append `.await` to the function call if this is `async`. // We append `.await` to the function call if this is `async`.
let dot_await = catch.function.sig.asyncness let dot_await = catch.function.sig.asyncness
@ -138,5 +141,5 @@ pub fn catch_attribute(
args: proc_macro::TokenStream, args: proc_macro::TokenStream,
input: proc_macro::TokenStream input: proc_macro::TokenStream
) -> TokenStream { ) -> TokenStream {
_catch(args, input).unwrap_or_else(|d| d.emit_as_tokens()) _catch(args, input).unwrap_or_else(|d| d.emit_as_item_tokens())
} }

View File

@ -62,7 +62,7 @@ fn parse_route(attr: RouteAttribute, function: syn::ItemFn) -> Result<Route> {
// FIXME(diag: warning) // FIXME(diag: warning)
data.full_span.warning("`data` used with non-payload-supporting method") data.full_span.warning("`data` used with non-payload-supporting method")
.span_note(attr.method.span, msg) .span_note(attr.method.span, msg)
.emit_as_tokens(); .emit_as_item_tokens();
} }
} }
@ -115,11 +115,7 @@ fn parse_route(attr: RouteAttribute, function: syn::ItemFn) -> Result<Route> {
} }
// Check that all of the declared parameters are function inputs. // Check that all of the declared parameters are function inputs.
let span = match function.sig.inputs.is_empty() { let span = function.sig.paren_token.span;
false => function.sig.inputs.span(),
true => function.span()
};
for missing in segments.difference(&fn_segments) { for missing in segments.difference(&fn_segments) {
diags.push(missing.span.error("unused dynamic parameter") diags.push(missing.span.error("unused dynamic parameter")
.span_note(span, format!("expected argument named `{}` here", missing.name))) .span_note(span, format!("expected argument named `{}` here", missing.name)))
@ -522,5 +518,5 @@ pub fn route_attribute<M: Into<Option<crate::http::Method>>>(
None => complete_route(args.into(), input.into()) None => complete_route(args.into(), input.into())
}; };
result.unwrap_or_else(|diag| diag.emit_as_tokens()) result.unwrap_or_else(|diag| diag.emit_as_item_tokens())
} }

View File

@ -45,7 +45,7 @@ fn prefixed_vec(
__vector __vector
})) }))
.unwrap_or_else(|diag| { .unwrap_or_else(|diag| {
let diag_tokens = diag.emit_as_tokens(); let diag_tokens = diag.emit_as_expr_tokens();
quote!({ quote!({
#diag_tokens #diag_tokens
let __vec: #_Vec<#ty> = vec![]; let __vec: #_Vec<#ty> = vec![];
@ -64,15 +64,16 @@ pub fn catchers_macro(input: proc_macro::TokenStream) -> TokenStream {
pub fn uri_macro(input: proc_macro::TokenStream) -> TokenStream { pub fn uri_macro(input: proc_macro::TokenStream) -> TokenStream {
uri::_uri_macro(input.into()) uri::_uri_macro(input.into())
.unwrap_or_else(|diag| diag.emit_as_tokens()) .unwrap_or_else(|diag| diag.emit_as_expr_tokens())
} }
pub fn uri_internal_macro(input: proc_macro::TokenStream) -> TokenStream { pub fn uri_internal_macro(input: proc_macro::TokenStream) -> TokenStream {
uri::_uri_internal_macro(input.into()) let tokens = uri::_uri_internal_macro(input.into())
.unwrap_or_else(|diag| diag.emit_as_tokens()) .unwrap_or_else(|diag| diag.emit_as_expr_tokens());
tokens
} }
pub fn guide_tests_internal(input: proc_macro::TokenStream) -> TokenStream { pub fn guide_tests_internal(input: proc_macro::TokenStream) -> TokenStream {
test_guide::_macro(input) test_guide::_macro(input)
.unwrap_or_else(|diag| diag.emit_as_tokens()) .unwrap_or_else(|diag| diag.emit_as_item_tokens())
} }

View File

@ -34,9 +34,9 @@ impl FromMeta for FormField {
} }
} }
fn validate_struct(gen: &DeriveGenerator, data: Struct<'_>) -> Result<()> { fn validate_struct(_: &DeriveGenerator, data: Struct<'_>) -> Result<()> {
if data.fields().is_empty() { if data.fields().is_empty() {
return Err(gen.input.span().error("at least one field is required")); return Err(data.fields.span().error("at least one field is required"));
} }
let mut names = ::std::collections::HashMap::new(); let mut names = ::std::collections::HashMap::new();
@ -67,9 +67,9 @@ pub fn derive_from_form(input: proc_macro::TokenStream) -> TokenStream {
.map_type_generic(|_, ident, _| quote! { .map_type_generic(|_, ident, _| quote! {
#ident : ::rocket::request::FromFormValue<'__f> #ident : ::rocket::request::FromFormValue<'__f>
}) })
.validate_generics(|_, generics| match generics.lifetimes().count() > 1 { .validate_generics(|_, generics| match generics.lifetimes().enumerate().last() {
true => Err(generics.span().error("only one lifetime is supported")), Some((i, lt)) if i >= 1 => Err(lt.span().error("only one lifetime is supported")),
false => Ok(()) _ => Ok(())
}) })
.validate_struct(validate_struct) .validate_struct(validate_struct)
.function(|_, inner| quote! { .function(|_, inner| quote! {
@ -85,7 +85,7 @@ pub fn derive_from_form(input: proc_macro::TokenStream) -> TokenStream {
.try_map_fields(move |_, fields| { .try_map_fields(move |_, fields| {
define_vars_and_mods!(_None, _Some, _Ok, _Err); define_vars_and_mods!(_None, _Some, _Ok, _Err);
let (constructors, matchers, builders) = fields.iter().map(|field| { let (constructors, matchers, builders) = fields.iter().map(|field| {
let (ident, span) = (&field.ident, field.span().into()); let (ident, span) = (&field.ident, field.span());
let default_name = ident.as_ref().expect("named").to_string(); let default_name = ident.as_ref().expect("named").to_string();
let name = Form::from_attrs("form", &field.attrs) let name = Form::from_attrs("form", &field.attrs)
.map(|result| result.map(|form| form.field.name)) .map(|result| result.map(|form| form.field.name))

View File

@ -12,18 +12,17 @@ pub fn derive_from_form_value(input: proc_macro::TokenStream) -> TokenStream {
DeriveGenerator::build_for(input, quote!(impl<'__v> ::rocket::request::FromFormValue<'__v>)) DeriveGenerator::build_for(input, quote!(impl<'__v> ::rocket::request::FromFormValue<'__v>))
.generic_support(GenericSupport::None) .generic_support(GenericSupport::None)
.data_support(DataSupport::Enum) .data_support(DataSupport::Enum)
.validate_enum(|generator, data| { .validate_enum(|_, data| {
// This derive only works for variants that are nullary. // This derive only works for variants that are nullary.
for variant in data.variants() { for variant in data.variants() {
if !variant.fields().is_empty() { if !variant.fields().is_empty() {
return Err(variant.span().error("variants cannot have fields")); return Err(variant.fields().span().error("variants cannot have fields"));
} }
} }
// Emit a warning if the enum is empty. // Emit a warning if the enum is empty.
if data.variants.is_empty() { if data.variants.is_empty() {
return Err(generator.input.span() return Err(data.brace_token.span.error("enum must have at least one field"));
.error("enum must have at least one field"));
} }
Ok(()) Ok(())

View File

@ -43,7 +43,7 @@ pub fn derive_responder(input: proc_macro::TokenStream) -> TokenStream {
quote_spanned!(item.span().into() => __res.set_header(#item);) quote_spanned!(item.span().into() => __res.set_header(#item);)
} }
let attr = ItemAttr::from_attrs("response", fields.parent_attrs()) let attr = ItemAttr::from_attrs("response", fields.parent.attrs())
.unwrap_or_else(|| Ok(Default::default()))?; .unwrap_or_else(|| Ok(Default::default()))?;
let responder = fields.iter().next().map(|f| { let responder = fields.iter().next().map(|f| {

View File

@ -2,7 +2,7 @@
use devise::{*, ext::SpanDiagnosticExt}; use devise::{*, ext::SpanDiagnosticExt};
use crate::derive::from_form::Form; use crate::derive::from_form::Form;
use crate::proc_macro2::{TokenStream, Span}; use crate::proc_macro2::TokenStream;
const NO_EMPTY_FIELDS: &str = "fieldless structs or variants are not supported"; const NO_EMPTY_FIELDS: &str = "fieldless structs or variants are not supported";
const NO_NULLARY: &str = "nullary items are not supported"; const NO_NULLARY: &str = "nullary items are not supported";
@ -10,29 +10,25 @@ const NO_EMPTY_ENUMS: &str = "empty enums are not supported";
const ONLY_ONE_UNNAMED: &str = "tuple structs or variants must have exactly one field"; const ONLY_ONE_UNNAMED: &str = "tuple structs or variants must have exactly one field";
const EXACTLY_ONE_FIELD: &str = "struct must have exactly one field"; const EXACTLY_ONE_FIELD: &str = "struct must have exactly one field";
fn validate_fields(fields: Fields<'_>, parent_span: Span) -> Result<()> { fn validate_fields(ident: &syn::Ident, fields: Fields<'_>) -> Result<()> {
if fields.count() == 0 { if fields.count() == 0 {
return Err(parent_span.error(NO_EMPTY_FIELDS)) return Err(ident.span().error(NO_EMPTY_FIELDS))
} else if fields.are_unnamed() && fields.count() > 1 { } else if fields.are_unnamed() && fields.count() > 1 {
return Err(fields.span().error(ONLY_ONE_UNNAMED)); return Err(fields.span.error(ONLY_ONE_UNNAMED));
} else if fields.are_unit() { } else if fields.are_unit() {
return Err(parent_span.error(NO_NULLARY)); return Err(fields.span.error(NO_NULLARY));
} }
Ok(()) Ok(())
} }
fn validate_struct(gen: &DeriveGenerator, data: Struct<'_>) -> Result<()> { fn validate_enum(_: &DeriveGenerator, data: Enum<'_>) -> Result<()> {
validate_fields(data.fields(), gen.input.span())
}
fn validate_enum(gen: &DeriveGenerator, data: Enum<'_>) -> Result<()> {
if data.variants().count() == 0 { if data.variants().count() == 0 {
return Err(gen.input.span().error(NO_EMPTY_ENUMS)); return Err(data.brace_token.span.error(NO_EMPTY_ENUMS));
} }
for variant in data.variants() { for variant in data.variants() {
validate_fields(variant.fields(), variant.span())?; validate_fields(&variant.ident, variant.fields())?;
} }
Ok(()) Ok(())
@ -49,7 +45,7 @@ pub fn derive_uri_display_query(input: proc_macro::TokenStream) -> TokenStream {
.data_support(DataSupport::Struct | DataSupport::Enum) .data_support(DataSupport::Struct | DataSupport::Enum)
.generic_support(GenericSupport::Type | GenericSupport::Lifetime) .generic_support(GenericSupport::Type | GenericSupport::Lifetime)
.validate_enum(validate_enum) .validate_enum(validate_enum)
.validate_struct(validate_struct) .validate_struct(|gen, data| validate_fields(&gen.input.ident, data.fields()))
.map_type_generic(move |_, ident, _| quote!(#ident : #UriDisplay)) .map_type_generic(move |_, ident, _| quote!(#ident : #UriDisplay))
.function(move |_, inner| quote! { .function(move |_, inner| quote! {
fn fmt(&self, f: &mut #Formatter) -> ::std::fmt::Result { fn fmt(&self, f: &mut #Formatter) -> ::std::fmt::Result {
@ -72,7 +68,12 @@ pub fn derive_uri_display_query(input: proc_macro::TokenStream) -> TokenStream {
Ok(tokens) Ok(tokens)
}) })
.to_tokens(); .try_to_tokens();
let uri_display = match uri_display {
Ok(tokens) => tokens,
Err(diag) => return diag.emit_as_item_tokens()
};
let i = input.clone(); let i = input.clone();
let gen_trait = quote!(impl #FromUriParam<#Query, Self>); let gen_trait = quote!(impl #FromUriParam<#Query, Self>);
@ -136,7 +137,7 @@ pub fn derive_uri_display_path(input: proc_macro::TokenStream) -> TokenStream {
.map_type_generic(move |_, ident, _| quote!(#ident : #UriDisplay)) .map_type_generic(move |_, ident, _| quote!(#ident : #UriDisplay))
.validate_fields(|_, fields| match fields.count() { .validate_fields(|_, fields| match fields.count() {
1 => Ok(()), 1 => Ok(()),
_ => Err(fields.span().error(EXACTLY_ONE_FIELD)) _ => Err(fields.span.error(EXACTLY_ONE_FIELD))
}) })
.function(move |_, inner| quote! { .function(move |_, inner| quote! {
fn fmt(&self, f: &mut #Formatter) -> ::std::fmt::Result { fn fmt(&self, f: &mut #Formatter) -> ::std::fmt::Result {
@ -149,7 +150,12 @@ pub fn derive_uri_display_path(input: proc_macro::TokenStream) -> TokenStream {
let accessor = field.accessor(); let accessor = field.accessor();
quote_spanned!(span => f.write_value(&#accessor)?;) quote_spanned!(span => f.write_value(&#accessor)?;)
}) })
.to_tokens(); .try_to_tokens();
let uri_display = match uri_display {
Ok(tokens) => tokens,
Err(diag) => return diag.emit_as_item_tokens()
};
let i = input.clone(); let i = input.clone();
let gen_trait = quote!(impl #FromUriParam<#Path, Self>); let gen_trait = quote!(impl #FromUriParam<#Path, Self>);

View File

@ -85,7 +85,7 @@ impl FromMeta for MediaType {
// FIXME(diag: warning) // FIXME(diag: warning)
meta.value_span() meta.value_span()
.warning(format!("'{}' is not a known media type", mt)) .warning(format!("'{}' is not a known media type", mt))
.emit_as_tokens(); .emit_as_item_tokens();
} }
Ok(MediaType(mt)) Ok(MediaType(mt))

View File

@ -86,6 +86,7 @@ vars_and_mods! {
FromTransformedData => rocket::data::FromTransformedData, FromTransformedData => rocket::data::FromTransformedData,
Transform => rocket::data::Transform, Transform => rocket::data::Transform,
Query => rocket::request::Query, Query => rocket::request::Query,
FromFormValue => rocket::request::FromFormValue,
Request => rocket::Request, Request => rocket::Request,
Response => rocket::response::Response, Response => rocket::response::Response,
Data => rocket::Data, Data => rocket::Data,
@ -136,7 +137,7 @@ macro_rules! emit {
let debug_tokens = proc_macro2::Span::call_site() let debug_tokens = proc_macro2::Span::call_site()
.note("emitting Rocket code generation debug output") .note("emitting Rocket code generation debug output")
.note(tokens.to_string()) .note(tokens.to_string())
.emit_as_tokens(); .emit_as_item_tokens();
tokens.extend(debug_tokens); tokens.extend(debug_tokens);
} }

View File

@ -30,7 +30,7 @@ impl Diagnostics {
let mut last = iter.next().expect("Diagnostic::emit_head empty"); let mut last = iter.next().expect("Diagnostic::emit_head empty");
for diag in iter { for diag in iter {
// FIXME(diag: emit, can there be errors here?) // FIXME(diag: emit, can there be errors here?)
last.emit_as_tokens(); last.emit_as_item_tokens();
last = diag; last = diag;
} }

View File

@ -18,10 +18,10 @@ warning: attribute is typically applied to `main` function
| ^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^
| |
note: this function is not `main` note: this function is not `main`
--> $DIR/async-entry.rs:13:5 --> $DIR/async-entry.rs:13:14
| |
13 | async fn foo() { } 13 | async fn foo() { }
| ^^^^^^^^^^^^^^ | ^^^
= 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)
error: attribute can only be applied to `async` functions error: attribute can only be applied to `async` functions
@ -38,120 +38,120 @@ note: this function must be `async`
= 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: attribute cannot be applied to `main` function error: attribute cannot be applied to `main` function
--> $DIR/async-entry.rs:55:5 --> $DIR/async-entry.rs:52:5
| |
55 | #[rocket::launch] 52 | #[rocket::launch]
| ^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^
| |
= note: this attribute generates a `main` function = note: this attribute generates a `main` function
note: this function cannot be `main` note: this function cannot be `main`
--> $DIR/async-entry.rs:56:5 --> $DIR/async-entry.rs:53:8
| |
56 | fn main() -> rocket::Rocket { 53 | fn main() -> rocket::Rocket {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^
= 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: attribute can only be applied to functions that return a value error: attribute can only be applied to functions that return a value
--> $DIR/async-entry.rs:63:5 --> $DIR/async-entry.rs:59:5
| |
63 | #[rocket::launch] 59 | #[rocket::launch]
| ^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^
| |
note: this function must return a value note: this function must return a value
--> $DIR/async-entry.rs:64:5 --> $DIR/async-entry.rs:60:5
| |
64 | async fn rocket() { 60 | async fn rocket() {
| ^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^
= 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: attribute can only be applied to functions that return a value error: attribute can only be applied to functions that return a value
--> $DIR/async-entry.rs:72:5 --> $DIR/async-entry.rs:67:5
| |
72 | #[rocket::launch] 67 | #[rocket::launch]
| ^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^
| |
note: this function must return a value note: this function must return a value
--> $DIR/async-entry.rs:73:5 --> $DIR/async-entry.rs:68:5
| |
73 | fn rocket() { 68 | fn rocket() {
| ^^^^^^^^^^^ | ^^^^^^^^^^^
= 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: attribute cannot be applied to `main` function error: attribute cannot be applied to `main` function
--> $DIR/async-entry.rs:89:5 --> $DIR/async-entry.rs:82:5
| |
89 | #[rocket::launch] 82 | #[rocket::launch]
| ^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^
| |
= note: this attribute generates a `main` function = note: this attribute generates a `main` function
note: this function cannot be `main` note: this function cannot be `main`
--> $DIR/async-entry.rs:90:5 --> $DIR/async-entry.rs:83:8
| |
90 | fn main() -> &'static str { 83 | fn main() -> &'static str {
| ^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^
= 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: attribute cannot be applied to `main` function error: attribute cannot be applied to `main` function
--> $DIR/async-entry.rs:98:5 --> $DIR/async-entry.rs:90:5
| |
98 | #[rocket::launch] 90 | #[rocket::launch]
| ^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^
| |
= note: this attribute generates a `main` function = note: this attribute generates a `main` function
note: this function cannot be `main` note: this function cannot be `main`
--> $DIR/async-entry.rs:99:5 --> $DIR/async-entry.rs:91:14
| |
99 | async fn main() -> rocket::Rocket { 91 | async fn main() -> rocket::Rocket {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^
= 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[E0728]: `await` is only allowed inside `async` functions and blocks error[E0728]: `await` is only allowed inside `async` functions and blocks
--> $DIR/async-entry.rs:82:17 --> $DIR/async-entry.rs:76:17
| |
81 | fn rocket() -> rocket::Rocket { 75 | fn rocket() -> rocket::Rocket {
| ------ this is not `async` | ------ this is not `async`
82 | let _ = rocket::ignite().launch().await; 76 | let _ = rocket::ignite().launch().await;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ only allowed inside `async` functions and blocks | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ only allowed inside `async` functions and blocks
error[E0308]: mismatched types error[E0308]: mismatched types
--> $DIR/async-entry.rs:40:9 --> $DIR/async-entry.rs:38:9
| |
40 | rocket::ignite() 38 | rocket::ignite()
| ^^^^^^^^^^^^^^^^ expected struct `std::string::String`, found struct `rocket::Rocket` | ^^^^^^^^^^^^^^^^ expected struct `std::string::String`, found struct `rocket::Rocket`
error[E0308]: mismatched types error[E0308]: mismatched types
--> $DIR/async-entry.rs:49:9 --> $DIR/async-entry.rs:47:9
| |
49 | "hi".to_string() 47 | "hi".to_string()
| ^^^^^^^^^^^^^^^^ expected struct `rocket::Rocket`, found struct `std::string::String` | ^^^^^^^^^^^^^^^^ expected struct `rocket::Rocket`, found struct `std::string::String`
error[E0308]: mismatched types error[E0308]: mismatched types
--> $DIR/async-entry.rs:27:21 --> $DIR/async-entry.rs:26:21
| |
27 | async fn main() { 26 | async fn main() {
| ^ expected `()` because of default return type | ^ expected `()` because of default return type
| _____________________| | _____________________|
| | | |
28 | | //~^ ERROR mismatched types 27 | |
29 | | rocket::ignite() 28 | | rocket::ignite()
30 | | } 29 | | }
| | ^- help: try adding a semicolon: `;` | | ^- help: try adding a semicolon: `;`
| |_____| | |_____|
| expected `()`, found struct `rocket::Rocket` | expected `()`, found struct `rocket::Rocket`
error[E0308]: mismatched types error[E0308]: mismatched types
--> $DIR/async-entry.rs:37:26 --> $DIR/async-entry.rs:36:26
| |
37 | async fn rocket() -> String { 36 | async fn rocket() -> String {
| ^^^^^^ | ^^^^^^
| | | |
| expected struct `rocket::Rocket`, found struct `std::string::String` | expected struct `rocket::Rocket`, found struct `std::string::String`
| expected due to this | expected due to this
error[E0277]: `main` has invalid return type `rocket::Rocket` error[E0277]: `main` has invalid return type `rocket::Rocket`
--> $DIR/async-entry.rs:106:20 --> $DIR/async-entry.rs:97:20
| |
106 | async fn main() -> rocket::Rocket { 97 | async fn main() -> 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`

View File

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

View File

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

View File

@ -1,19 +1,19 @@
error: expected `,` error: expected `,`
--> $DIR/catchers.rs:4:25 --> $DIR/catchers.rs:4:25
| |
4 | let _ = catchers![a b]; //~ ERROR expected 4 | let _ = catchers![a b];
| ^ | ^
error: expected identifier error: expected identifier
--> $DIR/catchers.rs:6:26 --> $DIR/catchers.rs:6:26
| |
6 | let _ = catchers![a::, ]; //~ ERROR expected identifier 6 | let _ = catchers![a::, ];
| ^ | ^
error: unexpected end of input, expected identifier error: unexpected end of input, expected identifier
--> $DIR/catchers.rs:7:13 --> $DIR/catchers.rs:7:13
| |
7 | let _ = catchers![a::]; //~ ERROR expected identifier 7 | let _ = catchers![a::];
| ^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^
| |
= 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)

View File

@ -12,37 +12,50 @@ note: error occurred while deriving `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: tuple structs are not supported error: tuple structs are not supported
--> $DIR/from_form.rs:10:1 --> $DIR/from_form.rs:9:1
| |
10 | struct Foo1; 9 | struct Foo1;
| ^^^^^^^^^^^^ | ^^^^^^^^^^^^
| |
note: error occurred while deriving `FromForm` note: error occurred while deriving `FromForm`
--> $DIR/from_form.rs:9:10 --> $DIR/from_form.rs:8:10
| |
9 | #[derive(FromForm)] 8 | #[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: at least one field is required error: at least one field is required
--> $DIR/from_form.rs:14:1 --> $DIR/from_form.rs:12:13
| |
14 | struct Foo2 { } 12 | struct Foo2 { }
| ^^^^^^^^^^^^^^^^ | ^^^^
| |
note: error occurred while deriving `FromForm` note: error occurred while deriving `FromForm`
--> $DIR/from_form.rs:13:10 --> $DIR/from_form.rs:11:10
| |
13 | #[derive(FromForm)] 11 | #[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: tuple structs are not supported error: tuple structs are not supported
--> $DIR/from_form.rs:18:1 --> $DIR/from_form.rs:15:1
| |
18 | struct Foo3(usize); 15 | struct Foo3(usize);
| ^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^
| |
note: error occurred while deriving `FromForm`
--> $DIR/from_form.rs:14:10
|
14 | #[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:18:25
|
18 | struct NextTodoTask<'f, 'a> {
| ^^
|
note: error occurred while deriving `FromForm` note: error occurred while deriving `FromForm`
--> $DIR/from_form.rs:17:10 --> $DIR/from_form.rs:17:10
| |
@ -50,132 +63,145 @@ note: error occurred while deriving `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: only one lifetime is supported
--> $DIR/from_form.rs:22:20
|
22 | struct NextTodoTask<'f, 'a> {
| ^^^^^^^^
|
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 error: invalid form field name
--> $DIR/from_form.rs:32:20 --> $DIR/from_form.rs:27:20
| |
32 | #[form(field = "isindex")] 27 | #[form(field = "isindex")]
| ^^^^^^^^^ | ^^^^^^^^^
| |
note: error occurred while deriving `FromForm` note: error occurred while deriving `FromForm`
--> $DIR/from_form.rs:30:10 --> $DIR/from_form.rs:25:10
| |
30 | #[derive(FromForm)] 25 | #[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: duplicate field name error: duplicate field name
--> $DIR/from_form.rs:41:5 --> $DIR/from_form.rs:35:5
| |
41 | foo: usize, 35 | foo: usize,
| ^^^ | ^^^
| |
note: previous definition here note: previous definition here
--> $DIR/from_form.rs:39:20 --> $DIR/from_form.rs:33:20
| |
39 | #[form(field = "foo")] 33 | #[form(field = "foo")]
| ^^^^^ | ^^^^^
note: error occurred while deriving `FromForm` note: error occurred while deriving `FromForm`
--> $DIR/from_form.rs:37:10 --> $DIR/from_form.rs:31:10
| |
37 | #[derive(FromForm)] 31 | #[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:42:20
|
42 | #[form(field = "hello")]
| ^^^^^^^
|
note: previous definition here
--> $DIR/from_form.rs:40:20
|
40 | #[form(field = "hello")]
| ^^^^^^^
note: error occurred while deriving `FromForm`
--> $DIR/from_form.rs:38:10
|
38 | #[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: duplicate field name error: duplicate field name
--> $DIR/from_form.rs:49:20 --> $DIR/from_form.rs:49:20
| |
49 | #[form(field = "hello")] 49 | #[form(field = "first")]
| ^^^^^^^ | ^^^^^^^
| |
note: previous definition here note: previous definition here
--> $DIR/from_form.rs:47:20 --> $DIR/from_form.rs:48:5
| |
47 | #[form(field = "hello")] 48 | first: String,
| ^^^^^^^
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")]
| ^^^^^^^
|
note: previous definition here
--> $DIR/from_form.rs:56:5
|
56 | first: String,
| ^^^^^ | ^^^^^
note: error occurred while deriving `FromForm` note: error occurred while deriving `FromForm`
--> $DIR/from_form.rs:54:10 --> $DIR/from_form.rs:46:10
| |
54 | #[derive(FromForm)] 46 | #[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: duplicate attribute parameter: field error: duplicate attribute parameter: field
--> $DIR/from_form.rs:64:28 --> $DIR/from_form.rs:55:28
| |
64 | #[form(field = "blah", field = "bloo")] 55 | #[form(field = "blah", field = "bloo")]
| ^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^
| |
note: error occurred while deriving `FromForm` note: error occurred while deriving `FromForm`
--> $DIR/from_form.rs:62:10 --> $DIR/from_form.rs:53:10
| |
62 | #[derive(FromForm)] 53 | #[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: malformed attribute: expected list error: malformed attribute: expected list
--> $DIR/from_form.rs:71:7 --> $DIR/from_form.rs:61:7
| |
71 | #[form] 61 | #[form]
| ^^^^ | ^^^^
| |
= help: expected syntax: #[form(key = value, ..)] = help: expected syntax: #[form(key = value, ..)]
note: error occurred while deriving `FromForm` note: error occurred while deriving `FromForm`
--> $DIR/from_form.rs:69:10 --> $DIR/from_form.rs:59:10
| |
69 | #[derive(FromForm)] 59 | #[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: expected key/value pair error: expected key/value pair
--> $DIR/from_form.rs:78:12 --> $DIR/from_form.rs:67:12
| |
78 | #[form("blah")] 67 | #[form("blah")]
| ^^^^^^ | ^^^^^^
| |
note: error occurred while deriving `FromForm` note: error occurred while deriving `FromForm`
--> $DIR/from_form.rs:76:10 --> $DIR/from_form.rs:65:10
| |
76 | #[derive(FromForm)] 65 | #[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: expected key/value pair error: expected key/value pair
--> $DIR/from_form.rs:85:12 --> $DIR/from_form.rs:73:12
| |
85 | #[form(123)] 73 | #[form(123)]
| ^^^ | ^^^
| |
note: error occurred while deriving `FromForm`
--> $DIR/from_form.rs:71:10
|
71 | #[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:79:12
|
79 | #[form(beep = "bop")]
| ^^^^^^^^^^^^
|
note: error occurred while deriving `FromForm`
--> $DIR/from_form.rs:77:10
|
77 | #[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:86:7
|
86 | #[form(field = "bleh")]
| ^^^^
|
note: error occurred while deriving `FromForm` note: error occurred while deriving `FromForm`
--> $DIR/from_form.rs:83:10 --> $DIR/from_form.rs:83:10
| |
@ -183,11 +209,11 @@ note: error occurred while deriving `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: unexpected attribute parameter: `beep` error: invalid value: expected string literal
--> $DIR/from_form.rs:92:12 --> $DIR/from_form.rs:92:20
| |
92 | #[form(beep = "bop")] 92 | #[form(field = true)]
| ^^^^^^^^^^^^ | ^^^^
| |
note: error occurred while deriving `FromForm` note: error occurred while deriving `FromForm`
--> $DIR/from_form.rs:90:10 --> $DIR/from_form.rs:90:10
@ -196,63 +222,76 @@ note: error occurred while deriving `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: duplicate invocation of `form` attribute
--> $DIR/from_form.rs:100:5
|
100 | #[form(field = "bleh")]
| ^^^^^^^^^^^^^^^^^^^^^^^
|
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)]
| ^^^^
|
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 error: expected literal or key/value pair
--> $DIR/from_form.rs:114:12 --> $DIR/from_form.rs:98:12
| |
114 | #[form(field)] 98 | #[form(field)]
| ^^^^^ | ^^^^^
| |
note: error occurred while deriving `FromForm` note: error occurred while deriving `FromForm`
--> $DIR/from_form.rs:112:10 --> $DIR/from_form.rs:96:10
| |
112 | #[derive(FromForm)] 96 | #[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: invalid value: expected string literal error: invalid value: expected string literal
--> $DIR/from_form.rs:121:20 --> $DIR/from_form.rs:104:20
| |
121 | #[form(field = 123)] 104 | #[form(field = 123)]
| ^^^ | ^^^
| |
note: error occurred while deriving `FromForm` note: error occurred while deriving `FromForm`
--> $DIR/from_form.rs:119:10 --> $DIR/from_form.rs:102:10
| |
119 | #[derive(FromForm)] 102 | #[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:110:20
|
110 | #[form(field = "hello&world")]
| ^^^^^^^^^^^^^
|
note: error occurred while deriving `FromForm`
--> $DIR/from_form.rs:108:10
|
108 | #[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:116:20
|
116 | #[form(field = "!@#$%^&*()_")]
| ^^^^^^^^^^^^^
|
note: error occurred while deriving `FromForm`
--> $DIR/from_form.rs:114:10
|
114 | #[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:122:20
|
122 | #[form(field = "?")]
| ^^^
|
note: error occurred while deriving `FromForm`
--> $DIR/from_form.rs:120:10
|
120 | #[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: invalid form field name error: invalid form field name
--> $DIR/from_form.rs:128:20 --> $DIR/from_form.rs:128:20
| |
128 | #[form(field = "hello&world")] 128 | #[form(field = "")]
| ^^^^^^^^^^^^^ | ^^
| |
note: error occurred while deriving `FromForm` note: error occurred while deriving `FromForm`
--> $DIR/from_form.rs:126:10 --> $DIR/from_form.rs:126:10
@ -262,66 +301,27 @@ note: error occurred while deriving `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: invalid form field name error: invalid form field name
--> $DIR/from_form.rs:135:20 --> $DIR/from_form.rs:134:20
| |
135 | #[form(field = "!@#$%^&*()_")] 134 | #[form(field = "a&b")]
| ^^^^^^^^^^^^^
|
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 = "?")]
| ^^^
|
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 = "")]
| ^^
|
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")]
| ^^^^^ | ^^^^^
| |
note: error occurred while deriving `FromForm` note: error occurred while deriving `FromForm`
--> $DIR/from_form.rs:154:10 --> $DIR/from_form.rs:132:10
| |
154 | #[derive(FromForm)] 132 | #[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: invalid form field name error: invalid form field name
--> $DIR/from_form.rs:163:20 --> $DIR/from_form.rs:140:20
| |
163 | #[form(field = "a=")] 140 | #[form(field = "a=")]
| ^^^^ | ^^^^
| |
note: error occurred while deriving `FromForm` note: error occurred while deriving `FromForm`
--> $DIR/from_form.rs:161:10 --> $DIR/from_form.rs:138:10
| |
161 | #[derive(FromForm)] 138 | #[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)

View File

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

View File

@ -12,66 +12,78 @@ note: error occurred while deriving `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: tuple structs are not supported error: tuple structs are not supported
--> $DIR/from_form_value.rs:8:1 --> $DIR/from_form_value.rs:7:1
| |
8 | struct Foo2(usize); 7 | struct Foo2(usize);
| ^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^
| |
note: error occurred while deriving `FromFormValue` note: error occurred while deriving `FromFormValue`
--> $DIR/from_form_value.rs:7:10 --> $DIR/from_form_value.rs:6:10
| |
7 | #[derive(FromFormValue)] 6 | #[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: named structs are not supported error: named structs are not supported
--> $DIR/from_form_value.rs:12:1 --> $DIR/from_form_value.rs:10:1
| |
12 | / struct Foo3 { 10 | / struct Foo3 {
13 | | //~^ ERROR not supported 11 | | foo: usize,
14 | | foo: usize, 12 | | }
15 | | }
| |_^ | |_^
| |
note: error occurred while deriving `FromFormValue` note: error occurred while deriving `FromFormValue`
--> $DIR/from_form_value.rs:11:10 --> $DIR/from_form_value.rs:9:10
| |
11 | #[derive(FromFormValue)] 9 | #[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: variants cannot have fields error: variants cannot have fields
--> $DIR/from_form_value.rs:19:5 --> $DIR/from_form_value.rs:16:7
| |
19 | A(usize), 16 | A(usize),
| ^^^^^^^^ | ^^^^^
| |
note: error occurred while deriving `FromFormValue` note: error occurred while deriving `FromFormValue`
--> $DIR/from_form_value.rs:17:10 --> $DIR/from_form_value.rs:14:10
| |
17 | #[derive(FromFormValue)] 14 | #[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: enum must have at least one field error: enum must have at least one field
--> $DIR/from_form_value.rs:24:1 --> $DIR/from_form_value.rs:20:11
| |
24 | enum Foo5 { } 20 | enum Foo5 { }
| ^^^^^^^^^^^^^ | ^^^
| |
note: error occurred while deriving `FromFormValue` note: error occurred while deriving `FromFormValue`
--> $DIR/from_form_value.rs:23:10 --> $DIR/from_form_value.rs:19:10
| |
23 | #[derive(FromFormValue)] 19 | #[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: type generics are not supported error: type generics are not supported
--> $DIR/from_form_value.rs:28:11 --> $DIR/from_form_value.rs:23:11
| |
28 | enum Foo6<T> { 23 | enum Foo6<T> {
| ^ | ^
| |
note: error occurred while deriving `FromFormValue`
--> $DIR/from_form_value.rs:22:10
|
22 | #[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:29:20
|
29 | #[form(value = 123)]
| ^^^
|
note: error occurred while deriving `FromFormValue` note: error occurred while deriving `FromFormValue`
--> $DIR/from_form_value.rs:27:10 --> $DIR/from_form_value.rs:27:10
| |
@ -79,11 +91,11 @@ note: error occurred while deriving `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: invalid value: expected string literal error: expected literal or key/value pair
--> $DIR/from_form_value.rs:35:20 --> $DIR/from_form_value.rs:35:12
| |
35 | #[form(value = 123)] 35 | #[form(value)]
| ^^^ | ^^^^^
| |
note: error occurred while deriving `FromFormValue` note: error occurred while deriving `FromFormValue`
--> $DIR/from_form_value.rs:33:10 --> $DIR/from_form_value.rs:33:10
@ -91,16 +103,3 @@ note: error occurred while deriving `FromFormValue`
33 | #[derive(FromFormValue)] 33 | #[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: expected literal or key/value pair
--> $DIR/from_form_value.rs:42:12
|
42 | #[form(value)]
| ^^^^^
|
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

@ -1,15 +1,15 @@
error[E0277]: the trait bound `u8: rocket::response::Responder<'_, '_>` is not satisfied error[E0277]: the trait bound `u8: rocket::response::Responder<'_, '_>` is not satisfied
--> $DIR/responder-types.rs:9:5 --> $DIR/responder-types.rs:5:5
| |
9 | thing: u8, 5 | thing: u8,
| ^^^^^^^^^ the trait `rocket::response::Responder<'_, '_>` is not implemented for `u8` | ^^^^^^^^^ the trait `rocket::response::Responder<'_, '_>` is not implemented for `u8`
| |
= note: required by `rocket::response::Responder::respond_to` = note: required by `rocket::response::Responder::respond_to`
error[E0277]: the trait bound `rocket::http::Header<'_>: std::convert::From<u8>` is not satisfied error[E0277]: the trait bound `rocket::http::Header<'_>: std::convert::From<u8>` is not satisfied
--> $DIR/responder-types.rs:16:5 --> $DIR/responder-types.rs:11:5
| |
16 | other: u8, 11 | other: 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:
@ -18,17 +18,17 @@ error[E0277]: the trait bound `rocket::http::Header<'_>: std::convert::From<u8>`
= 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
--> $DIR/responder-types.rs:22:5 --> $DIR/responder-types.rs:16:5
| |
22 | thing: u8, 16 | thing: u8,
| ^^^^^^^^^ the trait `rocket::response::Responder<'_, '_>` is not implemented for `u8` | ^^^^^^^^^ the trait `rocket::response::Responder<'_, '_>` is not implemented for `u8`
| |
= note: required by `rocket::response::Responder::respond_to` = note: required by `rocket::response::Responder::respond_to`
error[E0277]: the trait bound `rocket::http::Header<'_>: std::convert::From<u8>` is not satisfied error[E0277]: the trait bound `rocket::http::Header<'_>: std::convert::From<u8>` is not satisfied
--> $DIR/responder-types.rs:24:5 --> $DIR/responder-types.rs:17:5
| |
24 | other: u8, 17 | other: 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:
@ -37,9 +37,9 @@ error[E0277]: the trait bound `rocket::http::Header<'_>: std::convert::From<u8>`
= 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
--> $DIR/responder-types.rs:32:5 --> $DIR/responder-types.rs:24:5
| |
32 | then: String, 24 | then: String,
| ^^^^^^^^^^^^ 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:
@ -48,9 +48,9 @@ error[E0277]: the trait bound `rocket::http::Header<'_>: std::convert::From<std:
= 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
--> $DIR/responder-types.rs:37:13 --> $DIR/responder-types.rs:28:13
| |
37 | fn foo() -> usize { 0 } 28 | fn foo() -> usize { 0 }
| ^^^^^ 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`

View File

@ -1,216 +1,216 @@
error: missing expected parameter: `path` error: missing expected parameter: `path`
--> $DIR/route-attribute-general-syntax.rs:5:1 --> $DIR/route-attribute-general-syntax.rs:4:1
| |
5 | #[get()] //~ ERROR missing expected parameter 4 | #[get()]
| ^^^^^^^^ | ^^^^^^^^
| |
= 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 `fn` error: expected `fn`
--> $DIR/route-attribute-general-syntax.rs:11:1 --> $DIR/route-attribute-general-syntax.rs:9:1
| |
11 | struct S; 9 | struct S;
| ^^^^^^ | ^^^^^^
| |
= help: #[get] can only be used on functions = help: #[get] can only be used on functions
error: expected `fn` error: expected `fn`
--> $DIR/route-attribute-general-syntax.rs:16:1 --> $DIR/route-attribute-general-syntax.rs:12:1
| |
16 | enum A { } 12 | enum A { }
| ^^^^ | ^^^^
| |
= help: #[get] can only be used on functions = help: #[get] can only be used on functions
error: expected `fn` error: expected `fn`
--> $DIR/route-attribute-general-syntax.rs:21:1 --> $DIR/route-attribute-general-syntax.rs:15:1
| |
21 | trait Foo { } 15 | trait Foo { }
| ^^^^^ | ^^^^^
| |
= help: #[get] can only be used on functions = help: #[get] can only be used on functions
error: expected `fn` error: expected `fn`
--> $DIR/route-attribute-general-syntax.rs:26:1 --> $DIR/route-attribute-general-syntax.rs:18:1
| |
26 | impl S { } 18 | impl S { }
| ^^^^ | ^^^^
| |
= help: #[get] can only be used on functions = help: #[get] can only be used on functions
error: expected key/value pair error: expected key/value pair
--> $DIR/route-attribute-general-syntax.rs:32:12 --> $DIR/route-attribute-general-syntax.rs:21:12
| |
32 | #[get("/", 123)] //~ ERROR expected 21 | #[get("/", 123)]
| ^^^ | ^^^
error: expected key/value pair error: expected key/value pair
--> $DIR/route-attribute-general-syntax.rs:35:12 --> $DIR/route-attribute-general-syntax.rs:24:12
| |
35 | #[get("/", "/")] //~ ERROR expected 24 | #[get("/", "/")]
| ^^^ | ^^^
error: unexpected keyed parameter: expected literal or identifier error: unexpected keyed parameter: expected literal or identifier
--> $DIR/route-attribute-general-syntax.rs:38:7 --> $DIR/route-attribute-general-syntax.rs:27:7
| |
38 | #[get(data = "<foo>", "/")] //~ ERROR unexpected keyed parameter 27 | #[get(data = "<foo>", "/")]
| ^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^
error: unexpected attribute parameter: `unknown` error: unexpected attribute parameter: `unknown`
--> $DIR/route-attribute-general-syntax.rs:41:12 --> $DIR/route-attribute-general-syntax.rs:30:12
| |
41 | #[get("/", unknown = "foo")] //~ ERROR unexpected 30 | #[get("/", unknown = "foo")]
| ^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^
error: malformed attribute error: malformed attribute
--> $DIR/route-attribute-general-syntax.rs:44:1 --> $DIR/route-attribute-general-syntax.rs:33:1
| |
44 | #[get("/", ...)] //~ ERROR malformed 33 | #[get("/", ...)]
| ^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^
| |
= help: expected syntax: #[get(key = value, ..)] = help: expected syntax: #[get(key = value, ..)]
= 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: handler arguments cannot be ignored error: handler arguments cannot be ignored
--> $DIR/route-attribute-general-syntax.rs:51:7 --> $DIR/route-attribute-general-syntax.rs:39:7
| |
51 | fn c1(_: usize) {} //~ ERROR cannot be ignored 39 | fn c1(_: usize) {}
| ^^^^^^^^ | ^^^^^^^^
| |
= help: all handler arguments must be of the form: `ident: Type` = help: all handler arguments must be of the form: `ident: Type`
error: invalid value: expected string literal error: invalid value: expected string literal
--> $DIR/route-attribute-general-syntax.rs:56:7 --> $DIR/route-attribute-general-syntax.rs:43:7
| |
56 | #[get(100)] //~ ERROR expected string 43 | #[get(100)]
| ^^^ | ^^^
error: invalid value: expected string literal error: invalid value: expected string literal
--> $DIR/route-attribute-general-syntax.rs:59:7 --> $DIR/route-attribute-general-syntax.rs:46:7
| |
59 | #[get('/')] //~ ERROR expected string 46 | #[get('/')]
| ^^^ | ^^^
error: invalid value: expected integer literal error: invalid value: expected integer literal
--> $DIR/route-attribute-general-syntax.rs:62:19 --> $DIR/route-attribute-general-syntax.rs:49:19
| |
62 | #[get("/", rank = "1")] //~ ERROR expected integer 49 | #[get("/", rank = "1")]
| ^^^ | ^^^
error: invalid value: expected integer literal error: invalid value: expected integer literal
--> $DIR/route-attribute-general-syntax.rs:65:19 --> $DIR/route-attribute-general-syntax.rs:52:19
| |
65 | #[get("/", rank = '1')] //~ ERROR expected integer 52 | #[get("/", rank = '1')]
| ^^^ | ^^^
error: invalid or unknown media type error: invalid or unknown media type
--> $DIR/route-attribute-general-syntax.rs:70:21 --> $DIR/route-attribute-general-syntax.rs:57:21
| |
70 | #[get("/", format = "applicationx-custom")] //~ ERROR invalid or unknown media type 57 | #[get("/", format = "applicationx-custom")]
| ^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^
error: invalid or unknown media type error: invalid or unknown media type
--> $DIR/route-attribute-general-syntax.rs:73:21 --> $DIR/route-attribute-general-syntax.rs:60:21
| |
73 | #[get("/", format = "")] //~ ERROR invalid or unknown media type 60 | #[get("/", format = "")]
| ^^ | ^^
error: invalid or unknown media type error: invalid or unknown media type
--> $DIR/route-attribute-general-syntax.rs:76:21 --> $DIR/route-attribute-general-syntax.rs:63:21
| |
76 | #[get("/", format = "//")] //~ ERROR invalid or unknown media type 63 | #[get("/", format = "//")]
| ^^^^ | ^^^^
error: invalid or unknown media type error: invalid or unknown media type
--> $DIR/route-attribute-general-syntax.rs:79:21 --> $DIR/route-attribute-general-syntax.rs:66:21
| |
79 | #[get("/", format = "/")] //~ ERROR invalid or unknown media type 66 | #[get("/", format = "/")]
| ^^^ | ^^^
error: invalid or unknown media type error: invalid or unknown media type
--> $DIR/route-attribute-general-syntax.rs:82:21 --> $DIR/route-attribute-general-syntax.rs:69:21
| |
82 | #[get("/", format = "a/")] //~ ERROR invalid or unknown media type 69 | #[get("/", format = "a/")]
| ^^^^ | ^^^^
error: invalid or unknown media type error: invalid or unknown media type
--> $DIR/route-attribute-general-syntax.rs:85:21 --> $DIR/route-attribute-general-syntax.rs:72:21
| |
85 | #[get("/", format = "/a")] //~ ERROR invalid or unknown media type 72 | #[get("/", format = "/a")]
| ^^^^ | ^^^^
error: invalid or unknown media type error: invalid or unknown media type
--> $DIR/route-attribute-general-syntax.rs:88:21 --> $DIR/route-attribute-general-syntax.rs:75:21
| |
88 | #[get("/", format = "/a/")] //~ ERROR invalid or unknown media type 75 | #[get("/", format = "/a/")]
| ^^^^^ | ^^^^^
error: invalid or unknown media type error: invalid or unknown media type
--> $DIR/route-attribute-general-syntax.rs:91:21 --> $DIR/route-attribute-general-syntax.rs:78:21
| |
91 | #[get("/", format = "a/b/")] //~ ERROR invalid or unknown media type 78 | #[get("/", format = "a/b/")]
| ^^^^^^ | ^^^^^^
error: invalid or unknown media type error: invalid or unknown media type
--> $DIR/route-attribute-general-syntax.rs:94:21 --> $DIR/route-attribute-general-syntax.rs:81:21
| |
94 | #[get("/", format = "unknown")] //~ ERROR unknown media type 81 | #[get("/", format = "unknown")]
| ^^^^^^^^^ | ^^^^^^^^^
error: invalid value: expected string literal error: invalid value: expected string literal
--> $DIR/route-attribute-general-syntax.rs:97:21 --> $DIR/route-attribute-general-syntax.rs:84:21
| |
97 | #[get("/", format = 12)] //~ ERROR expected string 84 | #[get("/", format = 12)]
| ^^ | ^^
error: invalid value: expected string literal error: invalid value: expected string literal
--> $DIR/route-attribute-general-syntax.rs:100:21 --> $DIR/route-attribute-general-syntax.rs:87:21
| |
100 | #[get("/", format = 'j')] //~ ERROR expected string 87 | #[get("/", format = 'j')]
| ^^^ | ^^^
error: invalid or unknown media type error: invalid or unknown media type
--> $DIR/route-attribute-general-syntax.rs:103:21 --> $DIR/route-attribute-general-syntax.rs:90:21
| |
103 | #[get("/", format = "text//foo")] //~ ERROR invalid or unknown media type 90 | #[get("/", format = "text//foo")]
| ^^^^^^^^^^^ | ^^^^^^^^^^^
error: invalid HTTP method for route handlers error: invalid HTTP method for route handlers
--> $DIR/route-attribute-general-syntax.rs:108:9 --> $DIR/route-attribute-general-syntax.rs:95:9
| |
108 | #[route(CONNECT, "/")] //~ ERROR invalid HTTP method for route 95 | #[route(CONNECT, "/")]
| ^^^^^^^ | ^^^^^^^
| |
= 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: invalid HTTP method error: invalid HTTP method
--> $DIR/route-attribute-general-syntax.rs:112:9 --> $DIR/route-attribute-general-syntax.rs:98:9
| |
112 | #[route(FIX, "/")] //~ ERROR invalid HTTP method 98 | #[route(FIX, "/")]
| ^^^ | ^^^
| |
= 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: expected identifier, found string literal error: expected identifier, found string literal
--> $DIR/route-attribute-general-syntax.rs:116:9 --> $DIR/route-attribute-general-syntax.rs:101:9
| |
116 | #[route("hi", "/")] //~ ERROR expected identifier 101 | #[route("hi", "/")]
| ^^^^ | ^^^^
| |
= 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: expected identifier, found string literal error: expected identifier, found string literal
--> $DIR/route-attribute-general-syntax.rs:120:9 --> $DIR/route-attribute-general-syntax.rs:104:9
| |
120 | #[route("GET", "/")] //~ ERROR expected identifier 104 | #[route("GET", "/")]
| ^^^^^ | ^^^^^
| |
= 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: expected identifier, found integer literal error: expected identifier, found integer literal
--> $DIR/route-attribute-general-syntax.rs:124:9 --> $DIR/route-attribute-general-syntax.rs:107:9
| |
124 | #[route(120, "/")] //~ ERROR expected identifier 107 | #[route(120, "/")]
| ^^^ | ^^^
| |
= 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`

View File

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

View File

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

View File

@ -1,44 +1,44 @@
warning: 'application/x-custom' is not a known media type warning: 'application/x-custom' is not a known media type
--> $DIR/route-warnings.rs:7:21 --> $DIR/route-warnings.rs:7:21
| |
7 | #[get("/", format = "application/x-custom")] //~ WARNING not a known media type 7 | #[get("/", format = "application/x-custom")]
| ^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^
warning: 'x-custom/plain' is not a known media type warning: 'x-custom/plain' is not a known media type
--> $DIR/route-warnings.rs:10:21 --> $DIR/route-warnings.rs:10:21
| |
10 | #[get("/", format = "x-custom/plain")] //~ WARNING not a known media type 10 | #[get("/", format = "x-custom/plain")]
| ^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^
warning: 'x-custom/x-custom' is not a known media type warning: 'x-custom/x-custom' is not a known media type
--> $DIR/route-warnings.rs:13:21 --> $DIR/route-warnings.rs:13:21
| |
13 | #[get("/", format = "x-custom/x-custom")] //~ WARNING not a known media type 13 | #[get("/", format = "x-custom/x-custom")]
| ^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^
warning: `data` used with non-payload-supporting method warning: `data` used with non-payload-supporting method
--> $DIR/route-warnings.rs:18:12 --> $DIR/route-warnings.rs:18:12
| |
18 | #[get("/", data = "<_foo>")] //~ WARNING used with non-payload-supporting method 18 | #[get("/", data = "<_foo>")]
| ^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^
| |
note: 'GET' does not typically support payloads note: 'GET' does not typically support payloads
--> $DIR/route-warnings.rs:18:3 --> $DIR/route-warnings.rs:18:3
| |
18 | #[get("/", data = "<_foo>")] //~ WARNING used with non-payload-supporting method 18 | #[get("/", data = "<_foo>")]
| ^^^ | ^^^
= 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: `data` used with non-payload-supporting method warning: `data` used with non-payload-supporting method
--> $DIR/route-warnings.rs:21:13 --> $DIR/route-warnings.rs:21:13
| |
21 | #[head("/", data = "<_foo>")] //~ WARNING used with non-payload-supporting method 21 | #[head("/", data = "<_foo>")]
| ^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^
| |
note: 'HEAD' does not typically support payloads note: 'HEAD' does not typically support payloads
--> $DIR/route-warnings.rs:21:3 --> $DIR/route-warnings.rs:21:3
| |
21 | #[head("/", data = "<_foo>")] //~ WARNING used with non-payload-supporting method 21 | #[head("/", data = "<_foo>")]
| ^^^^ | ^^^^
= 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)

View File

@ -1,19 +1,19 @@
error: expected `,` error: expected `,`
--> $DIR/routes.rs:4:23 --> $DIR/routes.rs:4:23
| |
4 | let _ = routes![a b]; //~ ERROR expected `,` 4 | let _ = routes![a b];
| ^ | ^
error: expected identifier error: expected identifier
--> $DIR/routes.rs:6:24 --> $DIR/routes.rs:6:24
| |
6 | let _ = routes![a::, ]; //~ ERROR expected identifier 6 | let _ = routes![a::, ];
| ^ | ^
error: unexpected end of input, expected identifier error: unexpected end of input, expected identifier
--> $DIR/routes.rs:7:13 --> $DIR/routes.rs:7:13
| |
7 | let _ = routes![a::]; //~ ERROR expected identifier 7 | let _ = routes![a::];
| ^^^^^^^^^^^^ | ^^^^^^^^^^^^
| |
= 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)

View File

@ -1,7 +1,7 @@
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
--> $DIR/typed-uri-bad-type.rs:48:23 --> $DIR/typed-uri-bad-type.rs:42:23
| |
48 | uri!(simple: id = "hi"); 42 | uri!(simple: id = "hi");
| ^^^^ 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:
@ -11,9 +11,9 @@ error[E0277]: the trait bound `usize: rocket::http::uri::FromUriParam<rocket::ht
= note: required by `rocket::http::uri::FromUriParam::from_uri_param` = 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
--> $DIR/typed-uri-bad-type.rs:51:18 --> $DIR/typed-uri-bad-type.rs:44:18
| |
51 | uri!(simple: "hello"); 44 | uri!(simple: "hello");
| ^^^^^^^ 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:
@ -23,9 +23,9 @@ error[E0277]: the trait bound `usize: rocket::http::uri::FromUriParam<rocket::ht
= note: required by `rocket::http::uri::FromUriParam::from_uri_param` = 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
--> $DIR/typed-uri-bad-type.rs:54:23 --> $DIR/typed-uri-bad-type.rs:46:23
| |
54 | uri!(simple: id = 239239i64); 46 | uri!(simple: id = 239239i64);
| ^^^^^^^^^ 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:
@ -35,15 +35,15 @@ error[E0277]: the trait bound `usize: rocket::http::uri::FromUriParam<rocket::ht
= note: required by `rocket::http::uri::FromUriParam::from_uri_param` = 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
--> $DIR/typed-uri-bad-type.rs:57:31 --> $DIR/typed-uri-bad-type.rs:48:31
| |
57 | uri!(not_uri_display: 10, S); 48 | uri!(not_uri_display: 10, S);
| ^ the trait `rocket::http::uri::FromUriParam<rocket::http::uri::Path, _>` is not implemented for `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 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 --> $DIR/typed-uri-bad-type.rs:53:26
| |
63 | uri!(optionals: id = Some(10), name = Ok("bob".into())); 53 | 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` | ^^^^^^^^ 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:
@ -53,9 +53,9 @@ error[E0277]: the trait bound `i32: rocket::http::uri::FromUriParam<rocket::http
= note: required because of the requirements on the impl of `rocket::http::uri::FromUriParam<rocket::http::uri::Path, std::option::Option<{integer}>>` for `std::option::Option<i32>` = 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
--> $DIR/typed-uri-bad-type.rs:63:43 --> $DIR/typed-uri-bad-type.rs:53:43
| |
63 | uri!(optionals: id = Some(10), name = Ok("bob".into())); 53 | 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` | ^^^^^^^^^^^^^^^^ 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:
@ -67,9 +67,9 @@ error[E0277]: the trait bound `std::string::String: rocket::http::uri::FromUriPa
= note: required because of the requirements on the impl of `rocket::http::uri::FromUriParam<rocket::http::uri::Path, std::result::Result<_, _>>` for `std::result::Result<std::string::String, &rocket::http::RawStr>` = 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
--> $DIR/typed-uri-bad-type.rs:67:20 --> $DIR/typed-uri-bad-type.rs:55:20
| |
67 | uri!(simple_q: "hi"); 55 | uri!(simple_q: "hi");
| ^^^^ 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:
@ -79,9 +79,9 @@ error[E0277]: the trait bound `isize: rocket::http::uri::FromUriParam<rocket::ht
= note: required by `rocket::http::uri::FromUriParam::from_uri_param` = 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
--> $DIR/typed-uri-bad-type.rs:70:25 --> $DIR/typed-uri-bad-type.rs:57:25
| |
70 | uri!(simple_q: id = "hi"); 57 | uri!(simple_q: id = "hi");
| ^^^^ 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:
@ -91,24 +91,24 @@ error[E0277]: the trait bound `isize: rocket::http::uri::FromUriParam<rocket::ht
= 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
--> $DIR/typed-uri-bad-type.rs:73:24 --> $DIR/typed-uri-bad-type.rs:59:24
| |
73 | uri!(other_q: 100, S); 59 | uri!(other_q: 100, S);
| ^ 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[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
--> $DIR/typed-uri-bad-type.rs:76:26 --> $DIR/typed-uri-bad-type.rs:61:26
| |
76 | uri!(other_q: rest = S, id = 100); 61 | uri!(other_q: rest = S, id = 100);
| ^ 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[E0277]: the trait bound `S: rocket::http::uri::Ignorable<rocket::http::uri::Query>` is not satisfied 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 --> $DIR/typed-uri-bad-type.rs:36:29
| |
40 | fn other_q(id: usize, rest: S) { } 36 | fn other_q(id: usize, rest: S) { }
| ^ the trait `rocket::http::uri::Ignorable<rocket::http::uri::Query>` is not implemented for `S` | ^ the trait `rocket::http::uri::Ignorable<rocket::http::uri::Query>` is not implemented for `S`
... ...
79 | uri!(other_q: rest = _, id = 100); 63 | uri!(other_q: rest = _, id = 100);
| ---------------------------------- in this macro invocation | ---------------------------------- in this macro invocation
| |
::: $WORKSPACE/core/http/src/uri/uri_display.rs:465:40 ::: $WORKSPACE/core/http/src/uri/uri_display.rs:465:40
@ -119,12 +119,12 @@ error[E0277]: the trait bound `S: rocket::http::uri::Ignorable<rocket::http::uri
= 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[E0277]: the trait bound `usize: rocket::http::uri::Ignorable<rocket::http::uri::Query>` is not satisfied 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 --> $DIR/typed-uri-bad-type.rs:36:16
| |
40 | fn other_q(id: usize, rest: S) { } 36 | fn other_q(id: usize, rest: S) { }
| ^^^^^ the trait `rocket::http::uri::Ignorable<rocket::http::uri::Query>` is not implemented for `usize` | ^^^^^ the trait `rocket::http::uri::Ignorable<rocket::http::uri::Query>` is not implemented for `usize`
... ...
81 | uri!(other_q: rest = S, id = _); 65 | uri!(other_q: rest = S, id = _);
| -------------------------------- in this macro invocation | -------------------------------- in this macro invocation
| |
::: $WORKSPACE/core/http/src/uri/uri_display.rs:465:40 ::: $WORKSPACE/core/http/src/uri/uri_display.rs:465:40
@ -135,7 +135,7 @@ error[E0277]: the trait bound `usize: rocket::http::uri::Ignorable<rocket::http:
= 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[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
--> $DIR/typed-uri-bad-type.rs:81:26 --> $DIR/typed-uri-bad-type.rs:65:26
| |
81 | uri!(other_q: rest = S, id = _); 65 | 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`

View File

@ -1,246 +1,238 @@
error: path parameters cannot be ignored error: path parameters cannot be ignored
--> $DIR/typed-uris-bad-params.rs:77:37 --> $DIR/typed-uris-bad-params.rs:55:37
| |
77 | uri!(optionals: id = 10, name = _); 55 | uri!(optionals: id = 10, name = _);
| ^ | ^
error: path parameters cannot be ignored error: path parameters cannot be ignored
--> $DIR/typed-uris-bad-params.rs:74:26 --> $DIR/typed-uris-bad-params.rs:53:26
| |
74 | uri!(optionals: id = _, name = "bob".into()); 53 | uri!(optionals: id = _, name = "bob".into());
| ^ | ^
error: invalid parameters for `has_two` route uri error: invalid parameters for `has_two` route uri
--> $DIR/typed-uris-bad-params.rs:70:19 --> $DIR/typed-uris-bad-params.rs:51:19
| |
70 | uri!(has_two: id = 100, cookies = "hi"); //~ ERROR invalid parameters 51 | uri!(has_two: id = 100, cookies = "hi");
| ^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^
| |
= note: uri parameters are: id: i32, name: String = note: uri parameters are: id: i32, name: String
= help: missing parameter: `name` = help: missing parameter: `name`
help: unknown parameter: `cookies` help: unknown parameter: `cookies`
--> $DIR/typed-uris-bad-params.rs:70:29 --> $DIR/typed-uris-bad-params.rs:51:29
| |
70 | uri!(has_two: id = 100, cookies = "hi"); //~ ERROR invalid parameters 51 | uri!(has_two: id = 100, cookies = "hi");
| ^^^^^^^ | ^^^^^^^
error: invalid parameters for `has_two` route uri error: invalid parameters for `has_two` route uri
--> $DIR/typed-uris-bad-params.rs:65:19 --> $DIR/typed-uris-bad-params.rs:49:19
| |
65 | uri!(has_two: cookies = "hi", id = 100, id = 10, id = 10); //~ ERROR invalid parameters 49 | uri!(has_two: cookies = "hi", id = 100, id = 10, id = 10);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
= note: uri parameters are: id: i32, name: String = note: uri parameters are: id: i32, name: String
= help: missing parameter: `name` = help: missing parameter: `name`
help: unknown parameter: `cookies` help: unknown parameter: `cookies`
--> $DIR/typed-uris-bad-params.rs:65:19 --> $DIR/typed-uris-bad-params.rs:49:19
| |
65 | uri!(has_two: cookies = "hi", id = 100, id = 10, id = 10); //~ ERROR invalid parameters 49 | uri!(has_two: cookies = "hi", id = 100, id = 10, id = 10);
| ^^^^^^^ | ^^^^^^^
help: duplicate parameter: `id` help: duplicate parameter: `id`
--> $DIR/typed-uris-bad-params.rs:65:45 --> $DIR/typed-uris-bad-params.rs:49:45
| |
65 | uri!(has_two: cookies = "hi", id = 100, id = 10, id = 10); //~ ERROR invalid parameters 49 | uri!(has_two: cookies = "hi", id = 100, id = 10, id = 10);
| ^^ ^^ | ^^ ^^
error: invalid parameters for `has_two` route uri error: invalid parameters for `has_two` route uri
--> $DIR/typed-uris-bad-params.rs:62:19 --> $DIR/typed-uris-bad-params.rs:47:19
| |
62 | uri!(has_two: name = "hi"); //~ ERROR invalid parameters 47 | uri!(has_two: name = "hi");
| ^^^^^^^^^^^ | ^^^^^^^^^^^
| |
= note: uri parameters are: id: i32, name: String = note: uri parameters are: id: i32, name: String
= help: missing parameter: `id` = help: missing parameter: `id`
error: invalid parameters for `has_two` route uri error: invalid parameters for `has_two` route uri
--> $DIR/typed-uris-bad-params.rs:58:19 --> $DIR/typed-uris-bad-params.rs:45:19
| |
58 | uri!(has_two: id = 100, id = 100, ); //~ ERROR invalid parameters 45 | uri!(has_two: id = 100, id = 100, );
| ^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^
| |
= note: uri parameters are: id: i32, name: String = note: uri parameters are: id: i32, name: String
= help: missing parameter: `name` = help: missing parameter: `name`
help: duplicate parameter: `id` help: duplicate parameter: `id`
--> $DIR/typed-uris-bad-params.rs:58:29 --> $DIR/typed-uris-bad-params.rs:45:29
| |
58 | uri!(has_two: id = 100, id = 100, ); //~ ERROR invalid parameters 45 | uri!(has_two: id = 100, id = 100, );
| ^^ | ^^
error: invalid parameters for `has_one_guarded` route uri error: invalid parameters for `has_one_guarded` route uri
--> $DIR/typed-uris-bad-params.rs:55:27 --> $DIR/typed-uris-bad-params.rs:43:27
| |
55 | uri!(has_one_guarded: id = 100, cookies = "hi"); //~ ERROR invalid parameters 43 | uri!(has_one_guarded: id = 100, cookies = "hi");
| ^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^
| |
= note: uri parameters are: id: i32 = note: uri parameters are: id: i32
help: unknown parameter: `cookies` help: unknown parameter: `cookies`
--> $DIR/typed-uris-bad-params.rs:55:37 --> $DIR/typed-uris-bad-params.rs:43:37
| |
55 | uri!(has_one_guarded: id = 100, cookies = "hi"); //~ ERROR invalid parameters 43 | uri!(has_one_guarded: id = 100, cookies = "hi");
| ^^^^^^^ | ^^^^^^^
error: invalid parameters for `has_one_guarded` route uri error: invalid parameters for `has_one_guarded` route uri
--> $DIR/typed-uris-bad-params.rs:52:27 --> $DIR/typed-uris-bad-params.rs:41:27
| |
52 | uri!(has_one_guarded: cookies = "hi", id = 100); //~ ERROR invalid parameters 41 | uri!(has_one_guarded: cookies = "hi", id = 100);
| ^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^
| |
= note: uri parameters are: id: i32 = note: uri parameters are: id: i32
help: unknown parameter: `cookies` help: unknown parameter: `cookies`
--> $DIR/typed-uris-bad-params.rs:52:27 --> $DIR/typed-uris-bad-params.rs:41:27
| |
52 | uri!(has_one_guarded: cookies = "hi", id = 100); //~ ERROR invalid parameters 41 | uri!(has_one_guarded: cookies = "hi", id = 100);
| ^^^^^^^ | ^^^^^^^
error: invalid parameters for `has_one` route uri error: invalid parameters for `has_one` route uri
--> $DIR/typed-uris-bad-params.rs:48:19 --> $DIR/typed-uris-bad-params.rs:39:19
| |
48 | uri!(has_one: name = "hi"); //~ ERROR invalid parameters 39 | uri!(has_one: name = "hi");
| ^^^^^^^^^^^ | ^^^^^^^^^^^
| |
= note: uri parameters are: id: i32 = note: uri parameters are: id: i32
= help: missing parameter: `id` = help: missing parameter: `id`
help: unknown parameter: `name` help: unknown parameter: `name`
--> $DIR/typed-uris-bad-params.rs:48:19 --> $DIR/typed-uris-bad-params.rs:39:19
| |
48 | uri!(has_one: name = "hi"); //~ ERROR invalid parameters 39 | uri!(has_one: name = "hi");
| ^^^^ | ^^^^
error: invalid parameters for `has_one` route uri error: invalid parameters for `has_one` route uri
--> $DIR/typed-uris-bad-params.rs:45:19 --> $DIR/typed-uris-bad-params.rs:37:19
| |
45 | uri!(has_one: id = 100, id = 100, ); //~ ERROR invalid parameters 37 | uri!(has_one: id = 100, id = 100, );
| ^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^
| |
= note: uri parameters are: id: i32 = note: uri parameters are: id: i32
help: duplicate parameter: `id` help: duplicate parameter: `id`
--> $DIR/typed-uris-bad-params.rs:45:29 --> $DIR/typed-uris-bad-params.rs:37:29
| |
45 | uri!(has_one: id = 100, id = 100, ); //~ ERROR invalid parameters 37 | uri!(has_one: id = 100, id = 100, );
| ^^ | ^^
error: invalid parameters for `has_one` route uri error: invalid parameters for `has_one` route uri
--> $DIR/typed-uris-bad-params.rs:42:19 --> $DIR/typed-uris-bad-params.rs:35:19
| |
42 | uri!(has_one: id = 100, id = 100); //~ ERROR invalid parameters 35 | uri!(has_one: id = 100, id = 100);
| ^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^
| |
= note: uri parameters are: id: i32 = note: uri parameters are: id: i32
help: duplicate parameter: `id` help: duplicate parameter: `id`
--> $DIR/typed-uris-bad-params.rs:42:29 --> $DIR/typed-uris-bad-params.rs:35:29
| |
42 | uri!(has_one: id = 100, id = 100); //~ ERROR invalid parameters 35 | uri!(has_one: id = 100, id = 100);
| ^^ | ^^
error: invalid parameters for `has_one` route uri error: invalid parameters for `has_one` route uri
--> $DIR/typed-uris-bad-params.rs:38:19 --> $DIR/typed-uris-bad-params.rs:33:19
| |
38 | uri!(has_one: name = 100, age = 50, id = 100, id = 50); //~ ERROR invalid parameters 33 | uri!(has_one: name = 100, age = 50, id = 100, id = 50);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
= note: uri parameters are: id: i32 = note: uri parameters are: id: i32
help: unknown parameters: `name`, `age` help: unknown parameters: `name`, `age`
--> $DIR/typed-uris-bad-params.rs:38:19 --> $DIR/typed-uris-bad-params.rs:33:19
| |
38 | uri!(has_one: name = 100, age = 50, id = 100, id = 50); //~ ERROR invalid parameters 33 | uri!(has_one: name = 100, age = 50, id = 100, id = 50);
| ^^^^ ^^^ | ^^^^ ^^^
help: duplicate parameter: `id` help: duplicate parameter: `id`
--> $DIR/typed-uris-bad-params.rs:38:51 --> $DIR/typed-uris-bad-params.rs:33:51
| |
38 | uri!(has_one: name = 100, age = 50, id = 100, id = 50); //~ ERROR invalid parameters 33 | uri!(has_one: name = 100, age = 50, id = 100, id = 50);
| ^^ | ^^
error: invalid parameters for `has_one` route uri error: invalid parameters for `has_one` route uri
--> $DIR/typed-uris-bad-params.rs:35:19 --> $DIR/typed-uris-bad-params.rs:31:19
| |
35 | uri!(has_one: name = 100, age = 50, id = 100); //~ ERROR invalid parameters 31 | uri!(has_one: name = 100, age = 50, id = 100);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
= note: uri parameters are: id: i32 = note: uri parameters are: id: i32
help: unknown parameters: `name`, `age` help: unknown parameters: `name`, `age`
--> $DIR/typed-uris-bad-params.rs:35:19 --> $DIR/typed-uris-bad-params.rs:31:19
| |
35 | uri!(has_one: name = 100, age = 50, id = 100); //~ ERROR invalid parameters 31 | uri!(has_one: name = 100, age = 50, id = 100);
| ^^^^ ^^^ | ^^^^ ^^^
error: invalid parameters for `has_one` route uri
--> $DIR/typed-uris-bad-params.rs:32:19
|
32 | uri!(has_one: name = 100, id = 100); //~ ERROR invalid parameters
| ^^^^^^^^^^^^^^^^^^^^
|
= note: uri parameters are: id: i32
help: unknown parameter: `name`
--> $DIR/typed-uris-bad-params.rs:32:19
|
32 | uri!(has_one: name = 100, id = 100); //~ ERROR invalid parameters
| ^^^^
error: invalid parameters for `has_one` route uri error: invalid parameters for `has_one` route uri
--> $DIR/typed-uris-bad-params.rs:29:19 --> $DIR/typed-uris-bad-params.rs:29:19
| |
29 | uri!(has_one: id = 100, name = "hi"); //~ ERROR invalid parameters 29 | uri!(has_one: name = 100, id = 100);
| ^^^^^^^^^^^^^^^^^^^^
|
= note: uri parameters are: id: i32
help: unknown parameter: `name`
--> $DIR/typed-uris-bad-params.rs:29:19
|
29 | uri!(has_one: name = 100, id = 100);
| ^^^^
error: invalid parameters for `has_one` route uri
--> $DIR/typed-uris-bad-params.rs:27:19
|
27 | uri!(has_one: id = 100, name = "hi");
| ^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^
| |
= note: uri parameters are: id: i32 = note: uri parameters are: id: i32
help: unknown parameter: `name` help: unknown parameter: `name`
--> $DIR/typed-uris-bad-params.rs:29:29 --> $DIR/typed-uris-bad-params.rs:27:29
| |
29 | uri!(has_one: id = 100, name = "hi"); //~ ERROR invalid parameters 27 | uri!(has_one: id = 100, name = "hi");
| ^^^^ | ^^^^
error: `has_two` route uri expects 2 parameters but 1 was supplied error: `has_two` route uri expects 2 parameters but 1 was supplied
--> $DIR/typed-uris-bad-params.rs:27:19 --> $DIR/typed-uris-bad-params.rs:25:19
| |
27 | uri!(has_two: 10); //~ ERROR expects 2 parameters but 1 25 | uri!(has_two: 10);
| ^^ | ^^
| |
= note: expected parameters: id: i32, name: String = note: expected parameters: id: i32, name: String
error: `has_two` route uri expects 2 parameters but 3 were supplied error: `has_two` route uri expects 2 parameters but 3 were supplied
--> $DIR/typed-uris-bad-params.rs:26:19 --> $DIR/typed-uris-bad-params.rs:24:19
| |
26 | uri!(has_two: 10, "hi", "there"); //~ ERROR expects 2 parameters but 3 24 | uri!(has_two: 10, "hi", "there");
| ^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^
| |
= note: expected parameters: id: i32, name: String = note: expected parameters: id: i32, name: String
error: `has_one_guarded` route uri expects 1 parameter but 2 were supplied error: `has_one_guarded` route uri expects 1 parameter but 2 were supplied
--> $DIR/typed-uris-bad-params.rs:24:27 --> $DIR/typed-uris-bad-params.rs:22:27
| |
24 | uri!(has_one_guarded: "hi", 100); //~ ERROR expects 1 parameter but 2 22 | uri!(has_one_guarded: "hi", 100);
| ^^^^^^^^^ | ^^^^^^^^^
| |
= note: expected parameter: id: i32 = note: expected parameter: id: i32
error: `has_one` route uri expects 1 parameter but 2 were supplied error: `has_one` route uri expects 1 parameter but 2 were supplied
--> $DIR/typed-uris-bad-params.rs:23:19 --> $DIR/typed-uris-bad-params.rs:21:19
| |
23 | uri!(has_one: "Hello", 23, ); //~ ERROR expects 1 parameter but 2 21 | uri!(has_one: "Hello", 23, );
| ^^^^^^^^^^^^ | ^^^^^^^^^^^^
| |
= note: expected parameter: id: i32 = note: expected parameter: id: i32
error: `has_one` route uri expects 1 parameter but 2 were supplied error: `has_one` route uri expects 1 parameter but 2 were supplied
--> $DIR/typed-uris-bad-params.rs:22:19 --> $DIR/typed-uris-bad-params.rs:20:19
| |
22 | uri!(has_one: 1, 23); //~ ERROR expects 1 parameter but 2 20 | uri!(has_one: 1, 23);
| ^^^^^ | ^^^^^
| |
= note: expected parameter: id: i32 = note: expected parameter: id: i32
error: `has_one` route uri expects 1 parameter but 0 were supplied error: `has_one` route uri expects 1 parameter but 0 were supplied
--> $DIR/typed-uris-bad-params.rs:20:10 --> $DIR/typed-uris-bad-params.rs:18:10
| |
20 | uri!(has_one); //~ ERROR expects 1 parameter but 0 18 | uri!(has_one);
| ^^^^^^^ | ^^^^^^^
| |
= note: expected parameter: id: i32 = note: expected parameter: id: i32
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

@ -1,37 +1,37 @@
error: named and unnamed parameters cannot be mixed error: named and unnamed parameters cannot be mixed
--> $DIR/typed-uris-invalid-syntax.rs:7:18 --> $DIR/typed-uris-invalid-syntax.rs:7:18
| |
7 | uri!(simple: id = 100, "Hello"); //~ ERROR named and unnamed 7 | uri!(simple: id = 100, "Hello");
| ^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^
error: named and unnamed parameters cannot be mixed error: named and unnamed parameters cannot be mixed
--> $DIR/typed-uris-invalid-syntax.rs:8:18 --> $DIR/typed-uris-invalid-syntax.rs:8:18
| |
8 | uri!(simple: "Hello", id = 100); //~ ERROR named and unnamed 8 | uri!(simple: "Hello", id = 100);
| ^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^
error: expected `:` error: expected `:`
--> $DIR/typed-uris-invalid-syntax.rs:9:16 --> $DIR/typed-uris-invalid-syntax.rs:9:16
| |
9 | uri!(simple,); //~ ERROR expected `:` 9 | uri!(simple,);
| ^ | ^
error: expected argument list after `:` error: expected argument list after `:`
--> $DIR/typed-uris-invalid-syntax.rs:10:16 --> $DIR/typed-uris-invalid-syntax.rs:10:16
| |
10 | uri!(simple:); //~ ERROR argument list 10 | uri!(simple:);
| ^ | ^
error: unexpected end of input: expected ',' followed by route path error: unexpected end of input: expected ',' followed by route path
--> $DIR/typed-uris-invalid-syntax.rs:11:10 --> $DIR/typed-uris-invalid-syntax.rs:11:10
| |
11 | uri!("/mount"); //~ ERROR route path 11 | uri!("/mount");
| ^^^^^^^^ | ^^^^^^^^
error: unexpected end of input, expected identifier error: unexpected end of input, expected identifier
--> $DIR/typed-uris-invalid-syntax.rs:12:5 --> $DIR/typed-uris-invalid-syntax.rs:12:5
| |
12 | uri!("/mount",); //~ ERROR expected identifier 12 | uri!("/mount",);
| ^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^
| |
= 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)
@ -39,19 +39,19 @@ error: unexpected end of input, expected identifier
error: invalid mount point; mount points must be static, absolute URIs: `/example` error: invalid mount point; mount points must be static, absolute URIs: `/example`
--> $DIR/typed-uris-invalid-syntax.rs:13:10 --> $DIR/typed-uris-invalid-syntax.rs:13:10
| |
13 | uri!("mount", simple); //~ invalid mount point 13 | uri!("mount", simple);
| ^^^^^^^ | ^^^^^^^
error: invalid mount point; mount points must be static, absolute URIs: `/example` error: invalid mount point; mount points must be static, absolute URIs: `/example`
--> $DIR/typed-uris-invalid-syntax.rs:14:10 --> $DIR/typed-uris-invalid-syntax.rs:14:10
| |
14 | uri!("/mount/<id>", simple); //~ invalid mount point 14 | uri!("/mount/<id>", simple);
| ^^^^^^^^^^^^^ | ^^^^^^^^^^^^^
error: unexpected end of input, call to `uri!` cannot be empty error: unexpected end of input, call to `uri!` cannot be empty
--> $DIR/typed-uris-invalid-syntax.rs:15:5 --> $DIR/typed-uris-invalid-syntax.rs:15:5
| |
15 | uri!(); //~ unexpected end of input 15 | uri!();
| ^^^^^^^ | ^^^^^^^
| |
= 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)
@ -59,7 +59,7 @@ error: unexpected end of input, call to `uri!` cannot be empty
error: unexpected end of input, expected expression error: unexpected end of input, expected expression
--> $DIR/typed-uris-invalid-syntax.rs:16:5 --> $DIR/typed-uris-invalid-syntax.rs:16:5
| |
16 | uri!(simple: id = ); //~ expected expression 16 | uri!(simple: id = );
| ^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^
| |
= 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)

View File

@ -1,21 +1,47 @@
error: fieldless structs or variants are not supported error: fieldless structs or variants are not supported
--> $DIR/uri_display.rs:9:1 --> $DIR/uri_display.rs:4:8
| |
9 | struct Foo1; 4 | struct Foo1;
| ^^^^^^^^^^^^ | ^^^^
| |
note: error occurred while deriving `UriDisplay` note: error occurred while deriving `UriDisplay`
--> $DIR/uri_display.rs:5:10 --> $DIR/uri_display.rs:3:10
| |
5 | #[derive(UriDisplayQuery)] 3 | #[derive(UriDisplayQuery)]
| ^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^
= 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: fieldless structs or variants are not supported error: fieldless structs or variants are not supported
--> $DIR/uri_display.rs:16:1 --> $DIR/uri_display.rs:7:8
|
7 | struct Foo2();
| ^^^^
|
note: error occurred while deriving `UriDisplay`
--> $DIR/uri_display.rs:6:10
|
6 | #[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:10:11
| |
16 | struct Foo2(); 10 | enum Foo3 { }
| ^^^^^^^^^^^^^^ | ^^^
|
note: error occurred while deriving `UriDisplay`
--> $DIR/uri_display.rs:9:10
|
9 | #[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:14:5
|
14 | Variant,
| ^^^^^^^
| |
note: error occurred while deriving `UriDisplay` note: error occurred while deriving `UriDisplay`
--> $DIR/uri_display.rs:12:10 --> $DIR/uri_display.rs:12:10
@ -24,463 +50,82 @@ note: error occurred while deriving `UriDisplay`
| ^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^
= 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: empty enums are not supported
--> $DIR/uri_display.rs:23:1
|
23 | enum Foo3 { }
| ^^^^^^^^^^^^^
|
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,
| ^^^^^^^
|
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 error: tuple structs or variants must have exactly one field
--> $DIR/uri_display.rs:39:13 --> $DIR/uri_display.rs:18:12
| |
39 | struct Foo5(String, String); 18 | struct Foo5(String, String);
| ^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^
| |
note: error occurred while deriving `UriDisplay` note: error occurred while deriving `UriDisplay`
--> $DIR/uri_display.rs:35:10 --> $DIR/uri_display.rs:17:10
| |
35 | #[derive(UriDisplayQuery)] 17 | #[derive(UriDisplayQuery)]
| ^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^
= 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: invalid value: expected string literal error: invalid value: expected string literal
--> $DIR/uri_display.rs:47:20 --> $DIR/uri_display.rs:22:20
| |
47 | #[form(field = 123)] 22 | #[form(field = 123)]
| ^^^ | ^^^
| |
note: error occurred while deriving `UriDisplay` note: error occurred while deriving `UriDisplay`
--> $DIR/uri_display.rs:42:10 --> $DIR/uri_display.rs:20:10
| |
42 | #[derive(UriDisplayQuery)] 20 | #[derive(UriDisplayQuery)]
| ^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^
= 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: struct must have exactly one field error: struct must have exactly one field
--> $DIR/uri_display.rs:55:13 --> $DIR/uri_display.rs:27:12
| |
55 | struct Foo7(String, usize); 27 | struct Foo7(String, usize);
| ^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^
| |
note: error occurred while deriving `UriDisplay` note: error occurred while deriving `UriDisplay`
--> $DIR/uri_display.rs:52:10 --> $DIR/uri_display.rs:26:10
| |
52 | #[derive(UriDisplayPath)] 26 | #[derive(UriDisplayPath)]
| ^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^
= 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: struct must have exactly one field error: struct must have exactly one field
--> $DIR/uri_display.rs:61:1 --> $DIR/uri_display.rs:30:8
| |
61 | struct Foo8; 30 | struct Foo8;
| ^^^^^^^^^^^^ | ^^^^
| |
note: error occurred while deriving `UriDisplay` note: error occurred while deriving `UriDisplay`
--> $DIR/uri_display.rs:58:10 --> $DIR/uri_display.rs:29:10
| |
58 | #[derive(UriDisplayPath)] 29 | #[derive(UriDisplayPath)]
| ^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^
= 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: enums are not supported error: enums are not supported
--> $DIR/uri_display.rs:67:1 --> $DIR/uri_display.rs:33:1
| |
67 | enum Foo9 { } 33 | enum Foo9 { }
| ^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^
| |
note: error occurred while deriving `UriDisplay` note: error occurred while deriving `UriDisplay`
--> $DIR/uri_display.rs:64:10 --> $DIR/uri_display.rs:32:10
| |
64 | #[derive(UriDisplayPath)] 32 | #[derive(UriDisplayPath)]
| ^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^
= 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: named structs are not supported error: named structs are not supported
--> $DIR/uri_display.rs:73:1 --> $DIR/uri_display.rs:36:1
| |
73 | / struct Foo10 { 36 | / struct Foo10 {
74 | | //~^ ERROR not supported 37 | | named: usize
75 | | named: usize 38 | | }
76 | | }
| |_^ | |_^
| |
note: error occurred while deriving `UriDisplay` note: error occurred while deriving `UriDisplay`
--> $DIR/uri_display.rs:70:10 --> $DIR/uri_display.rs:35:10
| |
70 | #[derive(UriDisplayPath)] 35 | #[derive(UriDisplayPath)]
| ^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^
= 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[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

@ -7,52 +7,52 @@ error[E0277]: the trait bound `BadType: rocket::http::uri::UriDisplay<rocket::ht
= 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 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 --> $DIR/uri_display_type_errors.rs:10:5
| |
11 | field: BadType, 10 | field: BadType,
| ^^^^^^^^^^^^^^ the trait `rocket::http::uri::UriDisplay<rocket::http::uri::Query>` is not implemented for `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 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 --> $DIR/uri_display_type_errors.rs:16:5
| |
18 | bad: BadType, 16 | bad: BadType,
| ^^^^^^^^^^^^ the trait `rocket::http::uri::UriDisplay<rocket::http::uri::Query>` is not implemented for `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 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 --> $DIR/uri_display_type_errors.rs:21:11
| |
24 | Inner(BadType), 21 | Inner(BadType),
| ^^^^^^^ the trait `rocket::http::uri::UriDisplay<rocket::http::uri::Query>` is not implemented for `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`
= 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 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 --> $DIR/uri_display_type_errors.rs:27:9
| |
31 | field: BadType, 27 | field: BadType,
| ^^^^^^^^^^^^^^ the trait `rocket::http::uri::UriDisplay<rocket::http::uri::Query>` is not implemented for `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`
= 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 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 --> $DIR/uri_display_type_errors.rs:35:9
| |
40 | other: BadType, 35 | other: BadType,
| ^^^^^^^^^^^^^^ the trait `rocket::http::uri::UriDisplay<rocket::http::uri::Query>` is not implemented for `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`
= 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 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 --> $DIR/uri_display_type_errors.rs:40:12
| |
46 | struct Baz(BadType); 40 | struct Baz(BadType);
| ^^^^^^^ 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`

View File

@ -12,20 +12,6 @@ error: [note] this function must be `async`
7 | fn foo() { } 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 error: attribute can only be applied to `async` functions
--> $DIR/async-entry.rs:18:5 --> $DIR/async-entry.rs:18:5
| |
@ -42,124 +28,124 @@ error: [note] this function must be `async`
error: attribute cannot be applied to `main` function error: attribute cannot be applied to `main` function
--- note: this attribute generates a `main` function --- note: this attribute generates a `main` function
--> $DIR/async-entry.rs:55:5 --> $DIR/async-entry.rs:52:5
| |
55 | #[rocket::launch] 52 | #[rocket::launch]
| ^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^
| |
= 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: [note] this function cannot be `main` error: [note] this function cannot be `main`
--> $DIR/async-entry.rs:56:5 --> $DIR/async-entry.rs:53:8
| |
56 | fn main() -> rocket::Rocket { 53 | fn main() -> rocket::Rocket {
| ^^ | ^^^^
error: attribute can only be applied to functions that return a value error: attribute can only be applied to functions that return a value
--> $DIR/async-entry.rs:63:5 --> $DIR/async-entry.rs:59:5
| |
63 | #[rocket::launch] 59 | #[rocket::launch]
| ^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^
| |
= 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: [note] this function must return a value error: [note] this function must return a value
--> $DIR/async-entry.rs:64:5 --> $DIR/async-entry.rs:60:5
| |
64 | async fn rocket() { 60 | async fn rocket() {
| ^^^^^ | ^^^^^
error: attribute can only be applied to functions that return a value error: attribute can only be applied to functions that return a value
--> $DIR/async-entry.rs:72:5 --> $DIR/async-entry.rs:67:5
| |
72 | #[rocket::launch] 67 | #[rocket::launch]
| ^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^
| |
= 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: [note] this function must return a value error: [note] this function must return a value
--> $DIR/async-entry.rs:73:5 --> $DIR/async-entry.rs:68:5
| |
73 | fn rocket() { 68 | fn rocket() {
| ^^ | ^^
error: attribute cannot be applied to `main` function error: attribute cannot be applied to `main` function
--- note: this attribute generates a `main` function --- note: this attribute generates a `main` function
--> $DIR/async-entry.rs:89:5 --> $DIR/async-entry.rs:82:5
| |
89 | #[rocket::launch] 82 | #[rocket::launch]
| ^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^
| |
= 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: [note] this function cannot be `main` error: [note] this function cannot be `main`
--> $DIR/async-entry.rs:83:8
|
83 | fn main() -> &'static str {
| ^^^^
error: attribute cannot be applied to `main` function
--- note: this attribute generates a `main` function
--> $DIR/async-entry.rs:90:5 --> $DIR/async-entry.rs:90:5
| |
90 | fn main() -> &'static str { 90 | #[rocket::launch]
| ^^
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) = 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` error: [note] this function cannot be `main`
--> $DIR/async-entry.rs:99:5 --> $DIR/async-entry.rs:91:14
| |
99 | async fn main() -> rocket::Rocket { 91 | async fn main() -> rocket::Rocket {
| ^^^^^ | ^^^^
error[E0728]: `await` is only allowed inside `async` functions and blocks error[E0728]: `await` is only allowed inside `async` functions and blocks
--> $DIR/async-entry.rs:82:17 --> $DIR/async-entry.rs:76:17
| |
81 | fn rocket() -> rocket::Rocket { 75 | fn rocket() -> rocket::Rocket {
| ------ this is not `async` | ------ this is not `async`
82 | let _ = rocket::ignite().launch().await; 76 | let _ = rocket::ignite().launch().await;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ only allowed inside `async` functions and blocks | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ only allowed inside `async` functions and blocks
error[E0308]: mismatched types error[E0308]: mismatched types
--> $DIR/async-entry.rs:40:9 --> $DIR/async-entry.rs:38:9
| |
40 | rocket::ignite() 38 | rocket::ignite()
| ^^^^^^^^^^^^^^^^ expected struct `std::string::String`, found struct `rocket::rocket::Rocket` | ^^^^^^^^^^^^^^^^ expected struct `std::string::String`, found struct `rocket::rocket::Rocket`
error[E0308]: mismatched types error[E0308]: mismatched types
--> $DIR/async-entry.rs:49:9 --> $DIR/async-entry.rs:47:9
| |
49 | "hi".to_string() 47 | "hi".to_string()
| ^^^^^^^^^^^^^^^^ expected struct `rocket::rocket::Rocket`, found struct `std::string::String` | ^^^^^^^^^^^^^^^^ expected struct `rocket::rocket::Rocket`, found struct `std::string::String`
error[E0308]: mismatched types error[E0308]: mismatched types
--> $DIR/async-entry.rs:27:21 --> $DIR/async-entry.rs:26:21
| |
27 | async fn main() { 26 | async fn main() {
| ^ expected `()` because of default return type | ^ expected `()` because of default return type
| _____________________| | _____________________|
| | | |
28 | | //~^ ERROR mismatched types 27 | |
29 | | rocket::ignite() 28 | | rocket::ignite()
30 | | } 29 | | }
| | ^- help: try adding a semicolon: `;` | | ^- help: try adding a semicolon: `;`
| |_____| | |_____|
| expected `()`, found struct `rocket::rocket::Rocket` | expected `()`, found struct `rocket::rocket::Rocket`
error[E0308]: mismatched types error[E0308]: mismatched types
--> $DIR/async-entry.rs:37:26 --> $DIR/async-entry.rs:36:26
| |
37 | async fn rocket() -> String { 36 | async fn rocket() -> String {
| ^^^^^^ | ^^^^^^
| | | |
| expected struct `rocket::rocket::Rocket`, found struct `std::string::String` | expected struct `rocket::rocket::Rocket`, found struct `std::string::String`
| expected due to this | expected due to this
error[E0277]: `main` has invalid return type `rocket::rocket::Rocket` error[E0277]: `main` has invalid return type `rocket::rocket::Rocket`
--> $DIR/async-entry.rs:106:20 --> $DIR/async-entry.rs:97:20
| |
106 | async fn main() -> rocket::Rocket { 97 | async fn main() -> 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`

View File

@ -7,59 +7,59 @@ error: expected `fn`
error: expected `fn` error: expected `fn`
--- help: `#[catch]` can only be used on functions --- help: `#[catch]` can only be used on functions
--> $DIR/catch.rs:11:7 --> $DIR/catch.rs:9:7
| |
11 | const CATCH: &str = "Catcher"; 9 | const CATCH: &str = "Catcher";
| ^^^^^ | ^^^^^
error: invalid value: expected unsigned integer literal error: invalid value: expected unsigned integer literal
--- help: `#[catch]` expects a single status integer, e.g.: #[catch(404)] --- help: `#[catch]` expects a single status integer, e.g.: #[catch(404)]
--> $DIR/catch.rs:15:9 --> $DIR/catch.rs:11:9
| |
15 | #[catch("404")] //~ ERROR expected unsigned integer literal 11 | #[catch("404")]
| ^^^^^ | ^^^^^
error: unexpected keyed parameter: expected literal or identifier error: unexpected keyed parameter: expected literal or identifier
--- help: `#[catch]` expects a single status integer, e.g.: #[catch(404)] --- help: `#[catch]` expects a single status integer, e.g.: #[catch(404)]
--> $DIR/catch.rs:19:9 --> $DIR/catch.rs:14:9
| |
19 | #[catch(code = "404")] //~ ERROR unexpected keyed parameter 14 | #[catch(code = "404")]
| ^^^^ | ^^^^
error: unexpected keyed parameter: expected literal or identifier error: unexpected keyed parameter: expected literal or identifier
--- help: `#[catch]` expects a single status integer, e.g.: #[catch(404)] --- help: `#[catch]` expects a single status integer, e.g.: #[catch(404)]
--> $DIR/catch.rs:23:9 --> $DIR/catch.rs:17:9
| |
23 | #[catch(code = 404)] //~ ERROR unexpected keyed parameter 17 | #[catch(code = 404)]
| ^^^^ | ^^^^
error: status must be in range [100, 599] error: status must be in range [100, 599]
--- help: `#[catch]` expects a single status integer, e.g.: #[catch(404)] --- help: `#[catch]` expects a single status integer, e.g.: #[catch(404)]
--> $DIR/catch.rs:27:9 --> $DIR/catch.rs:20:9
| |
27 | #[catch(99)] //~ ERROR in range [100, 599] 20 | #[catch(99)]
| ^^ | ^^
error: status must be in range [100, 599] error: status must be in range [100, 599]
--- help: `#[catch]` expects a single status integer, e.g.: #[catch(404)] --- help: `#[catch]` expects a single status integer, e.g.: #[catch(404)]
--> $DIR/catch.rs:31:9 --> $DIR/catch.rs:23:9
| |
31 | #[catch(600)] //~ ERROR in range [100, 599] 23 | #[catch(600)]
| ^^^ | ^^^
error: unexpected attribute parameter: `message` error: unexpected attribute parameter: `message`
--- help: `#[catch]` expects a single status integer, e.g.: #[catch(404)] --- help: `#[catch]` expects a single status integer, e.g.: #[catch(404)]
--> $DIR/catch.rs:35:14 --> $DIR/catch.rs:26:14
| |
35 | #[catch(400, message = "foo")] //~ ERROR unexpected attribute parameter: `message` 26 | #[catch(400, message = "foo")]
| ^^^^^^^ | ^^^^^^^
error: invalid number of arguments: must be zero or one 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`
--> $DIR/catch.rs:40:7 --> $DIR/catch.rs:30:6
| |
40 | fn f3(_request: &Request, other: bool) { 30 | fn f3(_request: &Request, other: bool) { }
| ^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused import: `rocket::Request` warning: unused import: `rocket::Request`
--> $DIR/catch.rs:3:5 --> $DIR/catch.rs:3:5

View File

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

View File

@ -1,19 +1,19 @@
error: expected `,` error: expected `,`
--> $DIR/catchers.rs:4:25 --> $DIR/catchers.rs:4:25
| |
4 | let _ = catchers![a b]; //~ ERROR expected 4 | let _ = catchers![a b];
| ^ | ^
error: expected identifier error: expected identifier
--> $DIR/catchers.rs:6:26 --> $DIR/catchers.rs:6:26
| |
6 | let _ = catchers![a::, ]; //~ ERROR expected identifier 6 | let _ = catchers![a::, ];
| ^ | ^
error: unexpected end of input, expected identifier error: unexpected end of input, expected identifier
--> $DIR/catchers.rs:7:13 --> $DIR/catchers.rs:7:13
| |
7 | let _ = catchers![a::]; //~ ERROR expected identifier 7 | let _ = catchers![a::];
| ^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^
| |
= 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)

View File

@ -13,39 +13,53 @@ error: [note] error occurred while deriving `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: tuple structs are not supported error: tuple structs are not supported
--> $DIR/from_form.rs:10:1 --> $DIR/from_form.rs:9:1
| |
10 | struct Foo1; 9 | struct Foo1;
| ^^^^^^ | ^^^^^^
error: [note] error occurred while deriving `FromForm` error: [note] error occurred while deriving `FromForm`
--> $DIR/from_form.rs:9:10 --> $DIR/from_form.rs:8:10
| |
9 | #[derive(FromForm)] 8 | #[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: at least one field is required error: at least one field is required
--> $DIR/from_form.rs:14:1 --> $DIR/from_form.rs:12:13
| |
14 | struct Foo2 { } 12 | struct Foo2 { }
| ^^^^^^ | ^^^^
error: [note] error occurred while deriving `FromForm` error: [note] error occurred while deriving `FromForm`
--> $DIR/from_form.rs:13:10 --> $DIR/from_form.rs:11:10
| |
13 | #[derive(FromForm)] 11 | #[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: tuple structs are not supported error: tuple structs are not supported
--> $DIR/from_form.rs:18:1 --> $DIR/from_form.rs:15:1
| |
18 | struct Foo3(usize); 15 | struct Foo3(usize);
| ^^^^^^ | ^^^^^^
error: [note] error occurred while deriving `FromForm`
--> $DIR/from_form.rs:14:10
|
14 | #[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:18:25
|
18 | struct NextTodoTask<'f, 'a> {
| ^^
error: [note] error occurred while deriving `FromForm` error: [note] error occurred while deriving `FromForm`
--> $DIR/from_form.rs:17:10 --> $DIR/from_form.rs:17:10
| |
@ -54,50 +68,56 @@ error: [note] error occurred while deriving `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: 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 error: invalid form field name
--> $DIR/from_form.rs:32:20 --> $DIR/from_form.rs:27:20
| |
32 | #[form(field = "isindex")] 27 | #[form(field = "isindex")]
| ^^^^^^^^^ | ^^^^^^^^^
error: [note] error occurred while deriving `FromForm` error: [note] error occurred while deriving `FromForm`
--> $DIR/from_form.rs:30:10 --> $DIR/from_form.rs:25:10
| |
30 | #[derive(FromForm)] 25 | #[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: duplicate field name error: duplicate field name
--> $DIR/from_form.rs:41:5 --> $DIR/from_form.rs:35:5
| |
41 | foo: usize, 35 | foo: usize,
| ^^^ | ^^^
error: [note] previous definition here error: [note] previous definition here
--> $DIR/from_form.rs:39:20 --> $DIR/from_form.rs:33:20
| |
39 | #[form(field = "foo")] 33 | #[form(field = "foo")]
| ^^^^^ | ^^^^^
error: [note] error occurred while deriving `FromForm` error: [note] error occurred while deriving `FromForm`
--> $DIR/from_form.rs:37:10 --> $DIR/from_form.rs:31:10
| |
37 | #[derive(FromForm)] 31 | #[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:42:20
|
42 | #[form(field = "hello")]
| ^^^^^^^
error: [note] previous definition here
--> $DIR/from_form.rs:40:20
|
40 | #[form(field = "hello")]
| ^^^^^^^
error: [note] error occurred while deriving `FromForm`
--> $DIR/from_form.rs:38:10
|
38 | #[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)
@ -105,92 +125,100 @@ error: [note] error occurred while deriving `FromForm`
error: duplicate field name error: duplicate field name
--> $DIR/from_form.rs:49:20 --> $DIR/from_form.rs:49:20
| |
49 | #[form(field = "hello")] 49 | #[form(field = "first")]
| ^^^^^^^ | ^^^^^^^
error: [note] previous definition here error: [note] previous definition here
--> $DIR/from_form.rs:47:20 --> $DIR/from_form.rs:48:5
| |
47 | #[form(field = "hello")] 48 | first: String,
| ^^^^^^^
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` error: [note] error occurred while deriving `FromForm`
--> $DIR/from_form.rs:54:10 --> $DIR/from_form.rs:46:10
| |
54 | #[derive(FromForm)] 46 | #[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: duplicate attribute parameter: field error: duplicate attribute parameter: field
--> $DIR/from_form.rs:64:28 --> $DIR/from_form.rs:55:28
| |
64 | #[form(field = "blah", field = "bloo")] 55 | #[form(field = "blah", field = "bloo")]
| ^^^^^ | ^^^^^
error: [note] error occurred while deriving `FromForm` error: [note] error occurred while deriving `FromForm`
--> $DIR/from_form.rs:62:10 --> $DIR/from_form.rs:53:10
| |
62 | #[derive(FromForm)] 53 | #[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: malformed attribute: expected list error: malformed attribute: expected list
--- help: expected syntax: #[form(key = value, ..)] --- help: expected syntax: #[form(key = value, ..)]
--> $DIR/from_form.rs:71:7 --> $DIR/from_form.rs:61:7
| |
71 | #[form] 61 | #[form]
| ^^^^ | ^^^^
error: [note] error occurred while deriving `FromForm` error: [note] error occurred while deriving `FromForm`
--> $DIR/from_form.rs:69:10 --> $DIR/from_form.rs:59:10
| |
69 | #[derive(FromForm)] 59 | #[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: expected key/value pair error: expected key/value pair
--> $DIR/from_form.rs:78:12 --> $DIR/from_form.rs:67:12
| |
78 | #[form("blah")] 67 | #[form("blah")]
| ^^^^^^ | ^^^^^^
error: [note] error occurred while deriving `FromForm` error: [note] error occurred while deriving `FromForm`
--> $DIR/from_form.rs:76:10 --> $DIR/from_form.rs:65:10
| |
76 | #[derive(FromForm)] 65 | #[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: expected key/value pair error: expected key/value pair
--> $DIR/from_form.rs:85:12 --> $DIR/from_form.rs:73:12
| |
85 | #[form(123)] 73 | #[form(123)]
| ^^^ | ^^^
error: [note] error occurred while deriving `FromForm`
--> $DIR/from_form.rs:71:10
|
71 | #[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:79:12
|
79 | #[form(beep = "bop")]
| ^^^^
error: [note] error occurred while deriving `FromForm`
--> $DIR/from_form.rs:77:10
|
77 | #[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:86:7
|
86 | #[form(field = "bleh")]
| ^^^^
error: [note] error occurred while deriving `FromForm` error: [note] error occurred while deriving `FromForm`
--> $DIR/from_form.rs:83:10 --> $DIR/from_form.rs:83:10
| |
@ -199,11 +227,11 @@ error: [note] error occurred while deriving `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: unexpected attribute parameter: `beep` error: invalid value: expected string literal
--> $DIR/from_form.rs:92:12 --> $DIR/from_form.rs:92:20
| |
92 | #[form(beep = "bop")] 92 | #[form(field = true)]
| ^^^^ | ^^^^
error: [note] error occurred while deriving `FromForm` error: [note] error occurred while deriving `FromForm`
--> $DIR/from_form.rs:90:10 --> $DIR/from_form.rs:90:10
@ -213,58 +241,72 @@ error: [note] error occurred while deriving `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: duplicate invocation of `form` attribute error: expected literal or key/value pair
--> $DIR/from_form.rs:100:5 --> $DIR/from_form.rs:98:12
| |
100 | #[form(field = "bleh")] 98 | #[form(field)]
| ^ | ^^^^^
error: [note] error occurred while deriving `FromForm` error: [note] error occurred while deriving `FromForm`
--> $DIR/from_form.rs:97:10 --> $DIR/from_form.rs:96:10
| |
97 | #[derive(FromForm)] 96 | #[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: invalid value: expected string literal error: invalid value: expected string literal
--> $DIR/from_form.rs:107:20 --> $DIR/from_form.rs:104:20
| |
107 | #[form(field = true)] 104 | #[form(field = 123)]
| ^^^^
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` error: [note] error occurred while deriving `FromForm`
--> $DIR/from_form.rs:119:10 --> $DIR/from_form.rs:102:10
| |
119 | #[derive(FromForm)] 102 | #[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:110:20
|
110 | #[form(field = "hello&world")]
| ^^^^^^^^^^^^^
error: [note] error occurred while deriving `FromForm`
--> $DIR/from_form.rs:108:10
|
108 | #[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:116:20
|
116 | #[form(field = "!@#$%^&*()_")]
| ^^^^^^^^^^^^^
error: [note] error occurred while deriving `FromForm`
--> $DIR/from_form.rs:114:10
|
114 | #[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:122:20
|
122 | #[form(field = "?")]
| ^^^
error: [note] error occurred while deriving `FromForm`
--> $DIR/from_form.rs:120:10
|
120 | #[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)
@ -272,8 +314,8 @@ error: [note] error occurred while deriving `FromForm`
error: invalid form field name error: invalid form field name
--> $DIR/from_form.rs:128:20 --> $DIR/from_form.rs:128:20
| |
128 | #[form(field = "hello&world")] 128 | #[form(field = "")]
| ^^^^^^^^^^^^^ | ^^
error: [note] error occurred while deriving `FromForm` error: [note] error occurred while deriving `FromForm`
--> $DIR/from_form.rs:126:10 --> $DIR/from_form.rs:126:10
@ -284,71 +326,29 @@ error: [note] error occurred while deriving `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: invalid form field name error: invalid form field name
--> $DIR/from_form.rs:135:20 --> $DIR/from_form.rs:134:20
| |
135 | #[form(field = "!@#$%^&*()_")] 134 | #[form(field = "a&b")]
| ^^^^^^^^^^^^^
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` error: [note] error occurred while deriving `FromForm`
--> $DIR/from_form.rs:154:10 --> $DIR/from_form.rs:132:10
| |
154 | #[derive(FromForm)] 132 | #[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: invalid form field name error: invalid form field name
--> $DIR/from_form.rs:163:20 --> $DIR/from_form.rs:140:20
| |
163 | #[form(field = "a=")] 140 | #[form(field = "a=")]
| ^^^^ | ^^^^
error: [note] error occurred while deriving `FromForm` error: [note] error occurred while deriving `FromForm`
--> $DIR/from_form.rs:161:10 --> $DIR/from_form.rs:138:10
| |
161 | #[derive(FromForm)] 138 | #[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)

View File

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

View File

@ -13,67 +13,81 @@ error: [note] error occurred while deriving `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: tuple structs are not supported error: tuple structs are not supported
--> $DIR/from_form_value.rs:8:1 --> $DIR/from_form_value.rs:7:1
| |
8 | struct Foo2(usize); 7 | struct Foo2(usize);
| ^^^^^^ | ^^^^^^
error: [note] error occurred while deriving `FromFormValue` error: [note] error occurred while deriving `FromFormValue`
--> $DIR/from_form_value.rs:7:10 --> $DIR/from_form_value.rs:6:10
| |
7 | #[derive(FromFormValue)] 6 | #[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: named structs are not supported error: named structs are not supported
--> $DIR/from_form_value.rs:12:1 --> $DIR/from_form_value.rs:10:1
| |
12 | struct Foo3 { 10 | struct Foo3 {
| ^^^^^^ | ^^^^^^
error: [note] error occurred while deriving `FromFormValue` error: [note] error occurred while deriving `FromFormValue`
--> $DIR/from_form_value.rs:11:10 --> $DIR/from_form_value.rs:9:10
| |
11 | #[derive(FromFormValue)] 9 | #[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: variants cannot have fields error: variants cannot have fields
--> $DIR/from_form_value.rs:19:5 --> $DIR/from_form_value.rs:16:7
| |
19 | A(usize), 16 | A(usize),
| ^ | ^^^^^
error: [note] error occurred while deriving `FromFormValue` error: [note] error occurred while deriving `FromFormValue`
--> $DIR/from_form_value.rs:17:10 --> $DIR/from_form_value.rs:14:10
| |
17 | #[derive(FromFormValue)] 14 | #[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: enum must have at least one field error: enum must have at least one field
--> $DIR/from_form_value.rs:24:1 --> $DIR/from_form_value.rs:20:11
| |
24 | enum Foo5 { } 20 | enum Foo5 { }
| ^^^^ | ^^^
error: [note] error occurred while deriving `FromFormValue` error: [note] error occurred while deriving `FromFormValue`
--> $DIR/from_form_value.rs:23:10 --> $DIR/from_form_value.rs:19:10
| |
23 | #[derive(FromFormValue)] 19 | #[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: type generics are not supported error: type generics are not supported
--> $DIR/from_form_value.rs:28:11 --> $DIR/from_form_value.rs:23:11
| |
28 | enum Foo6<T> { 23 | enum Foo6<T> {
| ^ | ^
error: [note] error occurred while deriving `FromFormValue`
--> $DIR/from_form_value.rs:22:10
|
22 | #[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:29:20
|
29 | #[form(value = 123)]
| ^^^
error: [note] error occurred while deriving `FromFormValue` error: [note] error occurred while deriving `FromFormValue`
--> $DIR/from_form_value.rs:27:10 --> $DIR/from_form_value.rs:27:10
| |
@ -82,11 +96,11 @@ error: [note] error occurred while deriving `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: invalid value: expected string literal error: expected literal or key/value pair
--> $DIR/from_form_value.rs:35:20 --> $DIR/from_form_value.rs:35:12
| |
35 | #[form(value = 123)] 35 | #[form(value)]
| ^^^ | ^^^^^
error: [note] error occurred while deriving `FromFormValue` error: [note] error occurred while deriving `FromFormValue`
--> $DIR/from_form_value.rs:33:10 --> $DIR/from_form_value.rs:33:10
@ -95,17 +109,3 @@ error: [note] error occurred while deriving `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: 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

@ -1,15 +1,15 @@
error[E0277]: the trait bound `u8: rocket::response::Responder<'_, '_>` is not satisfied error[E0277]: the trait bound `u8: rocket::response::Responder<'_, '_>` is not satisfied
--> $DIR/responder-types.rs:9:5 --> $DIR/responder-types.rs:5:5
| |
9 | thing: u8, 5 | thing: u8,
| ^^^^^ the trait `rocket::response::Responder<'_, '_>` is not implemented for `u8` | ^^^^^ the trait `rocket::response::Responder<'_, '_>` is not implemented for `u8`
| |
= note: required by `rocket::response::Responder::respond_to` = note: required by `rocket::response::Responder::respond_to`
error[E0277]: the trait bound `rocket::http::Header<'_>: std::convert::From<u8>` is not satisfied error[E0277]: the trait bound `rocket::http::Header<'_>: std::convert::From<u8>` is not satisfied
--> $DIR/responder-types.rs:16:5 --> $DIR/responder-types.rs:11:5
| |
16 | other: u8, 11 | other: 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:
@ -18,17 +18,17 @@ error[E0277]: the trait bound `rocket::http::Header<'_>: std::convert::From<u8>`
= 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
--> $DIR/responder-types.rs:22:5 --> $DIR/responder-types.rs:16:5
| |
22 | thing: u8, 16 | thing: u8,
| ^^^^^ the trait `rocket::response::Responder<'_, '_>` is not implemented for `u8` | ^^^^^ the trait `rocket::response::Responder<'_, '_>` is not implemented for `u8`
| |
= note: required by `rocket::response::Responder::respond_to` = note: required by `rocket::response::Responder::respond_to`
error[E0277]: the trait bound `rocket::http::Header<'_>: std::convert::From<u8>` is not satisfied error[E0277]: the trait bound `rocket::http::Header<'_>: std::convert::From<u8>` is not satisfied
--> $DIR/responder-types.rs:24:5 --> $DIR/responder-types.rs:17:5
| |
24 | other: u8, 17 | other: 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:
@ -37,9 +37,9 @@ error[E0277]: the trait bound `rocket::http::Header<'_>: std::convert::From<u8>`
= 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
--> $DIR/responder-types.rs:32:5 --> $DIR/responder-types.rs:24:5
| |
32 | then: String, 24 | then: String,
| ^^^^ 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:
@ -48,9 +48,9 @@ error[E0277]: the trait bound `rocket::http::Header<'_>: std::convert::From<std:
= 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
--> $DIR/responder-types.rs:37:13 --> $DIR/responder-types.rs:28:13
| |
37 | fn foo() -> usize { 0 } 28 | fn foo() -> usize { 0 }
| ^^^^^ 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`

View File

@ -1,206 +1,206 @@
error: missing expected parameter: `path` error: missing expected parameter: `path`
--> $DIR/route-attribute-general-syntax.rs:5:1 --> $DIR/route-attribute-general-syntax.rs:4:1
| |
5 | #[get()] //~ ERROR missing expected parameter 4 | #[get()]
| ^^^^^^^^ | ^^^^^^^^
| |
= 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 `fn` error: expected `fn`
--- help: #[get] can only be used on functions --- help: #[get] can only be used on functions
--> $DIR/route-attribute-general-syntax.rs:11:1 --> $DIR/route-attribute-general-syntax.rs:9:1
| |
11 | struct S; 9 | struct S;
| ^^^^^^ | ^^^^^^
error: expected `fn` error: expected `fn`
--- help: #[get] can only be used on functions --- help: #[get] can only be used on functions
--> $DIR/route-attribute-general-syntax.rs:16:1 --> $DIR/route-attribute-general-syntax.rs:12:1
| |
16 | enum A { } 12 | enum A { }
| ^^^^ | ^^^^
error: expected `fn` error: expected `fn`
--- help: #[get] can only be used on functions --- help: #[get] can only be used on functions
--> $DIR/route-attribute-general-syntax.rs:21:1 --> $DIR/route-attribute-general-syntax.rs:15:1
| |
21 | trait Foo { } 15 | trait Foo { }
| ^^^^^ | ^^^^^
error: expected `fn` error: expected `fn`
--- help: #[get] can only be used on functions --- help: #[get] can only be used on functions
--> $DIR/route-attribute-general-syntax.rs:26:1 --> $DIR/route-attribute-general-syntax.rs:18:1
| |
26 | impl S { } 18 | impl S { }
| ^^^^ | ^^^^
error: expected key/value pair error: expected key/value pair
--> $DIR/route-attribute-general-syntax.rs:32:12 --> $DIR/route-attribute-general-syntax.rs:21:12
| |
32 | #[get("/", 123)] //~ ERROR expected 21 | #[get("/", 123)]
| ^^^ | ^^^
error: expected key/value pair error: expected key/value pair
--> $DIR/route-attribute-general-syntax.rs:35:12 --> $DIR/route-attribute-general-syntax.rs:24:12
| |
35 | #[get("/", "/")] //~ ERROR expected 24 | #[get("/", "/")]
| ^^^ | ^^^
error: unexpected keyed parameter: expected literal or identifier error: unexpected keyed parameter: expected literal or identifier
--> $DIR/route-attribute-general-syntax.rs:38:7 --> $DIR/route-attribute-general-syntax.rs:27:7
| |
38 | #[get(data = "<foo>", "/")] //~ ERROR unexpected keyed parameter 27 | #[get(data = "<foo>", "/")]
| ^^^^ | ^^^^
error: unexpected attribute parameter: `unknown` error: unexpected attribute parameter: `unknown`
--> $DIR/route-attribute-general-syntax.rs:41:12 --> $DIR/route-attribute-general-syntax.rs:30:12
| |
41 | #[get("/", unknown = "foo")] //~ ERROR unexpected 30 | #[get("/", unknown = "foo")]
| ^^^^^^^ | ^^^^^^^
error: malformed attribute error: malformed attribute
--- help: expected syntax: #[get(key = value, ..)] --- help: expected syntax: #[get(key = value, ..)]
--> $DIR/route-attribute-general-syntax.rs:44:1 --> $DIR/route-attribute-general-syntax.rs:33:1
| |
44 | #[get("/", ...)] //~ ERROR malformed 33 | #[get("/", ...)]
| ^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^
| |
= 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: handler arguments cannot be ignored error: handler arguments cannot be ignored
--- help: all handler arguments must be of the form: `ident: Type` --- help: all handler arguments must be of the form: `ident: Type`
--> $DIR/route-attribute-general-syntax.rs:51:7 --> $DIR/route-attribute-general-syntax.rs:39:7
| |
51 | fn c1(_: usize) {} //~ ERROR cannot be ignored 39 | fn c1(_: usize) {}
| ^ | ^
error: invalid value: expected string literal error: invalid value: expected string literal
--> $DIR/route-attribute-general-syntax.rs:56:7 --> $DIR/route-attribute-general-syntax.rs:43:7
| |
56 | #[get(100)] //~ ERROR expected string 43 | #[get(100)]
| ^^^ | ^^^
error: invalid value: expected string literal error: invalid value: expected string literal
--> $DIR/route-attribute-general-syntax.rs:59:7 --> $DIR/route-attribute-general-syntax.rs:46:7
| |
59 | #[get('/')] //~ ERROR expected string 46 | #[get('/')]
| ^^^ | ^^^
error: invalid value: expected integer literal error: invalid value: expected integer literal
--> $DIR/route-attribute-general-syntax.rs:62:19 --> $DIR/route-attribute-general-syntax.rs:49:19
| |
62 | #[get("/", rank = "1")] //~ ERROR expected integer 49 | #[get("/", rank = "1")]
| ^^^ | ^^^
error: invalid value: expected integer literal error: invalid value: expected integer literal
--> $DIR/route-attribute-general-syntax.rs:65:19 --> $DIR/route-attribute-general-syntax.rs:52:19
| |
65 | #[get("/", rank = '1')] //~ ERROR expected integer 52 | #[get("/", rank = '1')]
| ^^^ | ^^^
error: invalid or unknown media type error: invalid or unknown media type
--> $DIR/route-attribute-general-syntax.rs:70:21 --> $DIR/route-attribute-general-syntax.rs:57:21
| |
70 | #[get("/", format = "applicationx-custom")] //~ ERROR invalid or unknown media type 57 | #[get("/", format = "applicationx-custom")]
| ^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^
error: invalid or unknown media type error: invalid or unknown media type
--> $DIR/route-attribute-general-syntax.rs:73:21 --> $DIR/route-attribute-general-syntax.rs:60:21
| |
73 | #[get("/", format = "")] //~ ERROR invalid or unknown media type 60 | #[get("/", format = "")]
| ^^ | ^^
error: invalid or unknown media type error: invalid or unknown media type
--> $DIR/route-attribute-general-syntax.rs:76:21 --> $DIR/route-attribute-general-syntax.rs:63:21
| |
76 | #[get("/", format = "//")] //~ ERROR invalid or unknown media type 63 | #[get("/", format = "//")]
| ^^^^ | ^^^^
error: invalid or unknown media type error: invalid or unknown media type
--> $DIR/route-attribute-general-syntax.rs:79:21 --> $DIR/route-attribute-general-syntax.rs:66:21
| |
79 | #[get("/", format = "/")] //~ ERROR invalid or unknown media type 66 | #[get("/", format = "/")]
| ^^^ | ^^^
error: invalid or unknown media type error: invalid or unknown media type
--> $DIR/route-attribute-general-syntax.rs:82:21 --> $DIR/route-attribute-general-syntax.rs:69:21
| |
82 | #[get("/", format = "a/")] //~ ERROR invalid or unknown media type 69 | #[get("/", format = "a/")]
| ^^^^ | ^^^^
error: invalid or unknown media type error: invalid or unknown media type
--> $DIR/route-attribute-general-syntax.rs:85:21 --> $DIR/route-attribute-general-syntax.rs:72:21
| |
85 | #[get("/", format = "/a")] //~ ERROR invalid or unknown media type 72 | #[get("/", format = "/a")]
| ^^^^ | ^^^^
error: invalid or unknown media type error: invalid or unknown media type
--> $DIR/route-attribute-general-syntax.rs:88:21 --> $DIR/route-attribute-general-syntax.rs:75:21
| |
88 | #[get("/", format = "/a/")] //~ ERROR invalid or unknown media type 75 | #[get("/", format = "/a/")]
| ^^^^^ | ^^^^^
error: invalid or unknown media type error: invalid or unknown media type
--> $DIR/route-attribute-general-syntax.rs:91:21 --> $DIR/route-attribute-general-syntax.rs:78:21
| |
91 | #[get("/", format = "a/b/")] //~ ERROR invalid or unknown media type 78 | #[get("/", format = "a/b/")]
| ^^^^^^ | ^^^^^^
error: invalid or unknown media type error: invalid or unknown media type
--> $DIR/route-attribute-general-syntax.rs:94:21 --> $DIR/route-attribute-general-syntax.rs:81:21
| |
94 | #[get("/", format = "unknown")] //~ ERROR unknown media type 81 | #[get("/", format = "unknown")]
| ^^^^^^^^^ | ^^^^^^^^^
error: invalid value: expected string literal error: invalid value: expected string literal
--> $DIR/route-attribute-general-syntax.rs:97:21 --> $DIR/route-attribute-general-syntax.rs:84:21
| |
97 | #[get("/", format = 12)] //~ ERROR expected string 84 | #[get("/", format = 12)]
| ^^ | ^^
error: invalid value: expected string literal error: invalid value: expected string literal
--> $DIR/route-attribute-general-syntax.rs:100:21 --> $DIR/route-attribute-general-syntax.rs:87:21
| |
100 | #[get("/", format = 'j')] //~ ERROR expected string 87 | #[get("/", format = 'j')]
| ^^^ | ^^^
error: invalid or unknown media type error: invalid or unknown media type
--> $DIR/route-attribute-general-syntax.rs:103:21 --> $DIR/route-attribute-general-syntax.rs:90:21
| |
103 | #[get("/", format = "text//foo")] //~ ERROR invalid or unknown media type 90 | #[get("/", format = "text//foo")]
| ^^^^^^^^^^^ | ^^^^^^^^^^^
error: invalid HTTP method for route handlers error: invalid HTTP method for route handlers
--- 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`
--> $DIR/route-attribute-general-syntax.rs:108:9 --> $DIR/route-attribute-general-syntax.rs:95:9
| |
108 | #[route(CONNECT, "/")] //~ ERROR invalid HTTP method for route 95 | #[route(CONNECT, "/")]
| ^^^^^^^ | ^^^^^^^
error: invalid HTTP method error: invalid HTTP method
--- 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`
--> $DIR/route-attribute-general-syntax.rs:112:9 --> $DIR/route-attribute-general-syntax.rs:98:9
| |
112 | #[route(FIX, "/")] //~ ERROR invalid HTTP method 98 | #[route(FIX, "/")]
| ^^^ | ^^^
error: expected identifier, found string literal error: expected identifier, found string 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`
--> $DIR/route-attribute-general-syntax.rs:116:9 --> $DIR/route-attribute-general-syntax.rs:101:9
| |
116 | #[route("hi", "/")] //~ ERROR expected identifier 101 | #[route("hi", "/")]
| ^^^^ | ^^^^
error: expected identifier, found string literal error: expected identifier, found string 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`
--> $DIR/route-attribute-general-syntax.rs:120:9 --> $DIR/route-attribute-general-syntax.rs:104:9
| |
120 | #[route("GET", "/")] //~ ERROR expected identifier 104 | #[route("GET", "/")]
| ^^^^^ | ^^^^^
error: expected identifier, found integer literal 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`
--> $DIR/route-attribute-general-syntax.rs:124:9 --> $DIR/route-attribute-general-syntax.rs:107:9
| |
124 | #[route(120, "/")] //~ ERROR expected identifier 107 | #[route(120, "/")]
| ^^^ | ^^^

View File

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

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

View File

@ -1,19 +1,19 @@
error: expected `,` error: expected `,`
--> $DIR/routes.rs:4:23 --> $DIR/routes.rs:4:23
| |
4 | let _ = routes![a b]; //~ ERROR expected `,` 4 | let _ = routes![a b];
| ^ | ^
error: expected identifier error: expected identifier
--> $DIR/routes.rs:6:24 --> $DIR/routes.rs:6:24
| |
6 | let _ = routes![a::, ]; //~ ERROR expected identifier 6 | let _ = routes![a::, ];
| ^ | ^
error: unexpected end of input, expected identifier error: unexpected end of input, expected identifier
--> $DIR/routes.rs:7:13 --> $DIR/routes.rs:7:13
| |
7 | let _ = routes![a::]; //~ ERROR expected identifier 7 | let _ = routes![a::];
| ^^^^^^^^^^^^ | ^^^^^^^^^^^^
| |
= 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)

View File

@ -1,7 +1,7 @@
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
--> $DIR/typed-uri-bad-type.rs:48:23 --> $DIR/typed-uri-bad-type.rs:42:23
| |
48 | uri!(simple: id = "hi"); 42 | uri!(simple: id = "hi");
| ^^^^ 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:
@ -11,9 +11,9 @@ error[E0277]: the trait bound `usize: rocket::http::uri::FromUriParam<rocket::ht
= note: required by `rocket::http::uri::FromUriParam::from_uri_param` = 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
--> $DIR/typed-uri-bad-type.rs:51:18 --> $DIR/typed-uri-bad-type.rs:44:18
| |
51 | uri!(simple: "hello"); 44 | uri!(simple: "hello");
| ^^^^^^^ 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:
@ -23,9 +23,9 @@ error[E0277]: the trait bound `usize: rocket::http::uri::FromUriParam<rocket::ht
= note: required by `rocket::http::uri::FromUriParam::from_uri_param` = 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
--> $DIR/typed-uri-bad-type.rs:54:23 --> $DIR/typed-uri-bad-type.rs:46:23
| |
54 | uri!(simple: id = 239239i64); 46 | uri!(simple: id = 239239i64);
| ^^^^^^^^^ 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:
@ -35,15 +35,15 @@ error[E0277]: the trait bound `usize: rocket::http::uri::FromUriParam<rocket::ht
= note: required by `rocket::http::uri::FromUriParam::from_uri_param` = 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
--> $DIR/typed-uri-bad-type.rs:57:31 --> $DIR/typed-uri-bad-type.rs:48:31
| |
57 | uri!(not_uri_display: 10, S); 48 | uri!(not_uri_display: 10, S);
| ^ the trait `rocket::http::uri::FromUriParam<rocket::http::uri::Path, _>` is not implemented for `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 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 --> $DIR/typed-uri-bad-type.rs:53:26
| |
63 | uri!(optionals: id = Some(10), name = Ok("bob".into())); 53 | 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` | ^^^^ 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:
@ -53,9 +53,9 @@ error[E0277]: the trait bound `i32: rocket::http::uri::FromUriParam<rocket::http
= note: required because of the requirements on the impl of `rocket::http::uri::FromUriParam<rocket::http::uri::Path, std::option::Option<{integer}>>` for `std::option::Option<i32>` = 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
--> $DIR/typed-uri-bad-type.rs:63:43 --> $DIR/typed-uri-bad-type.rs:53:43
| |
63 | uri!(optionals: id = Some(10), name = Ok("bob".into())); 53 | 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` | ^^ 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:
@ -67,9 +67,9 @@ error[E0277]: the trait bound `std::string::String: rocket::http::uri::FromUriPa
= note: required because of the requirements on the impl of `rocket::http::uri::FromUriParam<rocket::http::uri::Path, std::result::Result<_, _>>` for `std::result::Result<std::string::String, &rocket::http::RawStr>` = 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
--> $DIR/typed-uri-bad-type.rs:67:20 --> $DIR/typed-uri-bad-type.rs:55:20
| |
67 | uri!(simple_q: "hi"); 55 | uri!(simple_q: "hi");
| ^^^^ 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:
@ -79,9 +79,9 @@ error[E0277]: the trait bound `isize: rocket::http::uri::FromUriParam<rocket::ht
= note: required by `rocket::http::uri::FromUriParam::from_uri_param` = 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
--> $DIR/typed-uri-bad-type.rs:70:25 --> $DIR/typed-uri-bad-type.rs:57:25
| |
70 | uri!(simple_q: id = "hi"); 57 | uri!(simple_q: id = "hi");
| ^^^^ 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:
@ -91,24 +91,24 @@ error[E0277]: the trait bound `isize: rocket::http::uri::FromUriParam<rocket::ht
= 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
--> $DIR/typed-uri-bad-type.rs:73:24 --> $DIR/typed-uri-bad-type.rs:59:24
| |
73 | uri!(other_q: 100, S); 59 | uri!(other_q: 100, S);
| ^ 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[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
--> $DIR/typed-uri-bad-type.rs:76:26 --> $DIR/typed-uri-bad-type.rs:61:26
| |
76 | uri!(other_q: rest = S, id = 100); 61 | uri!(other_q: rest = S, id = 100);
| ^ 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[E0277]: the trait bound `S: rocket::http::uri::Ignorable<rocket::http::uri::Query>` is not satisfied 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 --> $DIR/typed-uri-bad-type.rs:36:29
| |
40 | fn other_q(id: usize, rest: S) { } 36 | fn other_q(id: usize, rest: S) { }
| ^ the trait `rocket::http::uri::Ignorable<rocket::http::uri::Query>` is not implemented for `S` | ^ the trait `rocket::http::uri::Ignorable<rocket::http::uri::Query>` is not implemented for `S`
... ...
79 | uri!(other_q: rest = _, id = 100); 63 | uri!(other_q: rest = _, id = 100);
| ---------------------------------- in this macro invocation | ---------------------------------- in this macro invocation
| |
::: $WORKSPACE/core/http/src/uri/uri_display.rs:465:40 ::: $WORKSPACE/core/http/src/uri/uri_display.rs:465:40
@ -119,12 +119,12 @@ error[E0277]: the trait bound `S: rocket::http::uri::Ignorable<rocket::http::uri
= 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[E0277]: the trait bound `usize: rocket::http::uri::Ignorable<rocket::http::uri::Query>` is not satisfied 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 --> $DIR/typed-uri-bad-type.rs:36:16
| |
40 | fn other_q(id: usize, rest: S) { } 36 | fn other_q(id: usize, rest: S) { }
| ^^^^^ the trait `rocket::http::uri::Ignorable<rocket::http::uri::Query>` is not implemented for `usize` | ^^^^^ the trait `rocket::http::uri::Ignorable<rocket::http::uri::Query>` is not implemented for `usize`
... ...
81 | uri!(other_q: rest = S, id = _); 65 | uri!(other_q: rest = S, id = _);
| -------------------------------- in this macro invocation | -------------------------------- in this macro invocation
| |
::: $WORKSPACE/core/http/src/uri/uri_display.rs:465:40 ::: $WORKSPACE/core/http/src/uri/uri_display.rs:465:40
@ -135,7 +135,7 @@ error[E0277]: the trait bound `usize: rocket::http::uri::Ignorable<rocket::http:
= 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[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
--> $DIR/typed-uri-bad-type.rs:81:26 --> $DIR/typed-uri-bad-type.rs:65:26
| |
81 | uri!(other_q: rest = S, id = _); 65 | 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`

View File

@ -1,313 +1,233 @@
error: path parameters cannot be ignored error: path parameters cannot be ignored
--> $DIR/typed-uris-bad-params.rs:77:37 --> $DIR/typed-uris-bad-params.rs:55:37
| |
77 | uri!(optionals: id = 10, name = _); 55 | uri!(optionals: id = 10, name = _);
| ^ | ^
error: path parameters cannot be ignored error: path parameters cannot be ignored
--> $DIR/typed-uris-bad-params.rs:74:26 --> $DIR/typed-uris-bad-params.rs:53:26
| |
74 | uri!(optionals: id = _, name = "bob".into()); 53 | uri!(optionals: id = _, name = "bob".into());
| ^ | ^
error: macro expansion ignores token `compile_error` and any following error: invalid parameters for `has_two` route uri
--> $DIR/typed-uris-bad-params.rs:70:29 --- note: uri parameters are: id: i32, name: String
--- help: missing parameter: `name`
--> $DIR/typed-uris-bad-params.rs:51:19
| |
13 | #[post("/<id>?<name>")] 51 | uri!(has_two: id = 100, cookies = "hi");
| ------------------------ help: you might be missing a semicolon here: `;` | ^^
| |
| caused by the macro expansion here error: [help] unknown parameter: `cookies`
... --> $DIR/typed-uris-bad-params.rs:51:29
70 | uri!(has_two: id = 100, cookies = "hi"); //~ ERROR invalid parameters |
51 | uri!(has_two: id = 100, cookies = "hi");
| ^^^^^^^ | ^^^^^^^
|
= note: the usage of `rocket::rocket_internal_uri!` is likely invalid in expression context
error: invalid parameters for `has_two` route uri error: invalid parameters for `has_two` route uri
--- note: uri parameters are: id: i32, name: String --- note: uri parameters are: id: i32, name: String
--- help: missing parameter: `name` --- help: missing parameter: `name`
--> $DIR/typed-uris-bad-params.rs:70:19 --> $DIR/typed-uris-bad-params.rs:49:19
| |
70 | uri!(has_two: id = 100, cookies = "hi"); //~ ERROR invalid parameters 49 | uri!(has_two: cookies = "hi", id = 100, id = 10, id = 10);
| ^^
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 error: [help] unknown parameter: `cookies`
--- note: uri parameters are: id: i32, name: String --> $DIR/typed-uris-bad-params.rs:49:19
--- 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 49 | uri!(has_two: cookies = "hi", id = 100, id = 10, id = 10);
| ^^^^^^^ | ^^^^^^^
error: [help] duplicate parameter: `id`
--> $DIR/typed-uris-bad-params.rs:49:45
|
49 | uri!(has_two: cookies = "hi", id = 100, id = 10, id = 10);
| ^^
error: invalid parameters for `has_two` route uri error: invalid parameters for `has_two` route uri
--- note: uri parameters are: id: i32, name: String --- note: uri parameters are: id: i32, name: String
--- help: missing parameter: `id` --- help: missing parameter: `id`
--> $DIR/typed-uris-bad-params.rs:62:19 --> $DIR/typed-uris-bad-params.rs:47:19
| |
62 | uri!(has_two: name = "hi"); //~ ERROR invalid parameters 47 | uri!(has_two: name = "hi");
| ^^^^ | ^^^^
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 error: invalid parameters for `has_two` route uri
--- note: uri parameters are: id: i32, name: String --- note: uri parameters are: id: i32, name: String
--- help: missing parameter: `name` --- 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 --> $DIR/typed-uris-bad-params.rs:45:19
| |
45 | uri!(has_one: id = 100, id = 100, ); //~ ERROR invalid parameters 45 | uri!(has_two: id = 100, id = 100, );
| ^^ | ^^
error: macro expansion ignores token `compile_error` and any following error: [help] duplicate parameter: `id`
--> $DIR/typed-uris-bad-params.rs:42:29 --> $DIR/typed-uris-bad-params.rs:45:29
| |
7 | #[post("/<id>")] 45 | uri!(has_two: id = 100, id = 100, );
| ----------------- 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
| ^^ | ^^
error: invalid parameters for `has_one_guarded` route uri
--- note: uri parameters are: id: i32
--> $DIR/typed-uris-bad-params.rs:43:27
| |
= note: the usage of `rocket::rocket_internal_uri!` is likely invalid in expression context 43 | uri!(has_one_guarded: id = 100, cookies = "hi");
| ^^
error: [help] unknown parameter: `cookies`
--> $DIR/typed-uris-bad-params.rs:43:37
|
43 | uri!(has_one_guarded: id = 100, cookies = "hi");
| ^^^^^^^
error: invalid parameters for `has_one_guarded` route uri
--- note: uri parameters are: id: i32
--> $DIR/typed-uris-bad-params.rs:41:27
|
41 | uri!(has_one_guarded: cookies = "hi", id = 100);
| ^^^^^^^
error: [help] unknown parameter: `cookies`
--> $DIR/typed-uris-bad-params.rs:41:27
|
41 | uri!(has_one_guarded: cookies = "hi", id = 100);
| ^^^^^^^
error: invalid parameters for `has_one` route uri error: invalid parameters for `has_one` route uri
--- note: uri parameters are: id: i32 --- note: uri parameters are: id: i32
--> $DIR/typed-uris-bad-params.rs:42:19 --- help: missing parameter: `id`
--> $DIR/typed-uris-bad-params.rs:39:19
| |
42 | uri!(has_one: id = 100, id = 100); //~ ERROR invalid parameters 39 | uri!(has_one: name = "hi");
| ^^^^
error: [help] unknown parameter: `name`
--> $DIR/typed-uris-bad-params.rs:39:19
|
39 | uri!(has_one: name = "hi");
| ^^^^
error: invalid parameters for `has_one` route uri
--- note: uri parameters are: id: i32
--> $DIR/typed-uris-bad-params.rs:37:19
|
37 | uri!(has_one: id = 100, id = 100, );
| ^^ | ^^
error: macro expansion ignores token `compile_error` and any following error: [help] duplicate parameter: `id`
--> $DIR/typed-uris-bad-params.rs:38:19 --> $DIR/typed-uris-bad-params.rs:37:29
| |
7 | #[post("/<id>")] 37 | uri!(has_one: id = 100, id = 100, );
| ----------------- 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 error: invalid parameters for `has_one` route uri
--- note: uri parameters are: id: i32 --- note: uri parameters are: id: i32
--> $DIR/typed-uris-bad-params.rs:35:19 --> $DIR/typed-uris-bad-params.rs:35:19
| |
35 | uri!(has_one: name = 100, age = 50, id = 100); //~ ERROR invalid parameters 35 | uri!(has_one: id = 100, id = 100);
| ^^^^ | ^^
error: macro expansion ignores token `compile_error` and any following error: [help] duplicate parameter: `id`
--> $DIR/typed-uris-bad-params.rs:32:19 --> $DIR/typed-uris-bad-params.rs:35:29
| |
7 | #[post("/<id>")] 35 | uri!(has_one: id = 100, id = 100);
| ----------------- 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 error: invalid parameters for `has_one` route uri
--- note: uri parameters are: id: i32 --- note: uri parameters are: id: i32
--> $DIR/typed-uris-bad-params.rs:32:19 --> $DIR/typed-uris-bad-params.rs:33:19
| |
32 | uri!(has_one: name = 100, id = 100); //~ ERROR invalid parameters 33 | uri!(has_one: name = 100, age = 50, id = 100, id = 50);
| ^^^^ | ^^^^
error: macro expansion ignores token `compile_error` and any following error: [help] unknown parameters: `name`, `age`
--> $DIR/typed-uris-bad-params.rs:29:29 --> $DIR/typed-uris-bad-params.rs:33:19
| |
7 | #[post("/<id>")] 33 | uri!(has_one: name = 100, age = 50, id = 100, id = 50);
| ----------------- help: you might be missing a semicolon here: `;` | ^^^^
| |
| caused by the macro expansion here error: [help] duplicate parameter: `id`
... --> $DIR/typed-uris-bad-params.rs:33:51
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 33 | uri!(has_one: name = 100, age = 50, id = 100, id = 50);
| ^^
error: invalid parameters for `has_one` route uri
--- note: uri parameters are: id: i32
--> $DIR/typed-uris-bad-params.rs:31:19
|
31 | uri!(has_one: name = 100, age = 50, id = 100);
| ^^^^
error: [help] unknown parameters: `name`, `age`
--> $DIR/typed-uris-bad-params.rs:31:19
|
31 | uri!(has_one: name = 100, age = 50, id = 100);
| ^^^^
error: invalid parameters for `has_one` route uri error: invalid parameters for `has_one` route uri
--- note: uri parameters are: id: i32 --- note: uri parameters are: id: i32
--> $DIR/typed-uris-bad-params.rs:29:19 --> $DIR/typed-uris-bad-params.rs:29:19
| |
29 | uri!(has_one: id = 100, name = "hi"); //~ ERROR invalid parameters 29 | uri!(has_one: name = 100, id = 100);
| ^^^^
error: [help] unknown parameter: `name`
--> $DIR/typed-uris-bad-params.rs:29:19
|
29 | uri!(has_one: name = 100, id = 100);
| ^^^^
error: invalid parameters for `has_one` route uri
--- note: uri parameters are: id: i32
--> $DIR/typed-uris-bad-params.rs:27:19
|
27 | uri!(has_one: id = 100, name = "hi");
| ^^ | ^^
error: [help] unknown parameter: `name`
--> $DIR/typed-uris-bad-params.rs:27:29
|
27 | uri!(has_one: id = 100, name = "hi");
| ^^^^
error: `has_two` route uri expects 2 parameters but 1 was supplied error: `has_two` route uri expects 2 parameters but 1 was supplied
--- note: expected parameters: id: i32, name: String --- note: expected parameters: id: i32, name: String
--> $DIR/typed-uris-bad-params.rs:27:19 --> $DIR/typed-uris-bad-params.rs:25:19
| |
27 | uri!(has_two: 10); //~ ERROR expects 2 parameters but 1 25 | uri!(has_two: 10);
| ^^ | ^^
error: `has_two` route uri expects 2 parameters but 3 were supplied error: `has_two` route uri expects 2 parameters but 3 were supplied
--- note: expected parameters: id: i32, name: String --- note: expected parameters: id: i32, name: String
--> $DIR/typed-uris-bad-params.rs:26:19 --> $DIR/typed-uris-bad-params.rs:24:19
| |
26 | uri!(has_two: 10, "hi", "there"); //~ ERROR expects 2 parameters but 3 24 | uri!(has_two: 10, "hi", "there");
| ^^ | ^^
error: `has_one_guarded` route uri expects 1 parameter but 2 were supplied error: `has_one_guarded` route uri expects 1 parameter but 2 were supplied
--- note: expected parameter: id: i32 --- note: expected parameter: id: i32
--> $DIR/typed-uris-bad-params.rs:24:27 --> $DIR/typed-uris-bad-params.rs:22:27
| |
24 | uri!(has_one_guarded: "hi", 100); //~ ERROR expects 1 parameter but 2 22 | uri!(has_one_guarded: "hi", 100);
| ^^^^ | ^^^^
error: `has_one` route uri expects 1 parameter but 2 were supplied error: `has_one` route uri expects 1 parameter but 2 were supplied
--- note: expected parameter: id: i32 --- note: expected parameter: id: i32
--> $DIR/typed-uris-bad-params.rs:23:19 --> $DIR/typed-uris-bad-params.rs:21:19
| |
23 | uri!(has_one: "Hello", 23, ); //~ ERROR expects 1 parameter but 2 21 | uri!(has_one: "Hello", 23, );
| ^^^^^^^ | ^^^^^^^
error: `has_one` route uri expects 1 parameter but 2 were supplied error: `has_one` route uri expects 1 parameter but 2 were supplied
--- note: expected parameter: id: i32 --- note: expected parameter: id: i32
--> $DIR/typed-uris-bad-params.rs:22:19 --> $DIR/typed-uris-bad-params.rs:20:19
| |
22 | uri!(has_one: 1, 23); //~ ERROR expects 1 parameter but 2 20 | uri!(has_one: 1, 23);
| ^ | ^
error: `has_one` route uri expects 1 parameter but 0 were supplied error: `has_one` route uri expects 1 parameter but 0 were supplied
--- note: expected parameter: id: i32 --- note: expected parameter: id: i32
--> $DIR/typed-uris-bad-params.rs:20:10 --> $DIR/typed-uris-bad-params.rs:18:10
| |
20 | uri!(has_one); //~ ERROR expects 1 parameter but 0 18 | uri!(has_one);
| ^^^^^^^ | ^^^^^^^
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

@ -1,37 +1,37 @@
error: named and unnamed parameters cannot be mixed error: named and unnamed parameters cannot be mixed
--> $DIR/typed-uris-invalid-syntax.rs:7:18 --> $DIR/typed-uris-invalid-syntax.rs:7:18
| |
7 | uri!(simple: id = 100, "Hello"); //~ ERROR named and unnamed 7 | uri!(simple: id = 100, "Hello");
| ^^ | ^^
error: named and unnamed parameters cannot be mixed error: named and unnamed parameters cannot be mixed
--> $DIR/typed-uris-invalid-syntax.rs:8:18 --> $DIR/typed-uris-invalid-syntax.rs:8:18
| |
8 | uri!(simple: "Hello", id = 100); //~ ERROR named and unnamed 8 | uri!(simple: "Hello", id = 100);
| ^^^^^^^ | ^^^^^^^
error: expected `:` error: expected `:`
--> $DIR/typed-uris-invalid-syntax.rs:9:16 --> $DIR/typed-uris-invalid-syntax.rs:9:16
| |
9 | uri!(simple,); //~ ERROR expected `:` 9 | uri!(simple,);
| ^ | ^
error: expected argument list after `:` error: expected argument list after `:`
--> $DIR/typed-uris-invalid-syntax.rs:10:16 --> $DIR/typed-uris-invalid-syntax.rs:10:16
| |
10 | uri!(simple:); //~ ERROR argument list 10 | uri!(simple:);
| ^ | ^
error: unexpected end of input: expected ',' followed by route path error: unexpected end of input: expected ',' followed by route path
--> $DIR/typed-uris-invalid-syntax.rs:11:10 --> $DIR/typed-uris-invalid-syntax.rs:11:10
| |
11 | uri!("/mount"); //~ ERROR route path 11 | uri!("/mount");
| ^^^^^^^^ | ^^^^^^^^
error: unexpected end of input, expected identifier error: unexpected end of input, expected identifier
--> $DIR/typed-uris-invalid-syntax.rs:12:5 --> $DIR/typed-uris-invalid-syntax.rs:12:5
| |
12 | uri!("/mount",); //~ ERROR expected identifier 12 | uri!("/mount",);
| ^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^
| |
= 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)
@ -39,19 +39,19 @@ error: unexpected end of input, expected identifier
error: invalid mount point; mount points must be static, absolute URIs: `/example` error: invalid mount point; mount points must be static, absolute URIs: `/example`
--> $DIR/typed-uris-invalid-syntax.rs:13:10 --> $DIR/typed-uris-invalid-syntax.rs:13:10
| |
13 | uri!("mount", simple); //~ invalid mount point 13 | uri!("mount", simple);
| ^^^^^^^ | ^^^^^^^
error: invalid mount point; mount points must be static, absolute URIs: `/example` error: invalid mount point; mount points must be static, absolute URIs: `/example`
--> $DIR/typed-uris-invalid-syntax.rs:14:10 --> $DIR/typed-uris-invalid-syntax.rs:14:10
| |
14 | uri!("/mount/<id>", simple); //~ invalid mount point 14 | uri!("/mount/<id>", simple);
| ^^^^^^^^^^^^^ | ^^^^^^^^^^^^^
error: unexpected end of input, call to `uri!` cannot be empty error: unexpected end of input, call to `uri!` cannot be empty
--> $DIR/typed-uris-invalid-syntax.rs:15:5 --> $DIR/typed-uris-invalid-syntax.rs:15:5
| |
15 | uri!(); //~ unexpected end of input 15 | uri!();
| ^^^^^^^ | ^^^^^^^
| |
= 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)
@ -59,7 +59,7 @@ error: unexpected end of input, call to `uri!` cannot be empty
error: unexpected end of input, expected expression error: unexpected end of input, expected expression
--> $DIR/typed-uris-invalid-syntax.rs:16:5 --> $DIR/typed-uris-invalid-syntax.rs:16:5
| |
16 | uri!(simple: id = ); //~ expected expression 16 | uri!(simple: id = );
| ^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^
| |
= 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)

View File

@ -1,22 +1,50 @@
error: fieldless structs or variants are not supported error: fieldless structs or variants are not supported
--> $DIR/uri_display.rs:9:1 --> $DIR/uri_display.rs:4:8
| |
9 | struct Foo1; 4 | struct Foo1;
| ^^^^^^ | ^^^^
error: [note] error occurred while deriving `UriDisplay` error: [note] error occurred while deriving `UriDisplay`
--> $DIR/uri_display.rs:5:10 --> $DIR/uri_display.rs:3:10
| |
5 | #[derive(UriDisplayQuery)] 3 | #[derive(UriDisplayQuery)]
| ^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^
| |
= 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: fieldless structs or variants are not supported error: fieldless structs or variants are not supported
--> $DIR/uri_display.rs:16:1 --> $DIR/uri_display.rs:7:8
|
7 | struct Foo2();
| ^^^^
error: [note] error occurred while deriving `UriDisplay`
--> $DIR/uri_display.rs:6:10
|
6 | #[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:10:11
| |
16 | struct Foo2(); 10 | enum Foo3 { }
| ^^^^^^ | ^^^
error: [note] error occurred while deriving `UriDisplay`
--> $DIR/uri_display.rs:9:10
|
9 | #[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:14:5
|
14 | Variant,
| ^^^^^^^
error: [note] error occurred while deriving `UriDisplay` error: [note] error occurred while deriving `UriDisplay`
--> $DIR/uri_display.rs:12:10 --> $DIR/uri_display.rs:12:10
@ -26,468 +54,86 @@ error: [note] error occurred while deriving `UriDisplay`
| |
= 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: 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 error: tuple structs or variants must have exactly one field
--> $DIR/uri_display.rs:39:13 --> $DIR/uri_display.rs:18:12
| |
39 | struct Foo5(String, String); 18 | struct Foo5(String, String);
| ^^^^^^ | ^^^^^^^^^^^^^^^^
error: [note] error occurred while deriving `UriDisplay` error: [note] error occurred while deriving `UriDisplay`
--> $DIR/uri_display.rs:35:10 --> $DIR/uri_display.rs:17:10
| |
35 | #[derive(UriDisplayQuery)] 17 | #[derive(UriDisplayQuery)]
| ^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^
| |
= 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: invalid value: expected string literal error: invalid value: expected string literal
--> $DIR/uri_display.rs:47:20 --> $DIR/uri_display.rs:22:20
| |
47 | #[form(field = 123)] 22 | #[form(field = 123)]
| ^^^ | ^^^
error: [note] error occurred while deriving `UriDisplay` error: [note] error occurred while deriving `UriDisplay`
--> $DIR/uri_display.rs:42:10 --> $DIR/uri_display.rs:20:10
| |
42 | #[derive(UriDisplayQuery)] 20 | #[derive(UriDisplayQuery)]
| ^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^
| |
= 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: struct must have exactly one field error: struct must have exactly one field
--> $DIR/uri_display.rs:55:13 --> $DIR/uri_display.rs:27:12
| |
55 | struct Foo7(String, usize); 27 | struct Foo7(String, usize);
| ^^^^^^ | ^^^^^^^^^^^^^^^
error: [note] error occurred while deriving `UriDisplay` error: [note] error occurred while deriving `UriDisplay`
--> $DIR/uri_display.rs:52:10 --> $DIR/uri_display.rs:26:10
| |
52 | #[derive(UriDisplayPath)] 26 | #[derive(UriDisplayPath)]
| ^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^
| |
= 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: struct must have exactly one field error: struct must have exactly one field
--> $DIR/uri_display.rs:61:1 --> $DIR/uri_display.rs:30:8
| |
61 | struct Foo8; 30 | struct Foo8;
| ^^^^^^ | ^^^^
error: [note] error occurred while deriving `UriDisplay` error: [note] error occurred while deriving `UriDisplay`
--> $DIR/uri_display.rs:58:10 --> $DIR/uri_display.rs:29:10
| |
58 | #[derive(UriDisplayPath)] 29 | #[derive(UriDisplayPath)]
| ^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^
| |
= 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: enums are not supported error: enums are not supported
--> $DIR/uri_display.rs:67:1 --> $DIR/uri_display.rs:33:1
| |
67 | enum Foo9 { } 33 | enum Foo9 { }
| ^^^^ | ^^^^
error: [note] error occurred while deriving `UriDisplay` error: [note] error occurred while deriving `UriDisplay`
--> $DIR/uri_display.rs:64:10 --> $DIR/uri_display.rs:32:10
| |
64 | #[derive(UriDisplayPath)] 32 | #[derive(UriDisplayPath)]
| ^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^
| |
= 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: named structs are not supported error: named structs are not supported
--> $DIR/uri_display.rs:73:1 --> $DIR/uri_display.rs:36:1
| |
73 | struct Foo10 { 36 | struct Foo10 {
| ^^^^^^ | ^^^^^^
error: [note] error occurred while deriving `UriDisplay` error: [note] error occurred while deriving `UriDisplay`
--> $DIR/uri_display.rs:70:10 --> $DIR/uri_display.rs:35:10
| |
70 | #[derive(UriDisplayPath)] 35 | #[derive(UriDisplayPath)]
| ^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^
| |
= 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[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

@ -7,52 +7,52 @@ error[E0277]: the trait bound `BadType: rocket::http::uri::UriDisplay<rocket::ht
= 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 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 --> $DIR/uri_display_type_errors.rs:10:5
| |
11 | field: BadType, 10 | field: BadType,
| ^^^^^ the trait `rocket::http::uri::UriDisplay<rocket::http::uri::Query>` is not implemented for `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 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 --> $DIR/uri_display_type_errors.rs:16:5
| |
18 | bad: BadType, 16 | bad: BadType,
| ^^^ the trait `rocket::http::uri::UriDisplay<rocket::http::uri::Query>` is not implemented for `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 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 --> $DIR/uri_display_type_errors.rs:21:11
| |
24 | Inner(BadType), 21 | Inner(BadType),
| ^^^^^^^ the trait `rocket::http::uri::UriDisplay<rocket::http::uri::Query>` is not implemented for `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`
= 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 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 --> $DIR/uri_display_type_errors.rs:27:9
| |
31 | field: BadType, 27 | field: BadType,
| ^^^^^ the trait `rocket::http::uri::UriDisplay<rocket::http::uri::Query>` is not implemented for `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`
= 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 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 --> $DIR/uri_display_type_errors.rs:35:9
| |
40 | other: BadType, 35 | other: BadType,
| ^^^^^ the trait `rocket::http::uri::UriDisplay<rocket::http::uri::Query>` is not implemented for `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`
= 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 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 --> $DIR/uri_display_type_errors.rs:40:12
| |
46 | struct Baz(BadType); 40 | struct Baz(BadType);
| ^^^^^^^ 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`

View File

@ -5,19 +5,18 @@
mod main_a { mod main_a {
#[rocket::main] #[rocket::main]
fn foo() { } fn foo() { }
//~^^ ERROR `async`
} }
mod main_b { mod main_b {
#[rocket::main] #[rocket::main]
async fn foo() { } async fn foo() { }
//~^^ WARNING `main`
} }
mod main_d { mod main_d {
#[rocket::main] #[rocket::main]
fn main() { fn main() {
//~^^ ERROR `async`
let _ = rocket::ignite().launch().await; let _ = rocket::ignite().launch().await;
} }
} }
@ -25,7 +24,7 @@ mod main_d {
mod main_f { mod main_f {
#[rocket::main] #[rocket::main]
async fn main() { async fn main() {
//~^ ERROR mismatched types
rocket::ignite() rocket::ignite()
} }
} }
@ -35,10 +34,9 @@ mod main_f {
mod launch_a { mod launch_a {
#[rocket::launch] #[rocket::launch]
async fn rocket() -> String { async fn rocket() -> String {
//~^ ERROR mismatched types
let _ = rocket::ignite().launch().await; let _ = rocket::ignite().launch().await;
rocket::ignite() rocket::ignite()
//~^ ERROR mismatched types
} }
} }
@ -47,14 +45,12 @@ mod launch_b {
async fn rocket() -> rocket::Rocket { async fn rocket() -> rocket::Rocket {
let _ = rocket::ignite().launch().await; let _ = rocket::ignite().launch().await;
"hi".to_string() "hi".to_string()
//~^ ERROR mismatched types
} }
} }
mod launch_c { mod launch_c {
#[rocket::launch] #[rocket::launch]
fn main() -> rocket::Rocket { fn main() -> rocket::Rocket {
//~^^ ERROR `main`
rocket::ignite() rocket::ignite()
} }
} }
@ -62,7 +58,6 @@ mod launch_c {
mod launch_d { mod launch_d {
#[rocket::launch] #[rocket::launch]
async fn rocket() { async fn rocket() {
//~^^ ERROR functions that return
let _ = rocket::ignite().launch().await; let _ = rocket::ignite().launch().await;
rocket::ignite() rocket::ignite()
} }
@ -71,7 +66,6 @@ mod launch_d {
mod launch_e { mod launch_e {
#[rocket::launch] #[rocket::launch]
fn rocket() { fn rocket() {
//~^^ ERROR functions that return
rocket::ignite() rocket::ignite()
} }
} }
@ -80,7 +74,6 @@ mod launch_f {
#[rocket::launch] #[rocket::launch]
fn rocket() -> rocket::Rocket { fn rocket() -> rocket::Rocket {
let _ = rocket::ignite().launch().await; let _ = rocket::ignite().launch().await;
//~^ ERROR only allowed inside `async`
rocket::ignite() rocket::ignite()
} }
} }
@ -88,7 +81,6 @@ mod launch_f {
mod launch_g { mod launch_g {
#[rocket::launch] #[rocket::launch]
fn main() -> &'static str { fn main() -> &'static str {
//~^^ ERROR `main`
let _ = rocket::ignite().launch().await; let _ = rocket::ignite().launch().await;
"hi" "hi"
} }
@ -97,13 +89,11 @@ mod launch_g {
mod launch_h { mod launch_h {
#[rocket::launch] #[rocket::launch]
async fn main() -> rocket::Rocket { async fn main() -> rocket::Rocket {
//~^^ ERROR `main`
rocket::ignite() rocket::ignite()
} }
} }
#[rocket::main] #[rocket::main]
async fn main() -> rocket::Rocket { async fn main() -> rocket::Rocket {
//~^ ERROR invalid return type
rocket::ignite() rocket::ignite()
} }

View File

@ -4,42 +4,29 @@ use rocket::Request;
#[catch(404)] #[catch(404)]
struct Catcher(String); struct Catcher(String);
//~^ ERROR expected `fn`
//~^^ HELP on functions
#[catch(404)] #[catch(404)]
const CATCH: &str = "Catcher"; const CATCH: &str = "Catcher";
//~^ ERROR expected `fn`
//~^^ HELP on functions
#[catch("404")] //~ ERROR expected unsigned integer literal #[catch("404")]
//~^ HELP #[catch(404)]
fn e1(_request: &Request) { } fn e1(_request: &Request) { }
#[catch(code = "404")] //~ ERROR unexpected keyed parameter #[catch(code = "404")]
//~^ HELP #[catch(404)]
fn e2(_request: &Request) { } fn e2(_request: &Request) { }
#[catch(code = 404)] //~ ERROR unexpected keyed parameter #[catch(code = 404)]
//~^ HELP #[catch(404)]
fn e3(_request: &Request) { } fn e3(_request: &Request) { }
#[catch(99)] //~ ERROR in range [100, 599] #[catch(99)]
//~^ HELP #[catch(404)]
fn e4(_request: &Request) { } fn e4(_request: &Request) { }
#[catch(600)] //~ ERROR in range [100, 599] #[catch(600)]
//~^ HELP #[catch(404)]
fn e5(_request: &Request) { } fn e5(_request: &Request) { }
#[catch(400, message = "foo")] //~ ERROR unexpected attribute parameter: `message` #[catch(400, message = "foo")]
//~^ HELP #[catch(404)]
fn e5(_request: &Request) { } fn e5(_request: &Request) { }
#[catch(404)] #[catch(404)]
fn f3(_request: &Request, other: bool) { fn f3(_request: &Request, other: bool) { }
//~^ ERROR invalid number of arguments
//~^^ HELP optionally take an argument
}
fn main() { } fn main() { }

View File

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

View File

@ -1,8 +1,8 @@
#[macro_use] extern crate rocket; #[macro_use] extern crate rocket;
fn main() { fn main() {
let _ = catchers![a b]; //~ ERROR expected let _ = catchers![a b];
let _ = catchers![]; let _ = catchers![];
let _ = catchers![a::, ]; //~ ERROR expected identifier let _ = catchers![a::, ];
let _ = catchers![a::]; //~ ERROR expected identifier let _ = catchers![a::];
} }

View File

@ -4,23 +4,18 @@ use rocket::http::RawStr;
#[derive(FromForm)] #[derive(FromForm)]
enum Thing { } enum Thing { }
//~^ ERROR not supported
#[derive(FromForm)] #[derive(FromForm)]
struct Foo1; struct Foo1;
//~^ ERROR not supported
#[derive(FromForm)] #[derive(FromForm)]
struct Foo2 { } struct Foo2 { }
//~^ ERROR one field is required
#[derive(FromForm)] #[derive(FromForm)]
struct Foo3(usize); struct Foo3(usize);
//~^ ERROR not supported
#[derive(FromForm)] #[derive(FromForm)]
struct NextTodoTask<'f, 'a> { struct NextTodoTask<'f, 'a> {
//~^ ERROR only one lifetime
description: String, description: String,
raw_description: &'f RawStr, raw_description: &'f RawStr,
other: &'a RawStr, other: &'a RawStr,
@ -30,7 +25,6 @@ struct NextTodoTask<'f, 'a> {
#[derive(FromForm)] #[derive(FromForm)]
struct BadName1 { struct BadName1 {
#[form(field = "isindex")] #[form(field = "isindex")]
//~^ ERROR invalid form field name
field: String, field: String,
} }
@ -39,7 +33,6 @@ struct Demo2 {
#[form(field = "foo")] #[form(field = "foo")]
field: String, field: String,
foo: usize, foo: usize,
//~^ ERROR duplicate field
} }
#[derive(FromForm)] #[derive(FromForm)]
@ -47,7 +40,6 @@ struct MyForm9 {
#[form(field = "hello")] #[form(field = "hello")]
first: String, first: String,
#[form(field = "hello")] #[form(field = "hello")]
//~^ ERROR duplicate field
other: String, other: String,
} }
@ -55,42 +47,36 @@ struct MyForm9 {
struct MyForm10 { struct MyForm10 {
first: String, first: String,
#[form(field = "first")] #[form(field = "first")]
//~^ ERROR duplicate field
other: String, other: String,
} }
#[derive(FromForm)] #[derive(FromForm)]
struct MyForm { struct MyForm {
#[form(field = "blah", field = "bloo")] #[form(field = "blah", field = "bloo")]
//~^ ERROR duplicate
my_field: String, my_field: String,
} }
#[derive(FromForm)] #[derive(FromForm)]
struct MyForm1 { struct MyForm1 {
#[form] #[form]
//~^ ERROR malformed attribute
my_field: String, my_field: String,
} }
#[derive(FromForm)] #[derive(FromForm)]
struct MyForm2 { struct MyForm2 {
#[form("blah")] #[form("blah")]
//~^ ERROR expected key/value
my_field: String, my_field: String,
} }
#[derive(FromForm)] #[derive(FromForm)]
struct MyForm3 { struct MyForm3 {
#[form(123)] #[form(123)]
//~^ ERROR expected key/value
my_field: String, my_field: String,
} }
#[derive(FromForm)] #[derive(FromForm)]
struct MyForm4 { struct MyForm4 {
#[form(beep = "bop")] #[form(beep = "bop")]
//~^ ERROR unexpected attribute parameter
my_field: String, my_field: String,
} }
@ -98,70 +84,60 @@ struct MyForm4 {
struct MyForm5 { struct MyForm5 {
#[form(field = "blah")] #[form(field = "blah")]
#[form(field = "bleh")] #[form(field = "bleh")]
//~^ ERROR duplicate
my_field: String, my_field: String,
} }
#[derive(FromForm)] #[derive(FromForm)]
struct MyForm6 { struct MyForm6 {
#[form(field = true)] #[form(field = true)]
//~^ ERROR invalid value: expected string
my_field: String, my_field: String,
} }
#[derive(FromForm)] #[derive(FromForm)]
struct MyForm7 { struct MyForm7 {
#[form(field)] #[form(field)]
//~^ ERROR expected literal or key/value
my_field: String, my_field: String,
} }
#[derive(FromForm)] #[derive(FromForm)]
struct MyForm8 { struct MyForm8 {
#[form(field = 123)] #[form(field = 123)]
//~^ ERROR invalid value: expected string
my_field: String, my_field: String,
} }
#[derive(FromForm)] #[derive(FromForm)]
struct MyForm11 { struct MyForm11 {
#[form(field = "hello&world")] #[form(field = "hello&world")]
//~^ ERROR invalid form field name
first: String, first: String,
} }
#[derive(FromForm)] #[derive(FromForm)]
struct MyForm12 { struct MyForm12 {
#[form(field = "!@#$%^&*()_")] #[form(field = "!@#$%^&*()_")]
//~^ ERROR invalid form field name
first: String, first: String,
} }
#[derive(FromForm)] #[derive(FromForm)]
struct MyForm13 { struct MyForm13 {
#[form(field = "?")] #[form(field = "?")]
//~^ ERROR invalid form field name
first: String, first: String,
} }
#[derive(FromForm)] #[derive(FromForm)]
struct MyForm14 { struct MyForm14 {
#[form(field = "")] #[form(field = "")]
//~^ ERROR invalid form field name
first: String, first: String,
} }
#[derive(FromForm)] #[derive(FromForm)]
struct BadName2 { struct BadName2 {
#[form(field = "a&b")] #[form(field = "a&b")]
//~^ ERROR invalid form field name
field: String, field: String,
} }
#[derive(FromForm)] #[derive(FromForm)]
struct BadName3 { struct BadName3 {
#[form(field = "a=")] #[form(field = "a=")]
//~^ ERROR invalid form field name
field: String, field: String,
} }

View File

@ -5,7 +5,6 @@ struct Unknown;
#[derive(FromForm)] #[derive(FromForm)]
struct BadType3 { struct BadType3 {
field: Unknown, field: Unknown,
//~^ rocket::request::FromFormValue
} }
struct Foo<T>(T); struct Foo<T>(T);
@ -13,7 +12,6 @@ struct Foo<T>(T);
#[derive(FromForm)] #[derive(FromForm)]
struct Other { struct Other {
field: Foo<usize>, field: Foo<usize>,
//~^ rocket::request::FromFormValue
} }
fn main() { } fn main() { }

View File

@ -2,45 +2,37 @@
#[derive(FromFormValue)] #[derive(FromFormValue)]
struct Foo1; struct Foo1;
//~^ ERROR not supported
#[derive(FromFormValue)] #[derive(FromFormValue)]
struct Foo2(usize); struct Foo2(usize);
//~^ ERROR not supported
#[derive(FromFormValue)] #[derive(FromFormValue)]
struct Foo3 { struct Foo3 {
//~^ ERROR not supported
foo: usize, foo: usize,
} }
#[derive(FromFormValue)] #[derive(FromFormValue)]
enum Foo4 { enum Foo4 {
A(usize), A(usize),
//~^ ERROR cannot have fields
} }
#[derive(FromFormValue)] #[derive(FromFormValue)]
enum Foo5 { } enum Foo5 { }
//~^ ERROR at least one field
#[derive(FromFormValue)] #[derive(FromFormValue)]
enum Foo6<T> { enum Foo6<T> {
//~^ ERROR type generics are not supported
A(T), A(T),
} }
#[derive(FromFormValue)] #[derive(FromFormValue)]
enum Bar1 { enum Bar1 {
#[form(value = 123)] #[form(value = 123)]
//~^ ERROR invalid value: expected string
A, A,
} }
#[derive(FromFormValue)] #[derive(FromFormValue)]
enum Bar2 { enum Bar2 {
#[form(value)] #[form(value)]
//~^ ERROR expected literal or key/value
A, A,
} }

View File

@ -1,28 +1,20 @@
// normalize-stderr-test: "<(.*) as (.*)>" -> "$1 as $$TRAIT"
// normalize-stderr-test: "and \d+ others" -> "and $$N others"
// normalize-stderr-test: "::: (.*)/core/lib" -> "::: $$ROCKET/core/lib"
#[macro_use] extern crate rocket; #[macro_use] extern crate rocket;
#[derive(Responder)] #[derive(Responder)]
struct Thing1 { struct Thing1 {
thing: u8, thing: u8,
//~^ ERROR Responder
} }
#[derive(Responder)] #[derive(Responder)]
struct Thing2 { struct Thing2 {
thing: String, thing: String,
other: u8, other: u8,
//~^ ERROR Header
} }
#[derive(Responder)] #[derive(Responder)]
struct Thing3 { struct Thing3 {
thing: u8, thing: u8,
//~^ ERROR Responder
other: u8, other: u8,
//~^ ERROR Header
} }
#[derive(Responder)] #[derive(Responder)]
@ -30,11 +22,9 @@ struct Thing4 {
thing: String, thing: String,
other: rocket::http::ContentType, other: rocket::http::ContentType,
then: String, then: String,
//~^ ERROR Header
} }
#[get("/")] #[get("/")]
fn foo() -> usize { 0 } fn foo() -> usize { 0 }
//~^ ERROR Responder
fn main() { } fn main() { }

View File

@ -1,128 +1,110 @@
#[macro_use] extern crate rocket; #[macro_use] extern crate rocket;
// Check a path is supplied, at least. // Check a path is supplied, at least.
#[get()]
#[get()] //~ ERROR missing expected parameter
fn a0() {} fn a0() {}
// Check that it only works on functions. // Check that it only works on functions.
#[get("/")] #[get("/")]
struct S; struct S;
//~^ ERROR expected `fn`
//~^^ HELP on functions
#[get("/")] #[get("/")]
enum A { } enum A { }
//~^ ERROR expected `fn`
//~^^ HELP on functions
#[get("/")] #[get("/")]
trait Foo { } trait Foo { }
//~^ ERROR expected `fn`
//~^^ HELP on functions
#[get("/")] #[get("/")]
impl S { } impl S { }
//~^ ERROR expected `fn`
//~^^ HELP on functions
// Check that additional parameter weirdness is caught. // Check that additional parameter weirdness is caught.
#[get("/", 123)]
#[get("/", 123)] //~ ERROR expected
fn b0() {} fn b0() {}
#[get("/", "/")] //~ ERROR expected #[get("/", "/")]
fn b1() {} fn b1() {}
#[get(data = "<foo>", "/")] //~ ERROR unexpected keyed parameter #[get(data = "<foo>", "/")]
fn b2(foo: usize) {} fn b2(foo: usize) {}
#[get("/", unknown = "foo")] //~ ERROR unexpected #[get("/", unknown = "foo")]
fn b3() {} fn b3() {}
#[get("/", ...)] //~ ERROR malformed #[get("/", ...)]
//~^ HELP expected syntax
fn b4() {} fn b4() {}
// Check that all identifiers are named // Check that all identifiers are named
#[get("/")] #[get("/")]
fn c1(_: usize) {} //~ ERROR cannot be ignored fn c1(_: usize) {}
//~^ HELP must be of the form
// Check that the path is a string, rank is an integer. // Check that the path is a string, rank is an integer.
#[get(100)] //~ ERROR expected string #[get(100)]
fn d0() {} fn d0() {}
#[get('/')] //~ ERROR expected string #[get('/')]
fn d1() {} fn d1() {}
#[get("/", rank = "1")] //~ ERROR expected integer #[get("/", rank = "1")]
fn d2() {} fn d2() {}
#[get("/", rank = '1')] //~ ERROR expected integer #[get("/", rank = '1')]
fn d3() {} fn d3() {}
// Check that formats are valid media-type strings. // Check that formats are valid media-type strings.
#[get("/", format = "applicationx-custom")] //~ ERROR invalid or unknown media type #[get("/", format = "applicationx-custom")]
fn e0() {} fn e0() {}
#[get("/", format = "")] //~ ERROR invalid or unknown media type #[get("/", format = "")]
fn e1() {} fn e1() {}
#[get("/", format = "//")] //~ ERROR invalid or unknown media type #[get("/", format = "//")]
fn e2() {} fn e2() {}
#[get("/", format = "/")] //~ ERROR invalid or unknown media type #[get("/", format = "/")]
fn e3() {} fn e3() {}
#[get("/", format = "a/")] //~ ERROR invalid or unknown media type #[get("/", format = "a/")]
fn e4() {} fn e4() {}
#[get("/", format = "/a")] //~ ERROR invalid or unknown media type #[get("/", format = "/a")]
fn e5() {} fn e5() {}
#[get("/", format = "/a/")] //~ ERROR invalid or unknown media type #[get("/", format = "/a/")]
fn e6() {} fn e6() {}
#[get("/", format = "a/b/")] //~ ERROR invalid or unknown media type #[get("/", format = "a/b/")]
fn e7() {} fn e7() {}
#[get("/", format = "unknown")] //~ ERROR unknown media type #[get("/", format = "unknown")]
fn e8() {} fn e8() {}
#[get("/", format = 12)] //~ ERROR expected string #[get("/", format = 12)]
fn e9() {} fn e9() {}
#[get("/", format = 'j')] //~ ERROR expected string #[get("/", format = 'j')]
fn e10() {} fn e10() {}
#[get("/", format = "text//foo")] //~ ERROR invalid or unknown media type #[get("/", format = "text//foo")]
fn e12() {} fn e12() {}
// Check that route methods are validated properly. // Check that route methods are validated properly.
#[route(CONNECT, "/")] //~ ERROR invalid HTTP method for route #[route(CONNECT, "/")]
//~^ HELP method must be one of
fn f0() {} fn f0() {}
#[route(FIX, "/")] //~ ERROR invalid HTTP method #[route(FIX, "/")]
//~^ HELP method must be one of
fn f1() {} fn f1() {}
#[route("hi", "/")] //~ ERROR expected identifier #[route("hi", "/")]
//~^ HELP method must be one of
fn f2() {} fn f2() {}
#[route("GET", "/")] //~ ERROR expected identifier #[route("GET", "/")]
//~^ HELP method must be one of
fn f3() {} fn f3() {}
#[route(120, "/")] //~ ERROR expected identifier #[route(120, "/")]
//~^ HELP method must be one of
fn f4() {} fn f4() {}
fn main() {} fn main() {}

View File

@ -2,131 +2,104 @@
// Check that route paths are absolute and normalized. // Check that route paths are absolute and normalized.
#[get("a")] //~ ERROR invalid path URI #[get("a")]
//~^ HELP expected
fn f0() {} fn f0() {}
#[get("")] //~ ERROR invalid path URI #[get("")]
//~^ HELP expected
fn f1() {} fn f1() {}
#[get("a/b/c")] //~ ERROR invalid path URI #[get("a/b/c")]
//~^ HELP expected
fn f2() {} fn f2() {}
#[get("/a///b")] //~ ERROR empty segments #[get("/a///b")]
//~^ NOTE expected
fn f3() {} fn f3() {}
#[get("/?bat&&")] //~ ERROR empty segments #[get("/?bat&&")]
fn f4() {} fn f4() {}
#[get("/?bat&&")] //~ ERROR empty segments #[get("/?bat&&")]
fn f5() {} fn f5() {}
#[get("/a/b//")] //~ ERROR empty segments #[get("/a/b//")]
//~^ NOTE expected
fn f6() {} fn f6() {}
// Check that paths contain only valid URI characters // Check that paths contain only valid URI characters
#[get("/!@#$%^&*()")] //~ ERROR invalid path URI #[get("/!@#$%^&*()")]
//~^ HELP origin form
fn g1() {} fn g1() {}
#[get("/a%20b")] //~ ERROR invalid URI characters #[get("/a%20b")]
//~^ NOTE cannot contain reserved
//~^^ HELP reserved characters include
fn g2() {} fn g2() {}
#[get("/a?a%20b")] //~ ERROR invalid URI characters #[get("/a?a%20b")]
//~^ NOTE cannot contain reserved
//~^^ HELP reserved characters include
fn g3() {} fn g3() {}
#[get("/a?a+b")] //~ ERROR invalid URI characters #[get("/a?a+b")]
//~^ NOTE cannot contain reserved
//~^^ HELP reserved characters include
fn g4() {} fn g4() {}
// Check that all declared parameters are accounted for // Check that all declared parameters are accounted for
#[get("/<name>")] //~ ERROR unused dynamic parameter #[get("/<name>")]
fn h0(_name: usize) {} //~ NOTE expected argument named `name` here fn h0(_name: usize) {}
#[get("/a?<r>")] //~ ERROR unused dynamic parameter #[get("/a?<r>")]
fn h1() {} //~ NOTE expected argument named `r` here fn h1() {}
#[post("/a", data = "<test>")] //~ ERROR unused dynamic parameter #[post("/a", data = "<test>")]
fn h2() {} //~ NOTE expected argument named `test` here fn h2() {}
#[get("/<_r>")] //~ ERROR unused dynamic parameter #[get("/<_r>")]
fn h3() {} //~ NOTE expected argument named `_r` here fn h3() {}
#[get("/<_r>/<b>")]
fn h4() {}
#[get("/<_r>/<b>")] //~ ERROR unused dynamic parameter
//~^ ERROR unused dynamic parameter
fn h4() {} //~ NOTE expected argument named `_r` here
//~^ NOTE expected argument named `b` here
// Check dynamic parameters are valid idents // Check dynamic parameters are valid idents
#[get("/<foo_.>")] //~ ERROR `foo_.` is not a valid identifier #[get("/<foo_.>")]
//~^ HELP must be valid
fn i0() {} fn i0() {}
#[get("/<foo*>")] //~ ERROR `foo*` is not a valid identifier #[get("/<foo*>")]
//~^ HELP must be valid
fn i1() {} fn i1() {}
#[get("/<!>")] //~ ERROR `!` is not a valid identifier #[get("/<!>")]
//~^ HELP must be valid
fn i2() {} fn i2() {}
#[get("/<name>:<id>")] //~ ERROR `name>:<id` is not a valid identifier #[get("/<name>:<id>")]
//~^ HELP must be valid
fn i3() {} fn i3() {}
// Check that a data parameter is exactly `<param>` // Check that a data parameter is exactly `<param>`
#[get("/", data = "foo")] //~ ERROR malformed parameter #[get("/", data = "foo")]
//~^ HELP must be of the form
fn j0() {} fn j0() {}
#[get("/", data = "<foo..>")] //~ ERROR malformed parameter #[get("/", data = "<foo..>")]
//~^ HELP must be of the form
fn j1() {} fn j1() {}
#[get("/", data = "<foo")] //~ ERROR missing a closing bracket #[get("/", data = "<foo")]
//~^ HELP did you mean
fn j2() {} fn j2() {}
#[get("/", data = "<test >")] //~ ERROR `test ` is not a valid identifier #[get("/", data = "<test >")]
//~^ HELP must be valid
fn j3() {} fn j3() {}
// Check that all identifiers are named // Check that all identifiers are named
#[get("/<_>")] //~ ERROR must be named #[get("/<_>")]
fn k0(_: usize) {} //~^ HELP use a name such as fn k0(_: usize) {}
// Check that strange dynamic syntax is caught. // Check that strange dynamic syntax is caught.
#[get("/<>")] //~ ERROR cannot be empty #[get("/<>")]
fn m0() {} fn m0() {}
#[get("/<id><")] //~ ERROR malformed parameter #[get("/<id><")]
//~^ HELP must be of the form
//~^^ HELP identifiers cannot contain
fn m1() {} fn m1() {}
#[get("/<<<<id><")] //~ ERROR malformed parameter #[get("/<<<<id><")]
//~^ HELP must be of the form
//~^^ HELP identifiers cannot contain
fn m2() {} fn m2() {}
#[get("/<>name><")] //~ ERROR malformed parameter #[get("/<>name><")]
//~^ HELP must be of the form
//~^^ HELP identifiers cannot contain
fn m3() {} fn m3() {}
fn main() { } fn main() { }

View File

@ -3,29 +3,24 @@
struct Q; struct Q;
#[get("/<foo>")] #[get("/<foo>")]
fn f0(foo: Q) {} //~ ERROR FromParam fn f0(foo: Q) {}
#[get("/<foo..>")] #[get("/<foo..>")]
fn f1(foo: Q) {} //~ ERROR FromSegments fn f1(foo: Q) {}
#[get("/?<foo>")] #[get("/?<foo>")]
fn f2(foo: Q) {} //~ ERROR FromFormValue fn f2(foo: Q) {}
#[get("/?<foo..>")] #[get("/?<foo..>")]
fn f3(foo: Q) {} //~ ERROR FromQuery fn f3(foo: Q) {}
#[post("/", data = "<foo>")] #[post("/", data = "<foo>")]
fn f4(foo: Q) {} //~ ERROR FromData fn f4(foo: Q) {}
#[get("/<foo>")] #[get("/<foo>")]
fn f5(a: Q, foo: Q) {} fn f5(a: Q, foo: Q) {}
//~^ ERROR FromParam
//~^^ ERROR FromRequest
#[get("/<foo>/other/<bar>/<good>/okay")] #[get("/<foo>/other/<bar>/<good>/okay")]
fn f6(a: Q, foo: Q, good: usize, bar: Q) {} fn f6(a: Q, foo: Q, good: usize, bar: Q) {}
//~^ ERROR FromParam
//~^^ ERROR FromParam
//~^^^ ERROR FromRequest
fn main() { } fn main() { }

View File

@ -4,21 +4,21 @@
// Check for unknown media types. // Check for unknown media types.
#[get("/", format = "application/x-custom")] //~ WARNING not a known media type #[get("/", format = "application/x-custom")]
fn f0() {} fn f0() {}
#[get("/", format = "x-custom/plain")] //~ WARNING not a known media type #[get("/", format = "x-custom/plain")]
fn f1() {} fn f1() {}
#[get("/", format = "x-custom/x-custom")] //~ WARNING not a known media type #[get("/", format = "x-custom/x-custom")]
fn f2() {} fn f2() {}
// Check if a data argument is used with a usually non-payload bearing method. // Check if a data argument is used with a usually non-payload bearing method.
#[get("/", data = "<_foo>")] //~ WARNING used with non-payload-supporting method #[get("/", data = "<_foo>")]
fn g0(_foo: rocket::Data) {} fn g0(_foo: rocket::Data) {}
#[head("/", data = "<_foo>")] //~ WARNING used with non-payload-supporting method #[head("/", data = "<_foo>")]
fn g1(_foo: rocket::Data) {} fn g1(_foo: rocket::Data) {}
fn main() { fn main() {

View File

@ -1,8 +1,8 @@
#[macro_use] extern crate rocket; #[macro_use] extern crate rocket;
fn main() { fn main() {
let _ = routes![a b]; //~ ERROR expected `,` let _ = routes![a b];
let _ = routes![]; let _ = routes![];
let _ = routes![a::, ]; //~ ERROR expected identifier let _ = routes![a::, ];
let _ = routes![a::]; //~ ERROR expected identifier let _ = routes![a::];
} }

View File

@ -1,7 +1,3 @@
// normalize-stderr-test: "<(.*) as (.*)>" -> "$1 as $$TRAIT"
// normalize-stderr-test: "and \d+ others" -> "and $$N others"
// normalize-stderr-test: "::: (.*)/core/http" -> "::: $$ROCKET/core/http"
#[macro_use] extern crate rocket; #[macro_use] extern crate rocket;
use rocket::http::RawStr; use rocket::http::RawStr;
@ -38,48 +34,35 @@ fn simple_q(id: isize) { }
#[post("/?<id>&<rest..>")] #[post("/?<id>&<rest..>")]
fn other_q(id: usize, rest: S) { } fn other_q(id: usize, rest: S) { }
//~^ ERROR S: rocket::http::uri::Ignorable<rocket::http::uri::Query>
//~^^ ERROR usize: rocket::http::uri::Ignorable<rocket::http::uri::Query>
#[post("/?<id>&<name>")] #[post("/?<id>&<name>")]
fn optionals_q(id: Option<i32>, name: Result<String, &RawStr>) { } fn optionals_q(id: Option<i32>, name: Result<String, &RawStr>) { }
fn main() { fn main() {
uri!(simple: id = "hi"); uri!(simple: id = "hi");
//~^ ERROR usize: rocket::http::uri::FromUriParam<rocket::http::uri::Path, &str>
uri!(simple: "hello"); uri!(simple: "hello");
//~^ ERROR usize: rocket::http::uri::FromUriParam<rocket::http::uri::Path, &str>
uri!(simple: id = 239239i64); uri!(simple: id = 239239i64);
//~^ ERROR usize: rocket::http::uri::FromUriParam<rocket::http::uri::Path, i64>
uri!(not_uri_display: 10, S); uri!(not_uri_display: 10, S);
//~^ ERROR S: rocket::http::uri::FromUriParam<rocket::http::uri::Path, _>
// This one is okay. In paths, a value _must_ be supplied. // This one is okay. In paths, a value _must_ be supplied.
uri!(optionals: id = 10, name = "bob".to_string()); uri!(optionals: id = 10, name = "bob".to_string());
uri!(optionals: id = Some(10), name = Ok("bob".into())); uri!(optionals: id = Some(10), name = Ok("bob".into()));
//~^ ERROR i32: rocket::http::uri::FromUriParam<rocket::http::uri::Path, std::option::Option<{integer}>>
//~^^ ERROR String: rocket::http::uri::FromUriParam<rocket::http::uri::Path, std::result::Result<_, _>>
uri!(simple_q: "hi"); uri!(simple_q: "hi");
//~^ ERROR isize: rocket::http::uri::FromUriParam<rocket::http::uri::Query, &str>
uri!(simple_q: id = "hi"); uri!(simple_q: id = "hi");
//~^ ERROR isize: rocket::http::uri::FromUriParam<rocket::http::uri::Query, &str>
uri!(other_q: 100, S); uri!(other_q: 100, S);
//~^ ERROR S: rocket::http::uri::FromUriParam<rocket::http::uri::Query, _>
uri!(other_q: rest = S, id = 100); uri!(other_q: rest = S, id = 100);
//~^ ERROR S: rocket::http::uri::FromUriParam<rocket::http::uri::Query, _>
uri!(other_q: rest = _, id = 100); uri!(other_q: rest = _, id = 100);
uri!(other_q: rest = S, id = _); uri!(other_q: rest = S, id = _);
//~^ ERROR S: rocket::http::uri::FromUriParam<rocket::http::uri::Query, _>
// These are all okay. // These are all okay.
uri!(optionals_q: _, _); uri!(optionals_q: _, _);

View File

@ -1,7 +1,5 @@
#[macro_use] extern crate rocket; #[macro_use] extern crate rocket;
use std::fmt;
use rocket::http::{Cookies, RawStr}; use rocket::http::{Cookies, RawStr};
#[post("/<id>")] #[post("/<id>")]
@ -17,63 +15,42 @@ fn has_two(cookies: Cookies, id: i32, name: String) { }
fn optionals(id: Option<i32>, name: Result<String, &RawStr>) { } fn optionals(id: Option<i32>, name: Result<String, &RawStr>) { }
fn main() { fn main() {
uri!(has_one); //~ ERROR expects 1 parameter but 0 uri!(has_one);
uri!(has_one: 1, 23); //~ ERROR expects 1 parameter but 2 uri!(has_one: 1, 23);
uri!(has_one: "Hello", 23, ); //~ ERROR expects 1 parameter but 2 uri!(has_one: "Hello", 23, );
uri!(has_one_guarded: "hi", 100); //~ ERROR expects 1 parameter but 2 uri!(has_one_guarded: "hi", 100);
uri!(has_two: 10, "hi", "there"); //~ ERROR expects 2 parameters but 3 uri!(has_two: 10, "hi", "there");
uri!(has_two: 10); //~ ERROR expects 2 parameters but 1 uri!(has_two: 10);
uri!(has_one: id = 100, name = "hi"); //~ ERROR invalid parameters uri!(has_one: id = 100, name = "hi");
//~^ HELP unknown parameter: `name`
uri!(has_one: name = 100, id = 100); //~ ERROR invalid parameters uri!(has_one: name = 100, id = 100);
//~^ HELP unknown parameter: `name`
uri!(has_one: name = 100, age = 50, id = 100); //~ ERROR invalid parameters uri!(has_one: name = 100, age = 50, id = 100);
//~^ HELP unknown parameters: `name`, `age`
uri!(has_one: name = 100, age = 50, id = 100, id = 50); //~ ERROR invalid parameters uri!(has_one: name = 100, age = 50, id = 100, id = 50);
//~^ HELP unknown parameters: `name`, `age`
//~^^ HELP duplicate parameter: `id`
uri!(has_one: id = 100, id = 100); //~ ERROR invalid parameters uri!(has_one: id = 100, id = 100);
//~^ HELP duplicate parameter: `id`
uri!(has_one: id = 100, id = 100, ); //~ ERROR invalid parameters uri!(has_one: id = 100, id = 100, );
//~^ HELP duplicate parameter: `id`
uri!(has_one: name = "hi"); //~ ERROR invalid parameters uri!(has_one: name = "hi");
//~^ HELP unknown parameter: `name`
//~^^ HELP missing parameter: `id`
uri!(has_one_guarded: cookies = "hi", id = 100); //~ ERROR invalid parameters uri!(has_one_guarded: cookies = "hi", id = 100);
//~^ HELP unknown parameter: `cookies`
uri!(has_one_guarded: id = 100, cookies = "hi"); //~ ERROR invalid parameters uri!(has_one_guarded: id = 100, cookies = "hi");
//~^ HELP unknown parameter: `cookies`
uri!(has_two: id = 100, id = 100, ); //~ ERROR invalid parameters uri!(has_two: id = 100, id = 100, );
//~^ HELP duplicate parameter: `id`
//~^^ HELP missing parameter: `name`
uri!(has_two: name = "hi"); //~ ERROR invalid parameters uri!(has_two: name = "hi");
//~^ HELP missing parameter: `id`
uri!(has_two: cookies = "hi", id = 100, id = 10, id = 10); //~ ERROR invalid parameters uri!(has_two: cookies = "hi", id = 100, id = 10, id = 10);
//~^ HELP duplicate parameter: `id`
//~^^ HELP missing parameter: `name`
//~^^^ HELP unknown parameter: `cookies`
uri!(has_two: id = 100, cookies = "hi"); //~ ERROR invalid parameters uri!(has_two: id = 100, cookies = "hi");
//~^ HELP missing parameter: `name`
//~^^ HELP unknown parameter: `cookies`
uri!(optionals: id = _, name = "bob".into()); uri!(optionals: id = _, name = "bob".into());
//~^ ERROR cannot be ignored
uri!(optionals: id = 10, name = _); uri!(optionals: id = 10, name = _);
//~^ ERROR cannot be ignored
} }

View File

@ -4,14 +4,14 @@
fn simple(id: i32, name: String) -> &'static str { "" } fn simple(id: i32, name: String) -> &'static str { "" }
fn main() { fn main() {
uri!(simple: id = 100, "Hello"); //~ ERROR named and unnamed uri!(simple: id = 100, "Hello");
uri!(simple: "Hello", id = 100); //~ ERROR named and unnamed uri!(simple: "Hello", id = 100);
uri!(simple,); //~ ERROR expected `:` uri!(simple,);
uri!(simple:); //~ ERROR argument list uri!(simple:);
uri!("/mount"); //~ ERROR route path uri!("/mount");
uri!("/mount",); //~ ERROR expected identifier uri!("/mount",);
uri!("mount", simple); //~ invalid mount point uri!("mount", simple);
uri!("/mount/<id>", simple); //~ invalid mount point uri!("/mount/<id>", simple);
uri!(); //~ unexpected end of input uri!();
uri!(simple: id = ); //~ expected expression uri!(simple: id = );
} }

View File

@ -1,77 +1,39 @@
// normalize-stderr-test: "::: (.*)/core/http" -> "::: $$ROCKET/core/http"
#[macro_use] extern crate rocket; #[macro_use] extern crate rocket;
#[derive(UriDisplayQuery)] #[derive(UriDisplayQuery)]
//~^ ERROR Foo1: rocket::http::uri::UriDisplay<rocket::http::uri::Query>
//~| ERROR Foo1: rocket::http::uri::UriDisplay<rocket::http::uri::Query>
//~| ERROR Foo1: rocket::http::uri::UriDisplay<rocket::http::uri::Query>
struct Foo1; struct Foo1;
//~^ ERROR not supported
#[derive(UriDisplayQuery)] #[derive(UriDisplayQuery)]
//~^ ERROR Foo2: rocket::http::uri::UriDisplay<rocket::http::uri::Query>
//~| ERROR Foo2: rocket::http::uri::UriDisplay<rocket::http::uri::Query>
//~| ERROR Foo2: rocket::http::uri::UriDisplay<rocket::http::uri::Query>
struct Foo2(); struct Foo2();
//~^ ERROR not supported
#[derive(UriDisplayQuery)] #[derive(UriDisplayQuery)]
//~^ ERROR Foo3: rocket::http::uri::UriDisplay<rocket::http::uri::Query>
//~| ERROR Foo3: rocket::http::uri::UriDisplay<rocket::http::uri::Query>
//~| ERROR Foo3: rocket::http::uri::UriDisplay<rocket::http::uri::Query>
enum Foo3 { } enum Foo3 { }
//~^ ERROR not supported
#[derive(UriDisplayQuery)] #[derive(UriDisplayQuery)]
//~^ ERROR Foo4: rocket::http::uri::UriDisplay<rocket::http::uri::Query>
//~| ERROR Foo4: rocket::http::uri::UriDisplay<rocket::http::uri::Query>
//~| ERROR Foo4: rocket::http::uri::UriDisplay<rocket::http::uri::Query>
enum Foo4 { enum Foo4 {
Variant, Variant,
//~^ ERROR not supported
} }
#[derive(UriDisplayQuery)] #[derive(UriDisplayQuery)]
//~^ ERROR Foo5: rocket::http::uri::UriDisplay<rocket::http::uri::Query>
//~| ERROR Foo5: rocket::http::uri::UriDisplay<rocket::http::uri::Query>
//~| ERROR Foo5: rocket::http::uri::UriDisplay<rocket::http::uri::Query>
struct Foo5(String, String); struct Foo5(String, String);
//~^ ERROR exactly one
#[derive(UriDisplayQuery)] #[derive(UriDisplayQuery)]
//~^ ERROR Foo6: rocket::http::uri::UriDisplay<rocket::http::uri::Query>
//~| ERROR Foo6: rocket::http::uri::UriDisplay<rocket::http::uri::Query>
//~| ERROR Foo6: rocket::http::uri::UriDisplay<rocket::http::uri::Query>
struct Foo6 { struct Foo6 {
#[form(field = 123)] #[form(field = 123)]
//~^ ERROR invalid value: expected string
field: String, field: String,
} }
#[derive(UriDisplayPath)] #[derive(UriDisplayPath)]
//~^ ERROR Foo7: rocket::http::uri::UriDisplay<rocket::http::uri::Path>
//~| ERROR Foo7: rocket::http::uri::UriDisplay<rocket::http::uri::Path>
struct Foo7(String, usize); struct Foo7(String, usize);
//~^ ERROR exactly one
#[derive(UriDisplayPath)] #[derive(UriDisplayPath)]
//~^ ERROR Foo8: rocket::http::uri::UriDisplay<rocket::http::uri::Path>
//~| ERROR Foo8: rocket::http::uri::UriDisplay<rocket::http::uri::Path>
struct Foo8; struct Foo8;
//~^ ERROR exactly one
#[derive(UriDisplayPath)] #[derive(UriDisplayPath)]
//~^ ERROR Foo9: rocket::http::uri::UriDisplay<rocket::http::uri::Path>
//~| ERROR Foo9: rocket::http::uri::UriDisplay<rocket::http::uri::Path>
enum Foo9 { } enum Foo9 { }
//~^ ERROR not supported
#[derive(UriDisplayPath)] #[derive(UriDisplayPath)]
//~^ ERROR Foo10: rocket::http::uri::UriDisplay<rocket::http::uri::Path>
//~| ERROR Foo10: rocket::http::uri::UriDisplay<rocket::http::uri::Path>
struct Foo10 { struct Foo10 {
//~^ ERROR not supported
named: usize named: usize
} }

View File

@ -4,32 +4,27 @@ struct BadType;
#[derive(UriDisplayQuery)] #[derive(UriDisplayQuery)]
struct Bar1(BadType); struct Bar1(BadType);
//~^ ERROR UriDisplay<rocket::http::uri::Query>
#[derive(UriDisplayQuery)] #[derive(UriDisplayQuery)]
struct Bar2 { struct Bar2 {
field: BadType, field: BadType,
//~^ ERROR UriDisplay<rocket::http::uri::Query>
} }
#[derive(UriDisplayQuery)] #[derive(UriDisplayQuery)]
struct Bar3 { struct Bar3 {
field: String, field: String,
bad: BadType, bad: BadType,
//~^ ERROR UriDisplay<rocket::http::uri::Query>
} }
#[derive(UriDisplayQuery)] #[derive(UriDisplayQuery)]
enum Bar4 { enum Bar4 {
Inner(BadType), Inner(BadType),
//~^ ERROR UriDisplay<rocket::http::uri::Query>
} }
#[derive(UriDisplayQuery)] #[derive(UriDisplayQuery)]
enum Bar5 { enum Bar5 {
Inner { Inner {
field: BadType, field: BadType,
//~^ ERROR UriDisplay<rocket::http::uri::Query>
}, },
} }
@ -38,12 +33,10 @@ enum Bar6 {
Inner { Inner {
field: String, field: String,
other: BadType, other: BadType,
//~^ ERROR UriDisplay<rocket::http::uri::Query>
}, },
} }
#[derive(UriDisplayPath)] #[derive(UriDisplayPath)]
struct Baz(BadType); struct Baz(BadType);
//~^ ERROR UriDisplay<rocket::http::uri::Path>
fn main() { } fn main() { }

View File

@ -37,7 +37,7 @@ ref-cast = "1.0"
[dependencies.pear] [dependencies.pear]
git = "https://github.com/SergioBenitez/Pear.git" git = "https://github.com/SergioBenitez/Pear.git"
rev = "faee7c7e" rev = "4b68055"
[dev-dependencies] [dev-dependencies]
rocket = { version = "0.5.0-dev", path = "../lib" } rocket = { version = "0.5.0-dev", path = "../lib" }

View File

@ -42,7 +42,7 @@ atomic = "0.4"
[dependencies.pear] [dependencies.pear]
git = "https://github.com/SergioBenitez/Pear.git" git = "https://github.com/SergioBenitez/Pear.git"
rev = "faee7c7e" rev = "4b68055"
[dependencies.tokio] [dependencies.tokio]
version = "0.2.9" version = "0.2.9"