Skip to content

Commit

Permalink
Update 'devise', fix 'Responder' derive generics.
Browse files Browse the repository at this point in the history
  • Loading branch information
SergioBenitez committed Aug 20, 2021
1 parent 80cd300 commit 4b272f1
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
2 changes: 1 addition & 1 deletion core/codegen/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ indexmap = "1.0"
quote = "1.0"
syn = { version = "1.0.72", features = ["full", "visit", "visit-mut", "extra-traits"] }
proc-macro2 = "1.0.27"
devise = "0.3"
devise = "0.3.1"
rocket_http = { version = "0.5.0-rc.1", path = "../http/" }
unicode-xid = "0.2"
glob = "0.3"
Expand Down
4 changes: 2 additions & 2 deletions core/codegen/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -687,8 +687,8 @@ pub fn derive_from_form_field(input: TokenStream) -> TokenStream {
/// }
/// ```
///
/// [`FromForm`]: rocket::form::FromForm
/// [`form::Errors`]: rocket::form::Errors
/// [`FromForm`]: ../rocket/form/trait.FromForm.html
/// [`form::Errors`]: ../rocket/form/struct.Errors.html
///
/// # Generics
///
Expand Down
15 changes: 15 additions & 0 deletions core/codegen/tests/ui-fail/responder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,19 @@ struct Thing12(());
#[response(status = 404, content_type = 120)]
struct Thing13(());

#[derive(Responder)] // NO ERROR
enum Error<'r, T> {
#[response(status = 400)]
Unauthorized(T),
#[response(status = 404)]
NotFound(rocket::fs::NamedFile),
#[response(status = 500)]
A(&'r str, rocket::http::ContentType),
}

#[derive(Responder)] // NO ERROR
enum Error2<'r, T> {
Unauthorized(&'r T),
}

fn main() {}

0 comments on commit 4b272f1

Please sign in to comment.