Report as many form errors as possible.

This commit is contained in:
Sergio Benitez 2022-11-12 04:11:18 -08:00
parent 8166ad0c7c
commit 7e913eb8ac
14 changed files with 545 additions and 509 deletions

View File

@ -1,53 +1,51 @@
error[E0277]: the trait bound `Unknown: Poolable` is not satisfied error[E0277]: the trait bound `Unknown: Poolable` is not satisfied
--> tests/ui-fail-stable/database-types.rs:6:10 --> tests/ui-fail-stable/database-types.rs:6:10
| |
6 | struct A(Unknown); 6 | struct A(Unknown);
| ^^^^^^^ the trait `Poolable` is not implemented for `Unknown` | ^^^^^^^ the trait `Poolable` is not implemented for `Unknown`
| |
= help: the trait `Poolable` is implemented for `SqliteConnection` = help: the trait `Poolable` is implemented for `SqliteConnection`
note: required by a bound in `rocket_sync_db_pools::Connection` note: required by a bound in `rocket_sync_db_pools::Connection`
--> $WORKSPACE/contrib/sync_db_pools/lib/src/connection.rs --> $WORKSPACE/contrib/sync_db_pools/lib/src/connection.rs
| |
| pub struct Connection<K, C: Poolable> { | pub struct Connection<K, C: Poolable> {
| ^^^^^^^^ required by this bound in `rocket_sync_db_pools::Connection` | ^^^^^^^^ required by this bound in `rocket_sync_db_pools::Connection`
error[E0277]: the trait bound `Unknown: Poolable` is not satisfied
--> tests/ui-fail-stable/database-types.rs:5:1
|
5 | #[database("foo")]
| ^^^^^^^^^^^^^^^^^^ the trait `Poolable` is not implemented for `Unknown`
|
= help: the trait `Poolable` is implemented for `SqliteConnection`
note: required by a bound in `ConnectionPool`
--> $WORKSPACE/contrib/sync_db_pools/lib/src/connection.rs
|
| pub struct ConnectionPool<K, C: Poolable> {
| ^^^^^^^^ required by this bound in `ConnectionPool`
= note: this error originates in the attribute macro `database` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `Vec<i32>: Poolable` is not satisfied error[E0277]: the trait bound `Vec<i32>: Poolable` is not satisfied
--> tests/ui-fail-stable/database-types.rs:9:10 --> tests/ui-fail-stable/database-types.rs:9:10
| |
9 | struct B(Vec<i32>); 9 | struct B(Vec<i32>);
| ^^^ the trait `Poolable` is not implemented for `Vec<i32>` | ^^^ the trait `Poolable` is not implemented for `Vec<i32>`
| |
= help: the trait `Poolable` is implemented for `SqliteConnection` = help: the trait `Poolable` is implemented for `SqliteConnection`
note: required by a bound in `rocket_sync_db_pools::Connection` note: required by a bound in `rocket_sync_db_pools::Connection`
--> $WORKSPACE/contrib/sync_db_pools/lib/src/connection.rs --> $WORKSPACE/contrib/sync_db_pools/lib/src/connection.rs
| |
| pub struct Connection<K, C: Poolable> { | pub struct Connection<K, C: Poolable> {
| ^^^^^^^^ required by this bound in `rocket_sync_db_pools::Connection` | ^^^^^^^^ required by this bound in `rocket_sync_db_pools::Connection`
error[E0277]: the trait bound `Unknown: Poolable` is not satisfied
--> tests/ui-fail-stable/database-types.rs:6:10
|
6 | struct A(Unknown);
| ^^^^^^^ the trait `Poolable` is not implemented for `Unknown`
|
= help: the trait `Poolable` is implemented for `SqliteConnection`
note: required by a bound in `ConnectionPool`
--> $WORKSPACE/contrib/sync_db_pools/lib/src/connection.rs
|
| pub struct ConnectionPool<K, C: Poolable> {
| ^^^^^^^^ required by this bound in `ConnectionPool`
error[E0277]: the trait bound `Vec<i32>: Poolable` is not satisfied error[E0277]: the trait bound `Vec<i32>: Poolable` is not satisfied
--> tests/ui-fail-stable/database-types.rs:8:1 --> tests/ui-fail-stable/database-types.rs:9:10
| |
8 | #[database("foo")] 9 | struct B(Vec<i32>);
| ^^^^^^^^^^^^^^^^^^ the trait `Poolable` is not implemented for `Vec<i32>` | ^^^ the trait `Poolable` is not implemented for `Vec<i32>`
| |
= help: the trait `Poolable` is implemented for `SqliteConnection` = help: the trait `Poolable` is implemented for `SqliteConnection`
note: required by a bound in `ConnectionPool` note: required by a bound in `ConnectionPool`
--> $WORKSPACE/contrib/sync_db_pools/lib/src/connection.rs --> $WORKSPACE/contrib/sync_db_pools/lib/src/connection.rs
| |
| pub struct ConnectionPool<K, C: Poolable> { | pub struct ConnectionPool<K, C: Poolable> {
| ^^^^^^^^ required by this bound in `ConnectionPool` | ^^^^^^^^ required by this bound in `ConnectionPool`
= note: this error originates in the attribute macro `database` (in Nightly builds, run with -Z macro-backtrace for more info)

View File

@ -1,3 +1,5 @@
use std::collections::HashSet;
use devise::{*, ext::{TypeExt, SpanDiagnosticExt}}; use devise::{*, ext::{TypeExt, SpanDiagnosticExt}};
use syn::{visit_mut::VisitMut, visit::Visit}; use syn::{visit_mut::VisitMut, visit::Visit};
@ -148,6 +150,13 @@ impl PartialEq for FieldName {
} }
} }
fn member_to_ident(member: syn::Member) -> syn::Ident {
match member {
syn::Member::Named(ident) => ident,
syn::Member::Unnamed(i) => format_ident!("__{}", i.index, span = i.span),
}
}
impl FieldExt for Field<'_> { impl FieldExt for Field<'_> {
fn ident(&self) -> Option<&syn::Ident> { fn ident(&self) -> Option<&syn::Ident> {
self.ident.as_ref() self.ident.as_ref()
@ -163,10 +172,10 @@ impl FieldExt for Field<'_> {
} }
} }
/// Returns the ident used by the context generated for the `FromForm` impl.
/// This is _not_ the field's ident and should not be used as such.
fn context_ident(&self) -> syn::Ident { fn context_ident(&self) -> syn::Ident {
self.ident() member_to_ident(self.member())
.map(|i| i.clone())
.unwrap_or_else(|| syn::Ident::new("__form_field", self.span()))
} }
// With named existentials, this could return an `impl Iterator`... // With named existentials, this could return an `impl Iterator`...
@ -203,13 +212,24 @@ impl FieldExt for Field<'_> {
} }
} }
struct RecordMemberAccesses(Vec<syn::Member>); #[derive(Default)]
struct RecordMemberAccesses {
reference: bool,
accesses: HashSet<(syn::Ident, bool)>,
}
impl<'a> Visit<'a> for RecordMemberAccesses { impl<'a> Visit<'a> for RecordMemberAccesses {
fn visit_expr_reference(&mut self, i: &'a syn::ExprReference) {
self.reference = true;
syn::visit::visit_expr_reference(self, i);
self.reference = false;
}
fn visit_expr_field(&mut self, i: &syn::ExprField) { fn visit_expr_field(&mut self, i: &syn::ExprField) {
if let syn::Expr::Path(e) = &*i.base { if let syn::Expr::Path(e) = &*i.base {
if e.path.is_ident("self") { if e.path.is_ident("self") {
self.0.push(i.member.clone()); let ident = member_to_ident(i.member.clone());
self.accesses.insert((ident, self.reference));
} }
} }
@ -218,9 +238,7 @@ impl<'a> Visit<'a> for RecordMemberAccesses {
} }
struct ValidationMutator<'a> { struct ValidationMutator<'a> {
field: &'a syn::Ident, field: Field<'a>,
parent: &'a syn::Ident,
local: bool,
visited: bool, visited: bool,
} }
@ -266,76 +284,115 @@ impl VisitMut for ValidationMutator<'_> {
} }
self.visited = true; self.visited = true;
let (parent, field) = (self.parent, self.field); let accessor = self.field.context_ident().with_span(self.field.ty.span());
let form_field = match self.local { call.args.insert(0, syn::parse_quote!(#accessor));
true => syn::parse2(quote_spanned!(field.span() => &#field)).unwrap(),
false => {
let parent = parent.clone().with_span(field.span());
syn::parse2(quote_spanned!(field.span() => &#parent.#field)).unwrap()
}
};
call.args.insert(0, form_field);
syn::visit_mut::visit_expr_call_mut(self, call); syn::visit_mut::visit_expr_call_mut(self, call);
} }
fn visit_ident_mut(&mut self, i: &mut syn::Ident) {
if !self.local && i == "self" {
*i = self.parent.clone().with_span(i.span());
}
}
fn visit_macro_mut(&mut self, mac: &mut syn::Macro) { fn visit_macro_mut(&mut self, mac: &mut syn::Macro) {
mac.tokens = self.visit_token_stream(mac.tokens.clone()); mac.tokens = self.visit_token_stream(mac.tokens.clone());
syn::visit_mut::visit_macro_mut(self, mac); syn::visit_mut::visit_macro_mut(self, mac);
} }
fn visit_ident_mut(&mut self, i: &mut syn::Ident) {
// replace `self` with the context ident
if i == "self" {
*i = self.field.context_ident().with_span(self.field.ty.span());
}
}
fn visit_expr_mut(&mut self, i: &mut syn::Expr) { fn visit_expr_mut(&mut self, i: &mut syn::Expr) {
// If this is a local, replace accesses of `self.field` with `field`. fn inner_field(i: &syn::Expr) -> Option<syn::Expr> {
if let syn::Expr::Field(e) = i { if let syn::Expr::Field(e) = i {
if let syn::Expr::Path(e) = &*e.base { if let syn::Expr::Path(p) = &*e.base {
if e.path.is_ident("self") && self.local { if p.path.is_ident("self") {
let new_expr = self.field; let member = &e.member;
*i = syn::parse_quote!(#new_expr); return Some(syn::parse_quote!(#member));
}
} }
} }
None
}
// replace `self.field` and `&self.field` with `field`
if let syn::Expr::Reference(r) = i {
if let Some(expr) = inner_field(&r.expr) {
if let Some(ref m) = r.mutability {
m.span()
.warning("`mut` has no effect in FromForm` validation")
.note("`mut` is being discarded")
.emit_as_item_tokens();
}
*i = expr;
}
} else if let Some(expr) = inner_field(&i) {
*i = expr;
} }
syn::visit_mut::visit_expr_mut(self, i); syn::visit_mut::visit_expr_mut(self, i);
} }
} }
pub fn validators<'v>( pub fn validators<'v>(field: Field<'v>) -> Result<impl Iterator<Item = syn::Expr> + 'v> {
field: Field<'v>,
parent: &'v syn::Ident, // field ident (if local) or form ident (if !local)
local: bool, // whether to emit local (true) or global (w/self) validations
) -> Result<impl Iterator<Item = syn::Expr> + 'v> {
Ok(FieldAttr::from_attrs(FieldAttr::NAME, &field.attrs)? Ok(FieldAttr::from_attrs(FieldAttr::NAME, &field.attrs)?
.into_iter() .into_iter()
.chain(FieldAttr::from_attrs(FieldAttr::NAME, field.parent.attrs())?) .chain(FieldAttr::from_attrs(FieldAttr::NAME, field.parent.attrs())?)
.filter_map(|a| a.validate) .filter_map(|a| a.validate)
.map(move |expr| { .map(move |mut expr| {
let mut members = RecordMemberAccesses(vec![]); // TODO:
members.visit_expr(&expr); // * We need a hashset of the member accesses.
// * And we need to know if they're bound by value or reference.
// - if value, use `Some(#member) = #member`
// - if ref, use `Some(#member) = &#member`
let mut record = RecordMemberAccesses::default();
record.accesses.insert((field.context_ident(), true));
record.visit_expr(&expr);
let field_member = field.member(); let mut v = ValidationMutator { field, visited: false };
let is_local_validation = members.0.iter().all(|m| m == &field_member);
(expr, is_local_validation)
})
.filter(move |(_, is_local)| *is_local == local)
.map(move |(mut expr, _)| {
let ty_span = field.ty.span();
let field = &field.context_ident().with_span(ty_span);
let mut v = ValidationMutator { parent, local, field, visited: false };
v.visit_expr_mut(&mut expr); v.visit_expr_mut(&mut expr);
let span = expr.key_span.unwrap_or(ty_span); let span = expr.key_span.unwrap_or(field.ty.span());
let matchers = record.accesses.iter().map(|(member, _)| member);
let values = record.accesses.iter()
.map(|(member, is_ref)| {
if *is_ref { quote_spanned!(span => &#member) }
else { quote_spanned!(span => #member) }
});
let matchers = quote_spanned!(span => (#(Some(#matchers)),*));
let values = quote_spanned!(span => (#(#values),*));
let name_opt = field.name_buf_opt().unwrap();
define_spanned_export!(span => _form); define_spanned_export!(span => _form);
syn::parse2(quote_spanned!(span => { let expr: syn::Expr = syn::parse_quote_spanned!(span => {
let __result: #_form::Result<'_, ()> = #expr; #[allow(unused_parens)]
__result let __result: #_form::Result<'_, ()> = match #values {
})).unwrap() #matchers => #expr,
_ => Ok(()),
};
__result.map_err(|__e| match #name_opt {
Some(__name) => __e.with_name(__name),
None => __e
})
});
expr
})) }))
// .map(move |(mut expr, local)| {
// let ty_span = field.ty.span();
// let mut v = ValidationMutator { field, local, visited: false };
// v.visit_expr_mut(&mut expr);
//
// let span = expr.key_span.unwrap_or(ty_span);
// define_spanned_export!(span => _form);
// syn::parse2(quote_spanned!(span => {
// let __result: #_form::Result<'_, ()> = #expr;
// __result
// })).unwrap()
// }))
} }
/// Take an $expr in `default = $expr` and turn it into a `Some($expr.into())`. /// Take an $expr in `default = $expr` and turn it into a `Some($expr.into())`.

View File

@ -1,5 +1,5 @@
use proc_macro2::TokenStream; use proc_macro2::TokenStream;
use devise::ext::{TypeExt, SpanDiagnosticExt, GenericsExt, Split2, quote_respanned}; use devise::ext::{TypeExt, SpanDiagnosticExt, GenericsExt, quote_respanned};
use syn::parse::Parser; use syn::parse::Parser;
use devise::*; use devise::*;
@ -221,43 +221,25 @@ pub fn derive_from_form(input: proc_macro::TokenStream) -> TokenStream {
.map(|f| mapper.map_field(f)) .map(|f| mapper.map_field(f))
.collect::<Result<Vec<TokenStream>>>()?; .collect::<Result<Vec<TokenStream>>>()?;
let o = syn::Ident::new("__o", fields.span());
let (_ok, _some, _err, _none) = (_Ok, _Some, _Err, _None); let (_ok, _some, _err, _none) = (_Ok, _Some, _Err, _None);
let (validate, name_buf_opt) = fields.iter() let validator = fields.iter().flat_map(|f| validators(f).unwrap());
.flat_map(|f| { let ident = fields.iter().map(|f| f.context_ident());
let validate = validators(f, &o, false).unwrap();
let name_buf = std::iter::repeat_with(move || f.name_buf_opt().unwrap());
validate.zip(name_buf)
})
.split2();
let ident: Vec<_> = fields.iter()
.map(|f| f.context_ident())
.collect();
let builder = fields.builder(|f| { let builder = fields.builder(|f| {
let ident = f.context_ident(); let ident = f.context_ident();
quote!(#ident.unwrap()) quote!(#ident.unwrap())
}); });
Ok(quote_spanned! { fields.span() => Ok(quote_spanned!(fields.span() =>
#(let #ident = match #finalize_field { #(
#_ok(#ident) => #_some(#ident), let #ident = match #finalize_field {
#_err(__e) => { __c.__errors.extend(__e); #_none } #_ok(#ident) => #_some(#ident),
};)* #_err(__e) => { __c.__errors.extend(__e); #_none }
};
if !__c.__errors.is_empty() { )*
return #_Err(__c.__errors);
}
let #o = #builder;
#( #(
if let #_err(__e) = #validate { if let #_err(__e) = #validator {
__c.__errors.extend(match #name_buf_opt { __c.__errors.extend(__e);
Some(__name) => __e.with_name(__name),
None => __e
});
} }
)* )*
@ -265,12 +247,11 @@ pub fn derive_from_form(input: proc_macro::TokenStream) -> TokenStream {
return #_Err(__c.__errors); return #_Err(__c.__errors);
} }
Ok(#o) Ok(#builder)
}) ))
}) })
.try_field_map(|_, f| { .try_field_map(|_, f| {
let (ident, ty) = (f.context_ident(), f.stripped_ty()); let (ident, ty) = (f.context_ident(), f.stripped_ty());
let validator = validators(f, &ident, true)?;
let name_buf_opt = f.name_buf_opt()?; let name_buf_opt = f.name_buf_opt()?;
let default = default(f)? let default = default(f)?
.unwrap_or_else(|| quote_spanned!(ty.span() => { .unwrap_or_else(|| quote_spanned!(ty.span() => {
@ -286,11 +267,6 @@ pub fn derive_from_form(input: proc_macro::TokenStream) -> TokenStream {
|| #default.ok_or_else(|| #_form::ErrorKind::Missing.into()), || #default.ok_or_else(|| #_form::ErrorKind::Missing.into()),
<#ty as #_form::FromForm<'r>>::finalize <#ty as #_form::FromForm<'r>>::finalize
) )
.and_then(|#ident| {
let mut __es = #_form::Errors::new();
#(if let #_err(__e) = #validator { __es.extend(__e); })*
__es.is_empty().then(|| #ident).ok_or(__es)
})
.map_err(|__e| match __name { .map_err(|__e| match __name {
Some(__name) => __e.with_name(__name), Some(__name) => __e.with_name(__name),
None => __e, None => __e,

View File

@ -410,8 +410,8 @@ fn form_errors() {
} }
#[test] #[test]
fn form_error_return_correct_field_name() { fn form_validate_error_return_correct_field_name() {
fn evaluate_other<'v>(_other: &String, _check: &bool) -> form::Result<'v, ()> { fn evaluate_other<'v>(_other: &str, _check: &bool) -> form::Result<'v, ()> {
Err(form::Error::validation(""))? Err(form::Error::validation(""))?
} }
@ -431,11 +431,11 @@ fn form_error_return_correct_field_name() {
#[test] #[test]
fn form_validate_contains_all_errors() { fn form_validate_contains_all_errors() {
fn evaluate<'v>(_value: &String) -> form::Result<'v, ()> { fn evaluate<'v>(_value: &str) -> form::Result<'v, ()> {
Err(form::Error::validation(""))? Err(form::Error::validation(""))?
} }
fn evaluate_with_argument<'v>(_value: &String, _check: &bool) -> form::Result<'v, ()> { fn evaluate_with_argument<'v>(_value: &str, _check: bool) -> form::Result<'v, ()> {
Err(form::Error::validation("lastname failed"))? Err(form::Error::validation("lastname failed"))?
} }
@ -445,7 +445,7 @@ fn form_validate_contains_all_errors() {
firstname: String, firstname: String,
check: bool, check: bool,
// this validator is hardcoded to return an error but it doesnt // this validator is hardcoded to return an error but it doesnt
#[field(validate = evaluate_with_argument(&self.check))] #[field(validate = evaluate_with_argument(self.check))]
lastname: String, lastname: String,
} }

View File

@ -438,9 +438,7 @@ error[E0308]: mismatched types
--> tests/ui-fail-nightly/from_form.rs:147:24 --> tests/ui-fail-nightly/from_form.rs:147:24
| |
147 | #[field(validate = 123)] 147 | #[field(validate = 123)]
| -------- ^^^ expected enum `Result`, found integer | ^^^ expected enum `Result`, found integer
| |
| expected due to this
| |
= note: expected enum `Result<(), Errors<'_>>` = note: expected enum `Result<(), Errors<'_>>`
found type `{integer}` found type `{integer}`

View File

@ -60,13 +60,13 @@ error[E0308]: arguments to this function are incorrect
30 | fn f3(_request: &Request, other: bool) { } 30 | fn f3(_request: &Request, other: bool) { }
| ^^ - ---- an argument of type `bool` is missing | ^^ - ---- an argument of type `bool` is missing
| | | |
| argument of type `&rocket::Request<'_>` unexpected | argument of type `Status` unexpected
| |
note: function defined here note: function defined here
--> tests/ui-fail-stable/catch.rs:30:4 --> tests/ui-fail-stable/catch.rs:30:4
| |
30 | fn f3(_request: &Request, other: bool) { } 30 | fn f3(_request: &Request, other: bool) { }
| ^^--------------------- | ^^ ------------------ -----------
help: did you mean help: did you mean
| |
29 | f3(bool, /* bool */) 29 | f3(bool, /* bool */)

View File

@ -15,7 +15,7 @@ error[E0277]: the trait bound `usize: Responder<'_, '_>` is not satisfied
<Accepted<R> as Responder<'r, 'o>> <Accepted<R> as Responder<'r, 'o>>
<Arc<[u8]> as Responder<'r, 'static>> <Arc<[u8]> as Responder<'r, 'static>>
<Arc<str> as Responder<'r, 'static>> <Arc<str> as Responder<'r, 'static>>
and 40 others and $N others
error[E0277]: the trait bound `bool: Responder<'_, '_>` is not satisfied error[E0277]: the trait bound `bool: Responder<'_, '_>` is not satisfied
--> tests/ui-fail-stable/catch_type_errors.rs:11:30 --> tests/ui-fail-stable/catch_type_errors.rs:11:30
@ -34,7 +34,7 @@ error[E0277]: the trait bound `bool: Responder<'_, '_>` is not satisfied
<Accepted<R> as Responder<'r, 'o>> <Accepted<R> as Responder<'r, 'o>>
<Arc<[u8]> as Responder<'r, 'static>> <Arc<[u8]> as Responder<'r, 'static>>
<Arc<str> as Responder<'r, 'static>> <Arc<str> as Responder<'r, 'static>>
and 40 others and $N others
error[E0308]: mismatched types error[E0308]: mismatched types
--> tests/ui-fail-stable/catch_type_errors.rs:16:17 --> tests/ui-fail-stable/catch_type_errors.rs:16:17
@ -48,7 +48,7 @@ note: function defined here
--> tests/ui-fail-stable/catch_type_errors.rs:16:4 --> tests/ui-fail-stable/catch_type_errors.rs:16:4
| |
16 | fn f3(_request: bool) -> usize { 16 | fn f3(_request: bool) -> usize {
| ^^- | ^^ --------------
error[E0277]: the trait bound `usize: Responder<'_, '_>` is not satisfied error[E0277]: the trait bound `usize: Responder<'_, '_>` is not satisfied
--> tests/ui-fail-stable/catch_type_errors.rs:16:26 --> tests/ui-fail-stable/catch_type_errors.rs:16:26
@ -67,7 +67,7 @@ error[E0277]: the trait bound `usize: Responder<'_, '_>` is not satisfied
<Accepted<R> as Responder<'r, 'o>> <Accepted<R> as Responder<'r, 'o>>
<Arc<[u8]> as Responder<'r, 'static>> <Arc<[u8]> as Responder<'r, 'static>>
<Arc<str> as Responder<'r, 'static>> <Arc<str> as Responder<'r, 'static>>
and 40 others and $N others
error[E0277]: the trait bound `usize: Responder<'_, '_>` is not satisfied error[E0277]: the trait bound `usize: Responder<'_, '_>` is not satisfied
--> tests/ui-fail-stable/catch_type_errors.rs:21:12 --> tests/ui-fail-stable/catch_type_errors.rs:21:12
@ -86,4 +86,4 @@ error[E0277]: the trait bound `usize: Responder<'_, '_>` is not satisfied
<Accepted<R> as Responder<'r, 'o>> <Accepted<R> as Responder<'r, 'o>>
<Arc<[u8]> as Responder<'r, 'static>> <Arc<[u8]> as Responder<'r, 'static>>
<Arc<str> as Responder<'r, 'static>> <Arc<str> as Responder<'r, 'static>>
and 40 others and $N others

View File

@ -470,9 +470,7 @@ error[E0308]: mismatched types
--> tests/ui-fail-stable/from_form.rs:147:24 --> tests/ui-fail-stable/from_form.rs:147:24
| |
147 | #[field(validate = 123)] 147 | #[field(validate = 123)]
| -------- ^^^ expected enum `Result`, found integer | ^^^ expected enum `Result`, found integer
| |
| expected due to this
| |
= note: expected enum `Result<(), Errors<'_>>` = note: expected enum `Result<(), Errors<'_>>`
found type `{integer}` found type `{integer}`
@ -556,4 +554,13 @@ error[E0277]: the trait bound `bool: From<&str>` is not satisfied
209 | #[field(default = "no conversion")] 209 | #[field(default = "no conversion")]
| ^^^^^^^^^^^^^^^ the trait `From<&str>` is not implemented for `bool` | ^^^^^^^^^^^^^^^ the trait `From<&str>` is not implemented for `bool`
| |
= note: required because of the requirements on the impl of `Into<bool>` for `&str` = help: the following other types implement trait `From<T>`:
<bool as From<format_description::parse::format_item::HourBase>>
<bool as From<format_description::parse::format_item::MonthCaseSensitive>>
<bool as From<format_description::parse::format_item::PeriodCase>>
<bool as From<format_description::parse::format_item::PeriodCaseSensitive>>
<bool as From<format_description::parse::format_item::SignBehavior>>
<bool as From<format_description::parse::format_item::WeekdayCaseSensitive>>
<bool as From<format_description::parse::format_item::WeekdayOneIndexed>>
<bool as From<format_description::parse::format_item::YearBase>>
= note: required for `&str` to implement `Into<bool>`

View File

@ -13,8 +13,8 @@ error[E0277]: the trait bound `Unknown: FromFormField<'_>` is not satisfied
Cow<'v, str> Cow<'v, str>
IpAddr IpAddr
Ipv4Addr Ipv4Addr
and 38 others and $N others
= note: required because of the requirements on the impl of `FromForm<'r>` for `Unknown` = note: required for `Unknown` to implement `FromForm<'r>`
error[E0277]: the trait bound `Foo<usize>: FromFormField<'_>` is not satisfied error[E0277]: the trait bound `Foo<usize>: FromFormField<'_>` is not satisfied
--> tests/ui-fail-stable/from_form_type_errors.rs:14:12 --> tests/ui-fail-stable/from_form_type_errors.rs:14:12
@ -31,5 +31,5 @@ error[E0277]: the trait bound `Foo<usize>: FromFormField<'_>` is not satisfied
Cow<'v, str> Cow<'v, str>
IpAddr IpAddr
Ipv4Addr Ipv4Addr
and 38 others and $N others
= note: required because of the requirements on the impl of `FromForm<'r>` for `Foo<usize>` = note: required for `Foo<usize>` to implement `FromForm<'r>`

View File

@ -13,30 +13,30 @@ error[E0277]: the trait bound `u8: Responder<'_, '_>` is not satisfied
<Accepted<R> as Responder<'r, 'o>> <Accepted<R> as Responder<'r, 'o>>
<Arc<[u8]> as Responder<'r, 'static>> <Arc<[u8]> as Responder<'r, 'static>>
<Arc<str> as Responder<'r, 'static>> <Arc<str> as Responder<'r, 'static>>
and 44 others and $N others
error[E0277]: the trait bound `Header<'_>: From<u8>` is not satisfied error[E0277]: the trait bound `Header<'_>: From<u8>` is not satisfied
--> tests/ui-fail-stable/responder-types.rs:11:5 --> tests/ui-fail-stable/responder-types.rs:11:5
| |
11 | other: u8, 11 | other: u8,
| ^^^^^ the trait `From<u8>` is not implemented for `Header<'_>` | ^^^^^ the trait `From<u8>` is not implemented for `Header<'_>`
| |
= help: the following other types implement trait `From<T>`: = help: the following other types implement trait `From<T>`:
<Header<'static> as From<&Cookie<'_>>> <Header<'static> as From<&Cookie<'_>>>
<Header<'static> as From<&ExpectCt>> <Header<'static> as From<&ExpectCt>>
<Header<'static> as From<&Frame>> <Header<'static> as From<&Frame>>
<Header<'static> as From<&Hsts>> <Header<'static> as From<&Hsts>>
<Header<'static> as From<&NoSniff>> <Header<'static> as From<&NoSniff>>
<Header<'static> as From<&Permission>> <Header<'static> as From<&Permission>>
<Header<'static> as From<&Prefetch>> <Header<'static> as From<&Prefetch>>
<Header<'static> as From<&Referrer>> <Header<'static> as From<&Referrer>>
and 4 others and $N others
= note: required because of the requirements on the impl of `Into<Header<'_>>` for `u8` = note: required for `u8` to implement `Into<Header<'_>>`
note: required by a bound in `rocket::Response::<'r>::set_header` note: required by a bound in `rocket::Response::<'r>::set_header`
--> $WORKSPACE/core/lib/src/response/response.rs --> $WORKSPACE/core/lib/src/response/response.rs
| |
| pub fn set_header<'h: 'r, H: Into<Header<'h>>>(&mut self, header: H) -> bool { | pub fn set_header<'h: 'r, H: Into<Header<'h>>>(&mut self, header: H) -> bool {
| ^^^^^^^^^^^^^^^^ required by this bound in `rocket::Response::<'r>::set_header` | ^^^^^^^^^^^^^^^^ required by this bound in `rocket::Response::<'r>::set_header`
error[E0277]: the trait bound `u8: Responder<'_, '_>` is not satisfied error[E0277]: the trait bound `u8: Responder<'_, '_>` is not satisfied
--> tests/ui-fail-stable/responder-types.rs:16:5 --> tests/ui-fail-stable/responder-types.rs:16:5
@ -53,72 +53,72 @@ error[E0277]: the trait bound `u8: Responder<'_, '_>` is not satisfied
<Accepted<R> as Responder<'r, 'o>> <Accepted<R> as Responder<'r, 'o>>
<Arc<[u8]> as Responder<'r, 'static>> <Arc<[u8]> as Responder<'r, 'static>>
<Arc<str> as Responder<'r, 'static>> <Arc<str> as Responder<'r, 'static>>
and 44 others and $N others
error[E0277]: the trait bound `Header<'_>: From<u8>` is not satisfied error[E0277]: the trait bound `Header<'_>: From<u8>` is not satisfied
--> tests/ui-fail-stable/responder-types.rs:17:5 --> tests/ui-fail-stable/responder-types.rs:17:5
| |
17 | other: u8, 17 | other: u8,
| ^^^^^ the trait `From<u8>` is not implemented for `Header<'_>` | ^^^^^ the trait `From<u8>` is not implemented for `Header<'_>`
| |
= help: the following other types implement trait `From<T>`: = help: the following other types implement trait `From<T>`:
<Header<'static> as From<&Cookie<'_>>> <Header<'static> as From<&Cookie<'_>>>
<Header<'static> as From<&ExpectCt>> <Header<'static> as From<&ExpectCt>>
<Header<'static> as From<&Frame>> <Header<'static> as From<&Frame>>
<Header<'static> as From<&Hsts>> <Header<'static> as From<&Hsts>>
<Header<'static> as From<&NoSniff>> <Header<'static> as From<&NoSniff>>
<Header<'static> as From<&Permission>> <Header<'static> as From<&Permission>>
<Header<'static> as From<&Prefetch>> <Header<'static> as From<&Prefetch>>
<Header<'static> as From<&Referrer>> <Header<'static> as From<&Referrer>>
and 4 others and $N others
= note: required because of the requirements on the impl of `Into<Header<'_>>` for `u8` = note: required for `u8` to implement `Into<Header<'_>>`
note: required by a bound in `rocket::Response::<'r>::set_header` note: required by a bound in `rocket::Response::<'r>::set_header`
--> $WORKSPACE/core/lib/src/response/response.rs --> $WORKSPACE/core/lib/src/response/response.rs
| |
| pub fn set_header<'h: 'r, H: Into<Header<'h>>>(&mut self, header: H) -> bool { | pub fn set_header<'h: 'r, H: Into<Header<'h>>>(&mut self, header: H) -> bool {
| ^^^^^^^^^^^^^^^^ required by this bound in `rocket::Response::<'r>::set_header` | ^^^^^^^^^^^^^^^^ required by this bound in `rocket::Response::<'r>::set_header`
error[E0277]: the trait bound `Header<'_>: From<std::string::String>` is not satisfied error[E0277]: the trait bound `Header<'_>: From<std::string::String>` is not satisfied
--> tests/ui-fail-stable/responder-types.rs:24:5 --> tests/ui-fail-stable/responder-types.rs:24:5
| |
24 | then: String, 24 | then: String,
| ^^^^ the trait `From<std::string::String>` is not implemented for `Header<'_>` | ^^^^ the trait `From<std::string::String>` is not implemented for `Header<'_>`
| |
= help: the following other types implement trait `From<T>`: = help: the following other types implement trait `From<T>`:
<Header<'static> as From<&Cookie<'_>>> <Header<'static> as From<&Cookie<'_>>>
<Header<'static> as From<&ExpectCt>> <Header<'static> as From<&ExpectCt>>
<Header<'static> as From<&Frame>> <Header<'static> as From<&Frame>>
<Header<'static> as From<&Hsts>> <Header<'static> as From<&Hsts>>
<Header<'static> as From<&NoSniff>> <Header<'static> as From<&NoSniff>>
<Header<'static> as From<&Permission>> <Header<'static> as From<&Permission>>
<Header<'static> as From<&Prefetch>> <Header<'static> as From<&Prefetch>>
<Header<'static> as From<&Referrer>> <Header<'static> as From<&Referrer>>
and 4 others and $N others
= note: required because of the requirements on the impl of `Into<Header<'_>>` for `std::string::String` = note: required for `std::string::String` to implement `Into<Header<'_>>`
note: required by a bound in `rocket::Response::<'r>::set_header` note: required by a bound in `rocket::Response::<'r>::set_header`
--> $WORKSPACE/core/lib/src/response/response.rs --> $WORKSPACE/core/lib/src/response/response.rs
| |
| pub fn set_header<'h: 'r, H: Into<Header<'h>>>(&mut self, header: H) -> bool { | pub fn set_header<'h: 'r, H: Into<Header<'h>>>(&mut self, header: H) -> bool {
| ^^^^^^^^^^^^^^^^ required by this bound in `rocket::Response::<'r>::set_header` | ^^^^^^^^^^^^^^^^ required by this bound in `rocket::Response::<'r>::set_header`
error[E0277]: the trait bound `usize: Responder<'_, '_>` is not satisfied error[E0277]: the trait bound `usize: Responder<'_, '_>` is not satisfied
--> tests/ui-fail-stable/responder-types.rs:28:13 --> tests/ui-fail-stable/responder-types.rs:28:13
| |
28 | fn foo() -> usize { 0 } 28 | fn foo() -> usize { 0 }
| ^^^^^ the trait `Responder<'_, '_>` is not implemented for `usize` | ^^^^^ the trait `Responder<'_, '_>` is not implemented for `usize`
| |
= help: the following other types implement trait `Responder<'r, 'o>`: = help: the following other types implement trait `Responder<'r, 'o>`:
<&'o [u8] as Responder<'r, 'o>> <&'o [u8] as Responder<'r, 'o>>
<&'o str as Responder<'r, 'o>> <&'o str as Responder<'r, 'o>>
<() as Responder<'r, 'static>> <() as Responder<'r, 'static>>
<(ContentType, R) as Responder<'r, 'o>> <(ContentType, R) as Responder<'r, 'o>>
<(Status, R) as Responder<'r, 'o>> <(Status, R) as Responder<'r, 'o>>
<Accepted<R> as Responder<'r, 'o>> <Accepted<R> as Responder<'r, 'o>>
<Arc<[u8]> as Responder<'r, 'static>> <Arc<[u8]> as Responder<'r, 'static>>
<Arc<str> as Responder<'r, 'static>> <Arc<str> as Responder<'r, 'static>>
and 44 others and $N others
note: required by a bound in `route::handler::<impl Outcome<rocket::Response<'o>, Status, rocket::Data<'o>>>::from` note: required by a bound in `route::handler::<impl Outcome<rocket::Response<'o>, Status, rocket::Data<'o>>>::from`
--> $WORKSPACE/core/lib/src/route/handler.rs --> $WORKSPACE/core/lib/src/route/handler.rs
| |
| pub fn from<R: Responder<'r, 'o>>(req: &'r Request<'_>, responder: R) -> Outcome<'r> { | pub fn from<R: Responder<'r, 'o>>(req: &'r Request<'_>, responder: R) -> Outcome<'r> {
| ^^^^^^^^^^^^^^^^^ required by this bound in `route::handler::<impl Outcome<rocket::Response<'o>, Status, rocket::Data<'o>>>::from` | ^^^^^^^^^^^^^^^^^ required by this bound in `route::handler::<impl Outcome<rocket::Response<'o>, Status, rocket::Data<'o>>>::from`

View File

@ -13,7 +13,7 @@ error[E0277]: the trait bound `Q: FromParam<'_>` is not satisfied
NonZeroI16 NonZeroI16
NonZeroI32 NonZeroI32
NonZeroI64 NonZeroI64
and 30 others and $N others
error[E0277]: the trait bound `Q: FromSegments<'_>` is not satisfied error[E0277]: the trait bound `Q: FromSegments<'_>` is not satisfied
--> tests/ui-fail-stable/route-type-errors.rs:9:12 --> tests/ui-fail-stable/route-type-errors.rs:9:12
@ -42,8 +42,8 @@ error[E0277]: the trait bound `Q: FromFormField<'_>` is not satisfied
Cow<'v, str> Cow<'v, str>
IpAddr IpAddr
Ipv4Addr Ipv4Addr
and 38 others and $N others
= note: required because of the requirements on the impl of `FromForm<'_>` for `Q` = note: required for `Q` to implement `FromForm<'_>`
error[E0277]: the trait bound `Q: FromFormField<'_>` is not satisfied error[E0277]: the trait bound `Q: FromFormField<'_>` is not satisfied
--> tests/ui-fail-stable/route-type-errors.rs:15:12 --> tests/ui-fail-stable/route-type-errors.rs:15:12
@ -60,8 +60,8 @@ error[E0277]: the trait bound `Q: FromFormField<'_>` is not satisfied
Cow<'v, str> Cow<'v, str>
IpAddr IpAddr
Ipv4Addr Ipv4Addr
and 38 others and $N others
= note: required because of the requirements on the impl of `FromForm<'_>` for `Q` = note: required for `Q` to implement `FromForm<'_>`
error[E0277]: the trait bound `Q: FromData<'_>` is not satisfied error[E0277]: the trait bound `Q: FromData<'_>` is not satisfied
--> tests/ui-fail-stable/route-type-errors.rs:18:12 --> tests/ui-fail-stable/route-type-errors.rs:18:12
@ -78,7 +78,7 @@ error[E0277]: the trait bound `Q: FromData<'_>` is not satisfied
Capped<&'r str> Capped<&'r str>
Capped<Cow<'impl0, str>> Capped<Cow<'impl0, str>>
Capped<TempFile<'impl0>> Capped<TempFile<'impl0>>
and 12 others and $N others
error[E0277]: the trait bound `Q: FromRequest<'_>` is not satisfied error[E0277]: the trait bound `Q: FromRequest<'_>` is not satisfied
--> tests/ui-fail-stable/route-type-errors.rs:21:10 --> tests/ui-fail-stable/route-type-errors.rs:21:10
@ -95,7 +95,7 @@ error[E0277]: the trait bound `Q: FromRequest<'_>` is not satisfied
&'r rocket::State<T> &'r rocket::State<T>
&'r rocket::http::Accept &'r rocket::http::Accept
&'r rocket::http::CookieJar<'r> &'r rocket::http::CookieJar<'r>
and 8 others and $N others
error[E0277]: the trait bound `Q: FromParam<'_>` is not satisfied error[E0277]: the trait bound `Q: FromParam<'_>` is not satisfied
--> tests/ui-fail-stable/route-type-errors.rs:21:18 --> tests/ui-fail-stable/route-type-errors.rs:21:18
@ -112,7 +112,7 @@ error[E0277]: the trait bound `Q: FromParam<'_>` is not satisfied
NonZeroI16 NonZeroI16
NonZeroI32 NonZeroI32
NonZeroI64 NonZeroI64
and 30 others and $N others
error[E0277]: the trait bound `Q: FromRequest<'_>` is not satisfied error[E0277]: the trait bound `Q: FromRequest<'_>` is not satisfied
--> tests/ui-fail-stable/route-type-errors.rs:24:10 --> tests/ui-fail-stable/route-type-errors.rs:24:10
@ -129,7 +129,7 @@ error[E0277]: the trait bound `Q: FromRequest<'_>` is not satisfied
&'r rocket::State<T> &'r rocket::State<T>
&'r rocket::http::Accept &'r rocket::http::Accept
&'r rocket::http::CookieJar<'r> &'r rocket::http::CookieJar<'r>
and 8 others and $N others
error[E0277]: the trait bound `Q: FromParam<'_>` is not satisfied error[E0277]: the trait bound `Q: FromParam<'_>` is not satisfied
--> tests/ui-fail-stable/route-type-errors.rs:24:18 --> tests/ui-fail-stable/route-type-errors.rs:24:18
@ -146,7 +146,7 @@ error[E0277]: the trait bound `Q: FromParam<'_>` is not satisfied
NonZeroI16 NonZeroI16
NonZeroI32 NonZeroI32
NonZeroI64 NonZeroI64
and 30 others and $N others
error[E0277]: the trait bound `Q: FromParam<'_>` is not satisfied error[E0277]: the trait bound `Q: FromParam<'_>` is not satisfied
--> tests/ui-fail-stable/route-type-errors.rs:24:39 --> tests/ui-fail-stable/route-type-errors.rs:24:39
@ -163,4 +163,4 @@ error[E0277]: the trait bound `Q: FromParam<'_>` is not satisfied
NonZeroI16 NonZeroI16
NonZeroI32 NonZeroI32
NonZeroI64 NonZeroI64
and 30 others and $N others

View File

@ -1,3 +1,15 @@
error[E0271]: type mismatch resolving `<std::string::String as FromParam<'_>>::Error == &str`
--> tests/ui-fail-stable/typed-uri-bad-type.rs:22:37
|
22 | fn optionals(id: Option<i32>, name: Result<String, &str>) { }
| ^^^^^^ expected enum `Infallible`, found `&str`
error[E0271]: type mismatch resolving `<std::string::String as FromParam<'_>>::Error == &str`
--> tests/ui-fail-stable/typed-uri-bad-type.rs:22:37
|
22 | fn optionals(id: Option<i32>, name: Result<String, &str>) { }
| ^^^^^^ expected `&str`, found enum `Infallible`
error[E0277]: the trait bound `usize: FromUriParam<rocket::http::uri::fmt::Path, &str>` is not satisfied error[E0277]: the trait bound `usize: FromUriParam<rocket::http::uri::fmt::Path, &str>` is not satisfied
--> tests/ui-fail-stable/typed-uri-bad-type.rs:45:22 --> tests/ui-fail-stable/typed-uri-bad-type.rs:45:22
| |
@ -13,7 +25,7 @@ error[E0277]: the trait bound `usize: FromUriParam<rocket::http::uri::fmt::Path,
<f64 as FromUriParam<P, f64>> <f64 as FromUriParam<P, f64>>
<i128 as FromUriParam<P, &'x i128>> <i128 as FromUriParam<P, &'x i128>>
<i128 as FromUriParam<P, &'x mut i128>> <i128 as FromUriParam<P, &'x mut i128>>
and 34 others and $N others
error[E0277]: the trait bound `usize: FromUriParam<rocket::http::uri::fmt::Path, &str>` is not satisfied error[E0277]: the trait bound `usize: FromUriParam<rocket::http::uri::fmt::Path, &str>` is not satisfied
--> tests/ui-fail-stable/typed-uri-bad-type.rs:47:17 --> tests/ui-fail-stable/typed-uri-bad-type.rs:47:17
@ -30,7 +42,7 @@ error[E0277]: the trait bound `usize: FromUriParam<rocket::http::uri::fmt::Path,
<f64 as FromUriParam<P, f64>> <f64 as FromUriParam<P, f64>>
<i128 as FromUriParam<P, &'x i128>> <i128 as FromUriParam<P, &'x i128>>
<i128 as FromUriParam<P, &'x mut i128>> <i128 as FromUriParam<P, &'x mut i128>>
and 34 others and $N others
error[E0277]: the trait bound `usize: FromUriParam<rocket::http::uri::fmt::Path, i64>` is not satisfied error[E0277]: the trait bound `usize: FromUriParam<rocket::http::uri::fmt::Path, i64>` is not satisfied
--> tests/ui-fail-stable/typed-uri-bad-type.rs:49:22 --> tests/ui-fail-stable/typed-uri-bad-type.rs:49:22
@ -47,7 +59,7 @@ error[E0277]: the trait bound `usize: FromUriParam<rocket::http::uri::fmt::Path,
<f64 as FromUriParam<P, f64>> <f64 as FromUriParam<P, f64>>
<i128 as FromUriParam<P, &'x i128>> <i128 as FromUriParam<P, &'x i128>>
<i128 as FromUriParam<P, &'x mut i128>> <i128 as FromUriParam<P, &'x mut i128>>
and 34 others and $N others
error[E0277]: the trait bound `S: FromUriParam<rocket::http::uri::fmt::Path, _>` is not satisfied error[E0277]: the trait bound `S: FromUriParam<rocket::http::uri::fmt::Path, _>` is not satisfied
--> tests/ui-fail-stable/typed-uri-bad-type.rs:51:30 --> tests/ui-fail-stable/typed-uri-bad-type.rs:51:30
@ -64,7 +76,7 @@ error[E0277]: the trait bound `S: FromUriParam<rocket::http::uri::fmt::Path, _>`
<&'a std::path::Path as FromUriParam<rocket::http::uri::fmt::Path, PathBuf>> <&'a std::path::Path as FromUriParam<rocket::http::uri::fmt::Path, PathBuf>>
<&'a str as FromUriParam<P, &'a str>> <&'a str as FromUriParam<P, &'a str>>
<&'a str as FromUriParam<P, &'x &'a str>> <&'a str as FromUriParam<P, &'x &'a str>>
and 155 others and $N others
error[E0277]: the trait bound `i32: FromUriParam<rocket::http::uri::fmt::Path, std::option::Option<{integer}>>` is not satisfied error[E0277]: the trait bound `i32: FromUriParam<rocket::http::uri::fmt::Path, std::option::Option<{integer}>>` is not satisfied
--> tests/ui-fail-stable/typed-uri-bad-type.rs:56:25 --> tests/ui-fail-stable/typed-uri-bad-type.rs:56:25
@ -81,8 +93,8 @@ error[E0277]: the trait bound `i32: FromUriParam<rocket::http::uri::fmt::Path, s
<f64 as FromUriParam<P, f64>> <f64 as FromUriParam<P, f64>>
<i128 as FromUriParam<P, &'x i128>> <i128 as FromUriParam<P, &'x i128>>
<i128 as FromUriParam<P, &'x mut i128>> <i128 as FromUriParam<P, &'x mut i128>>
and 34 others and $N others
= note: required because of the requirements on the impl of `FromUriParam<rocket::http::uri::fmt::Path, std::option::Option<{integer}>>` for `std::option::Option<i32>` = note: required for `std::option::Option<i32>` to implement `FromUriParam<rocket::http::uri::fmt::Path, std::option::Option<{integer}>>`
error[E0277]: the trait bound `std::string::String: FromUriParam<rocket::http::uri::fmt::Path, Result<_, _>>` is not satisfied error[E0277]: the trait bound `std::string::String: FromUriParam<rocket::http::uri::fmt::Path, Result<_, _>>` is not satisfied
--> tests/ui-fail-stable/typed-uri-bad-type.rs:56:42 --> tests/ui-fail-stable/typed-uri-bad-type.rs:56:42
@ -99,8 +111,8 @@ error[E0277]: the trait bound `std::string::String: FromUriParam<rocket::http::u
<&'a str as FromUriParam<P, std::string::String>> <&'a str as FromUriParam<P, std::string::String>>
<std::string::String as FromUriParam<P, &'a str>> <std::string::String as FromUriParam<P, &'a str>>
<std::string::String as FromUriParam<P, &'x &'a str>> <std::string::String as FromUriParam<P, &'x &'a str>>
and 4 others and $N others
= note: required because of the requirements on the impl of `FromUriParam<rocket::http::uri::fmt::Path, Result<_, _>>` for `Result<std::string::String, &str>` = note: required for `Result<std::string::String, &str>` to implement `FromUriParam<rocket::http::uri::fmt::Path, Result<_, _>>`
error[E0277]: the trait bound `isize: FromUriParam<rocket::http::uri::fmt::Query, &str>` is not satisfied error[E0277]: the trait bound `isize: FromUriParam<rocket::http::uri::fmt::Query, &str>` is not satisfied
--> tests/ui-fail-stable/typed-uri-bad-type.rs:58:19 --> tests/ui-fail-stable/typed-uri-bad-type.rs:58:19
@ -117,7 +129,7 @@ error[E0277]: the trait bound `isize: FromUriParam<rocket::http::uri::fmt::Query
<f64 as FromUriParam<P, f64>> <f64 as FromUriParam<P, f64>>
<i128 as FromUriParam<P, &'x i128>> <i128 as FromUriParam<P, &'x i128>>
<i128 as FromUriParam<P, &'x mut i128>> <i128 as FromUriParam<P, &'x mut i128>>
and 34 others and $N others
error[E0277]: the trait bound `isize: FromUriParam<rocket::http::uri::fmt::Query, &str>` is not satisfied error[E0277]: the trait bound `isize: FromUriParam<rocket::http::uri::fmt::Query, &str>` is not satisfied
--> tests/ui-fail-stable/typed-uri-bad-type.rs:60:24 --> tests/ui-fail-stable/typed-uri-bad-type.rs:60:24
@ -134,7 +146,7 @@ error[E0277]: the trait bound `isize: FromUriParam<rocket::http::uri::fmt::Query
<f64 as FromUriParam<P, f64>> <f64 as FromUriParam<P, f64>>
<i128 as FromUriParam<P, &'x i128>> <i128 as FromUriParam<P, &'x i128>>
<i128 as FromUriParam<P, &'x mut i128>> <i128 as FromUriParam<P, &'x mut i128>>
and 34 others and $N others
error[E0277]: the trait bound `S: FromUriParam<rocket::http::uri::fmt::Query, _>` is not satisfied error[E0277]: the trait bound `S: FromUriParam<rocket::http::uri::fmt::Query, _>` is not satisfied
--> tests/ui-fail-stable/typed-uri-bad-type.rs:62:23 --> tests/ui-fail-stable/typed-uri-bad-type.rs:62:23
@ -151,7 +163,7 @@ error[E0277]: the trait bound `S: FromUriParam<rocket::http::uri::fmt::Query, _>
<&'a std::path::Path as FromUriParam<rocket::http::uri::fmt::Path, PathBuf>> <&'a std::path::Path as FromUriParam<rocket::http::uri::fmt::Path, PathBuf>>
<&'a str as FromUriParam<P, &'a str>> <&'a str as FromUriParam<P, &'a str>>
<&'a str as FromUriParam<P, &'x &'a str>> <&'a str as FromUriParam<P, &'x &'a str>>
and 155 others and $N others
error[E0277]: the trait bound `S: FromUriParam<rocket::http::uri::fmt::Query, _>` is not satisfied error[E0277]: the trait bound `S: FromUriParam<rocket::http::uri::fmt::Query, _>` is not satisfied
--> tests/ui-fail-stable/typed-uri-bad-type.rs:64:25 --> tests/ui-fail-stable/typed-uri-bad-type.rs:64:25
@ -168,37 +180,37 @@ error[E0277]: the trait bound `S: FromUriParam<rocket::http::uri::fmt::Query, _>
<&'a std::path::Path as FromUriParam<rocket::http::uri::fmt::Path, PathBuf>> <&'a std::path::Path as FromUriParam<rocket::http::uri::fmt::Path, PathBuf>>
<&'a str as FromUriParam<P, &'a str>> <&'a str as FromUriParam<P, &'a str>>
<&'a str as FromUriParam<P, &'x &'a str>> <&'a str as FromUriParam<P, &'x &'a str>>
and 155 others and $N others
error[E0277]: the trait bound `S: Ignorable<rocket::http::uri::fmt::Query>` is not satisfied error[E0277]: the trait bound `S: Ignorable<rocket::http::uri::fmt::Query>` is not satisfied
--> tests/ui-fail-stable/typed-uri-bad-type.rs:66:25 --> tests/ui-fail-stable/typed-uri-bad-type.rs:66:25
| |
66 | uri!(other_q(rest = _, id = 100)); 66 | uri!(other_q(rest = _, id = 100));
| ^ the trait `Ignorable<rocket::http::uri::fmt::Query>` is not implemented for `S` | ^ the trait `Ignorable<rocket::http::uri::fmt::Query>` is not implemented for `S`
| |
= help: the following other types implement trait `Ignorable<P>`: = help: the following other types implement trait `Ignorable<P>`:
Result<T, E> Result<T, E>
std::option::Option<T> std::option::Option<T>
note: required by a bound in `assert_ignorable` note: required by a bound in `assert_ignorable`
--> $WORKSPACE/core/http/src/uri/fmt/uri_display.rs --> $WORKSPACE/core/http/src/uri/fmt/uri_display.rs
| |
| pub fn assert_ignorable<P: Part, T: Ignorable<P>>() { } | pub fn assert_ignorable<P: Part, T: Ignorable<P>>() { }
| ^^^^^^^^^^^^ required by this bound in `assert_ignorable` | ^^^^^^^^^^^^ required by this bound in `assert_ignorable`
error[E0277]: the trait bound `usize: Ignorable<rocket::http::uri::fmt::Query>` is not satisfied error[E0277]: the trait bound `usize: Ignorable<rocket::http::uri::fmt::Query>` is not satisfied
--> tests/ui-fail-stable/typed-uri-bad-type.rs:68:33 --> tests/ui-fail-stable/typed-uri-bad-type.rs:68:33
| |
68 | uri!(other_q(rest = S, id = _)); 68 | uri!(other_q(rest = S, id = _));
| ^ the trait `Ignorable<rocket::http::uri::fmt::Query>` is not implemented for `usize` | ^ the trait `Ignorable<rocket::http::uri::fmt::Query>` is not implemented for `usize`
| |
= help: the following other types implement trait `Ignorable<P>`: = help: the following other types implement trait `Ignorable<P>`:
Result<T, E> Result<T, E>
std::option::Option<T> std::option::Option<T>
note: required by a bound in `assert_ignorable` note: required by a bound in `assert_ignorable`
--> $WORKSPACE/core/http/src/uri/fmt/uri_display.rs --> $WORKSPACE/core/http/src/uri/fmt/uri_display.rs
| |
| pub fn assert_ignorable<P: Part, T: Ignorable<P>>() { } | pub fn assert_ignorable<P: Part, T: Ignorable<P>>() { }
| ^^^^^^^^^^^^ required by this bound in `assert_ignorable` | ^^^^^^^^^^^^ required by this bound in `assert_ignorable`
error[E0277]: the trait bound `S: FromUriParam<rocket::http::uri::fmt::Query, _>` is not satisfied error[E0277]: the trait bound `S: FromUriParam<rocket::http::uri::fmt::Query, _>` is not satisfied
--> tests/ui-fail-stable/typed-uri-bad-type.rs:68:25 --> tests/ui-fail-stable/typed-uri-bad-type.rs:68:25
@ -215,7 +227,7 @@ error[E0277]: the trait bound `S: FromUriParam<rocket::http::uri::fmt::Query, _>
<&'a std::path::Path as FromUriParam<rocket::http::uri::fmt::Path, PathBuf>> <&'a std::path::Path as FromUriParam<rocket::http::uri::fmt::Path, PathBuf>>
<&'a str as FromUriParam<P, &'a str>> <&'a str as FromUriParam<P, &'a str>>
<&'a str as FromUriParam<P, &'x &'a str>> <&'a str as FromUriParam<P, &'x &'a str>>
and 155 others and $N others
error[E0277]: the trait bound `usize: FromUriParam<rocket::http::uri::fmt::Path, &str>` is not satisfied error[E0277]: the trait bound `usize: FromUriParam<rocket::http::uri::fmt::Path, &str>` is not satisfied
--> tests/ui-fail-stable/typed-uri-bad-type.rs:77:40 --> tests/ui-fail-stable/typed-uri-bad-type.rs:77:40
@ -232,24 +244,24 @@ error[E0277]: the trait bound `usize: FromUriParam<rocket::http::uri::fmt::Path,
<f64 as FromUriParam<P, f64>> <f64 as FromUriParam<P, f64>>
<i128 as FromUriParam<P, &'x i128>> <i128 as FromUriParam<P, &'x i128>>
<i128 as FromUriParam<P, &'x mut i128>> <i128 as FromUriParam<P, &'x mut i128>>
and 34 others and $N others
error[E0277]: the trait bound `rocket::http::uri::Reference<'_>: ValidRoutePrefix` is not satisfied error[E0277]: the trait bound `rocket::http::uri::Reference<'_>: ValidRoutePrefix` is not satisfied
--> tests/ui-fail-stable/typed-uri-bad-type.rs:77:15 --> tests/ui-fail-stable/typed-uri-bad-type.rs:77:15
| |
77 | uri!(uri!("?foo#bar"), simple(id = "hi")); 77 | uri!(uri!("?foo#bar"), simple(id = "hi"));
| --- ^^^^^^^^^^ the trait `ValidRoutePrefix` is not implemented for `rocket::http::uri::Reference<'_>` | --- ^^^^^^^^^^ the trait `ValidRoutePrefix` is not implemented for `rocket::http::uri::Reference<'_>`
| | | |
| required by a bound introduced by this call | required by a bound introduced by this call
| |
= help: the following other types implement trait `ValidRoutePrefix`: = help: the following other types implement trait `ValidRoutePrefix`:
rocket::http::uri::Absolute<'a> rocket::http::uri::Absolute<'a>
rocket::http::uri::Origin<'a> rocket::http::uri::Origin<'a>
note: required by a bound in `RouteUriBuilder::with_prefix` note: required by a bound in `RouteUriBuilder::with_prefix`
--> $WORKSPACE/core/http/src/uri/fmt/formatter.rs --> $WORKSPACE/core/http/src/uri/fmt/formatter.rs
| |
| pub fn with_prefix<P: ValidRoutePrefix>(self, p: P) -> PrefixedRouteUri<P::Output> { | pub fn with_prefix<P: ValidRoutePrefix>(self, p: P) -> PrefixedRouteUri<P::Output> {
| ^^^^^^^^^^^^^^^^ required by this bound in `RouteUriBuilder::with_prefix` | ^^^^^^^^^^^^^^^^ required by this bound in `RouteUriBuilder::with_prefix`
error[E0277]: the trait bound `usize: FromUriParam<rocket::http::uri::fmt::Path, &str>` is not satisfied error[E0277]: the trait bound `usize: FromUriParam<rocket::http::uri::fmt::Path, &str>` is not satisfied
--> tests/ui-fail-stable/typed-uri-bad-type.rs:78:33 --> tests/ui-fail-stable/typed-uri-bad-type.rs:78:33
@ -266,24 +278,24 @@ error[E0277]: the trait bound `usize: FromUriParam<rocket::http::uri::fmt::Path,
<f64 as FromUriParam<P, f64>> <f64 as FromUriParam<P, f64>>
<i128 as FromUriParam<P, &'x i128>> <i128 as FromUriParam<P, &'x i128>>
<i128 as FromUriParam<P, &'x mut i128>> <i128 as FromUriParam<P, &'x mut i128>>
and 34 others and $N others
error[E0277]: the trait bound `rocket::http::uri::Asterisk: ValidRoutePrefix` is not satisfied error[E0277]: the trait bound `rocket::http::uri::Asterisk: ValidRoutePrefix` is not satisfied
--> tests/ui-fail-stable/typed-uri-bad-type.rs:78:15 --> tests/ui-fail-stable/typed-uri-bad-type.rs:78:15
| |
78 | uri!(uri!("*"), simple(id = "hi")); 78 | uri!(uri!("*"), simple(id = "hi"));
| --- ^^^ the trait `ValidRoutePrefix` is not implemented for `rocket::http::uri::Asterisk` | --- ^^^ the trait `ValidRoutePrefix` is not implemented for `rocket::http::uri::Asterisk`
| | | |
| required by a bound introduced by this call | required by a bound introduced by this call
| |
= help: the following other types implement trait `ValidRoutePrefix`: = help: the following other types implement trait `ValidRoutePrefix`:
rocket::http::uri::Absolute<'a> rocket::http::uri::Absolute<'a>
rocket::http::uri::Origin<'a> rocket::http::uri::Origin<'a>
note: required by a bound in `RouteUriBuilder::with_prefix` note: required by a bound in `RouteUriBuilder::with_prefix`
--> $WORKSPACE/core/http/src/uri/fmt/formatter.rs --> $WORKSPACE/core/http/src/uri/fmt/formatter.rs
| |
| pub fn with_prefix<P: ValidRoutePrefix>(self, p: P) -> PrefixedRouteUri<P::Output> { | pub fn with_prefix<P: ValidRoutePrefix>(self, p: P) -> PrefixedRouteUri<P::Output> {
| ^^^^^^^^^^^^^^^^ required by this bound in `RouteUriBuilder::with_prefix` | ^^^^^^^^^^^^^^^^ required by this bound in `RouteUriBuilder::with_prefix`
error[E0277]: the trait bound `usize: FromUriParam<rocket::http::uri::fmt::Path, &str>` is not satisfied error[E0277]: the trait bound `usize: FromUriParam<rocket::http::uri::fmt::Path, &str>` is not satisfied
--> tests/ui-fail-stable/typed-uri-bad-type.rs:81:25 --> tests/ui-fail-stable/typed-uri-bad-type.rs:81:25
@ -300,26 +312,26 @@ error[E0277]: the trait bound `usize: FromUriParam<rocket::http::uri::fmt::Path,
<f64 as FromUriParam<P, f64>> <f64 as FromUriParam<P, f64>>
<i128 as FromUriParam<P, &'x i128>> <i128 as FromUriParam<P, &'x i128>>
<i128 as FromUriParam<P, &'x mut i128>> <i128 as FromUriParam<P, &'x mut i128>>
and 34 others and $N others
error[E0277]: the trait bound `rocket::http::uri::Asterisk: ValidRouteSuffix<rocket::http::uri::Origin<'static>>` is not satisfied error[E0277]: the trait bound `rocket::http::uri::Asterisk: ValidRouteSuffix<rocket::http::uri::Origin<'static>>` is not satisfied
--> tests/ui-fail-stable/typed-uri-bad-type.rs:81:37 --> tests/ui-fail-stable/typed-uri-bad-type.rs:81:37
| |
81 | uri!(_, simple(id = "hi"), uri!("*")); 81 | uri!(_, simple(id = "hi"), uri!("*"));
| --- ^^^ the trait `ValidRouteSuffix<rocket::http::uri::Origin<'static>>` is not implemented for `rocket::http::uri::Asterisk` | --- ^^^ the trait `ValidRouteSuffix<rocket::http::uri::Origin<'static>>` is not implemented for `rocket::http::uri::Asterisk`
| | | |
| required by a bound introduced by this call | required by a bound introduced by this call
| |
= help: the following other types implement trait `ValidRouteSuffix<T>`: = help: the following other types implement trait `ValidRouteSuffix<T>`:
<rocket::http::uri::Absolute<'a> as ValidRouteSuffix<rocket::http::uri::Absolute<'a>>> <rocket::http::uri::Absolute<'a> as ValidRouteSuffix<rocket::http::uri::Absolute<'a>>>
<rocket::http::uri::Absolute<'a> as ValidRouteSuffix<rocket::http::uri::Origin<'a>>> <rocket::http::uri::Absolute<'a> as ValidRouteSuffix<rocket::http::uri::Origin<'a>>>
<rocket::http::uri::Reference<'a> as ValidRouteSuffix<rocket::http::uri::Absolute<'a>>> <rocket::http::uri::Reference<'a> as ValidRouteSuffix<rocket::http::uri::Absolute<'a>>>
<rocket::http::uri::Reference<'a> as ValidRouteSuffix<rocket::http::uri::Origin<'a>>> <rocket::http::uri::Reference<'a> as ValidRouteSuffix<rocket::http::uri::Origin<'a>>>
note: required by a bound in `RouteUriBuilder::with_suffix` note: required by a bound in `RouteUriBuilder::with_suffix`
--> $WORKSPACE/core/http/src/uri/fmt/formatter.rs --> $WORKSPACE/core/http/src/uri/fmt/formatter.rs
| |
| where S: ValidRouteSuffix<Origin<'static>> | where S: ValidRouteSuffix<Origin<'static>>
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `RouteUriBuilder::with_suffix` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `RouteUriBuilder::with_suffix`
error[E0277]: the trait bound `usize: FromUriParam<rocket::http::uri::fmt::Path, &str>` is not satisfied error[E0277]: the trait bound `usize: FromUriParam<rocket::http::uri::fmt::Path, &str>` is not satisfied
--> tests/ui-fail-stable/typed-uri-bad-type.rs:82:25 --> tests/ui-fail-stable/typed-uri-bad-type.rs:82:25
@ -336,35 +348,23 @@ error[E0277]: the trait bound `usize: FromUriParam<rocket::http::uri::fmt::Path,
<f64 as FromUriParam<P, f64>> <f64 as FromUriParam<P, f64>>
<i128 as FromUriParam<P, &'x i128>> <i128 as FromUriParam<P, &'x i128>>
<i128 as FromUriParam<P, &'x mut i128>> <i128 as FromUriParam<P, &'x mut i128>>
and 34 others and $N others
error[E0277]: the trait bound `rocket::http::uri::Origin<'_>: ValidRouteSuffix<rocket::http::uri::Origin<'static>>` is not satisfied error[E0277]: the trait bound `rocket::http::uri::Origin<'_>: ValidRouteSuffix<rocket::http::uri::Origin<'static>>` is not satisfied
--> tests/ui-fail-stable/typed-uri-bad-type.rs:82:37 --> tests/ui-fail-stable/typed-uri-bad-type.rs:82:37
| |
82 | uri!(_, simple(id = "hi"), uri!("/foo/bar")); 82 | uri!(_, simple(id = "hi"), uri!("/foo/bar"));
| --- ^^^^^^^^^^ the trait `ValidRouteSuffix<rocket::http::uri::Origin<'static>>` is not implemented for `rocket::http::uri::Origin<'_>` | --- ^^^^^^^^^^ the trait `ValidRouteSuffix<rocket::http::uri::Origin<'static>>` is not implemented for `rocket::http::uri::Origin<'_>`
| | | |
| required by a bound introduced by this call | required by a bound introduced by this call
| |
= help: the following other types implement trait `ValidRouteSuffix<T>`: = help: the following other types implement trait `ValidRouteSuffix<T>`:
<rocket::http::uri::Absolute<'a> as ValidRouteSuffix<rocket::http::uri::Absolute<'a>>> <rocket::http::uri::Absolute<'a> as ValidRouteSuffix<rocket::http::uri::Absolute<'a>>>
<rocket::http::uri::Absolute<'a> as ValidRouteSuffix<rocket::http::uri::Origin<'a>>> <rocket::http::uri::Absolute<'a> as ValidRouteSuffix<rocket::http::uri::Origin<'a>>>
<rocket::http::uri::Reference<'a> as ValidRouteSuffix<rocket::http::uri::Absolute<'a>>> <rocket::http::uri::Reference<'a> as ValidRouteSuffix<rocket::http::uri::Absolute<'a>>>
<rocket::http::uri::Reference<'a> as ValidRouteSuffix<rocket::http::uri::Origin<'a>>> <rocket::http::uri::Reference<'a> as ValidRouteSuffix<rocket::http::uri::Origin<'a>>>
note: required by a bound in `RouteUriBuilder::with_suffix` note: required by a bound in `RouteUriBuilder::with_suffix`
--> $WORKSPACE/core/http/src/uri/fmt/formatter.rs --> $WORKSPACE/core/http/src/uri/fmt/formatter.rs
|
| where S: ValidRouteSuffix<Origin<'static>>
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `RouteUriBuilder::with_suffix`
error[E0271]: type mismatch resolving `<std::string::String as FromParam<'_>>::Error == &str`
--> tests/ui-fail-stable/typed-uri-bad-type.rs:22:37
| |
22 | fn optionals(id: Option<i32>, name: Result<String, &str>) { } | where S: ValidRouteSuffix<Origin<'static>>
| ^^^^^^ expected enum `Infallible`, found `&str` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `RouteUriBuilder::with_suffix`
error[E0271]: type mismatch resolving `<std::string::String as FromParam<'_>>::Error == &str`
--> tests/ui-fail-stable/typed-uri-bad-type.rs:22:37
|
22 | fn optionals(id: Option<i32>, name: Result<String, &str>) { }
| ^^^^^^ expected `&str`, found enum `Infallible`

View File

@ -1,166 +1,166 @@
error[E0277]: the trait bound `BadType: UriDisplay<rocket::http::uri::fmt::Query>` is not satisfied error[E0277]: the trait bound `BadType: UriDisplay<rocket::http::uri::fmt::Query>` is not satisfied
--> tests/ui-fail-stable/uri_display_type_errors.rs:6:13 --> tests/ui-fail-stable/uri_display_type_errors.rs:6:13
| |
6 | struct Bar1(BadType); 6 | struct Bar1(BadType);
| ^^^^^^^ the trait `UriDisplay<rocket::http::uri::fmt::Query>` is not implemented for `BadType` | ^^^^^^^ the trait `UriDisplay<rocket::http::uri::fmt::Query>` is not implemented for `BadType`
| |
= help: the following other types implement trait `UriDisplay<P>`: = help: the following other types implement trait `UriDisplay<P>`:
<&T as UriDisplay<P>> <&T as UriDisplay<P>>
<&mut T as UriDisplay<P>> <&mut T as UriDisplay<P>>
<BTreeMap<K, V> as UriDisplay<rocket::http::uri::fmt::Query>> <BTreeMap<K, V> as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar1 as UriDisplay<rocket::http::uri::fmt::Query>> <Bar1 as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar2 as UriDisplay<rocket::http::uri::fmt::Query>> <Bar2 as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar3 as UriDisplay<rocket::http::uri::fmt::Query>> <Bar3 as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar4 as UriDisplay<rocket::http::uri::fmt::Query>> <Bar4 as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar5 as UriDisplay<rocket::http::uri::fmt::Query>> <Bar5 as UriDisplay<rocket::http::uri::fmt::Query>>
and 48 others and $N others
= note: required because of the requirements on the impl of `UriDisplay<rocket::http::uri::fmt::Query>` for `&BadType` = note: required for `&BadType` to implement `UriDisplay<rocket::http::uri::fmt::Query>`
note: required by a bound in `rocket::http::uri::fmt::Formatter::<'i, P>::write_value` note: required by a bound in `rocket::http::uri::fmt::Formatter::<'i, P>::write_value`
--> $WORKSPACE/core/http/src/uri/fmt/formatter.rs --> $WORKSPACE/core/http/src/uri/fmt/formatter.rs
| |
| pub fn write_value<T: UriDisplay<P>>(&mut self, value: T) -> fmt::Result { | pub fn write_value<T: UriDisplay<P>>(&mut self, value: T) -> fmt::Result {
| ^^^^^^^^^^^^^ required by this bound in `rocket::http::uri::fmt::Formatter::<'i, P>::write_value` | ^^^^^^^^^^^^^ required by this bound in `rocket::http::uri::fmt::Formatter::<'i, P>::write_value`
error[E0277]: the trait bound `BadType: UriDisplay<rocket::http::uri::fmt::Query>` is not satisfied error[E0277]: the trait bound `BadType: UriDisplay<rocket::http::uri::fmt::Query>` is not satisfied
--> tests/ui-fail-stable/uri_display_type_errors.rs:10:5 --> tests/ui-fail-stable/uri_display_type_errors.rs:10:5
| |
10 | field: BadType, 10 | field: BadType,
| ^^^^^ the trait `UriDisplay<rocket::http::uri::fmt::Query>` is not implemented for `BadType` | ^^^^^ the trait `UriDisplay<rocket::http::uri::fmt::Query>` is not implemented for `BadType`
| |
= help: the following other types implement trait `UriDisplay<P>`: = help: the following other types implement trait `UriDisplay<P>`:
<&T as UriDisplay<P>> <&T as UriDisplay<P>>
<&mut T as UriDisplay<P>> <&mut T as UriDisplay<P>>
<BTreeMap<K, V> as UriDisplay<rocket::http::uri::fmt::Query>> <BTreeMap<K, V> as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar1 as UriDisplay<rocket::http::uri::fmt::Query>> <Bar1 as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar2 as UriDisplay<rocket::http::uri::fmt::Query>> <Bar2 as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar3 as UriDisplay<rocket::http::uri::fmt::Query>> <Bar3 as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar4 as UriDisplay<rocket::http::uri::fmt::Query>> <Bar4 as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar5 as UriDisplay<rocket::http::uri::fmt::Query>> <Bar5 as UriDisplay<rocket::http::uri::fmt::Query>>
and 48 others and $N others
= note: required because of the requirements on the impl of `UriDisplay<rocket::http::uri::fmt::Query>` for `&BadType` = note: required for `&BadType` to implement `UriDisplay<rocket::http::uri::fmt::Query>`
note: required by a bound in `rocket::http::uri::fmt::Formatter::<'_, rocket::http::uri::fmt::Query>::write_named_value` note: required by a bound in `rocket::http::uri::fmt::Formatter::<'_, rocket::http::uri::fmt::Query>::write_named_value`
--> $WORKSPACE/core/http/src/uri/fmt/formatter.rs --> $WORKSPACE/core/http/src/uri/fmt/formatter.rs
| |
| pub fn write_named_value<T: UriDisplay<Query>>(&mut self, name: &str, value: T) -> fmt::Result { | pub fn write_named_value<T: UriDisplay<Query>>(&mut self, name: &str, value: T) -> fmt::Result {
| ^^^^^^^^^^^^^^^^^ required by this bound in `rocket::http::uri::fmt::Formatter::<'_, rocket::http::uri::fmt::Query>::write_named_value` | ^^^^^^^^^^^^^^^^^ required by this bound in `rocket::http::uri::fmt::Formatter::<'_, rocket::http::uri::fmt::Query>::write_named_value`
error[E0277]: the trait bound `BadType: UriDisplay<rocket::http::uri::fmt::Query>` is not satisfied error[E0277]: the trait bound `BadType: UriDisplay<rocket::http::uri::fmt::Query>` is not satisfied
--> tests/ui-fail-stable/uri_display_type_errors.rs:16:5 --> tests/ui-fail-stable/uri_display_type_errors.rs:16:5
| |
16 | bad: BadType, 16 | bad: BadType,
| ^^^ the trait `UriDisplay<rocket::http::uri::fmt::Query>` is not implemented for `BadType` | ^^^ the trait `UriDisplay<rocket::http::uri::fmt::Query>` is not implemented for `BadType`
| |
= help: the following other types implement trait `UriDisplay<P>`: = help: the following other types implement trait `UriDisplay<P>`:
<&T as UriDisplay<P>> <&T as UriDisplay<P>>
<&mut T as UriDisplay<P>> <&mut T as UriDisplay<P>>
<BTreeMap<K, V> as UriDisplay<rocket::http::uri::fmt::Query>> <BTreeMap<K, V> as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar1 as UriDisplay<rocket::http::uri::fmt::Query>> <Bar1 as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar2 as UriDisplay<rocket::http::uri::fmt::Query>> <Bar2 as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar3 as UriDisplay<rocket::http::uri::fmt::Query>> <Bar3 as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar4 as UriDisplay<rocket::http::uri::fmt::Query>> <Bar4 as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar5 as UriDisplay<rocket::http::uri::fmt::Query>> <Bar5 as UriDisplay<rocket::http::uri::fmt::Query>>
and 48 others and $N others
= note: required because of the requirements on the impl of `UriDisplay<rocket::http::uri::fmt::Query>` for `&BadType` = note: required for `&BadType` to implement `UriDisplay<rocket::http::uri::fmt::Query>`
note: required by a bound in `rocket::http::uri::fmt::Formatter::<'_, rocket::http::uri::fmt::Query>::write_named_value` note: required by a bound in `rocket::http::uri::fmt::Formatter::<'_, rocket::http::uri::fmt::Query>::write_named_value`
--> $WORKSPACE/core/http/src/uri/fmt/formatter.rs --> $WORKSPACE/core/http/src/uri/fmt/formatter.rs
| |
| pub fn write_named_value<T: UriDisplay<Query>>(&mut self, name: &str, value: T) -> fmt::Result { | pub fn write_named_value<T: UriDisplay<Query>>(&mut self, name: &str, value: T) -> fmt::Result {
| ^^^^^^^^^^^^^^^^^ required by this bound in `rocket::http::uri::fmt::Formatter::<'_, rocket::http::uri::fmt::Query>::write_named_value` | ^^^^^^^^^^^^^^^^^ required by this bound in `rocket::http::uri::fmt::Formatter::<'_, rocket::http::uri::fmt::Query>::write_named_value`
error[E0277]: the trait bound `BadType: UriDisplay<rocket::http::uri::fmt::Query>` is not satisfied error[E0277]: the trait bound `BadType: UriDisplay<rocket::http::uri::fmt::Query>` is not satisfied
--> tests/ui-fail-stable/uri_display_type_errors.rs:21:11 --> tests/ui-fail-stable/uri_display_type_errors.rs:21:11
| |
21 | Inner(BadType), 21 | Inner(BadType),
| ^^^^^^^ the trait `UriDisplay<rocket::http::uri::fmt::Query>` is not implemented for `BadType` | ^^^^^^^ the trait `UriDisplay<rocket::http::uri::fmt::Query>` is not implemented for `BadType`
| |
= help: the following other types implement trait `UriDisplay<P>`: = help: the following other types implement trait `UriDisplay<P>`:
<&T as UriDisplay<P>> <&T as UriDisplay<P>>
<&mut T as UriDisplay<P>> <&mut T as UriDisplay<P>>
<BTreeMap<K, V> as UriDisplay<rocket::http::uri::fmt::Query>> <BTreeMap<K, V> as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar1 as UriDisplay<rocket::http::uri::fmt::Query>> <Bar1 as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar2 as UriDisplay<rocket::http::uri::fmt::Query>> <Bar2 as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar3 as UriDisplay<rocket::http::uri::fmt::Query>> <Bar3 as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar4 as UriDisplay<rocket::http::uri::fmt::Query>> <Bar4 as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar5 as UriDisplay<rocket::http::uri::fmt::Query>> <Bar5 as UriDisplay<rocket::http::uri::fmt::Query>>
and 48 others and $N others
= note: required because of the requirements on the impl of `UriDisplay<rocket::http::uri::fmt::Query>` for `&BadType` = note: required for `&BadType` to implement `UriDisplay<rocket::http::uri::fmt::Query>`
= note: 1 redundant requirement hidden = note: 1 redundant requirement hidden
= note: required because of the requirements on the impl of `UriDisplay<rocket::http::uri::fmt::Query>` for `&&BadType` = note: required for `&&BadType` to implement `UriDisplay<rocket::http::uri::fmt::Query>`
note: required by a bound in `rocket::http::uri::fmt::Formatter::<'i, P>::write_value` note: required by a bound in `rocket::http::uri::fmt::Formatter::<'i, P>::write_value`
--> $WORKSPACE/core/http/src/uri/fmt/formatter.rs --> $WORKSPACE/core/http/src/uri/fmt/formatter.rs
| |
| pub fn write_value<T: UriDisplay<P>>(&mut self, value: T) -> fmt::Result { | pub fn write_value<T: UriDisplay<P>>(&mut self, value: T) -> fmt::Result {
| ^^^^^^^^^^^^^ required by this bound in `rocket::http::uri::fmt::Formatter::<'i, P>::write_value` | ^^^^^^^^^^^^^ required by this bound in `rocket::http::uri::fmt::Formatter::<'i, P>::write_value`
error[E0277]: the trait bound `BadType: UriDisplay<rocket::http::uri::fmt::Query>` is not satisfied error[E0277]: the trait bound `BadType: UriDisplay<rocket::http::uri::fmt::Query>` is not satisfied
--> tests/ui-fail-stable/uri_display_type_errors.rs:27:9 --> tests/ui-fail-stable/uri_display_type_errors.rs:27:9
| |
27 | field: BadType, 27 | field: BadType,
| ^^^^^ the trait `UriDisplay<rocket::http::uri::fmt::Query>` is not implemented for `BadType` | ^^^^^ the trait `UriDisplay<rocket::http::uri::fmt::Query>` is not implemented for `BadType`
| |
= help: the following other types implement trait `UriDisplay<P>`: = help: the following other types implement trait `UriDisplay<P>`:
<&T as UriDisplay<P>> <&T as UriDisplay<P>>
<&mut T as UriDisplay<P>> <&mut T as UriDisplay<P>>
<BTreeMap<K, V> as UriDisplay<rocket::http::uri::fmt::Query>> <BTreeMap<K, V> as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar1 as UriDisplay<rocket::http::uri::fmt::Query>> <Bar1 as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar2 as UriDisplay<rocket::http::uri::fmt::Query>> <Bar2 as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar3 as UriDisplay<rocket::http::uri::fmt::Query>> <Bar3 as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar4 as UriDisplay<rocket::http::uri::fmt::Query>> <Bar4 as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar5 as UriDisplay<rocket::http::uri::fmt::Query>> <Bar5 as UriDisplay<rocket::http::uri::fmt::Query>>
and 48 others and $N others
= note: required because of the requirements on the impl of `UriDisplay<rocket::http::uri::fmt::Query>` for `&BadType` = note: required for `&BadType` to implement `UriDisplay<rocket::http::uri::fmt::Query>`
= note: 1 redundant requirement hidden = note: 1 redundant requirement hidden
= note: required because of the requirements on the impl of `UriDisplay<rocket::http::uri::fmt::Query>` for `&&BadType` = note: required for `&&BadType` to implement `UriDisplay<rocket::http::uri::fmt::Query>`
note: required by a bound in `rocket::http::uri::fmt::Formatter::<'_, rocket::http::uri::fmt::Query>::write_named_value` note: required by a bound in `rocket::http::uri::fmt::Formatter::<'_, rocket::http::uri::fmt::Query>::write_named_value`
--> $WORKSPACE/core/http/src/uri/fmt/formatter.rs --> $WORKSPACE/core/http/src/uri/fmt/formatter.rs
| |
| pub fn write_named_value<T: UriDisplay<Query>>(&mut self, name: &str, value: T) -> fmt::Result { | pub fn write_named_value<T: UriDisplay<Query>>(&mut self, name: &str, value: T) -> fmt::Result {
| ^^^^^^^^^^^^^^^^^ required by this bound in `rocket::http::uri::fmt::Formatter::<'_, rocket::http::uri::fmt::Query>::write_named_value` | ^^^^^^^^^^^^^^^^^ required by this bound in `rocket::http::uri::fmt::Formatter::<'_, rocket::http::uri::fmt::Query>::write_named_value`
error[E0277]: the trait bound `BadType: UriDisplay<rocket::http::uri::fmt::Query>` is not satisfied error[E0277]: the trait bound `BadType: UriDisplay<rocket::http::uri::fmt::Query>` is not satisfied
--> tests/ui-fail-stable/uri_display_type_errors.rs:35:9 --> tests/ui-fail-stable/uri_display_type_errors.rs:35:9
| |
35 | other: BadType, 35 | other: BadType,
| ^^^^^ the trait `UriDisplay<rocket::http::uri::fmt::Query>` is not implemented for `BadType` | ^^^^^ the trait `UriDisplay<rocket::http::uri::fmt::Query>` is not implemented for `BadType`
| |
= help: the following other types implement trait `UriDisplay<P>`: = help: the following other types implement trait `UriDisplay<P>`:
<&T as UriDisplay<P>> <&T as UriDisplay<P>>
<&mut T as UriDisplay<P>> <&mut T as UriDisplay<P>>
<BTreeMap<K, V> as UriDisplay<rocket::http::uri::fmt::Query>> <BTreeMap<K, V> as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar1 as UriDisplay<rocket::http::uri::fmt::Query>> <Bar1 as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar2 as UriDisplay<rocket::http::uri::fmt::Query>> <Bar2 as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar3 as UriDisplay<rocket::http::uri::fmt::Query>> <Bar3 as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar4 as UriDisplay<rocket::http::uri::fmt::Query>> <Bar4 as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar5 as UriDisplay<rocket::http::uri::fmt::Query>> <Bar5 as UriDisplay<rocket::http::uri::fmt::Query>>
and 48 others and $N others
= note: required because of the requirements on the impl of `UriDisplay<rocket::http::uri::fmt::Query>` for `&BadType` = note: required for `&BadType` to implement `UriDisplay<rocket::http::uri::fmt::Query>`
= note: 1 redundant requirement hidden = note: 1 redundant requirement hidden
= note: required because of the requirements on the impl of `UriDisplay<rocket::http::uri::fmt::Query>` for `&&BadType` = note: required for `&&BadType` to implement `UriDisplay<rocket::http::uri::fmt::Query>`
note: required by a bound in `rocket::http::uri::fmt::Formatter::<'_, rocket::http::uri::fmt::Query>::write_named_value` note: required by a bound in `rocket::http::uri::fmt::Formatter::<'_, rocket::http::uri::fmt::Query>::write_named_value`
--> $WORKSPACE/core/http/src/uri/fmt/formatter.rs --> $WORKSPACE/core/http/src/uri/fmt/formatter.rs
| |
| pub fn write_named_value<T: UriDisplay<Query>>(&mut self, name: &str, value: T) -> fmt::Result { | pub fn write_named_value<T: UriDisplay<Query>>(&mut self, name: &str, value: T) -> fmt::Result {
| ^^^^^^^^^^^^^^^^^ required by this bound in `rocket::http::uri::fmt::Formatter::<'_, rocket::http::uri::fmt::Query>::write_named_value` | ^^^^^^^^^^^^^^^^^ required by this bound in `rocket::http::uri::fmt::Formatter::<'_, rocket::http::uri::fmt::Query>::write_named_value`
error[E0277]: the trait bound `BadType: UriDisplay<rocket::http::uri::fmt::Path>` is not satisfied error[E0277]: the trait bound `BadType: UriDisplay<rocket::http::uri::fmt::Path>` is not satisfied
--> tests/ui-fail-stable/uri_display_type_errors.rs:40:12 --> tests/ui-fail-stable/uri_display_type_errors.rs:40:12
| |
40 | struct Baz(BadType); 40 | struct Baz(BadType);
| ^^^^^^^ the trait `UriDisplay<rocket::http::uri::fmt::Path>` is not implemented for `BadType` | ^^^^^^^ the trait `UriDisplay<rocket::http::uri::fmt::Path>` is not implemented for `BadType`
| |
= help: the following other types implement trait `UriDisplay<P>`: = help: the following other types implement trait `UriDisplay<P>`:
<&T as UriDisplay<P>> <&T as UriDisplay<P>>
<&mut T as UriDisplay<P>> <&mut T as UriDisplay<P>>
<BTreeMap<K, V> as UriDisplay<rocket::http::uri::fmt::Query>> <BTreeMap<K, V> as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar1 as UriDisplay<rocket::http::uri::fmt::Query>> <Bar1 as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar2 as UriDisplay<rocket::http::uri::fmt::Query>> <Bar2 as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar3 as UriDisplay<rocket::http::uri::fmt::Query>> <Bar3 as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar4 as UriDisplay<rocket::http::uri::fmt::Query>> <Bar4 as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar5 as UriDisplay<rocket::http::uri::fmt::Query>> <Bar5 as UriDisplay<rocket::http::uri::fmt::Query>>
and 48 others and $N others
= note: required because of the requirements on the impl of `UriDisplay<rocket::http::uri::fmt::Path>` for `&BadType` = note: required for `&BadType` to implement `UriDisplay<rocket::http::uri::fmt::Path>`
note: required by a bound in `rocket::http::uri::fmt::Formatter::<'i, P>::write_value` note: required by a bound in `rocket::http::uri::fmt::Formatter::<'i, P>::write_value`
--> $WORKSPACE/core/http/src/uri/fmt/formatter.rs --> $WORKSPACE/core/http/src/uri/fmt/formatter.rs
| |
| pub fn write_value<T: UriDisplay<P>>(&mut self, value: T) -> fmt::Result { | pub fn write_value<T: UriDisplay<P>>(&mut self, value: T) -> fmt::Result {
| ^^^^^^^^^^^^^ required by this bound in `rocket::http::uri::fmt::Formatter::<'i, P>::write_value` | ^^^^^^^^^^^^^ required by this bound in `rocket::http::uri::fmt::Formatter::<'i, P>::write_value`

View File

@ -109,7 +109,7 @@ fn test_form_validation_context() {
assert_eq!(fuzzy(&c, "cats[0].nick", None), 1); assert_eq!(fuzzy(&c, "cats[0].nick", None), 1);
assert_eq!(exact(&c, "cats[0].name", None), 1); assert_eq!(exact(&c, "cats[0].name", None), 1);
let c = errors::<Person>("kitty.name=Michael"); let c = dbg!(errors::<Person>("kitty.name=Michael"));
assert_eq!(exact(&c, "kitty.nick", Missing), 1); assert_eq!(exact(&c, "kitty.nick", Missing), 1);
assert_eq!(exact(&c, "dog", Missing), 1); assert_eq!(exact(&c, "dog", Missing), 1);
assert_eq!(exact(&c, "cats[0].name", None), 0); assert_eq!(exact(&c, "cats[0].name", None), 0);