diff options
| author | bors <bors@rust-lang.org> | 2025-03-05 06:59:11 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2025-03-05 06:59:11 +0000 |
| commit | 4559163ccb500affc424fb9228dae5003672ffc7 (patch) | |
| tree | 9516de75915b28be6eb85407b0e3dc8b775ebf66 /compiler/rustc_error_codes | |
| parent | ac951d379913c667a1fb73a0830e81d65d2007cf (diff) | |
| parent | 3065925c7e7bd2c46f80091f1420eeeadbb8c99b (diff) | |
| download | rust-4559163ccb500affc424fb9228dae5003672ffc7.tar.gz rust-4559163ccb500affc424fb9228dae5003672ffc7.zip | |
Auto merge of #138031 - workingjubilee:rollup-5bsotpz, r=workingjubilee
Rollup of 15 pull requests Successful merges: - #137829 (Stabilize [T]::split_off... methods) - #137850 (Stabilize `box_uninit_write`) - #137912 (Do not recover missing lifetime with random in-scope lifetime) - #137913 (Allow struct field default values to reference struct's generics) - #137923 (Simplify `<Postorder as Iterator>::size_hint`) - #137949 (Update MSVC INSTALL.md instructions to recommend VS 2022 + recent Windows 10/11 SDK) - #137963 (Add ``dyn`` keyword to `E0373` examples) - #137975 (Remove unused `PpMode::needs_hir`) - #137981 (rustdoc search: increase strictness of typechecking) - #137986 (Fix some typos) - #137991 (Add `avr-none` to SUMMARY.md and platform-support.md) - #137993 (Remove obsolete comment from DeduceReadOnly) - #137996 (Revert "compiler/rustc_data_structures/src/sync/worker_local.rs: delete "unsafe impl Sync"") - #138019 (Pretty-print `#[deprecated]` attribute in HIR.) - #138026 (Make CrateItem::body() function return an option) r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_error_codes')
| -rw-r--r-- | compiler/rustc_error_codes/src/error_codes/E0373.md | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_error_codes/src/error_codes/E0373.md b/compiler/rustc_error_codes/src/error_codes/E0373.md index d4d26007aa5..b9db8072597 100644 --- a/compiler/rustc_error_codes/src/error_codes/E0373.md +++ b/compiler/rustc_error_codes/src/error_codes/E0373.md @@ -3,7 +3,7 @@ A captured variable in a closure may not live long enough. Erroneous code example: ```compile_fail,E0373 -fn foo() -> Box<Fn(u32) -> u32> { +fn foo() -> Box<dyn Fn(u32) -> u32> { let x = 0u32; Box::new(|y| x + y) } @@ -42,7 +42,7 @@ This approach moves (or copies, where possible) data into the closure, rather than taking references to it. For example: ``` -fn foo() -> Box<Fn(u32) -> u32> { +fn foo() -> Box<dyn Fn(u32) -> u32> { let x = 0u32; Box::new(move |y| x + y) } |
