--- /dev/null
+// run-pass
+#![allow(dead_code)]
+#[derive(Debug, PartialEq)]
+enum Bar {
+ A(i64),
+ B(i32),
+ C,
+}
+
+#[derive(Debug, PartialEq)]
+struct Foo(Bar, u8);
+
+static FOO: [Foo; 2] = [Foo(Bar::C, 0), Foo(Bar::C, 0xFF)];
+
+fn main() {
+ assert_eq!(&FOO[1], &Foo(Bar::C, 0xFF));
+}
+++ /dev/null
-macro_rules! borrow {
- ($x:expr) => { &$x } //~ ERROR mismatched types
-}
-
-fn foo(_: String) {}
-
-fn foo2(s: &String) {
- foo(s);
- //~^ ERROR mismatched types
-}
-
-fn foo3(_: u32) {}
-fn foo4(u: &u32) {
- foo3(u);
- //~^ ERROR mismatched types
-}
-
-struct S<'a> {
- u: &'a u32,
-}
-
-struct R {
- i: u32,
-}
-
-fn main() {
- let s = String::new();
- let r_s = &s;
- foo2(r_s);
- foo(&"aaa".to_owned());
- //~^ ERROR mismatched types
- foo(&mut "aaa".to_owned());
- //~^ ERROR mismatched types
- foo3(borrow!(0));
- foo4(&0);
- assert_eq!(3i32, &3i32);
- //~^ ERROR mismatched types
- let u = 3;
- let s = S { u };
- //~^ ERROR mismatched types
- let s = S { u: u };
- //~^ ERROR mismatched types
- let i = &4;
- let r = R { i };
- //~^ ERROR mismatched types
- let r = R { i: i };
- //~^ ERROR mismatched types
-
-
- let a = &1;
- let b = &2;
- let val: i32 = if true {
- a + 1
- } else {
- b
- //~^ ERROR mismatched types
- };
- let val: i32 = if true {
- let _ = 2;
- a + 1
- } else {
- let _ = 2;
- b
- //~^ ERROR mismatched types
- };
- let val = if true {
- *a
- } else if true {
- //~^ ERROR incompatible types
- b
- } else {
- &0
- };
-}
+++ /dev/null
-error[E0308]: mismatched types
- --> $DIR/deref-suggestion.rs:8:9
- |
-LL | foo(s);
- | ^- help: try using a conversion method: `.to_string()`
- | |
- | expected struct `String`, found `&String`
-
-error[E0308]: mismatched types
- --> $DIR/deref-suggestion.rs:14:10
- |
-LL | foo3(u);
- | ^ expected `u32`, found `&u32`
- |
-help: consider dereferencing the borrow
- |
-LL | foo3(*u);
- | ^
-
-error[E0308]: mismatched types
- --> $DIR/deref-suggestion.rs:30:9
- |
-LL | foo(&"aaa".to_owned());
- | ^^^^^^^^^^^^^^^^^ expected struct `String`, found `&String`
- |
-help: consider removing the borrow
- |
-LL | foo("aaa".to_owned());
- | --
-
-error[E0308]: mismatched types
- --> $DIR/deref-suggestion.rs:32:9
- |
-LL | foo(&mut "aaa".to_owned());
- | ^^^^^^^^^^^^^^^^^^^^^ expected struct `String`, found `&mut String`
- |
-help: consider removing the borrow
- |
-LL | foo("aaa".to_owned());
- | --
-
-error[E0308]: mismatched types
- --> $DIR/deref-suggestion.rs:2:20
- |
-LL | ($x:expr) => { &$x }
- | ^^^ expected `u32`, found `&{integer}`
-...
-LL | foo3(borrow!(0));
- | ---------- in this macro invocation
- |
- = note: this error originates in the macro `borrow` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-error[E0308]: mismatched types
- --> $DIR/deref-suggestion.rs:36:5
- |
-LL | assert_eq!(3i32, &3i32);
- | ^^^^^^^^^^^^^^^^^^^^^^^^ expected `i32`, found `&i32`
- |
- = note: this error originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-error[E0308]: mismatched types
- --> $DIR/deref-suggestion.rs:39:17
- |
-LL | let s = S { u };
- | ^
- | |
- | expected `&u32`, found integer
- | help: consider borrowing here: `u: &u`
-
-error[E0308]: mismatched types
- --> $DIR/deref-suggestion.rs:41:20
- |
-LL | let s = S { u: u };
- | ^
- | |
- | expected `&u32`, found integer
- | help: consider borrowing here: `&u`
-
-error[E0308]: mismatched types
- --> $DIR/deref-suggestion.rs:44:17
- |
-LL | let r = R { i };
- | ^ expected `u32`, found `&{integer}`
- |
-help: consider dereferencing the borrow
- |
-LL | let r = R { i: *i };
- | ^^^^^
-
-error[E0308]: mismatched types
- --> $DIR/deref-suggestion.rs:46:20
- |
-LL | let r = R { i: i };
- | ^ expected `u32`, found `&{integer}`
- |
-help: consider dereferencing the borrow
- |
-LL | let r = R { i: *i };
- | ^
-
-error[E0308]: mismatched types
- --> $DIR/deref-suggestion.rs:55:9
- |
-LL | b
- | ^ expected `i32`, found `&{integer}`
- |
-help: consider dereferencing the borrow
- |
-LL | *b
- | ^
-
-error[E0308]: mismatched types
- --> $DIR/deref-suggestion.rs:63:9
- |
-LL | b
- | ^ expected `i32`, found `&{integer}`
- |
-help: consider dereferencing the borrow
- |
-LL | *b
- | ^
-
-error[E0308]: `if` and `else` have incompatible types
- --> $DIR/deref-suggestion.rs:68:12
- |
-LL | let val = if true {
- | _______________-
-LL | | *a
- | | -- expected because of this
-LL | | } else if true {
- | |____________^
-LL | ||
-LL | || b
-LL | || } else {
-LL | || &0
-LL | || };
- | || ^
- | ||_____|
- | |______`if` and `else` have incompatible types
- | expected `i32`, found `&{integer}`
-
-error: aborting due to 13 previous errors
-
-For more information about this error, try `rustc --explain E0308`.
--- /dev/null
+struct S;
+
+impl S {
+ #[derive(Debug)] //~ ERROR `derive` may only be applied to `struct`s, `enum`s and `union`s
+ fn f() {
+ file!();
+ }
+}
+
+trait Tr1 {
+ #[derive(Debug)] //~ ERROR `derive` may only be applied to `struct`s, `enum`s and `union`s
+ fn f();
+}
+
+trait Tr2 {
+ #[derive(Debug)] //~ ERROR `derive` may only be applied to `struct`s, `enum`s and `union`s
+ type F;
+}
+
+fn main() {}
--- /dev/null
+error[E0774]: `derive` may only be applied to `struct`s, `enum`s and `union`s
+ --> $DIR/issue-43023.rs:4:5
+ |
+LL | #[derive(Debug)]
+ | ^^^^^^^^^^^^^^^^ not applicable here
+LL | / fn f() {
+LL | | file!();
+LL | | }
+ | |_____- not a `struct`, `enum` or `union`
+
+error[E0774]: `derive` may only be applied to `struct`s, `enum`s and `union`s
+ --> $DIR/issue-43023.rs:11:5
+ |
+LL | #[derive(Debug)]
+ | ^^^^^^^^^^^^^^^^ not applicable here
+LL | fn f();
+ | ------- not a `struct`, `enum` or `union`
+
+error[E0774]: `derive` may only be applied to `struct`s, `enum`s and `union`s
+ --> $DIR/issue-43023.rs:16:5
+ |
+LL | #[derive(Debug)]
+ | ^^^^^^^^^^^^^^^^ not applicable here
+LL | type F;
+ | ------- not a `struct`, `enum` or `union`
+
+error: aborting due to 3 previous errors
+
+For more information about this error, try `rustc --explain E0774`.
+++ /dev/null
-fn wants_uniq(x: String) { }
-fn wants_slice(x: &str) { }
-
-fn has_uniq(x: String) {
- wants_uniq(x);
- wants_slice(&*x);
-}
-
-fn has_slice(x: &str) {
- wants_uniq(x); //~ ERROR mismatched types
- wants_slice(x);
-}
-
-fn main() {
-}
+++ /dev/null
-error[E0308]: mismatched types
- --> $DIR/estr-subtyping.rs:10:15
- |
-LL | wants_uniq(x);
- | ^- help: try using a conversion method: `.to_string()`
- | |
- | expected struct `String`, found `&str`
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0308`.
--- /dev/null
+macro_rules! borrow {
+ ($x:expr) => { &$x } //~ ERROR mismatched types
+}
+
+fn foo(_: String) {}
+
+fn foo2(s: &String) {
+ foo(s);
+ //~^ ERROR mismatched types
+}
+
+fn foo3(_: u32) {}
+fn foo4(u: &u32) {
+ foo3(u);
+ //~^ ERROR mismatched types
+}
+
+struct S<'a> {
+ u: &'a u32,
+}
+
+struct R {
+ i: u32,
+}
+
+fn main() {
+ let s = String::new();
+ let r_s = &s;
+ foo2(r_s);
+ foo(&"aaa".to_owned());
+ //~^ ERROR mismatched types
+ foo(&mut "aaa".to_owned());
+ //~^ ERROR mismatched types
+ foo3(borrow!(0));
+ foo4(&0);
+ assert_eq!(3i32, &3i32);
+ //~^ ERROR mismatched types
+ let u = 3;
+ let s = S { u };
+ //~^ ERROR mismatched types
+ let s = S { u: u };
+ //~^ ERROR mismatched types
+ let i = &4;
+ let r = R { i };
+ //~^ ERROR mismatched types
+ let r = R { i: i };
+ //~^ ERROR mismatched types
+
+
+ let a = &1;
+ let b = &2;
+ let val: i32 = if true {
+ a + 1
+ } else {
+ b
+ //~^ ERROR mismatched types
+ };
+ let val: i32 = if true {
+ let _ = 2;
+ a + 1
+ } else {
+ let _ = 2;
+ b
+ //~^ ERROR mismatched types
+ };
+ let val = if true {
+ *a
+ } else if true {
+ //~^ ERROR incompatible types
+ b
+ } else {
+ &0
+ };
+}
--- /dev/null
+error[E0308]: mismatched types
+ --> $DIR/deref-suggestion.rs:8:9
+ |
+LL | foo(s);
+ | ^- help: try using a conversion method: `.to_string()`
+ | |
+ | expected struct `String`, found `&String`
+
+error[E0308]: mismatched types
+ --> $DIR/deref-suggestion.rs:14:10
+ |
+LL | foo3(u);
+ | ^ expected `u32`, found `&u32`
+ |
+help: consider dereferencing the borrow
+ |
+LL | foo3(*u);
+ | ^
+
+error[E0308]: mismatched types
+ --> $DIR/deref-suggestion.rs:30:9
+ |
+LL | foo(&"aaa".to_owned());
+ | ^^^^^^^^^^^^^^^^^ expected struct `String`, found `&String`
+ |
+help: consider removing the borrow
+ |
+LL | foo("aaa".to_owned());
+ | --
+
+error[E0308]: mismatched types
+ --> $DIR/deref-suggestion.rs:32:9
+ |
+LL | foo(&mut "aaa".to_owned());
+ | ^^^^^^^^^^^^^^^^^^^^^ expected struct `String`, found `&mut String`
+ |
+help: consider removing the borrow
+ |
+LL | foo("aaa".to_owned());
+ | --
+
+error[E0308]: mismatched types
+ --> $DIR/deref-suggestion.rs:2:20
+ |
+LL | ($x:expr) => { &$x }
+ | ^^^ expected `u32`, found `&{integer}`
+...
+LL | foo3(borrow!(0));
+ | ---------- in this macro invocation
+ |
+ = note: this error originates in the macro `borrow` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error[E0308]: mismatched types
+ --> $DIR/deref-suggestion.rs:36:5
+ |
+LL | assert_eq!(3i32, &3i32);
+ | ^^^^^^^^^^^^^^^^^^^^^^^^ expected `i32`, found `&i32`
+ |
+ = note: this error originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error[E0308]: mismatched types
+ --> $DIR/deref-suggestion.rs:39:17
+ |
+LL | let s = S { u };
+ | ^
+ | |
+ | expected `&u32`, found integer
+ | help: consider borrowing here: `u: &u`
+
+error[E0308]: mismatched types
+ --> $DIR/deref-suggestion.rs:41:20
+ |
+LL | let s = S { u: u };
+ | ^
+ | |
+ | expected `&u32`, found integer
+ | help: consider borrowing here: `&u`
+
+error[E0308]: mismatched types
+ --> $DIR/deref-suggestion.rs:44:17
+ |
+LL | let r = R { i };
+ | ^ expected `u32`, found `&{integer}`
+ |
+help: consider dereferencing the borrow
+ |
+LL | let r = R { i: *i };
+ | ^^^^^
+
+error[E0308]: mismatched types
+ --> $DIR/deref-suggestion.rs:46:20
+ |
+LL | let r = R { i: i };
+ | ^ expected `u32`, found `&{integer}`
+ |
+help: consider dereferencing the borrow
+ |
+LL | let r = R { i: *i };
+ | ^
+
+error[E0308]: mismatched types
+ --> $DIR/deref-suggestion.rs:55:9
+ |
+LL | b
+ | ^ expected `i32`, found `&{integer}`
+ |
+help: consider dereferencing the borrow
+ |
+LL | *b
+ | ^
+
+error[E0308]: mismatched types
+ --> $DIR/deref-suggestion.rs:63:9
+ |
+LL | b
+ | ^ expected `i32`, found `&{integer}`
+ |
+help: consider dereferencing the borrow
+ |
+LL | *b
+ | ^
+
+error[E0308]: `if` and `else` have incompatible types
+ --> $DIR/deref-suggestion.rs:68:12
+ |
+LL | let val = if true {
+ | _______________-
+LL | | *a
+ | | -- expected because of this
+LL | | } else if true {
+ | |____________^
+LL | ||
+LL | || b
+LL | || } else {
+LL | || &0
+LL | || };
+ | || ^
+ | ||_____|
+ | |______`if` and `else` have incompatible types
+ | expected `i32`, found `&{integer}`
+
+error: aborting due to 13 previous errors
+
+For more information about this error, try `rustc --explain E0308`.
+++ /dev/null
-mod a {
- struct Foo;
- impl Foo { pub fn new() {} }
- enum Bar {}
- impl Bar { pub fn new() {} }
-}
-
-fn main() {
- a::Foo::new();
- //~^ ERROR: struct `Foo` is private
- a::Bar::new();
- //~^ ERROR: enum `Bar` is private
-}
+++ /dev/null
-error[E0603]: struct `Foo` is private
- --> $DIR/issue-13641.rs:9:8
- |
-LL | a::Foo::new();
- | ^^^ private struct
- |
-note: the struct `Foo` is defined here
- --> $DIR/issue-13641.rs:2:5
- |
-LL | struct Foo;
- | ^^^^^^^^^^^
-
-error[E0603]: enum `Bar` is private
- --> $DIR/issue-13641.rs:11:8
- |
-LL | a::Bar::new();
- | ^^^ private enum
- |
-note: the enum `Bar` is defined here
- --> $DIR/issue-13641.rs:4:5
- |
-LL | enum Bar {}
- | ^^^^^^^^
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0603`.
+++ /dev/null
-// run-pass
-#![allow(dead_code)]
-#[derive(Debug, PartialEq)]
-enum Bar {
- A(i64),
- B(i32),
- C,
-}
-
-#[derive(Debug, PartialEq)]
-struct Foo(Bar, u8);
-
-static FOO: [Foo; 2] = [Foo(Bar::C, 0), Foo(Bar::C, 0xFF)];
-
-fn main() {
- assert_eq!(&FOO[1], &Foo(Bar::C, 0xFF));
-}
+++ /dev/null
-struct S;
-
-impl S {
- #[derive(Debug)] //~ ERROR `derive` may only be applied to `struct`s, `enum`s and `union`s
- fn f() {
- file!();
- }
-}
-
-trait Tr1 {
- #[derive(Debug)] //~ ERROR `derive` may only be applied to `struct`s, `enum`s and `union`s
- fn f();
-}
-
-trait Tr2 {
- #[derive(Debug)] //~ ERROR `derive` may only be applied to `struct`s, `enum`s and `union`s
- type F;
-}
-
-fn main() {}
+++ /dev/null
-error[E0774]: `derive` may only be applied to `struct`s, `enum`s and `union`s
- --> $DIR/issue-43023.rs:4:5
- |
-LL | #[derive(Debug)]
- | ^^^^^^^^^^^^^^^^ not applicable here
-LL | / fn f() {
-LL | | file!();
-LL | | }
- | |_____- not a `struct`, `enum` or `union`
-
-error[E0774]: `derive` may only be applied to `struct`s, `enum`s and `union`s
- --> $DIR/issue-43023.rs:11:5
- |
-LL | #[derive(Debug)]
- | ^^^^^^^^^^^^^^^^ not applicable here
-LL | fn f();
- | ------- not a `struct`, `enum` or `union`
-
-error[E0774]: `derive` may only be applied to `struct`s, `enum`s and `union`s
- --> $DIR/issue-43023.rs:16:5
- |
-LL | #[derive(Debug)]
- | ^^^^^^^^^^^^^^^^ not applicable here
-LL | type F;
- | ------- not a `struct`, `enum` or `union`
-
-error: aborting due to 3 previous errors
-
-For more information about this error, try `rustc --explain E0774`.
--- /dev/null
+mod a {
+ struct Foo;
+ impl Foo { pub fn new() {} }
+ enum Bar {}
+ impl Bar { pub fn new() {} }
+}
+
+fn main() {
+ a::Foo::new();
+ //~^ ERROR: struct `Foo` is private
+ a::Bar::new();
+ //~^ ERROR: enum `Bar` is private
+}
--- /dev/null
+error[E0603]: struct `Foo` is private
+ --> $DIR/issue-13641.rs:9:8
+ |
+LL | a::Foo::new();
+ | ^^^ private struct
+ |
+note: the struct `Foo` is defined here
+ --> $DIR/issue-13641.rs:2:5
+ |
+LL | struct Foo;
+ | ^^^^^^^^^^^
+
+error[E0603]: enum `Bar` is private
+ --> $DIR/issue-13641.rs:11:8
+ |
+LL | a::Bar::new();
+ | ^^^ private enum
+ |
+note: the enum `Bar` is defined here
+ --> $DIR/issue-13641.rs:4:5
+ |
+LL | enum Bar {}
+ | ^^^^^^^^
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0603`.
const ENTRY_LIMIT: usize = 1000;
// FIXME: The following limits should be reduced eventually.
const ROOT_ENTRY_LIMIT: usize = 1345;
-const ISSUES_ENTRY_LIMIT: usize = 2530;
+const ISSUES_ENTRY_LIMIT: usize = 2525;
fn check_entries(path: &Path, bad: &mut bool) {
let dirs = walkdir::WalkDir::new(&path.join("test/ui"))