Skip to content

Commit 81bf978

Browse files
committed
Add test for old ICE
The ICE from rust-lang#84044 no longer occurs.
1 parent f8abed9 commit 81bf978

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// #84044: This used to ICE.
2+
3+
fn main() {
4+
let f = || {};
5+
drop(&mut f); //~ ERROR cannot borrow `f` as mutable, as it is not declared as mutable
6+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
error[E0596]: cannot borrow `f` as mutable, as it is not declared as mutable
2+
--> $DIR/issue-84044-drop-non-mut.rs:5:10
3+
|
4+
LL | let f = || {};
5+
| - help: consider changing this to be mutable: `mut f`
6+
LL | drop(&mut f);
7+
| ^^^^^^ cannot borrow as mutable
8+
9+
error: aborting due to previous error
10+
11+
For more information about this error, try `rustc --explain E0596`.

0 commit comments

Comments
 (0)