Skip to content

Conversation

@qarmin
Copy link

@qarmin qarmin commented Nov 29, 2025

Fixes #1454

Temporary array was changed into temporary vector

@frederikhors
Copy link

@juhaku this is really urgent! Thanks for your amazing work!

@frederikhors
Copy link

@qarmin I tried this change using:

utoipa = { git = "https://github.com/juhaku/utoipa", rev = "634857582c3b9a2330f34bcf7615148cfa86c951" }
utoipa-axum = { git = "https://github.com/juhaku/utoipa", rev = "634857582c3b9a2330f34bcf7615148cfa86c951" }

and unfortunately the error is still there:

thread 'main' has overflowed its stack

@qarmin
Copy link
Author

qarmin commented Nov 30, 2025

Could you try running cargo clippy -- -D clippy::large_stack_arrays and print output here?

In my case, the example from #1454 no longer prints warning about large stack arrays but there might be another location causing the issue.

@frederikhors
Copy link

I'm on Windows, maybe the stack size is different if you're on linux/mac. Here the logs:

warning: `some_crate` (lib) generated 12 warnings
    Checking crate_name v0.1.0 (C:\project\src\crates\some\crate_name)
error: allocating a local array larger than 16384 bytes
    --> src\crate\src\models.rs:3325:33
     |
3325 | #[derive(Debug, Default, Clone, utoipa::ToSchema, serde::Serialize, serde::Deserialize)]
     |                                 ^^^^^^^^^^^^^^^^
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.91.0/index.html#large_stack_arrays
     = note: requested on the command line with `-D clippy::large-stack-arrays`
     = note: this error originates in the derive macro `utoipa::ToSchema` (in Nightly builds, run with -Z macro-backtrace for more info)

error: allocating a local array larger than 16384 bytes
    --> src\crate\src\models.rs:3990:33
     |
3990 | #[derive(Debug, Default, Clone, utoipa::ToSchema, serde::Serialize, serde::Deserialize)]
     |                                 ^^^^^^^^^^^^^^^^
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.91.0/index.html#large_stack_arrays
     = note: this error originates in the derive macro `utoipa::ToSchema` (in Nightly builds, run with -Z macro-backtrace for more info)

error: allocating a local array larger than 16384 bytes
    --> src\crate\src\models.rs:4432:33
     |
4432 | #[derive(Debug, Default, Clone, utoipa::ToSchema, serde::Serialize, serde::Deserialize)]
     |                                 ^^^^^^^^^^^^^^^^
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.91.0/index.html#large_stack_arrays
     = note: this error originates in the derive macro `utoipa::ToSchema` (in Nightly builds, run with -Z macro-backtrace for more info)

error: allocating a local array larger than 16384 bytes
    --> src\crate\src\models.rs:5163:33
     |
5163 | #[derive(Debug, Default, Clone, utoipa::ToSchema, serde::Serialize, serde::Deserialize)]
     |                                 ^^^^^^^^^^^^^^^^
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.91.0/index.html#large_stack_arrays
     = note: this error originates in the derive macro `utoipa::ToSchema` (in Nightly builds, run with -Z macro-backtrace for more info)

error: allocating a local array larger than 16384 bytes
    --> src\crate\src\models.rs:5761:33
     |
5761 | #[derive(Debug, Default, Clone, utoipa::ToSchema, serde::Serialize, serde::Deserialize)]
     |                                 ^^^^^^^^^^^^^^^^
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.91.0/index.html#large_stack_arrays
     = note: this error originates in the derive macro `utoipa::ToSchema` (in Nightly builds, run with -Z macro-backtrace for more info)

error: allocating a local array larger than 16384 bytes
    --> src\crate\src\models.rs:6274:33
     |
6274 | #[derive(Debug, Default, Clone, utoipa::ToSchema, serde::Serialize, serde::Deserialize)]
     |                                 ^^^^^^^^^^^^^^^^
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.91.0/index.html#large_stack_arrays
     = note: this error originates in the derive macro `utoipa::ToSchema` (in Nightly builds, run with -Z macro-backtrace for more info)

