mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 01:04:03 +00:00
edafbaffb2
- Either explicitly annotate `let x: () = expr;` where `x` has unit type, or remove the unit binding to leave only `expr;` instead. - Fix disjoint-capture-in-same-closure test
39 lines
643 B
Rust
39 lines
643 B
Rust
// revisions: no_drop_tracking drop_tracking drop_tracking_mir
|
|
// [drop_tracking] compile-flags: -Zdrop-tracking
|
|
// [drop_tracking_mir] compile-flags: -Zdrop-tracking-mir
|
|
// build-pass
|
|
// edition:2018
|
|
|
|
#![feature(generators)]
|
|
|
|
fn main() {
|
|
foo();
|
|
}
|
|
|
|
fn foo() {
|
|
|| {
|
|
yield drop(Config {
|
|
nickname: NonCopy,
|
|
b: NonCopy2,
|
|
}.nickname);
|
|
};
|
|
}
|
|
|
|
#[derive(Default)]
|
|
struct NonCopy;
|
|
impl Drop for NonCopy {
|
|
fn drop(&mut self) {}
|
|
}
|
|
|
|
#[derive(Default)]
|
|
struct NonCopy2;
|
|
impl Drop for NonCopy2 {
|
|
fn drop(&mut self) {}
|
|
}
|
|
|
|
#[derive(Default)]
|
|
struct Config {
|
|
nickname: NonCopy,
|
|
b: NonCopy2,
|
|
}
|