--- /dev/null
+struct Foo;
+const INIT: Foo = Foo;
+static FOO: Foo = INIT;
+
+fn main() {
+ let _a = FOO; //~ ERROR: cannot move out of static item
+}
--- /dev/null
+error[E0507]: cannot move out of static item `FOO`
+ --> $DIR/issue-17718-static-move.rs:6:14
+ |
+LL | let _a = FOO;
+ | ^^^
+ | |
+ | move occurs because `FOO` has type `Foo`, which does not implement the `Copy` trait
+ | help: consider borrowing here: `&FOO`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0507`.
--- /dev/null
+fn id<T>(x: T) -> T { x }
+
+const FOO: usize = 3;
+
+fn foo() -> &'static usize { &id(FOO) }
+//~^ ERROR: cannot return reference to temporary value
+
+fn main() {
+}
--- /dev/null
+error[E0515]: cannot return reference to temporary value
+ --> $DIR/issue-17718-constants-not-static.rs:5:30
+ |
+LL | fn foo() -> &'static usize { &id(FOO) }
+ | ^-------
+ | ||
+ | |temporary value created here
+ | returns a reference to data owned by the current function
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0515`.
--- /dev/null
+// check-pass
+#![allow(dead_code)]
+struct A;
+impl Drop for A {
+ fn drop(&mut self) {}
+}
+
+const FOO: A = A;
+
+fn main() {}
--- /dev/null
+// run-pass
+#![allow(unused_must_use)]
+// Test that we are able to reinitialize box with moved referent
+static mut ORDER: [usize; 3] = [0, 0, 0];
+static mut INDEX: usize = 0;
+
+struct Dropee (usize);
+
+impl Drop for Dropee {
+ fn drop(&mut self) {
+ unsafe {
+ ORDER[INDEX] = self.0;
+ INDEX = INDEX + 1;
+ }
+ }
+}
+
+fn add_sentintel() {
+ unsafe {
+ ORDER[INDEX] = 2;
+ INDEX = INDEX + 1;
+ }
+}
+
+fn main() {
+ let mut x = Box::new(Dropee(1));
+ *x; // move out from `*x`
+ add_sentintel();
+ *x = Dropee(3); // re-initialize `*x`
+ {x}; // drop value
+ unsafe {
+ assert_eq!(ORDER, [1, 2, 3]);
+ }
+}
+++ /dev/null
-pub use foo::FOO2;
-
-pub const FOO: usize = 3;
-const BAR: usize = 3;
-
-mod foo {
- pub const FOO2: usize = 3;
-}
+++ /dev/null
-// check-pass
-#![allow(dead_code)]
-struct A;
-impl Drop for A {
- fn drop(&mut self) {}
-}
-
-const FOO: A = A;
-
-fn main() {}
+++ /dev/null
-// aux-build:issue-17718-const-privacy.rs
-
-extern crate issue_17718_const_privacy as other;
-
-use a::B; //~ ERROR: constant `B` is private
-use other::{
- FOO,
- BAR, //~ ERROR: constant `BAR` is private
- FOO2,
-};
-
-mod a {
- const B: usize = 3;
-}
-
-fn main() {}
+++ /dev/null
-error[E0603]: constant `B` is private
- --> $DIR/issue-17718-const-privacy.rs:5:8
- |
-LL | use a::B;
- | ^ private constant
- |
-note: the constant `B` is defined here
- --> $DIR/issue-17718-const-privacy.rs:13:5
- |
-LL | const B: usize = 3;
- | ^^^^^^^^^^^^^^^^^^^
-
-error[E0603]: constant `BAR` is private
- --> $DIR/issue-17718-const-privacy.rs:8:5
- |
-LL | BAR,
- | ^^^ private constant
- |
-note: the constant `BAR` is defined here
- --> $DIR/auxiliary/issue-17718-const-privacy.rs:4:1
- |
-LL | const BAR: usize = 3;
- | ^^^^^^^^^^^^^^^^
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0603`.
+++ /dev/null
-fn id<T>(x: T) -> T { x }
-
-const FOO: usize = 3;
-
-fn foo() -> &'static usize { &id(FOO) }
-//~^ ERROR: cannot return reference to temporary value
-
-fn main() {
-}
+++ /dev/null
-error[E0515]: cannot return reference to temporary value
- --> $DIR/issue-17718-constants-not-static.rs:5:30
- |
-LL | fn foo() -> &'static usize { &id(FOO) }
- | ^-------
- | ||
- | |temporary value created here
- | returns a reference to data owned by the current function
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0515`.
+++ /dev/null
-// run-pass
-
-const FOO: usize = 3;
-
-fn main() {
- assert_eq!(FOO, 3);
-}
+++ /dev/null
-static A1: usize = 1;
-static mut A2: usize = 1;
-const A3: usize = 1;
-
-fn main() {
- match 1 {
- A1 => {} //~ ERROR: match bindings cannot shadow statics
- A2 => {} //~ ERROR: match bindings cannot shadow statics
- A3 => {}
- _ => {}
- }
-}
+++ /dev/null
-error[E0530]: match bindings cannot shadow statics
- --> $DIR/issue-17718-patterns.rs:7:9
- |
-LL | static A1: usize = 1;
- | --------------------- the static `A1` is defined here
-...
-LL | A1 => {}
- | ^^ cannot be named the same as a static
-
-error[E0530]: match bindings cannot shadow statics
- --> $DIR/issue-17718-patterns.rs:8:9
- |
-LL | static mut A2: usize = 1;
- | ------------------------- the static `A2` is defined here
-...
-LL | A2 => {}
- | ^^ cannot be named the same as a static
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0530`.
+++ /dev/null
-struct Foo;
-const INIT: Foo = Foo;
-static FOO: Foo = INIT;
-
-fn main() {
- let _a = FOO; //~ ERROR: cannot move out of static item
-}
+++ /dev/null
-error[E0507]: cannot move out of static item `FOO`
- --> $DIR/issue-17718-static-move.rs:6:14
- |
-LL | let _a = FOO;
- | ^^^
- | |
- | move occurs because `FOO` has type `Foo`, which does not implement the `Copy` trait
- | help: consider borrowing here: `&FOO`
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0507`.
+++ /dev/null
-#![feature(negative_impls)]
-
-use std::marker::Sync;
-
-struct Foo;
-impl !Sync for Foo {}
-
-static FOO: usize = 3;
-static BAR: Foo = Foo;
-//~^ ERROR: `Foo` cannot be shared between threads safely [E0277]
-
-fn main() {}
+++ /dev/null
-error[E0277]: `Foo` cannot be shared between threads safely
- --> $DIR/issue-17718-static-sync.rs:9:13
- |
-LL | static BAR: Foo = Foo;
- | ^^^ `Foo` cannot be shared between threads safely
- |
- = help: the trait `Sync` is not implemented for `Foo`
- = note: shared static variables must have a type that implements `Sync`
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0277`.
+++ /dev/null
-// run-pass
-#![allow(dead_code)]
-#![allow(unused_variables)]
-#![allow(unused_imports)]
-// pretty-expanded FIXME #23616
-
-use std::marker;
-use std::cell::UnsafeCell;
-
-struct MyUnsafePack<T>(UnsafeCell<T>);
-
-unsafe impl<T: Send> Sync for MyUnsafePack<T> {}
-
-struct MyUnsafe<T> {
- value: MyUnsafePack<T>
-}
-
-impl<T> MyUnsafe<T> {
- fn forbidden(&self) {}
-}
-
-unsafe impl<T: Send> Sync for MyUnsafe<T> {}
-
-enum UnsafeEnum<T> {
- VariantSafe,
- VariantUnsafe(UnsafeCell<T>)
-}
-
-unsafe impl<T: Send> Sync for UnsafeEnum<T> {}
-
-static STATIC1: UnsafeEnum<isize> = UnsafeEnum::VariantSafe;
-
-static STATIC2: MyUnsafePack<isize> = MyUnsafePack(UnsafeCell::new(1));
-const CONST: MyUnsafePack<isize> = MyUnsafePack(UnsafeCell::new(1));
-static STATIC3: MyUnsafe<isize> = MyUnsafe{value: CONST};
-
-static STATIC4: &'static MyUnsafePack<isize> = &STATIC2;
-
-struct Wrap<T> {
- value: T
-}
-
-unsafe impl<T: Send> Sync for Wrap<T> {}
-
-static UNSAFE: MyUnsafePack<isize> = MyUnsafePack(UnsafeCell::new(2));
-static WRAPPED_UNSAFE: Wrap<&'static MyUnsafePack<isize>> = Wrap { value: &UNSAFE };
-
-fn main() {
- let a = &STATIC1;
-
- STATIC3.forbidden()
-}
+++ /dev/null
-// run-pass
-#![allow(unused_must_use)]
-// Test that we are able to reinitialize box with moved referent
-static mut ORDER: [usize; 3] = [0, 0, 0];
-static mut INDEX: usize = 0;
-
-struct Dropee (usize);
-
-impl Drop for Dropee {
- fn drop(&mut self) {
- unsafe {
- ORDER[INDEX] = self.0;
- INDEX = INDEX + 1;
- }
- }
-}
-
-fn add_sentintel() {
- unsafe {
- ORDER[INDEX] = 2;
- INDEX = INDEX + 1;
- }
-}
-
-fn main() {
- let mut x = Box::new(Dropee(1));
- *x; // move out from `*x`
- add_sentintel();
- *x = Dropee(3); // re-initialize `*x`
- {x}; // drop value
- unsafe {
- assert_eq!(ORDER, [1, 2, 3]);
- }
-}
+++ /dev/null
-// MIR doesn't generate an error because the assignment isn't reachable. This
-// is OK because the test is here to check that the compiler doesn't ICE (cf.
-// #5500).
-
-// check-pass
-
-struct TrieMapIterator<'a> {
- node: &'a usize
-}
-
-fn main() {
- let a = 5;
- let _iter = TrieMapIterator{node: &a};
- _iter.node = &panic!()
-}
+++ /dev/null
-#[derive(Clone)]
-struct InGroup<F> {
- it: It,
- //~^ ERROR cannot find type `It` in this scope
- f: F,
-}
-fn dates_in_year() -> impl Clone {
- InGroup { f: |d| d }
- //~^ ERROR missing field `it` in initializer of `InGroup<_>`
-}
-
-fn main() {}
+++ /dev/null
-error[E0412]: cannot find type `It` in this scope
- --> $DIR/issue-77993-1.rs:3:9
- |
-LL | it: It,
- | ^^ not found in this scope
-
-error[E0063]: missing field `it` in initializer of `InGroup<_>`
- --> $DIR/issue-77993-1.rs:8:5
- |
-LL | InGroup { f: |d| d }
- | ^^^^^^^ missing `it`
-
-error: aborting due to 2 previous errors
-
-Some errors have detailed explanations: E0063, E0412.
-For more information about an error, try `rustc --explain E0063`.
--- /dev/null
+// MIR doesn't generate an error because the assignment isn't reachable. This
+// is OK because the test is here to check that the compiler doesn't ICE (cf.
+// #5500).
+
+// check-pass
+
+struct TrieMapIterator<'a> {
+ node: &'a usize
+}
+
+fn main() {
+ let a = 5;
+ let _iter = TrieMapIterator{node: &a};
+ _iter.node = &panic!()
+}
--- /dev/null
+// run-pass
+
+const FOO: usize = 3;
+
+fn main() {
+ assert_eq!(FOO, 3);
+}
--- /dev/null
+static A1: usize = 1;
+static mut A2: usize = 1;
+const A3: usize = 1;
+
+fn main() {
+ match 1 {
+ A1 => {} //~ ERROR: match bindings cannot shadow statics
+ A2 => {} //~ ERROR: match bindings cannot shadow statics
+ A3 => {}
+ _ => {}
+ }
+}
--- /dev/null
+error[E0530]: match bindings cannot shadow statics
+ --> $DIR/issue-17718-patterns.rs:7:9
+ |
+LL | static A1: usize = 1;
+ | --------------------- the static `A1` is defined here
+...
+LL | A1 => {}
+ | ^^ cannot be named the same as a static
+
+error[E0530]: match bindings cannot shadow statics
+ --> $DIR/issue-17718-patterns.rs:8:9
+ |
+LL | static mut A2: usize = 1;
+ | ------------------------- the static `A2` is defined here
+...
+LL | A2 => {}
+ | ^^ cannot be named the same as a static
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0530`.
--- /dev/null
+pub use foo::FOO2;
+
+pub const FOO: usize = 3;
+const BAR: usize = 3;
+
+mod foo {
+ pub const FOO2: usize = 3;
+}
--- /dev/null
+// aux-build:issue-17718-const-privacy.rs
+
+extern crate issue_17718_const_privacy as other;
+
+use a::B; //~ ERROR: constant `B` is private
+use other::{
+ FOO,
+ BAR, //~ ERROR: constant `BAR` is private
+ FOO2,
+};
+
+mod a {
+ const B: usize = 3;
+}
+
+fn main() {}
--- /dev/null
+error[E0603]: constant `B` is private
+ --> $DIR/issue-17718-const-privacy.rs:5:8
+ |
+LL | use a::B;
+ | ^ private constant
+ |
+note: the constant `B` is defined here
+ --> $DIR/issue-17718-const-privacy.rs:13:5
+ |
+LL | const B: usize = 3;
+ | ^^^^^^^^^^^^^^^^^^^
+
+error[E0603]: constant `BAR` is private
+ --> $DIR/issue-17718-const-privacy.rs:8:5
+ |
+LL | BAR,
+ | ^^^ private constant
+ |
+note: the constant `BAR` is defined here
+ --> $DIR/auxiliary/issue-17718-const-privacy.rs:4:1
+ |
+LL | const BAR: usize = 3;
+ | ^^^^^^^^^^^^^^^^
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0603`.
--- /dev/null
+#![feature(negative_impls)]
+
+use std::marker::Sync;
+
+struct Foo;
+impl !Sync for Foo {}
+
+static FOO: usize = 3;
+static BAR: Foo = Foo;
+//~^ ERROR: `Foo` cannot be shared between threads safely [E0277]
+
+fn main() {}
--- /dev/null
+error[E0277]: `Foo` cannot be shared between threads safely
+ --> $DIR/issue-17718-static-sync.rs:9:13
+ |
+LL | static BAR: Foo = Foo;
+ | ^^^ `Foo` cannot be shared between threads safely
+ |
+ = help: the trait `Sync` is not implemented for `Foo`
+ = note: shared static variables must have a type that implements `Sync`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0277`.
--- /dev/null
+// run-pass
+#![allow(dead_code)]
+#![allow(unused_variables)]
+#![allow(unused_imports)]
+// pretty-expanded FIXME #23616
+
+use std::marker;
+use std::cell::UnsafeCell;
+
+struct MyUnsafePack<T>(UnsafeCell<T>);
+
+unsafe impl<T: Send> Sync for MyUnsafePack<T> {}
+
+struct MyUnsafe<T> {
+ value: MyUnsafePack<T>
+}
+
+impl<T> MyUnsafe<T> {
+ fn forbidden(&self) {}
+}
+
+unsafe impl<T: Send> Sync for MyUnsafe<T> {}
+
+enum UnsafeEnum<T> {
+ VariantSafe,
+ VariantUnsafe(UnsafeCell<T>)
+}
+
+unsafe impl<T: Send> Sync for UnsafeEnum<T> {}
+
+static STATIC1: UnsafeEnum<isize> = UnsafeEnum::VariantSafe;
+
+static STATIC2: MyUnsafePack<isize> = MyUnsafePack(UnsafeCell::new(1));
+const CONST: MyUnsafePack<isize> = MyUnsafePack(UnsafeCell::new(1));
+static STATIC3: MyUnsafe<isize> = MyUnsafe{value: CONST};
+
+static STATIC4: &'static MyUnsafePack<isize> = &STATIC2;
+
+struct Wrap<T> {
+ value: T
+}
+
+unsafe impl<T: Send> Sync for Wrap<T> {}
+
+static UNSAFE: MyUnsafePack<isize> = MyUnsafePack(UnsafeCell::new(2));
+static WRAPPED_UNSAFE: Wrap<&'static MyUnsafePack<isize>> = Wrap { value: &UNSAFE };
+
+fn main() {
+ let a = &STATIC1;
+
+ STATIC3.forbidden()
+}
const ENTRY_LIMIT: usize = 1000;
// FIXME: The following limits should be reduced eventually.
-const ROOT_ENTRY_LIMIT: usize = 950;
-const ISSUES_ENTRY_LIMIT: usize = 2141;
+const ROOT_ENTRY_LIMIT: usize = 948;
+const ISSUES_ENTRY_LIMIT: usize = 2126;
fn check_entries(path: &Path, bad: &mut bool) {
let dirs = walkdir::WalkDir::new(&path.join("test/ui"))