error: allocating a local array larger than 16384 bytes
    --> src\crate\src\models.rs:7657:33
     |
7657 | #[derive(Debug, Default, Clone, utoipa::ToSchema, serde::Serialize, serde::Deserialize)]
     |                                 ^^^^^^^^^^^^^^^^
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.91.0/index.html#large_stack_arrays
     = note: this error originates in the derive macro `utoipa::ToSchema` (in Nightly builds, run with -Z macro-backtrace for more info)

error: allocating a local array larger than 16384 bytes
    --> src\crate\src\models.rs:8156:33
     |
8156 | #[derive(Debug, Default, Clone, utoipa::ToSchema, serde::Serialize, serde::Deserialize)]
     |                                 ^^^^^^^^^^^^^^^^
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.91.0/index.html#large_stack_arrays
     = note: this error originates in the derive macro `utoipa::ToSchema` (in Nightly builds, run with -Z macro-backtrace for more info)

error: allocating a local array larger than 16384 bytes
    --> src\crate\src\models.rs:8983:33
     |
8983 | #[derive(Debug, Default, Clone, utoipa::ToSchema, serde::Serialize, serde::Deserialize)]
     |                                 ^^^^^^^^^^^^^^^^
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.91.0/index.html#large_stack_arrays
     = note: this error originates in the derive macro `utoipa::ToSchema` (in Nightly builds, run with -Z macro-backtrace for more info)

error: allocating a local array larger than 16384 bytes
    --> src\crate\src\models.rs:9800:33
     |
9800 | #[derive(Debug, Default, Clone, utoipa::ToSchema, serde::Serialize, serde::Deserialize)]
     |                                 ^^^^^^^^^^^^^^^^
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.91.0/index.html#large_stack_arrays
     = note: this error originates in the derive macro `utoipa::ToSchema` (in Nightly builds, run with -Z macro-backtrace for more info)

error: allocating a local array larger than 16384 bytes
     --> src\crate\src\models.rs:10208:33
      |
10208 | #[derive(Debug, Default, Clone, utoipa::ToSchema, serde::Serialize, serde::Deserialize)]
      |                                 ^^^^^^^^^^^^^^^^
      |
      = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.91.0/index.html#large_stack_arrays
      = note: this error originates in the derive macro `utoipa::ToSchema` (in Nightly builds, run with -Z macro-backtrace for more info)

error: allocating a local array larger than 16384 bytes
     --> src\crate\src\models.rs:10539:33
      |
10539 | #[derive(Debug, Default, Clone, utoipa::ToSchema, serde::Serialize, serde::Deserialize)]
      |                                 ^^^^^^^^^^^^^^^^
      |
      = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.91.0/index.html#large_stack_arrays
      = note: this error originates in the derive macro `utoipa::ToSchema` (in Nightly builds, run with -Z macro-backtrace for more info)

error: allocating a local array larger than 16384 bytes
     --> src\crate\src\models.rs:12584:33
      |
12584 | #[derive(Debug, Default, Clone, utoipa::ToSchema, serde::Serialize, serde::Deserialize)]
      |                                 ^^^^^^^^^^^^^^^^
      |
      = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.91.0/index.html#large_stack_arrays
      = note: this error originates in the derive macro `utoipa::ToSchema` (in Nightly builds, run with -Z macro-backtrace for more info)

error: could not compile `some_crate` (lib) due to 13 previous errors

@frederikhors
Copy link

I'm thinking of removing utoipa altogether and going either with aide or by hand.

@qarmin
Copy link
Author

qarmin commented Nov 30, 2025

So this is yet another bug - my issue was about IntoParams, and here the error comes from ToSchema.
I’m unable to reproduce it locally (even with ~70 different fields in a simple struct), and I don’t really see what might be causing it, so I don’t think I’ll be able to fix this particular one.

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

Successfully merging this pull request may close these issues.

Bigger structs(but with small stack size) shows clippy warnings about allocating a local array larger than 16384 bytes

2 participants