--- /dev/null
+fn main() {
+ let needlesArr: Vec<char> = vec!['a', 'f'];
+ needlesArr.iter().fold(|x, y| {
+ //~^ ERROR this function takes 2 arguments but 1 argument was supplied
+ });
+}
--- /dev/null
+error[E0061]: this function takes 2 arguments but 1 argument was supplied
+ --> $DIR/issue-3044.rs:3:23
+ |
+LL | needlesArr.iter().fold(|x, y| {
+ | _______________________^^^^-
+LL | |
+LL | | });
+ | |______- an argument is missing
+ |
+note: associated function defined here
+ --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
+help: provide the argument
+ |
+LL ~ needlesArr.iter().fold(|x, y| {
+LL +
+LL ~ }, /* f */);
+ |
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0061`.
--- /dev/null
+// run-pass
+fn example_err(prog: &str, arg: &str) {
+ println!("{}: {}", prog, arg)
+}
+
+fn exit<F>(print: F, prog: &str, arg: &str) where F: FnOnce(&str, &str) {
+ print(prog, arg);
+}
+
+struct X<F> where F: FnOnce(&str, &str) {
+ err: F,
+}
+
+impl<F> X<F> where F: FnOnce(&str, &str) {
+ pub fn boom(self) {
+ exit(self.err, "prog", "arg");
+ }
+}
+
+pub fn main(){
+ let val = X {
+ err: example_err,
+ };
+ val.boom();
+}
+++ /dev/null
-#![crate_type="lib"]
-
-pub enum Foo {
- FooV { data: () }
-}
+++ /dev/null
-pub fn main() {
- const z: &'static isize = {
- static p: isize = 3;
- &p //~ ERROR constants cannot refer to statics
- };
-}
+++ /dev/null
-error[E0013]: constants cannot refer to statics
- --> $DIR/issue-18118-2.rs:4:10
- |
-LL | &p
- | ^
- |
- = help: consider extracting the value of the `static` to a `const`, and referring to that
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0013`.
+++ /dev/null
-pub fn main() {
- const z: &'static isize = {
- let p = 3;
- &p //~ ERROR `p` does not live long enough
- };
-}
+++ /dev/null
-error[E0597]: `p` does not live long enough
- --> $DIR/issue-18118.rs:4:9
- |
-LL | &p
- | ^^
- | |
- | borrowed value does not live long enough
- | using this value as a constant requires that `p` is borrowed for `'static`
-LL | };
- | - `p` dropped here while still borrowed
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0597`.
+++ /dev/null
-// check-pass
-trait A<T: A<T>> {}
-
-fn main() {}
+++ /dev/null
-macro_rules! foo {
- ($e:expr) => { $e.foo() }
- //~^ ERROR no method named `foo` found
-}
-
-fn main() {
- let a = 1i32;
- foo!(a);
-
- foo!(1i32.foo());
- //~^ ERROR no method named `foo` found
-}
+++ /dev/null
-error[E0599]: no method named `foo` found for type `i32` in the current scope
- --> $DIR/issue-25385.rs:2:23
- |
-LL | ($e:expr) => { $e.foo() }
- | ^^^ method not found in `i32`
-...
-LL | foo!(a);
- | ------- in this macro invocation
- |
- = note: this error originates in the macro `foo` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-error[E0599]: no method named `foo` found for type `i32` in the current scope
- --> $DIR/issue-25385.rs:10:15
- |
-LL | foo!(1i32.foo());
- | ^^^ method not found in `i32`
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0599`.
+++ /dev/null
-fn main() {
- let needlesArr: Vec<char> = vec!['a', 'f'];
- needlesArr.iter().fold(|x, y| {
- //~^ ERROR this function takes 2 arguments but 1 argument was supplied
- });
-}
+++ /dev/null
-error[E0061]: this function takes 2 arguments but 1 argument was supplied
- --> $DIR/issue-3044.rs:3:23
- |
-LL | needlesArr.iter().fold(|x, y| {
- | _______________________^^^^-
-LL | |
-LL | | });
- | |______- an argument is missing
- |
-note: associated function defined here
- --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
-help: provide the argument
- |
-LL ~ needlesArr.iter().fold(|x, y| {
-LL +
-LL ~ }, /* f */);
- |
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0061`.
+++ /dev/null
-// aux-build:issue-30535.rs
-
-extern crate issue_30535 as foo;
-
-fn bar(
- _: foo::Foo::FooV //~ ERROR expected type, found variant `foo::Foo::FooV`
-) {}
-
-fn main() {}
+++ /dev/null
-error[E0573]: expected type, found variant `foo::Foo::FooV`
- --> $DIR/issue-30535.rs:6:8
- |
-LL | _: foo::Foo::FooV
- | ^^^^^^^^^^^^^^
- | |
- | not a type
- | help: try using the variant's enum: `foo::Foo`
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0573`.
+++ /dev/null
-// run-pass
-// Regression test for #36381. The monomorphization collector was asserting that
-// there are no projection types, but the `<&str as
-// StreamOnce>::Position` projection contained a late-bound region,
-// and we don't currently normalize in that case until the function is
-// actually invoked.
-
-pub trait StreamOnce {
- type Position;
-}
-
-impl<'a> StreamOnce for &'a str {
- type Position = usize;
-}
-
-pub fn parser<F>(_: F) {
-}
-
-fn follow(_: &str) -> <&str as StreamOnce>::Position {
- panic!()
-}
-
-fn main() {
- parser(follow);
-}
+++ /dev/null
-// run-pass
-fn example_err(prog: &str, arg: &str) {
- println!("{}: {}", prog, arg)
-}
-
-fn exit<F>(print: F, prog: &str, arg: &str) where F: FnOnce(&str, &str) {
- print(prog, arg);
-}
-
-struct X<F> where F: FnOnce(&str, &str) {
- err: F,
-}
-
-impl<F> X<F> where F: FnOnce(&str, &str) {
- pub fn boom(self) {
- exit(self.err, "prog", "arg");
- }
-}
-
-pub fn main(){
- let val = X {
- err: example_err,
- };
- val.boom();
-}
+++ /dev/null
-trait Dim {
- fn dim() -> usize;
-}
-
-enum Dim3 {}
-
-impl Dim for Dim3 {
- fn dim() -> usize {
- 3
- }
-}
-
-fn main() {
- let array: [usize; Dim3::dim()]
- //~^ ERROR E0015
- = [0; Dim3::dim()];
- //~^ ERROR E0015
-}
+++ /dev/null
-error[E0015]: cannot call non-const fn `<Dim3 as Dim>::dim` in constants
- --> $DIR/issue-39559-2.rs:14:24
- |
-LL | let array: [usize; Dim3::dim()]
- | ^^^^^^^^^^^
- |
- = note: calls in constants are limited to constant functions, tuple structs and tuple variants
-
-error[E0015]: cannot call non-const fn `<Dim3 as Dim>::dim` in constants
- --> $DIR/issue-39559-2.rs:16:15
- |
-LL | = [0; Dim3::dim()];
- | ^^^^^^^^^^^
- |
- = note: calls in constants are limited to constant functions, tuple structs and tuple variants
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0015`.
+++ /dev/null
-trait Dim {
- fn dim() -> usize;
-}
-
-enum Dim3 {}
-
-impl Dim for Dim3 {
- fn dim() -> usize {
- 3
- }
-}
-
-pub struct Vector<T, D: Dim> {
- entries: [T; D::dim()],
- //~^ ERROR generic parameters may not be used
- _dummy: D,
-}
-
-fn main() {}
+++ /dev/null
-error: generic parameters may not be used in const operations
- --> $DIR/issue-39559.rs:14:18
- |
-LL | entries: [T; D::dim()],
- | ^^^^^^ cannot perform const operation using `D`
- |
- = note: type parameters may not be used in const expressions
- = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
-
-error: aborting due to previous error
-
+++ /dev/null
-// run-pass
-#![allow(unused_imports)]
-// This test checks for namespace pollution by private tests.
-// Tests used to marked as public causing name conflicts with normal
-// functions only in test builds.
-
-// compile-flags: --test
-
-mod a {
- pub fn foo() -> bool {
- true
- }
-}
-
-mod b {
- #[test]
- fn foo() {
- local_name(); // ensure the local name still works
- }
-
- #[test]
- fn local_name() {}
-}
-
-use a::*;
-use b::*;
-
-pub fn conflict() {
- let _: bool = foo();
-}
+++ /dev/null
-// run-pass
-#![allow(dead_code)]
-
-enum Enum {
- Foo { foo: usize },
- Bar { bar: usize }
-}
-
-fn fun1(e1: &Enum, e2: &Enum) -> usize {
- match (e1, e2) {
- (&Enum::Foo { foo: _ }, &Enum::Foo { foo: _ }) => 0,
- (&Enum::Foo { foo: _ }, &Enum::Bar { bar: _ }) => 1,
- (&Enum::Bar { bar: _ }, &Enum::Bar { bar: _ }) => 2,
- (&Enum::Bar { bar: _ }, &Enum::Foo { foo: _ }) => 3,
- }
-}
-
-fn fun2(e1: &Enum, e2: &Enum) -> usize {
- match (e1, e2) {
- (&Enum::Foo { foo: _ }, &Enum::Foo { foo: _ }) => 0,
- (&Enum::Foo { foo: _ }, _ ) => 1,
- (&Enum::Bar { bar: _ }, &Enum::Bar { bar: _ }) => 2,
- (&Enum::Bar { bar: _ }, _ ) => 3,
- }
-}
-
-pub fn main() {
- let foo = Enum::Foo { foo: 1 };
- let bar = Enum::Bar { bar: 1 };
-
- assert_eq!(fun1(&foo, &foo), 0);
- assert_eq!(fun1(&foo, &bar), 1);
- assert_eq!(fun1(&bar, &bar), 2);
- assert_eq!(fun1(&bar, &foo), 3);
-
- assert_eq!(fun2(&foo, &foo), 0);
- assert_eq!(fun2(&foo, &bar), 1); // fun2 returns 0
- assert_eq!(fun2(&bar, &bar), 2);
- assert_eq!(fun2(&bar, &foo), 3); // fun2 returns 2
-}
+++ /dev/null
-// build-pass
-#![allow(dead_code)]
-#![allow(improper_ctypes)]
-// pretty-expanded FIXME #23616
-#![allow(non_snake_case)]
-
-pub mod Bar {
- pub struct Foo {
- v: isize,
- }
-
- extern "C" {
- pub fn foo(v: *const Foo) -> Foo;
- }
-}
-
-pub fn main() {}
--- /dev/null
+// run-pass
+// Regression test for #36381. The monomorphization collector was asserting that
+// there are no projection types, but the `<&str as
+// StreamOnce>::Position` projection contained a late-bound region,
+// and we don't currently normalize in that case until the function is
+// actually invoked.
+
+pub trait StreamOnce {
+ type Position;
+}
+
+impl<'a> StreamOnce for &'a str {
+ type Position = usize;
+}
+
+pub fn parser<F>(_: F) {
+}
+
+fn follow(_: &str) -> <&str as StreamOnce>::Position {
+ panic!()
+}
+
+fn main() {
+ parser(follow);
+}
--- /dev/null
+macro_rules! foo {
+ ($e:expr) => { $e.foo() }
+ //~^ ERROR no method named `foo` found
+}
+
+fn main() {
+ let a = 1i32;
+ foo!(a);
+
+ foo!(1i32.foo());
+ //~^ ERROR no method named `foo` found
+}
--- /dev/null
+error[E0599]: no method named `foo` found for type `i32` in the current scope
+ --> $DIR/issue-25385.rs:2:23
+ |
+LL | ($e:expr) => { $e.foo() }
+ | ^^^ method not found in `i32`
+...
+LL | foo!(a);
+ | ------- in this macro invocation
+ |
+ = note: this error originates in the macro `foo` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error[E0599]: no method named `foo` found for type `i32` in the current scope
+ --> $DIR/issue-25385.rs:10:15
+ |
+LL | foo!(1i32.foo());
+ | ^^^ method not found in `i32`
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0599`.
--- /dev/null
+// run-pass
+#![allow(dead_code)]
+
+enum Enum {
+ Foo { foo: usize },
+ Bar { bar: usize }
+}
+
+fn fun1(e1: &Enum, e2: &Enum) -> usize {
+ match (e1, e2) {
+ (&Enum::Foo { foo: _ }, &Enum::Foo { foo: _ }) => 0,
+ (&Enum::Foo { foo: _ }, &Enum::Bar { bar: _ }) => 1,
+ (&Enum::Bar { bar: _ }, &Enum::Bar { bar: _ }) => 2,
+ (&Enum::Bar { bar: _ }, &Enum::Foo { foo: _ }) => 3,
+ }
+}
+
+fn fun2(e1: &Enum, e2: &Enum) -> usize {
+ match (e1, e2) {
+ (&Enum::Foo { foo: _ }, &Enum::Foo { foo: _ }) => 0,
+ (&Enum::Foo { foo: _ }, _ ) => 1,
+ (&Enum::Bar { bar: _ }, &Enum::Bar { bar: _ }) => 2,
+ (&Enum::Bar { bar: _ }, _ ) => 3,
+ }
+}
+
+pub fn main() {
+ let foo = Enum::Foo { foo: 1 };
+ let bar = Enum::Bar { bar: 1 };
+
+ assert_eq!(fun1(&foo, &foo), 0);
+ assert_eq!(fun1(&foo, &bar), 1);
+ assert_eq!(fun1(&bar, &bar), 2);
+ assert_eq!(fun1(&bar, &foo), 3);
+
+ assert_eq!(fun2(&foo, &foo), 0);
+ assert_eq!(fun2(&foo, &bar), 1); // fun2 returns 0
+ assert_eq!(fun2(&bar, &bar), 2);
+ assert_eq!(fun2(&bar, &foo), 3); // fun2 returns 2
+}
--- /dev/null
+#![crate_type="lib"]
+
+pub enum Foo {
+ FooV { data: () }
+}
--- /dev/null
+// aux-build:issue-30535.rs
+
+extern crate issue_30535 as foo;
+
+fn bar(
+ _: foo::Foo::FooV //~ ERROR expected type, found variant `foo::Foo::FooV`
+) {}
+
+fn main() {}
--- /dev/null
+error[E0573]: expected type, found variant `foo::Foo::FooV`
+ --> $DIR/issue-30535.rs:6:8
+ |
+LL | _: foo::Foo::FooV
+ | ^^^^^^^^^^^^^^
+ | |
+ | not a type
+ | help: try using the variant's enum: `foo::Foo`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0573`.
--- /dev/null
+trait Dim {
+ fn dim() -> usize;
+}
+
+enum Dim3 {}
+
+impl Dim for Dim3 {
+ fn dim() -> usize {
+ 3
+ }
+}
+
+fn main() {
+ let array: [usize; Dim3::dim()]
+ //~^ ERROR E0015
+ = [0; Dim3::dim()];
+ //~^ ERROR E0015
+}
--- /dev/null
+error[E0015]: cannot call non-const fn `<Dim3 as Dim>::dim` in constants
+ --> $DIR/issue-39559-2.rs:14:24
+ |
+LL | let array: [usize; Dim3::dim()]
+ | ^^^^^^^^^^^
+ |
+ = note: calls in constants are limited to constant functions, tuple structs and tuple variants
+
+error[E0015]: cannot call non-const fn `<Dim3 as Dim>::dim` in constants
+ --> $DIR/issue-39559-2.rs:16:15
+ |
+LL | = [0; Dim3::dim()];
+ | ^^^^^^^^^^^
+ |
+ = note: calls in constants are limited to constant functions, tuple structs and tuple variants
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0015`.
--- /dev/null
+trait Dim {
+ fn dim() -> usize;
+}
+
+enum Dim3 {}
+
+impl Dim for Dim3 {
+ fn dim() -> usize {
+ 3
+ }
+}
+
+pub struct Vector<T, D: Dim> {
+ entries: [T; D::dim()],
+ //~^ ERROR generic parameters may not be used
+ _dummy: D,
+}
+
+fn main() {}
--- /dev/null
+error: generic parameters may not be used in const operations
+ --> $DIR/issue-39559.rs:14:18
+ |
+LL | entries: [T; D::dim()],
+ | ^^^^^^ cannot perform const operation using `D`
+ |
+ = note: type parameters may not be used in const expressions
+ = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
+
+error: aborting due to previous error
+
--- /dev/null
+pub fn main() {
+ const z: &'static isize = {
+ static p: isize = 3;
+ &p //~ ERROR constants cannot refer to statics
+ };
+}
--- /dev/null
+error[E0013]: constants cannot refer to statics
+ --> $DIR/issue-18118-2.rs:4:10
+ |
+LL | &p
+ | ^
+ |
+ = help: consider extracting the value of the `static` to a `const`, and referring to that
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0013`.
--- /dev/null
+pub fn main() {
+ const z: &'static isize = {
+ let p = 3;
+ &p //~ ERROR `p` does not live long enough
+ };
+}
--- /dev/null
+error[E0597]: `p` does not live long enough
+ --> $DIR/issue-18118.rs:4:9
+ |
+LL | &p
+ | ^^
+ | |
+ | borrowed value does not live long enough
+ | using this value as a constant requires that `p` is borrowed for `'static`
+LL | };
+ | - `p` dropped here while still borrowed
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0597`.
--- /dev/null
+// run-pass
+#![allow(unused_imports)]
+// This test checks for namespace pollution by private tests.
+// Tests used to marked as public causing name conflicts with normal
+// functions only in test builds.
+
+// compile-flags: --test
+
+mod a {
+ pub fn foo() -> bool {
+ true
+ }
+}
+
+mod b {
+ #[test]
+ fn foo() {
+ local_name(); // ensure the local name still works
+ }
+
+ #[test]
+ fn local_name() {}
+}
+
+use a::*;
+use b::*;
+
+pub fn conflict() {
+ let _: bool = foo();
+}
--- /dev/null
+// check-pass
+trait A<T: A<T>> {}
+
+fn main() {}
const ENTRY_LIMIT: usize = 1000;
// FIXME: The following limits should be reduced eventually.
const ROOT_ENTRY_LIMIT: usize = 939;
-const ISSUES_ENTRY_LIMIT: usize = 2040;
+const ISSUES_ENTRY_LIMIT: usize = 2020;
fn check_entries(path: &Path, bad: &mut bool) {
for dir in Walk::new(&path.join("test/ui")) {