about summary refs log tree commit diff
path: root/src/test/run-pass
diff options
context:
space:
mode:
authorSimon Sapin <simon.sapin@exyr.org>2018-06-27 21:36:29 +0200
committerSimon Sapin <simon.sapin@exyr.org>2018-07-07 01:41:30 +0200
commit21526c5403d7a43144de897d0187c395fb92bacc (patch)
tree900a7bf9259c6343ce3e27d2c73ce9ee8a9e711e /src/test/run-pass
parent41730b7e2e2c28a13fe6d08a7ad47d31d68eccea (diff)
downloadrust-21526c5403d7a43144de897d0187c395fb92bacc.tar.gz
rust-21526c5403d7a43144de897d0187c395fb92bacc.zip
Add a test for Weak::new() not crashing for uninhabited types
Diffstat (limited to 'src/test/run-pass')
-rw-r--r--src/test/run-pass/weak-new-uninhabited-issue-48493.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/test/run-pass/weak-new-uninhabited-issue-48493.rs b/src/test/run-pass/weak-new-uninhabited-issue-48493.rs
new file mode 100644
index 00000000000..eb57c12ed12
--- /dev/null
+++ b/src/test/run-pass/weak-new-uninhabited-issue-48493.rs
@@ -0,0 +1,15 @@
+// Copyright 2018 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.
+
+fn main() {
+    enum Void {}
+    std::rc::Weak::<Void>::new();
+    std::sync::Weak::<Void>::new();
+}