From be1117113f60b8afedf90039b0dcb87148666567 Mon Sep 17 00:00:00 2001 From: Sean Bowe Date: Fri, 24 Apr 2015 12:34:27 -0600 Subject: [PATCH] Split up tests, reduce coverage --- ...eck-before-dropck-bug.rs => issue-22897.rs} | 12 ------------ src/test/compile-fail/issue-23041.rs | 18 ++++++++++++++++++ src/test/compile-fail/issue-23966.rs | 14 ++++++++++++++ src/test/compile-fail/issue-24013.rs | 17 +++++++++++++++++ 4 files changed, 49 insertions(+), 12 deletions(-) rename src/test/compile-fail/{typeck-before-dropck-bug.rs => issue-22897.rs} (74%) create mode 100644 src/test/compile-fail/issue-23041.rs create mode 100644 src/test/compile-fail/issue-23966.rs create mode 100644 src/test/compile-fail/issue-24013.rs diff --git a/src/test/compile-fail/typeck-before-dropck-bug.rs b/src/test/compile-fail/issue-22897.rs similarity index 74% rename from src/test/compile-fail/typeck-before-dropck-bug.rs rename to src/test/compile-fail/issue-22897.rs index 04ee993c0407..c6bbf2d4abcc 100644 --- a/src/test/compile-fail/typeck-before-dropck-bug.rs +++ b/src/test/compile-fail/issue-22897.rs @@ -17,15 +17,3 @@ fn unconstrained_type() { []; //~^ ERROR cannot determine a type for this expression: unconstrained type } - -fn invalid_impl_within_scope() { - { - use std::ops::Deref; - struct Something; - - impl Deref for Something {} - //~^ ERROR not all trait items implemented, missing: `Target`, `deref` - - *Something - }; -} diff --git a/src/test/compile-fail/issue-23041.rs b/src/test/compile-fail/issue-23041.rs new file mode 100644 index 000000000000..68895759c5c2 --- /dev/null +++ b/src/test/compile-fail/issue-23041.rs @@ -0,0 +1,18 @@ +// Copyright 2015 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 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +use std::any::Any; +fn main() +{ + fn bar(x:i32) ->i32 { 3*x }; + let b:Box = Box::new(bar as fn(_)->_); + b.downcast_ref::_>(); + //~^ ERROR cannot determine a type for this expression: unconstrained type +} diff --git a/src/test/compile-fail/issue-23966.rs b/src/test/compile-fail/issue-23966.rs new file mode 100644 index 000000000000..18b513686652 --- /dev/null +++ b/src/test/compile-fail/issue-23966.rs @@ -0,0 +1,14 @@ +// Copyright 2015 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 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn main() { + "".chars().fold(|_, _| (), ()); + //~^ ERROR cannot determine a type for this expression: unconstrained type +} diff --git a/src/test/compile-fail/issue-24013.rs b/src/test/compile-fail/issue-24013.rs new file mode 100644 index 000000000000..0adad8a88cbc --- /dev/null +++ b/src/test/compile-fail/issue-24013.rs @@ -0,0 +1,17 @@ +// Copyright 2015 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 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn main() { + use std::mem::{transmute, swap}; + let a = 1; + let b = 2; + unsafe {swap::<&mut _>(transmute(&a), transmute(&b))}; + //~^ ERROR cannot determine a type for this expression: unconstrained type +}