Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions tests/ui/traits/next-solver/closure-capture-in-loop-120328.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//@ compile-flags: -Znext-solver
//@ edition: 2021
//@ check-pass
Comment on lines +1 to +3

@adwinwhite adwinwhite Jul 20, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Could you put these at the top of the file instead?

View changes since the review


// Regression test for <https://github.com/rust-lang/rust/issues/120328>.
// Closures capturing an iterated variable in edition 2021 used to ICE
// with the next trait solver during MIR building.

fn main() {
for item in &[1, 2, 3] {
let _ = || *item;
}
}
Loading