diff options
| author | Ariel Ben-Yehuda <ariel.byd@gmail.com> | 2017-03-01 18:42:26 +0200 |
|---|---|---|
| committer | Ariel Ben-Yehuda <ariel.byd@gmail.com> | 2017-03-01 18:42:26 +0200 |
| commit | e294fd5ecbd097e343dc31b3df27bbf81dbea6de (patch) | |
| tree | ef3da9f703eca05bf752fda09598014b06796192 /src/test | |
| parent | e1cb9ba221e5cb0070ac82c6a234af11e4240680 (diff) | |
| download | rust-e294fd5ecbd097e343dc31b3df27bbf81dbea6de.tar.gz rust-e294fd5ecbd097e343dc31b3df27bbf81dbea6de.zip | |
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.
Diffstat (limited to 'src/test')
| -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 }; +} |
