about summary refs log tree commit diff
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2015-04-09 15:54:04 +0530
committerManish Goregaokar <manishsmail@gmail.com>2015-04-10 00:24:42 +0530
commit67fa4d3a0c1236e849c2446bcdc47e617452a645 (patch)
tree4695077bf6d45c32c5e4a1019e32b78a301e711f
parent3b871402998d093de327dc2bf424f69fab277b54 (diff)
parent59e62deac96072369ca91b57cff08dbdcbc1dd70 (diff)
downloadrust-67fa4d3a0c1236e849c2446bcdc47e617452a645.tar.gz
rust-67fa4d3a0c1236e849c2446bcdc47e617452a645.zip
Rollup merge of #24193 - lstat:needstest, r=alexcrichton
 Closes #22289
Closes #22370
Closes #22384
-rw-r--r--src/test/compile-fail/issue-22289.rs13
-rw-r--r--src/test/compile-fail/issue-22370.rs18
-rw-r--r--src/test/compile-fail/issue-22384.rs18
3 files changed, 49 insertions, 0 deletions
diff --git a/src/test/compile-fail/issue-22289.rs b/src/test/compile-fail/issue-22289.rs
new file mode 100644
index 00000000000..f4f6aaa94fe
--- /dev/null
+++ b/src/test/compile-fail/issue-22289.rs
@@ -0,0 +1,13 @@
+// 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 <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() {
+    0 as &std::any::Any; //~ ERROR non-scalar cast: `i32` as `&core::any::Any`
+}
diff --git a/src/test/compile-fail/issue-22370.rs b/src/test/compile-fail/issue-22370.rs
new file mode 100644
index 00000000000..4c6652d812c
--- /dev/null
+++ b/src/test/compile-fail/issue-22370.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 <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.
+
+// ignore-tidy-linelength
+
+trait A<T=Self> {}
+
+fn f(a: &A) {}
+//~^ ERROR the type parameter `T` must be explicitly specified in an object type because its default value `Self` references the type `Self`
+
+fn main() {}
diff --git a/src/test/compile-fail/issue-22384.rs b/src/test/compile-fail/issue-22384.rs
new file mode 100644
index 00000000000..368e2483533
--- /dev/null
+++ b/src/test/compile-fail/issue-22384.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 <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.
+
+trait Trait {
+    fn foo();
+}
+
+fn main() {
+    <<i32 as Copy>::foobar as Trait>::foo();
+    //~^ ERROR use of undeclared associated type `Copy::foobar`
+}