diff options
| author | bors <bors@rust-lang.org> | 2017-03-03 05:16:10 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2017-03-03 05:16:10 +0000 |
| commit | 042728e7ff27e305130747c0d1f19d4a67587863 (patch) | |
| tree | 9a900dffcc33c00f69849eba0419a496eef8efd3 /src/test/compile-fail | |
| parent | 2c6e0e445ed3b040495034f1b426f7d76697f72f (diff) | |
| parent | e294fd5ecbd097e343dc31b3df27bbf81dbea6de (diff) | |
| download | rust-042728e7ff27e305130747c0d1f19d4a67587863.tar.gz rust-042728e7ff27e305130747c0d1f19d4a67587863.zip | |
Auto merge of #40178 - arielb1:provide-destructors, r=eddyb
convert AdtDef::destructor to on-demand This removes the `Cell` from `AdtDef`. Also, moving destructor validity checking to on-demand (forced during item-type checking) ensures that invalid destructors can't cause ICEs. Fixes #38868. Fixes #40132. r? @eddyb
Diffstat (limited to 'src/test/compile-fail')
| -rw-r--r-- | src/test/compile-fail/issue-38868.rs | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/test/compile-fail/issue-38868.rs b/src/test/compile-fail/issue-38868.rs new file mode 100644 index 00000000000..c7e1da7094f --- /dev/null +++ b/src/test/compile-fail/issue-38868.rs @@ -0,0 +1,23 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or +// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license +// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +pub struct List<T> { + head: T, +} + +impl Drop for List<i32> { //~ ERROR E0366 + fn drop(&mut self) { + panic!() + } +} + +fn main() { + List { head: 0 }; +} |
