File: json_not_deserialize.stderr

package info (click to toggle)
rust-axum 0.7.9-13
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,992 kB
  • sloc: javascript: 26; makefile: 24; sql: 6; sh: 1
file content (51 lines) | stat: -rw-r--r-- 2,470 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
error[E0277]: the trait bound `for<'de> Struct: serde::de::Deserialize<'de>` is not satisfied
 --> tests/debug_handler/fail/json_not_deserialize.rs:7:24
  |
7 | async fn handler(_foo: Json<Struct>) {}
  |                        ^^^^^^^^^^^^ the trait `for<'de> serde::de::Deserialize<'de>` is not implemented for `Struct`, which is required by `Json<Struct>: FromRequest<()>`
  |
  = note: for local types consider adding `#[derive(serde::Deserialize)]` to your `Struct` type
  = note: for types from other crates check whether the crate offers a `serde` feature flag
  = help: the following other types implement trait `serde::de::Deserialize<'de>`:
            &'a [u8]
            &'a serde_json::raw::RawValue
            &'a std::path::Path
            &'a str
            ()
            (T,)
            (T0, T1)
            (T0, T1, T2)
          and $N others
  = note: required for `Struct` to implement `serde::de::DeserializeOwned`
  = note: required for `Json<Struct>` to implement `FromRequest<()>`
  = help: see issue #48214
help: add `#![feature(trivial_bounds)]` to the crate attributes to enable
  |
1 + #![feature(trivial_bounds)]
  |

error[E0277]: the trait bound `for<'de> Struct: serde::de::Deserialize<'de>` is not satisfied
 --> tests/debug_handler/fail/json_not_deserialize.rs:7:24
  |
7 | async fn handler(_foo: Json<Struct>) {}
  |                        ^^^^^^^^^^^^ the trait `for<'de> serde::de::Deserialize<'de>` is not implemented for `Struct`, which is required by `Json<Struct>: FromRequest<()>`
  |
  = note: for local types consider adding `#[derive(serde::Deserialize)]` to your `Struct` type
  = note: for types from other crates check whether the crate offers a `serde` feature flag
  = help: the following other types implement trait `serde::de::Deserialize<'de>`:
            &'a [u8]
            &'a serde_json::raw::RawValue
            &'a std::path::Path
            &'a str
            ()
            (T,)
            (T0, T1)
            (T0, T1, T2)
          and $N others
  = note: required for `Struct` to implement `serde::de::DeserializeOwned`
  = note: required for `Json<Struct>` to implement `FromRequest<()>`
note: required by a bound in `__axum_macros_check_handler_0_from_request_check`
 --> tests/debug_handler/fail/json_not_deserialize.rs:7:24
  |
7 | async fn handler(_foo: Json<Struct>) {}
  |                        ^^^^^^^^^^^^ required by this bound in `__axum_macros_check_handler_0_from_request_check`