Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regressed UI in tests/ui/endpoint/dynamic_schema_wrong_type.rs #481

Open
msrd0 opened this issue May 13, 2024 · 0 comments
Open

Regressed UI in tests/ui/endpoint/dynamic_schema_wrong_type.rs #481

msrd0 opened this issue May 13, 2024 · 0 comments

Comments

@msrd0
Copy link
Owner

msrd0 commented May 13, 2024

Updating the Rust compiler used for trybuild to 1.78 added this weird suggestion to wrap a string in a closure:

error[E0631]: type mismatch in function arguments
  --> tests/ui/endpoint/dynamic_schema_wrong_type.rs:16:21
   |
8  | fn schema(_: u16) -> String {
   | --------------------------- found signature defined here
...
16 | #[read_all(schema = "schema", status_codes = "status_codes")]
   |                     ^^^^^^^^ expected due to this
   |
   = note: expected function signature `fn(StatusCode) -> _`
              found function signature `fn(u16) -> _`
   = note: required for `fn(u16) -> std::string::String {schema}` to implement `CustomSchema`
help: consider wrapping the function in a closure
   |
16 | #[read_all(schema = |arg0: StatusCode| "schema"(/* u16 */), status_codes = "status_codes")]
   |                     ++++++++++++++++++         +++++++++++

error[E0271]: expected `status_codes` to be a fn item that returns `Vec<StatusCode>`, but it returns `Vec<u16>`
  --> tests/ui/endpoint/dynamic_schema_wrong_type.rs:16:46
   |
16 | #[read_all(schema = "schema", status_codes = "status_codes")]
   |                                              ^^^^^^^^^^^^^^ expected `Vec<StatusCode>`, found `Vec<u16>`
   |
   = note: expected struct `Vec<StatusCode>`
              found struct `Vec<u16>`
   = note: required for `fn() -> Vec<u16> {status_codes}` to implement `CustomStatusCodes`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant