2021-12-22 00:00:00 +00:00
|
|
|
// Regression test for issue 81708 and issue 91816 where running a drop
|
|
|
|
// elaboration on a MIR which failed borrowck lead to an ICE.
|
|
|
|
|
|
|
|
static A: () = {
|
|
|
|
let a: [String; 1];
|
2022-09-23 14:22:36 +00:00
|
|
|
//~^ ERROR destructor of
|
2021-12-22 00:00:00 +00:00
|
|
|
a[0] = String::new();
|
2022-09-23 14:22:36 +00:00
|
|
|
//~^ ERROR destructor of
|
2021-12-22 00:00:00 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct B<T>([T; 1]);
|
|
|
|
|
|
|
|
impl<T> B<T> {
|
|
|
|
pub const fn f(mut self, other: T) -> Self {
|
|
|
|
let _this = self;
|
2022-09-23 14:22:36 +00:00
|
|
|
//~^ ERROR destructor of
|
2021-12-22 00:00:00 +00:00
|
|
|
self.0[0] = other;
|
2022-09-23 14:22:36 +00:00
|
|
|
//~^ ERROR destructor of
|
2021-12-22 00:00:00 +00:00
|
|
|
self
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|