about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src/lib.rs
diff options
context:
space:
mode:
authorMatthias Krüger <476013+matthiaskrgr@users.noreply.github.com>2025-03-10 15:57:15 +0100
committerGitHub <noreply@github.com>2025-03-10 15:57:15 +0100
commitd1a875cd37ea27346e43d3091dabd84258113150 (patch)
tree4e246d1ce367dafb04df5a074fc63cceddea927a /compiler/rustc_codegen_llvm/src/lib.rs
parent0d6311931b3aa04460aa2c73aaf012242e5715e6 (diff)
parent295c70ef03d442c608d0dda0c14c06598c034411 (diff)
downloadrust-d1a875cd37ea27346e43d3091dabd84258113150.tar.gz
rust-d1a875cd37ea27346e43d3091dabd84258113150.zip
Rollup merge of #138281 - saethlin:mergeable-doctests-stacksize, r=GuillaumeGomez
Fix O(tests) stack usage in edition 2024 mergeable doctests

Fixes https://github.com/rust-lang/rust/issues/138248

The important change here is that we are not passing a potentially-large array by value. Between the fact that `TestFn` cannot be `Clone` and `test_main` takes a `Vec<TestDescAndFn>`, the only way to call `test::test_main` without O(tests) stack use is to call `Vec::push` many times.

The normal test harness does not have this problem because it calls `test_main_static` or `test_main_static_abort`, which take `&[TestDescAndFn]`. Changing `test::test_main` to take a slice is not a simple change, so I'm avoiding doing it here.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/lib.rs')
0 files changed, 0 insertions, 0 deletions