summaryrefslogtreecommitdiffstats
path: root/tests/ui/issues
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:41 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:41 +0000
commit4f9fe856a25ab29345b90e7725509e9ee38a37be (patch)
treee4ffd8a9374cae7b21f7cbfb352927e0e074aff6 /tests/ui/issues
parentAdding upstream version 1.68.2+dfsg1. (diff)
downloadrustc-upstream/1.69.0+dfsg1.tar.xz
rustc-upstream/1.69.0+dfsg1.zip
Adding upstream version 1.69.0+dfsg1.upstream/1.69.0+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/ui/issues')
-rw-r--r--tests/ui/issues/issue-100605.stderr4
-rw-r--r--tests/ui/issues/issue-102964.stderr2
-rw-r--r--tests/ui/issues/issue-10412.stderr1
-rw-r--r--tests/ui/issues/issue-106755.rs19
-rw-r--r--tests/ui/issues/issue-106755.stderr22
-rw-r--r--tests/ui/issues/issue-10764.stderr1
-rw-r--r--tests/ui/issues/issue-11374.stderr4
-rw-r--r--tests/ui/issues/issue-11844.stderr2
-rw-r--r--tests/ui/issues/issue-13446.stderr2
-rw-r--r--tests/ui/issues/issue-13466.rs4
-rw-r--r--tests/ui/issues/issue-13466.stderr4
-rw-r--r--tests/ui/issues/issue-14541.rs2
-rw-r--r--tests/ui/issues/issue-14541.stderr2
-rw-r--r--tests/ui/issues/issue-15783.rs2
-rw-r--r--tests/ui/issues/issue-15783.stderr2
-rw-r--r--tests/ui/issues/issue-15896.stderr2
-rw-r--r--tests/ui/issues/issue-16338.stderr2
-rw-r--r--tests/ui/issues/issue-16401.rs2
-rw-r--r--tests/ui/issues/issue-16401.stderr2
-rw-r--r--tests/ui/issues/issue-16939.stderr9
-rw-r--r--tests/ui/issues/issue-16966.stderr6
-rw-r--r--tests/ui/issues/issue-17337.stderr2
-rw-r--r--tests/ui/issues/issue-18423.rs2
-rw-r--r--tests/ui/issues/issue-18423.stderr2
-rw-r--r--tests/ui/issues/issue-18446.stderr2
-rw-r--r--tests/ui/issues/issue-18819.stderr2
-rw-r--r--tests/ui/issues/issue-19521.stderr2
-rw-r--r--tests/ui/issues/issue-20225.stderr6
-rw-r--r--tests/ui/issues/issue-21202.rs2
-rw-r--r--tests/ui/issues/issue-21202.stderr6
-rw-r--r--tests/ui/issues/issue-21332.rs2
-rw-r--r--tests/ui/issues/issue-21332.stderr2
-rw-r--r--tests/ui/issues/issue-22536-copy-mustnt-zero.rs28
-rw-r--r--tests/ui/issues/issue-23041.stderr2
-rw-r--r--tests/ui/issues/issue-24322.stderr2
-rw-r--r--tests/ui/issues/issue-24819.rs2
-rw-r--r--tests/ui/issues/issue-24819.stderr2
-rw-r--r--tests/ui/issues/issue-26094.rs7
-rw-r--r--tests/ui/issues/issue-26094.stderr6
-rw-r--r--tests/ui/issues/issue-27008.rs2
-rw-r--r--tests/ui/issues/issue-27008.stderr2
-rw-r--r--tests/ui/issues/issue-2735-2.rs27
-rw-r--r--tests/ui/issues/issue-2735-3.rs27
-rw-r--r--tests/ui/issues/issue-2735.rs22
-rw-r--r--tests/ui/issues/issue-27583.rs47
-rw-r--r--tests/ui/issues/issue-30123.stderr2
-rw-r--r--tests/ui/issues/issue-30438-c.rs1
-rw-r--r--tests/ui/issues/issue-30438-c.stderr12
-rw-r--r--tests/ui/issues/issue-32122-1.stderr2
-rw-r--r--tests/ui/issues/issue-32122-2.stderr2
-rw-r--r--tests/ui/issues/issue-3214.rs2
-rw-r--r--tests/ui/issues/issue-3214.stderr2
-rw-r--r--tests/ui/issues/issue-33504.stderr2
-rw-r--r--tests/ui/issues/issue-33903.rs10
-rw-r--r--tests/ui/issues/issue-33941.stderr6
-rw-r--r--tests/ui/issues/issue-35241.stderr2
-rw-r--r--tests/ui/issues/issue-3680.rs2
-rw-r--r--tests/ui/issues/issue-3680.stderr2
-rw-r--r--tests/ui/issues/issue-3702-2.stderr4
-rw-r--r--tests/ui/issues/issue-3763.rs7
-rw-r--r--tests/ui/issues/issue-3763.stderr22
-rw-r--r--tests/ui/issues/issue-38821.rs33
-rw-r--r--tests/ui/issues/issue-38821.stderr22
-rw-r--r--tests/ui/issues/issue-39292.rs17
-rw-r--r--tests/ui/issues/issue-39970.rs2
-rw-r--r--tests/ui/issues/issue-39970.stderr4
-rw-r--r--tests/ui/issues/issue-40003.rs178
-rw-r--r--tests/ui/issues/issue-40288.stderr4
-rw-r--r--tests/ui/issues/issue-40749.stderr2
-rw-r--r--tests/ui/issues/issue-43420-no-over-suggest.stderr2
-rw-r--r--tests/ui/issues/issue-4517.rs2
-rw-r--r--tests/ui/issues/issue-4517.stderr2
-rw-r--r--tests/ui/issues/issue-45697-1.stderr6
-rw-r--r--tests/ui/issues/issue-45697.stderr6
-rw-r--r--tests/ui/issues/issue-46471-1.stderr7
-rw-r--r--tests/ui/issues/issue-47715.stderr8
-rw-r--r--tests/ui/issues/issue-48179.rs38
-rw-r--r--tests/ui/issues/issue-48364.stderr4
-rw-r--r--tests/ui/issues/issue-4935.stderr9
-rw-r--r--tests/ui/issues/issue-4968.rs2
-rw-r--r--tests/ui/issues/issue-4968.stderr2
-rw-r--r--tests/ui/issues/issue-50576.rs6
-rw-r--r--tests/ui/issues/issue-50576.stderr22
-rw-r--r--tests/ui/issues/issue-5100.rs4
-rw-r--r--tests/ui/issues/issue-5100.stderr6
-rw-r--r--tests/ui/issues/issue-51515.rs1
-rw-r--r--tests/ui/issues/issue-51515.stderr9
-rw-r--r--tests/ui/issues/issue-51632-try-desugar-incompatible-types.stderr2
-rw-r--r--tests/ui/issues/issue-52126-assign-op-invariance.stderr2
-rw-r--r--tests/ui/issues/issue-53251.rs4
-rw-r--r--tests/ui/issues/issue-53251.stderr4
-rw-r--r--tests/ui/issues/issue-53348.rs2
-rw-r--r--tests/ui/issues/issue-53348.stderr2
-rw-r--r--tests/ui/issues/issue-5358-1.rs2
-rw-r--r--tests/ui/issues/issue-5358-1.stderr2
-rw-r--r--tests/ui/issues/issue-53712.rs9
-rw-r--r--tests/ui/issues/issue-53712.stderr11
-rw-r--r--tests/ui/issues/issue-54582.rs16
-rw-r--r--tests/ui/issues/issue-56943.stderr2
-rw-r--r--tests/ui/issues/issue-57362-2.stderr4
-rw-r--r--tests/ui/issues/issue-57741-1.stderr4
-rw-r--r--tests/ui/issues/issue-57741.stderr8
-rw-r--r--tests/ui/issues/issue-59488.stderr4
-rw-r--r--tests/ui/issues/issue-60218.stderr2
-rw-r--r--tests/ui/issues/issue-60622.rs2
-rw-r--r--tests/ui/issues/issue-60622.stderr4
-rw-r--r--tests/ui/issues/issue-61106.stderr2
-rw-r--r--tests/ui/issues/issue-6458-4.stderr2
-rw-r--r--tests/ui/issues/issue-65634-raw-ident-suggestion.edition2015.stderr4
-rw-r--r--tests/ui/issues/issue-65634-raw-ident-suggestion.edition2018.stderr4
-rw-r--r--tests/ui/issues/issue-67039-unsound-pin-partialeq.stderr2
-rw-r--r--tests/ui/issues/issue-69306.stderr6
-rw-r--r--tests/ui/issues/issue-69455.stderr4
-rw-r--r--tests/ui/issues/issue-69683.stderr2
-rw-r--r--tests/ui/issues/issue-70093/issue-70093-link-directives.rs10
-rw-r--r--tests/ui/issues/issue-70093/issue-70093.rs (renamed from tests/ui/issues/issue-70093.rs)0
-rw-r--r--tests/ui/issues/issue-7061.stderr2
-rw-r--r--tests/ui/issues/issue-7092.rs2
-rw-r--r--tests/ui/issues/issue-7092.stderr2
-rw-r--r--tests/ui/issues/issue-71676-1.stderr6
-rw-r--r--tests/ui/issues/issue-7364.stderr1
-rw-r--r--tests/ui/issues/issue-74236/main.stderr2
-rw-r--r--tests/ui/issues/issue-75307.rs3
-rw-r--r--tests/ui/issues/issue-75307.stderr8
-rw-r--r--tests/ui/issues/issue-75777.rs15
-rw-r--r--tests/ui/issues/issue-75777.stderr11
-rw-r--r--tests/ui/issues/issue-76191.stderr4
-rw-r--r--tests/ui/issues/issue-7813.rs4
-rw-r--r--tests/ui/issues/issue-7813.stderr14
-rw-r--r--tests/ui/issues/issue-7867.rs2
-rw-r--r--tests/ui/issues/issue-7867.stderr2
-rw-r--r--tests/ui/issues/issue-83924.fixed20
-rw-r--r--tests/ui/issues/issue-83924.rs20
-rw-r--r--tests/ui/issues/issue-83924.stderr22
-rw-r--r--tests/ui/issues/issue-92741.fixed13
-rw-r--r--tests/ui/issues/issue-92741.rs17
-rw-r--r--tests/ui/issues/issue-92741.stderr49
137 files changed, 304 insertions, 817 deletions
diff --git a/tests/ui/issues/issue-100605.stderr b/tests/ui/issues/issue-100605.stderr
index 886e3cd6b..be30eef2a 100644
--- a/tests/ui/issues/issue-100605.stderr
+++ b/tests/ui/issues/issue-100605.stderr
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
--> $DIR/issue-100605.rs:4:18
|
LL | takes_option(&None);
- | ------------ ^^^^^ expected enum `Option`, found `&Option<_>`
+ | ------------ ^^^^^ expected `Option<&String>`, found `&Option<_>`
| |
| arguments to this function are incorrect
|
@@ -29,7 +29,7 @@ error[E0308]: mismatched types
LL | takes_option(&res);
| ------------ ^^^^
| | |
- | | expected enum `Option`, found `&Option<String>`
+ | | expected `Option<&String>`, found `&Option<String>`
| | help: you can convert from `&Option<T>` to `Option<&T>` using `.as_ref()`: `res.as_ref()`
| arguments to this function are incorrect
|
diff --git a/tests/ui/issues/issue-102964.stderr b/tests/ui/issues/issue-102964.stderr
index 450403909..c0766480a 100644
--- a/tests/ui/issues/issue-102964.stderr
+++ b/tests/ui/issues/issue-102964.stderr
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
--> $DIR/issue-102964.rs:5:41
|
LL | fn bar_function<T>(function: Foo<T>) -> RcFoo<T> {
- | ------------ ^^^^^^^^ expected struct `Rc`, found `()`
+ | ------------ ^^^^^^^^ expected `Rc<&dyn Fn(&T)>`, found `()`
| |
| implicitly returns `()` as its body has no tail or `return` expression
|
diff --git a/tests/ui/issues/issue-10412.stderr b/tests/ui/issues/issue-10412.stderr
index 46b9fd541..26666782d 100644
--- a/tests/ui/issues/issue-10412.stderr
+++ b/tests/ui/issues/issue-10412.stderr
@@ -46,7 +46,6 @@ error[E0726]: implicit elided lifetime not allowed here
LL | impl<'self> Serializable<str> for &'self str {
| ^^^^^^^^^^^^^^^^^ expected lifetime parameter
|
- = note: assuming a `'static` lifetime...
help: indicate the anonymous lifetime
|
LL | impl<'self> Serializable<'_, str> for &'self str {
diff --git a/tests/ui/issues/issue-106755.rs b/tests/ui/issues/issue-106755.rs
new file mode 100644
index 000000000..46ece725f
--- /dev/null
+++ b/tests/ui/issues/issue-106755.rs
@@ -0,0 +1,19 @@
+// compile-flags:-Ztranslate-lang=en_US
+
+#![feature(negative_impls)]
+#![feature(marker_trait_attr)]
+
+#[marker]
+trait MyTrait {}
+
+struct TestType<T>(::std::marker::PhantomData<T>);
+
+unsafe impl<T: MyTrait + 'static> Send for TestType<T> {}
+
+impl<T: MyTrait> !Send for TestType<T> {} //~ ERROR found both positive and negative implementation
+
+unsafe impl<T: 'static> Send for TestType<T> {} //~ ERROR conflicting implementations
+
+impl !Send for TestType<i32> {}
+
+fn main() {}
diff --git a/tests/ui/issues/issue-106755.stderr b/tests/ui/issues/issue-106755.stderr
new file mode 100644
index 000000000..543970340
--- /dev/null
+++ b/tests/ui/issues/issue-106755.stderr
@@ -0,0 +1,22 @@
+error[E0751]: found both positive and negative implementation of trait `Send` for type `TestType<_>`:
+ --> $DIR/issue-106755.rs:13:1
+ |
+LL | unsafe impl<T: MyTrait + 'static> Send for TestType<T> {}
+ | ------------------------------------------------------ positive implementation here
+LL |
+LL | impl<T: MyTrait> !Send for TestType<T> {}
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ negative implementation here
+
+error[E0119]: conflicting implementations of trait `Send` for type `TestType<_>`
+ --> $DIR/issue-106755.rs:15:1
+ |
+LL | unsafe impl<T: MyTrait + 'static> Send for TestType<T> {}
+ | ------------------------------------------------------ first implementation here
+...
+LL | unsafe impl<T: 'static> Send for TestType<T> {}
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `TestType<_>`
+
+error: aborting due to 2 previous errors
+
+Some errors have detailed explanations: E0119, E0751.
+For more information about an error, try `rustc --explain E0119`.
diff --git a/tests/ui/issues/issue-10764.stderr b/tests/ui/issues/issue-10764.stderr
index 4d8a85a13..fcb45affe 100644
--- a/tests/ui/issues/issue-10764.stderr
+++ b/tests/ui/issues/issue-10764.stderr
@@ -8,6 +8,7 @@ LL | fn main() { f(bar) }
|
= note: expected fn pointer `fn()`
found fn item `extern "C" fn() {bar}`
+ = note: when the arguments and return types match, functions can be coerced to function pointers
note: function defined here
--> $DIR/issue-10764.rs:1:4
|
diff --git a/tests/ui/issues/issue-11374.stderr b/tests/ui/issues/issue-11374.stderr
index ace77814a..6e1fb1540 100644
--- a/tests/ui/issues/issue-11374.stderr
+++ b/tests/ui/issues/issue-11374.stderr
@@ -4,13 +4,13 @@ error[E0308]: mismatched types
LL | c.read_to(v);
| ------- ^
| | |
- | | expected `&mut [u8]`, found struct `Vec`
+ | | expected `&mut [u8]`, found `Vec<_>`
| | help: consider mutably borrowing here: `&mut v`
| arguments to this method are incorrect
|
= note: expected mutable reference `&mut [u8]`
found struct `Vec<_>`
-note: associated function defined here
+note: method defined here
--> $DIR/issue-11374.rs:13:12
|
LL | pub fn read_to(&mut self, vec: &mut [u8]) {
diff --git a/tests/ui/issues/issue-11844.stderr b/tests/ui/issues/issue-11844.stderr
index 81cf918a1..9afd20977 100644
--- a/tests/ui/issues/issue-11844.stderr
+++ b/tests/ui/issues/issue-11844.stderr
@@ -4,7 +4,7 @@ error[E0308]: mismatched types
LL | match a {
| - this expression has type `Option<Box<{integer}>>`
LL | Ok(a) =>
- | ^^^^^ expected enum `Option`, found enum `Result`
+ | ^^^^^ expected `Option<Box<{integer}>>`, found `Result<_, _>`
|
= note: expected enum `Option<Box<{integer}>>`
found enum `Result<_, _>`
diff --git a/tests/ui/issues/issue-13446.stderr b/tests/ui/issues/issue-13446.stderr
index 30fb73dd3..139c34c88 100644
--- a/tests/ui/issues/issue-13446.stderr
+++ b/tests/ui/issues/issue-13446.stderr
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
--> $DIR/issue-13446.rs:3:26
|
LL | static VEC: [u32; 256] = vec![];
- | ^^^^^^ expected array `[u32; 256]`, found struct `Vec`
+ | ^^^^^^ expected `[u32; 256]`, found `Vec<_>`
|
= note: expected array `[u32; 256]`
found struct `Vec<_>`
diff --git a/tests/ui/issues/issue-13466.rs b/tests/ui/issues/issue-13466.rs
index a420c7704..52d4d75d2 100644
--- a/tests/ui/issues/issue-13466.rs
+++ b/tests/ui/issues/issue-13466.rs
@@ -9,12 +9,12 @@ pub fn main() {
//~^ ERROR mismatched types
//~| expected enum `Option<{integer}>`
//~| found enum `Result<_, _>`
- //~| expected enum `Option`, found enum `Result`
+ //~| expected `Option<{integer}>`, found `Result<_, _>`
Err(e) => panic!(e)
//~^ ERROR mismatched types
//~| expected enum `Option<{integer}>`
//~| found enum `Result<_, _>`
- //~| expected enum `Option`, found enum `Result`
+ //~| expected `Option<{integer}>`, found `Result<_, _>`
};
}
diff --git a/tests/ui/issues/issue-13466.stderr b/tests/ui/issues/issue-13466.stderr
index c78466f4e..fd928e458 100644
--- a/tests/ui/issues/issue-13466.stderr
+++ b/tests/ui/issues/issue-13466.stderr
@@ -4,7 +4,7 @@ error[E0308]: mismatched types
LL | let _x: usize = match Some(1) {
| ------- this expression has type `Option<{integer}>`
LL | Ok(u) => u,
- | ^^^^^ expected enum `Option`, found enum `Result`
+ | ^^^^^ expected `Option<{integer}>`, found `Result<_, _>`
|
= note: expected enum `Option<{integer}>`
found enum `Result<_, _>`
@@ -16,7 +16,7 @@ LL | let _x: usize = match Some(1) {
| ------- this expression has type `Option<{integer}>`
...
LL | Err(e) => panic!(e)
- | ^^^^^^ expected enum `Option`, found enum `Result`
+ | ^^^^^^ expected `Option<{integer}>`, found `Result<_, _>`
|
= note: expected enum `Option<{integer}>`
found enum `Result<_, _>`
diff --git a/tests/ui/issues/issue-14541.rs b/tests/ui/issues/issue-14541.rs
index 555ec9f98..2ff1c1f88 100644
--- a/tests/ui/issues/issue-14541.rs
+++ b/tests/ui/issues/issue-14541.rs
@@ -4,7 +4,7 @@ struct Vec3 { y: f32, z: f32 }
fn make(v: Vec2) {
let Vec3 { y: _, z: _ } = v;
//~^ ERROR mismatched types
- //~| expected struct `Vec2`, found struct `Vec3`
+ //~| expected `Vec2`, found `Vec3`
}
fn main() { }
diff --git a/tests/ui/issues/issue-14541.stderr b/tests/ui/issues/issue-14541.stderr
index cf155f428..b80c68ce4 100644
--- a/tests/ui/issues/issue-14541.stderr
+++ b/tests/ui/issues/issue-14541.stderr
@@ -4,7 +4,7 @@ error[E0308]: mismatched types
LL | let Vec3 { y: _, z: _ } = v;
| ^^^^^^^^^^^^^^^^^^^ - this expression has type `Vec2`
| |
- | expected struct `Vec2`, found struct `Vec3`
+ | expected `Vec2`, found `Vec3`
error: aborting due to previous error
diff --git a/tests/ui/issues/issue-15783.rs b/tests/ui/issues/issue-15783.rs
index 0b1f4545e..ceb37a20e 100644
--- a/tests/ui/issues/issue-15783.rs
+++ b/tests/ui/issues/issue-15783.rs
@@ -9,6 +9,6 @@ fn main() {
//~^ ERROR mismatched types
//~| expected enum `Option<&[&str]>`
//~| found enum `Option<&[&str; 1]>`
- //~| expected slice `[&str]`, found array `[&str; 1]`
+ //~| expected `Option<&[&str]>`, found `Option<&[&str; 1]>`
assert_eq!(msg, 3);
}
diff --git a/tests/ui/issues/issue-15783.stderr b/tests/ui/issues/issue-15783.stderr
index 660dfe9ed..598ec7e60 100644
--- a/tests/ui/issues/issue-15783.stderr
+++ b/tests/ui/issues/issue-15783.stderr
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
--> $DIR/issue-15783.rs:8:19
|
LL | let msg = foo(x);
- | --- ^ expected slice `[&str]`, found array `[&str; 1]`
+ | --- ^ expected `Option<&[&str]>`, found `Option<&[&str; 1]>`
| |
| arguments to this function are incorrect
|
diff --git a/tests/ui/issues/issue-15896.stderr b/tests/ui/issues/issue-15896.stderr
index 038337f5a..ec0d74596 100644
--- a/tests/ui/issues/issue-15896.stderr
+++ b/tests/ui/issues/issue-15896.stderr
@@ -5,7 +5,7 @@ LL | let u = match e {
| - this expression has type `E`
LL | E::B(
LL | Tau{t: x},
- | ^^^^^^^^^ expected enum `R`, found struct `Tau`
+ | ^^^^^^^^^ expected `R`, found `Tau`
error: aborting due to previous error
diff --git a/tests/ui/issues/issue-16338.stderr b/tests/ui/issues/issue-16338.stderr
index 6878600b0..0f08485e5 100644
--- a/tests/ui/issues/issue-16338.stderr
+++ b/tests/ui/issues/issue-16338.stderr
@@ -4,7 +4,7 @@ error[E0308]: mismatched types
LL | let Slice { data: data, len: len } = "foo";
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ----- this expression has type `&str`
| |
- | expected `str`, found struct `Slice`
+ | expected `str`, found `Slice<_>`
|
= note: expected type `str`
found struct `Slice<_>`
diff --git a/tests/ui/issues/issue-16401.rs b/tests/ui/issues/issue-16401.rs
index 332352ca7..19ae7da10 100644
--- a/tests/ui/issues/issue-16401.rs
+++ b/tests/ui/issues/issue-16401.rs
@@ -9,7 +9,7 @@ fn main() {
//~^ ERROR mismatched types
//~| expected unit type `()`
//~| found struct `Slice<_>`
- //~| expected `()`, found struct `Slice`
+ //~| expected `()`, found `Slice<_>`
_ => unreachable!()
}
}
diff --git a/tests/ui/issues/issue-16401.stderr b/tests/ui/issues/issue-16401.stderr
index f8ea09070..02f9f3ea8 100644
--- a/tests/ui/issues/issue-16401.stderr
+++ b/tests/ui/issues/issue-16401.stderr
@@ -4,7 +4,7 @@ error[E0308]: mismatched types
LL | match () {
| -- this expression has type `()`
LL | Slice { data: data, len: len } => (),
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found struct `Slice`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found `Slice<_>`
|
= note: expected unit type `()`
found struct `Slice<_>`
diff --git a/tests/ui/issues/issue-16939.stderr b/tests/ui/issues/issue-16939.stderr
index 766456454..6db29bc61 100644
--- a/tests/ui/issues/issue-16939.stderr
+++ b/tests/ui/issues/issue-16939.stderr
@@ -2,17 +2,16 @@ error[E0057]: this function takes 0 arguments but 1 argument was supplied
--> $DIR/issue-16939.rs:5:9
|
LL | |t| f(t);
- | ^ - argument unexpected
+ | ^ -
+ | |
+ | unexpected argument
+ | help: remove the extra argument
|
note: callable defined here
--> $DIR/issue-16939.rs:4:12
|
LL | fn _foo<F: Fn()> (f: F) {
| ^^^^
-help: remove the extra argument
- |
-LL | |t| f();
- | ~~
error: aborting due to previous error
diff --git a/tests/ui/issues/issue-16966.stderr b/tests/ui/issues/issue-16966.stderr
index 60f5190db..8c92505b5 100644
--- a/tests/ui/issues/issue-16966.stderr
+++ b/tests/ui/issues/issue-16966.stderr
@@ -1,10 +1,8 @@
error[E0282]: type annotations needed
- --> $DIR/issue-16966.rs:2:5
+ --> $DIR/issue-16966.rs:2:12
|
LL | panic!(std::default::Default::default());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot infer type of the type parameter `M` declared on the function `begin_panic`
- |
- = note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info)
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot infer type
error: aborting due to previous error
diff --git a/tests/ui/issues/issue-17337.stderr b/tests/ui/issues/issue-17337.stderr
index 34c2eb05f..55e51e566 100644
--- a/tests/ui/issues/issue-17337.stderr
+++ b/tests/ui/issues/issue-17337.stderr
@@ -1,4 +1,4 @@
-error: use of deprecated associated function `Foo::foo`: text
+error: use of deprecated method `Foo::foo`: text
--> $DIR/issue-17337.rs:16:6
|
LL | .foo();
diff --git a/tests/ui/issues/issue-18423.rs b/tests/ui/issues/issue-18423.rs
index a81b32f05..675fd0411 100644
--- a/tests/ui/issues/issue-18423.rs
+++ b/tests/ui/issues/issue-18423.rs
@@ -2,7 +2,7 @@
struct Foo<'a> {
x: Box<'a, isize>
- //~^ ERROR this struct takes 0 lifetime arguments but 1 lifetime argument was supplied
+ //~^ ERROR struct takes 0 lifetime arguments but 1 lifetime argument was supplied
}
fn main() { }
diff --git a/tests/ui/issues/issue-18423.stderr b/tests/ui/issues/issue-18423.stderr
index bbf793662..5d154dbbb 100644
--- a/tests/ui/issues/issue-18423.stderr
+++ b/tests/ui/issues/issue-18423.stderr
@@ -1,4 +1,4 @@
-error[E0107]: this struct takes 0 lifetime arguments but 1 lifetime argument was supplied
+error[E0107]: struct takes 0 lifetime arguments but 1 lifetime argument was supplied
--> $DIR/issue-18423.rs:4:8
|
LL | x: Box<'a, isize>
diff --git a/tests/ui/issues/issue-18446.stderr b/tests/ui/issues/issue-18446.stderr
index 939cf0292..602b80c68 100644
--- a/tests/ui/issues/issue-18446.stderr
+++ b/tests/ui/issues/issue-18446.stderr
@@ -14,7 +14,7 @@ note: candidate #2 is defined in the trait `T`
|
LL | fn foo(&self);
| ^^^^^^^^^^^^^^
-help: disambiguate the associated function for candidate #2
+help: disambiguate the method for candidate #2
|
LL | T::foo(&x);
| ~~~~~~~~~~
diff --git a/tests/ui/issues/issue-18819.stderr b/tests/ui/issues/issue-18819.stderr
index 767fdd5ca..1fc974b60 100644
--- a/tests/ui/issues/issue-18819.stderr
+++ b/tests/ui/issues/issue-18819.stderr
@@ -4,7 +4,7 @@ error[E0061]: this function takes 2 arguments but 1 argument was supplied
LL | print_x(X);
| ^^^^^^^--- an argument of type `&str` is missing
|
-note: expected reference, found struct `X`
+note: expected `&dyn Foo<Item = bool>`, found `X`
--> $DIR/issue-18819.rs:16:13
|
LL | print_x(X);
diff --git a/tests/ui/issues/issue-19521.stderr b/tests/ui/issues/issue-19521.stderr
index b6847cd75..13a12acb3 100644
--- a/tests/ui/issues/issue-19521.stderr
+++ b/tests/ui/issues/issue-19521.stderr
@@ -2,7 +2,7 @@ error[E0599]: no method named `homura` found for reference `&'static str` in the
--> $DIR/issue-19521.rs:2:8
|
LL | "".homura()();
- | ^^^^^^ method not found in `&'static str`
+ | ^^^^^^ method not found in `&str`
error: aborting due to previous error
diff --git a/tests/ui/issues/issue-20225.stderr b/tests/ui/issues/issue-20225.stderr
index 582216010..b1c156720 100644
--- a/tests/ui/issues/issue-20225.stderr
+++ b/tests/ui/issues/issue-20225.stderr
@@ -6,7 +6,7 @@ LL | impl<'a, T> Fn<(&'a T,)> for Foo {
LL | extern "rust-call" fn call(&self, (_,): (T,)) {}
| ^^^^
| |
- | expected `&T`, found type parameter `T`
+ | expected `&'a T`, found type parameter `T`
| help: change the parameter type to match the trait: `(&'a T,)`
|
= note: expected signature `extern "rust-call" fn(&Foo, (&'a T,))`
@@ -20,7 +20,7 @@ LL | impl<'a, T> FnMut<(&'a T,)> for Foo {
LL | extern "rust-call" fn call_mut(&mut self, (_,): (T,)) {}
| ^^^^
| |
- | expected `&T`, found type parameter `T`
+ | expected `&'a T`, found type parameter `T`
| help: change the parameter type to match the trait: `(&'a T,)`
|
= note: expected signature `extern "rust-call" fn(&mut Foo, (&'a T,))`
@@ -35,7 +35,7 @@ LL | impl<'a, T> FnOnce<(&'a T,)> for Foo {
LL | extern "rust-call" fn call_once(self, (_,): (T,)) {}
| ^^^^
| |
- | expected `&T`, found type parameter `T`
+ | expected `&'a T`, found type parameter `T`
| help: change the parameter type to match the trait: `(&'a T,)`
|
= note: expected signature `extern "rust-call" fn(Foo, (&'a T,))`
diff --git a/tests/ui/issues/issue-21202.rs b/tests/ui/issues/issue-21202.rs
index f62de7ce7..2c5f13944 100644
--- a/tests/ui/issues/issue-21202.rs
+++ b/tests/ui/issues/issue-21202.rs
@@ -8,7 +8,7 @@ mod B {
use crate1::A::Foo;
fn bar(f: Foo) {
Foo::foo(&f);
- //~^ ERROR: associated function `foo` is private
+ //~^ ERROR: method `foo` is private
}
}
diff --git a/tests/ui/issues/issue-21202.stderr b/tests/ui/issues/issue-21202.stderr
index 1d2816fed..e7c3f2f9a 100644
--- a/tests/ui/issues/issue-21202.stderr
+++ b/tests/ui/issues/issue-21202.stderr
@@ -1,13 +1,13 @@
-error[E0624]: associated function `foo` is private
+error[E0624]: method `foo` is private
--> $DIR/issue-21202.rs:10:14
|
LL | Foo::foo(&f);
- | ^^^ private associated function
+ | ^^^ private method
|
::: $DIR/auxiliary/issue-21202.rs:4:9
|
LL | fn foo(&self) { }
- | ------------- private associated function defined here
+ | ------------- private method defined here
error: aborting due to previous error
diff --git a/tests/ui/issues/issue-21332.rs b/tests/ui/issues/issue-21332.rs
index 6547f3a9b..4473d00fd 100644
--- a/tests/ui/issues/issue-21332.rs
+++ b/tests/ui/issues/issue-21332.rs
@@ -4,7 +4,7 @@ impl Iterator for S {
type Item = i32;
fn next(&mut self) -> Result<i32, i32> { Ok(7) }
//~^ ERROR method `next` has an incompatible type for trait
- //~| expected enum `Option`, found enum `Result`
+ //~| expected `Option<i32>`, found `Result<i32, i32>`
}
fn main() {}
diff --git a/tests/ui/issues/issue-21332.stderr b/tests/ui/issues/issue-21332.stderr
index 0e1beebf2..825492880 100644
--- a/tests/ui/issues/issue-21332.stderr
+++ b/tests/ui/issues/issue-21332.stderr
@@ -4,7 +4,7 @@ error[E0053]: method `next` has an incompatible type for trait
LL | fn next(&mut self) -> Result<i32, i32> { Ok(7) }
| ^^^^^^^^^^^^^^^^
| |
- | expected enum `Option`, found enum `Result`
+ | expected `Option<i32>`, found `Result<i32, i32>`
| help: change the output type to match the trait: `Option<i32>`
|
= note: expected signature `fn(&mut S) -> Option<i32>`
diff --git a/tests/ui/issues/issue-22536-copy-mustnt-zero.rs b/tests/ui/issues/issue-22536-copy-mustnt-zero.rs
deleted file mode 100644
index 017f36484..000000000
--- a/tests/ui/issues/issue-22536-copy-mustnt-zero.rs
+++ /dev/null
@@ -1,28 +0,0 @@
-// run-pass
-// Regression test for Issue #22536: If a type implements Copy, then
-// moving it must not zero the original memory.
-
-
-trait Resources {
- type Buffer: Copy;
- fn foo(&self) {}
-}
-
-struct BufferHandle<R: Resources> {
- raw: <R as Resources>::Buffer,
-}
-impl<R: Resources> Copy for BufferHandle<R> {}
-impl<R: Resources> Clone for BufferHandle<R> {
- fn clone(&self) -> BufferHandle<R> { *self }
-}
-
-enum Res {}
-impl Resources for Res {
- type Buffer = u32;
-}
-
-fn main() {
- let b: BufferHandle<Res> = BufferHandle { raw: 1 };
- let c = b;
- assert_eq!(c.raw, b.raw)
-}
diff --git a/tests/ui/issues/issue-23041.stderr b/tests/ui/issues/issue-23041.stderr
index 6592b76a3..4271c67c3 100644
--- a/tests/ui/issues/issue-23041.stderr
+++ b/tests/ui/issues/issue-23041.stderr
@@ -2,7 +2,7 @@ error[E0282]: type annotations needed
--> $DIR/issue-23041.rs:6:7
|
LL | b.downcast_ref::<fn(_)->_>();
- | ^^^^^^^^^^^^ cannot infer type of the type parameter `T` declared on the associated function `downcast_ref`
+ | ^^^^^^^^^^^^ cannot infer type of the type parameter `T` declared on the method `downcast_ref`
|
help: consider specifying the generic argument
|
diff --git a/tests/ui/issues/issue-24322.stderr b/tests/ui/issues/issue-24322.stderr
index 1e4c8ac7c..954fd4928 100644
--- a/tests/ui/issues/issue-24322.stderr
+++ b/tests/ui/issues/issue-24322.stderr
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
--> $DIR/issue-24322.rs:8:29
|
LL | let x: &fn(&B) -> u32 = &B::func;
- | -------------- ^^^^^^^^ expected fn pointer, found fn item
+ | -------------- ^^^^^^^^ expected `&fn(&B) -> u32`, found `&fn(&B) -> u32 {B::func}`
| |
| expected due to this
|
diff --git a/tests/ui/issues/issue-24819.rs b/tests/ui/issues/issue-24819.rs
index 59c3f2cd1..fb4cfb7b2 100644
--- a/tests/ui/issues/issue-24819.rs
+++ b/tests/ui/issues/issue-24819.rs
@@ -4,7 +4,7 @@ fn main() {
let mut v = Vec::new();
foo(&mut v);
//~^ ERROR mismatched types
- //~| expected struct `HashSet`, found struct `Vec`
+ //~| expected `&mut HashSet<u32>`, found `&mut Vec<_>`
}
fn foo(h: &mut HashSet<u32>) {
diff --git a/tests/ui/issues/issue-24819.stderr b/tests/ui/issues/issue-24819.stderr
index 982a11fef..8b4f1dbce 100644
--- a/tests/ui/issues/issue-24819.stderr
+++ b/tests/ui/issues/issue-24819.stderr
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
--> $DIR/issue-24819.rs:5:9
|
LL | foo(&mut v);
- | --- ^^^^^^ expected struct `HashSet`, found struct `Vec`
+ | --- ^^^^^^ expected `&mut HashSet<u32>`, found `&mut Vec<_>`
| |
| arguments to this function are incorrect
|
diff --git a/tests/ui/issues/issue-26094.rs b/tests/ui/issues/issue-26094.rs
index d3d670aa9..2742529ed 100644
--- a/tests/ui/issues/issue-26094.rs
+++ b/tests/ui/issues/issue-26094.rs
@@ -1,7 +1,7 @@
macro_rules! some_macro {
- ($other: expr) => ({
- $other(None) //~ NOTE argument of type `Option<_>` unexpected
- })
+ ($other: expr) => {{
+ $other(None) //~ NOTE unexpected argument of type `Option<_>`
+ }};
}
fn some_function() {} //~ NOTE defined here
@@ -9,5 +9,4 @@ fn some_function() {} //~ NOTE defined here
fn main() {
some_macro!(some_function);
//~^ ERROR function takes 0 arguments but 1 argument was supplied
- //~| NOTE in this expansion of some_macro!
}
diff --git a/tests/ui/issues/issue-26094.stderr b/tests/ui/issues/issue-26094.stderr
index 881a6e538..ecdf48470 100644
--- a/tests/ui/issues/issue-26094.stderr
+++ b/tests/ui/issues/issue-26094.stderr
@@ -2,7 +2,7 @@ error[E0061]: this function takes 0 arguments but 1 argument was supplied
--> $DIR/issue-26094.rs:10:17
|
LL | $other(None)
- | ---- argument of type `Option<_>` unexpected
+ | ---- unexpected argument of type `Option<_>`
...
LL | some_macro!(some_function);
| ^^^^^^^^^^^^^
@@ -12,10 +12,6 @@ note: function defined here
|
LL | fn some_function() {}
| ^^^^^^^^^^^^^
-help: remove the extra argument
- |
-LL | some_function()
- | ~~~~~~~~~~~~~~~
error: aborting due to previous error
diff --git a/tests/ui/issues/issue-27008.rs b/tests/ui/issues/issue-27008.rs
index e04de33f6..adf8e779e 100644
--- a/tests/ui/issues/issue-27008.rs
+++ b/tests/ui/issues/issue-27008.rs
@@ -3,5 +3,5 @@ struct S;
fn main() {
let b = [0; S];
//~^ ERROR mismatched types
- //~| expected `usize`, found struct `S`
+ //~| expected `usize`, found `S`
}
diff --git a/tests/ui/issues/issue-27008.stderr b/tests/ui/issues/issue-27008.stderr
index 5b7e74c1c..9d18045aa 100644
--- a/tests/ui/issues/issue-27008.stderr
+++ b/tests/ui/issues/issue-27008.stderr
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
--> $DIR/issue-27008.rs:4:17
|
LL | let b = [0; S];
- | ^ expected `usize`, found struct `S`
+ | ^ expected `usize`, found `S`
error: aborting due to previous error
diff --git a/tests/ui/issues/issue-2735-2.rs b/tests/ui/issues/issue-2735-2.rs
deleted file mode 100644
index 70ebce9d3..000000000
--- a/tests/ui/issues/issue-2735-2.rs
+++ /dev/null
@@ -1,27 +0,0 @@
-// run-pass
-#![allow(non_camel_case_types)]
-
-use std::cell::Cell;
-
-// This test should behave exactly like issue-2735-3
-struct defer<'a> {
- b: &'a Cell<bool>,
-}
-
-impl<'a> Drop for defer<'a> {
- fn drop(&mut self) {
- self.b.set(true);
- }
-}
-
-fn defer(b: &Cell<bool>) -> defer {
- defer {
- b: b
- }
-}
-
-pub fn main() {
- let dtor_ran = &Cell::new(false);
- let _ = defer(dtor_ran);
- assert!(dtor_ran.get());
-}
diff --git a/tests/ui/issues/issue-2735-3.rs b/tests/ui/issues/issue-2735-3.rs
deleted file mode 100644
index 233015378..000000000
--- a/tests/ui/issues/issue-2735-3.rs
+++ /dev/null
@@ -1,27 +0,0 @@
-// run-pass
-#![allow(non_camel_case_types)]
-
-use std::cell::Cell;
-
-// This test should behave exactly like issue-2735-2
-struct defer<'a> {
- b: &'a Cell<bool>,
-}
-
-impl<'a> Drop for defer<'a> {
- fn drop(&mut self) {
- self.b.set(true);
- }
-}
-
-fn defer(b: &Cell<bool>) -> defer {
- defer {
- b: b
- }
-}
-
-pub fn main() {
- let dtor_ran = &Cell::new(false);
- defer(dtor_ran);
- assert!(dtor_ran.get());
-}
diff --git a/tests/ui/issues/issue-2735.rs b/tests/ui/issues/issue-2735.rs
deleted file mode 100644
index 20d3949a9..000000000
--- a/tests/ui/issues/issue-2735.rs
+++ /dev/null
@@ -1,22 +0,0 @@
-// run-pass
-#![allow(dead_code)]
-#![allow(non_camel_case_types)]
-
-// pretty-expanded FIXME #23616
-
-trait hax {
- fn dummy(&self) { }
-}
-impl<A> hax for A { }
-
-fn perform_hax<T: 'static>(x: Box<T>) -> Box<dyn hax+'static> {
- Box::new(x) as Box<dyn hax+'static>
-}
-
-fn deadcode() {
- perform_hax(Box::new("deadcode".to_string()));
-}
-
-pub fn main() {
- perform_hax(Box::new(42));
-}
diff --git a/tests/ui/issues/issue-27583.rs b/tests/ui/issues/issue-27583.rs
deleted file mode 100644
index 84c94c7c9..000000000
--- a/tests/ui/issues/issue-27583.rs
+++ /dev/null
@@ -1,47 +0,0 @@
-// check-pass
-// Regression test for issue #27583. Unclear how useful this will be
-// going forward, since the issue in question was EXTREMELY sensitive
-// to compiler internals (like the precise numbering of nodes), but
-// what the hey.
-
-#![allow(warnings)]
-
-use std::cell::Cell;
-use std::marker::PhantomData;
-
-pub trait Delegate<'tcx> { }
-
-pub struct InferCtxt<'a, 'tcx: 'a> {
- x: PhantomData<&'a Cell<&'tcx ()>>
-}
-
-pub struct MemCategorizationContext<'t, 'a: 't, 'tcx : 'a> {
- x: &'t InferCtxt<'a, 'tcx>,
-}
-
-pub struct ExprUseVisitor<'d, 't, 'a: 't, 'tcx:'a+'d> {
- typer: &'t InferCtxt<'a, 'tcx>,
- mc: MemCategorizationContext<'t, 'a, 'tcx>,
- delegate: &'d mut (Delegate<'tcx>+'d),
-}
-
-impl<'d,'t,'a,'tcx> ExprUseVisitor<'d,'t,'a,'tcx> {
- pub fn new(delegate: &'d mut Delegate<'tcx>,
- typer: &'t InferCtxt<'a, 'tcx>)
- -> ExprUseVisitor<'d,'t,'a,'tcx>
- {
- ExprUseVisitor {
- typer: typer,
- mc: MemCategorizationContext::new(typer),
- delegate: delegate,
- }
- }
-}
-
-impl<'t, 'a,'tcx> MemCategorizationContext<'t, 'a, 'tcx> {
- pub fn new(typer: &'t InferCtxt<'a, 'tcx>) -> MemCategorizationContext<'t, 'a, 'tcx> {
- MemCategorizationContext { x: typer }
- }
-}
-
-fn main() { }
diff --git a/tests/ui/issues/issue-30123.stderr b/tests/ui/issues/issue-30123.stderr
index 7808cbf8a..a00a1dbb8 100644
--- a/tests/ui/issues/issue-30123.stderr
+++ b/tests/ui/issues/issue-30123.stderr
@@ -1,4 +1,4 @@
-error[E0599]: no function or associated item named `new_undirected` found for struct `Graph<i32, i32>` in the current scope
+error[E0599]: no function or associated item named `new_undirected` found for struct `issue_30123_aux::Graph<i32, i32>` in the current scope
--> $DIR/issue-30123.rs:7:33
|
LL | let ug = Graph::<i32, i32>::new_undirected();
diff --git a/tests/ui/issues/issue-30438-c.rs b/tests/ui/issues/issue-30438-c.rs
index 4cf634245..813c1d3e2 100644
--- a/tests/ui/issues/issue-30438-c.rs
+++ b/tests/ui/issues/issue-30438-c.rs
@@ -5,7 +5,6 @@ trait Trait { type Out; }
struct Test<'a> { s: &'a str }
fn silly<'y, 'z>(_s: &'y Test<'z>) -> &'y <Test<'z> as Trait>::Out where 'z: 'static {
- //~^ WARN unnecessary lifetime parameter `'z`
let x = Test { s: "this cannot last" };
&x
//~^ ERROR: cannot return reference to local variable `x`
diff --git a/tests/ui/issues/issue-30438-c.stderr b/tests/ui/issues/issue-30438-c.stderr
index a7a5c0500..7c0010880 100644
--- a/tests/ui/issues/issue-30438-c.stderr
+++ b/tests/ui/issues/issue-30438-c.stderr
@@ -1,17 +1,9 @@
-warning: unnecessary lifetime parameter `'z`
- --> $DIR/issue-30438-c.rs:7:74
- |
-LL | fn silly<'y, 'z>(_s: &'y Test<'z>) -> &'y <Test<'z> as Trait>::Out where 'z: 'static {
- | ^^
- |
- = help: you can use the `'static` lifetime directly, in place of `'z`
-
error[E0515]: cannot return reference to local variable `x`
- --> $DIR/issue-30438-c.rs:10:5
+ --> $DIR/issue-30438-c.rs:9:5
|
LL | &x
| ^^ returns a reference to data owned by the current function
-error: aborting due to previous error; 1 warning emitted
+error: aborting due to previous error
For more information about this error, try `rustc --explain E0515`.
diff --git a/tests/ui/issues/issue-32122-1.stderr b/tests/ui/issues/issue-32122-1.stderr
index 10b0c0967..b4f5b1296 100644
--- a/tests/ui/issues/issue-32122-1.stderr
+++ b/tests/ui/issues/issue-32122-1.stderr
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
--> $DIR/issue-32122-1.rs:16:24
|
LL | let _: *const u8 = &a;
- | --------- ^^ expected `u8`, found struct `Foo`
+ | --------- ^^ expected `*const u8`, found `&Foo`
| |
| expected due to this
|
diff --git a/tests/ui/issues/issue-32122-2.stderr b/tests/ui/issues/issue-32122-2.stderr
index 5c3dade8e..02c335c15 100644
--- a/tests/ui/issues/issue-32122-2.stderr
+++ b/tests/ui/issues/issue-32122-2.stderr
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
--> $DIR/issue-32122-2.rs:27:24
|
LL | let _: *const u8 = &a;
- | --------- ^^ expected `u8`, found struct `Emm`
+ | --------- ^^ expected `*const u8`, found `&Emm`
| |
| expected due to this
|
diff --git a/tests/ui/issues/issue-3214.rs b/tests/ui/issues/issue-3214.rs
index 928a65938..e3c07bb3f 100644
--- a/tests/ui/issues/issue-3214.rs
+++ b/tests/ui/issues/issue-3214.rs
@@ -4,7 +4,7 @@ fn foo<T>() {
}
impl<T> Drop for Foo<T> {
- //~^ ERROR this struct takes 0 generic arguments but 1 generic argument
+ //~^ ERROR struct takes 0 generic arguments but 1 generic argument
fn drop(&mut self) {}
}
}
diff --git a/tests/ui/issues/issue-3214.stderr b/tests/ui/issues/issue-3214.stderr
index aa0b5ce64..7a2d772f0 100644
--- a/tests/ui/issues/issue-3214.stderr
+++ b/tests/ui/issues/issue-3214.stderr
@@ -8,7 +8,7 @@ LL | struct Foo {
LL | x: T,
| ^ use of generic parameter from outer function
-error[E0107]: this struct takes 0 generic arguments but 1 generic argument was supplied
+error[E0107]: struct takes 0 generic arguments but 1 generic argument was supplied
--> $DIR/issue-3214.rs:6:22
|
LL | impl<T> Drop for Foo<T> {
diff --git a/tests/ui/issues/issue-33504.stderr b/tests/ui/issues/issue-33504.stderr
index d9e7c3b16..a831cf585 100644
--- a/tests/ui/issues/issue-33504.stderr
+++ b/tests/ui/issues/issue-33504.stderr
@@ -7,7 +7,7 @@ LL | struct Test;
LL | let Test = 1;
| ^^^^ - this expression has type `{integer}`
| |
- | expected integer, found struct `Test`
+ | expected integer, found `Test`
| `Test` is interpreted as a unit struct, not a new binding
| help: introduce a new binding instead: `other_test`
diff --git a/tests/ui/issues/issue-33903.rs b/tests/ui/issues/issue-33903.rs
deleted file mode 100644
index 613aa121a..000000000
--- a/tests/ui/issues/issue-33903.rs
+++ /dev/null
@@ -1,10 +0,0 @@
-// check-pass
-#![allow(dead_code)]
-// Issue 33903:
-// Built-in indexing should be used even when the index is not
-// trivially an integer
-// Only built-in indexing can be used in constant expressions
-
-const FOO: i32 = [12, 34][0 + 1];
-
-fn main() {}
diff --git a/tests/ui/issues/issue-33941.stderr b/tests/ui/issues/issue-33941.stderr
index 668eaabca..e7f4a4fa0 100644
--- a/tests/ui/issues/issue-33941.stderr
+++ b/tests/ui/issues/issue-33941.stderr
@@ -2,7 +2,7 @@ error[E0271]: expected `Iter<'_, _, _>` to be an iterator that yields `&_`, but
--> $DIR/issue-33941.rs:6:36
|
LL | for _ in HashMap::new().iter().cloned() {}
- | ^^^^^^ expected reference, found tuple
+ | ^^^^^^ expected `&_`, found `(&_, &_)`
|
= note: expected reference `&_`
found tuple `(&_, &_)`
@@ -20,7 +20,7 @@ error[E0271]: expected `Iter<'_, _, _>` to be an iterator that yields `&_`, but
--> $DIR/issue-33941.rs:6:14
|
LL | for _ in HashMap::new().iter().cloned() {}
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected tuple, found reference
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `(&_, &_)`, found `&_`
|
= note: expected tuple `(&_, &_)`
found reference `&_`
@@ -31,7 +31,7 @@ error[E0271]: expected `Iter<'_, _, _>` to be an iterator that yields `&_`, but
--> $DIR/issue-33941.rs:6:14
|
LL | for _ in HashMap::new().iter().cloned() {}
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected tuple, found reference
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `(&_, &_)`, found `&_`
|
= note: expected tuple `(&_, &_)`
found reference `&_`
diff --git a/tests/ui/issues/issue-35241.stderr b/tests/ui/issues/issue-35241.stderr
index d600e934b..4a2c15511 100644
--- a/tests/ui/issues/issue-35241.stderr
+++ b/tests/ui/issues/issue-35241.stderr
@@ -5,7 +5,7 @@ LL | struct Foo(u32);
| ---------- `Foo` defines a struct constructor here, which should be called
LL |
LL | fn test() -> Foo { Foo }
- | --- ^^^ expected struct `Foo`, found struct constructor
+ | --- ^^^ expected `Foo`, found struct constructor
| |
| expected `Foo` because of return type
|
diff --git a/tests/ui/issues/issue-3680.rs b/tests/ui/issues/issue-3680.rs
index 37c9000c0..a0e527981 100644
--- a/tests/ui/issues/issue-3680.rs
+++ b/tests/ui/issues/issue-3680.rs
@@ -4,6 +4,6 @@ fn main() {
//~^ ERROR mismatched types
//~| expected enum `Option<_>`
//~| found enum `Result<_, _>`
- //~| expected enum `Option`, found enum `Result`
+ //~| expected `Option<_>`, found `Result<_, _>`
}
}
diff --git a/tests/ui/issues/issue-3680.stderr b/tests/ui/issues/issue-3680.stderr
index 29ba44f13..0b0ae419e 100644
--- a/tests/ui/issues/issue-3680.stderr
+++ b/tests/ui/issues/issue-3680.stderr
@@ -4,7 +4,7 @@ error[E0308]: mismatched types
LL | match None {
| ---- this expression has type `Option<_>`
LL | Err(_) => ()
- | ^^^^^^ expected enum `Option`, found enum `Result`
+ | ^^^^^^ expected `Option<_>`, found `Result<_, _>`
|
= note: expected enum `Option<_>`
found enum `Result<_, _>`
diff --git a/tests/ui/issues/issue-3702-2.stderr b/tests/ui/issues/issue-3702-2.stderr
index 1fd64ca90..0b94c3135 100644
--- a/tests/ui/issues/issue-3702-2.stderr
+++ b/tests/ui/issues/issue-3702-2.stderr
@@ -14,11 +14,11 @@ note: candidate #2 is defined in an impl of the trait `Add` for the type `isize`
|
LL | fn to_int(&self) -> isize { *self }
| ^^^^^^^^^^^^^^^^^^^^^^^^^
-help: disambiguate the associated function for candidate #1
+help: disambiguate the method for candidate #1
|
LL | ToPrimitive::to_int(&self) + other.to_int()
| ~~~~~~~~~~~~~~~~~~~~~~~~~~
-help: disambiguate the associated function for candidate #2
+help: disambiguate the method for candidate #2
|
LL | Add::to_int(&self) + other.to_int()
| ~~~~~~~~~~~~~~~~~~
diff --git a/tests/ui/issues/issue-3763.rs b/tests/ui/issues/issue-3763.rs
index 25ad6b319..893009a2c 100644
--- a/tests/ui/issues/issue-3763.rs
+++ b/tests/ui/issues/issue-3763.rs
@@ -1,5 +1,4 @@
-// compile-flags: -Zsave-analysis
-// Also regression test for #69416
+// Regression test for #3763
mod my_mod {
pub struct MyStruct {
@@ -21,9 +20,9 @@ fn main() {
let _woohoo = (Box::new(my_struct)).priv_field;
//~^ ERROR field `priv_field` of struct `MyStruct` is private
- (&my_struct).happyfun(); //~ ERROR associated function `happyfun` is private
+ (&my_struct).happyfun(); //~ ERROR method `happyfun` is private
- (Box::new(my_struct)).happyfun(); //~ ERROR associated function `happyfun` is private
+ (Box::new(my_struct)).happyfun(); //~ ERROR method `happyfun` is private
let nope = my_struct.priv_field;
//~^ ERROR field `priv_field` of struct `MyStruct` is private
}
diff --git a/tests/ui/issues/issue-3763.stderr b/tests/ui/issues/issue-3763.stderr
index 6f4567546..d101e4c33 100644
--- a/tests/ui/issues/issue-3763.stderr
+++ b/tests/ui/issues/issue-3763.stderr
@@ -1,35 +1,35 @@
error[E0616]: field `priv_field` of struct `MyStruct` is private
- --> $DIR/issue-3763.rs:18:32
+ --> $DIR/issue-3763.rs:17:32
|
LL | let _woohoo = (&my_struct).priv_field;
| ^^^^^^^^^^ private field
error[E0616]: field `priv_field` of struct `MyStruct` is private
- --> $DIR/issue-3763.rs:21:41
+ --> $DIR/issue-3763.rs:20:41
|
LL | let _woohoo = (Box::new(my_struct)).priv_field;
| ^^^^^^^^^^ private field
-error[E0624]: associated function `happyfun` is private
- --> $DIR/issue-3763.rs:24:18
+error[E0624]: method `happyfun` is private
+ --> $DIR/issue-3763.rs:23:18
|
LL | fn happyfun(&self) {}
- | ------------------ private associated function defined here
+ | ------------------ private method defined here
...
LL | (&my_struct).happyfun();
- | ^^^^^^^^ private associated function
+ | ^^^^^^^^ private method
-error[E0624]: associated function `happyfun` is private
- --> $DIR/issue-3763.rs:26:27
+error[E0624]: method `happyfun` is private
+ --> $DIR/issue-3763.rs:25:27
|
LL | fn happyfun(&self) {}
- | ------------------ private associated function defined here
+ | ------------------ private method defined here
...
LL | (Box::new(my_struct)).happyfun();
- | ^^^^^^^^ private associated function
+ | ^^^^^^^^ private method
error[E0616]: field `priv_field` of struct `MyStruct` is private
- --> $DIR/issue-3763.rs:27:26
+ --> $DIR/issue-3763.rs:26:26
|
LL | let nope = my_struct.priv_field;
| ^^^^^^^^^^ private field
diff --git a/tests/ui/issues/issue-38821.rs b/tests/ui/issues/issue-38821.rs
deleted file mode 100644
index 6753860e9..000000000
--- a/tests/ui/issues/issue-38821.rs
+++ /dev/null
@@ -1,33 +0,0 @@
-pub struct Nullable<T: NotNull>(T);
-
-pub trait NotNull {}
-
-pub trait IntoNullable {
- type Nullable;
-}
-
-impl<T: NotNull> IntoNullable for T {
- type Nullable = Nullable<T>;
-}
-
-impl<T: NotNull> IntoNullable for Nullable<T> {
- type Nullable = Nullable<T>;
-}
-
-pub trait Expression {
- type SqlType;
-}
-
-pub trait Column: Expression {}
-
-#[derive(Debug, Copy, Clone)]
-//~^ ERROR the trait bound `<Col as Expression>::SqlType: NotNull` is not satisfied
-pub enum ColumnInsertValue<Col, Expr> where
- Col: Column,
- Expr: Expression<SqlType=<Col::SqlType as IntoNullable>::Nullable>,
-{
- Expression(Col, Expr),
- Default(Col),
-}
-
-fn main() {}
diff --git a/tests/ui/issues/issue-38821.stderr b/tests/ui/issues/issue-38821.stderr
deleted file mode 100644
index a52a9c138..000000000
--- a/tests/ui/issues/issue-38821.stderr
+++ /dev/null
@@ -1,22 +0,0 @@
-error[E0277]: the trait bound `<Col as Expression>::SqlType: NotNull` is not satisfied
- --> $DIR/issue-38821.rs:23:17
- |
-LL | #[derive(Debug, Copy, Clone)]
- | ^^^^ the trait `NotNull` is not implemented for `<Col as Expression>::SqlType`
- |
-note: required for `<Col as Expression>::SqlType` to implement `IntoNullable`
- --> $DIR/issue-38821.rs:9:18
- |
-LL | impl<T: NotNull> IntoNullable for T {
- | ------- ^^^^^^^^^^^^ ^
- | |
- | unsatisfied trait bound introduced here
- = note: this error originates in the derive macro `Copy` (in Nightly builds, run with -Z macro-backtrace for more info)
-help: consider further restricting the associated type
- |
-LL | Expr: Expression<SqlType=<Col::SqlType as IntoNullable>::Nullable>, <Col as Expression>::SqlType: NotNull,
- | +++++++++++++++++++++++++++++++++++++++
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/issues/issue-39292.rs b/tests/ui/issues/issue-39292.rs
deleted file mode 100644
index 968cf0891..000000000
--- a/tests/ui/issues/issue-39292.rs
+++ /dev/null
@@ -1,17 +0,0 @@
-// run-pass
-// Regression test for issue #39292. The object vtable was being
-// incorrectly left with a null pointer.
-
-trait Foo<T> {
- fn print<'a>(&'a self) where T: 'a { println!("foo"); }
-}
-
-impl<'a> Foo<&'a ()> for () { }
-
-trait Bar: for<'a> Foo<&'a ()> { }
-
-impl Bar for () {}
-
-fn main() {
- (&() as &dyn Bar).print(); // Segfault
-}
diff --git a/tests/ui/issues/issue-39970.rs b/tests/ui/issues/issue-39970.rs
index f51e3b522..40d3ae30a 100644
--- a/tests/ui/issues/issue-39970.rs
+++ b/tests/ui/issues/issue-39970.rs
@@ -17,5 +17,5 @@ impl Visit for () where
fn main() {
<() as Visit>::visit();
- //~^ ERROR type mismatch resolving `for<'a> <() as Array<'a>>::Element == ()`
+ //~^ ERROR type mismatch resolving `<() as Array<'a>>::Element == ()`
}
diff --git a/tests/ui/issues/issue-39970.stderr b/tests/ui/issues/issue-39970.stderr
index 0cabdf7f2..8344b88c3 100644
--- a/tests/ui/issues/issue-39970.stderr
+++ b/tests/ui/issues/issue-39970.stderr
@@ -1,8 +1,8 @@
-error[E0271]: type mismatch resolving `for<'a> <() as Array<'a>>::Element == ()`
+error[E0271]: type mismatch resolving `<() as Array<'a>>::Element == ()`
--> $DIR/issue-39970.rs:19:5
|
LL | <() as Visit>::visit();
- | ^^^^^^^^^^^^^^^^^^^^ type mismatch resolving `for<'a> <() as Array<'a>>::Element == ()`
+ | ^^^^^^^^^^^^^^^^^^^^ type mismatch resolving `<() as Array<'a>>::Element == ()`
|
note: expected this to be `()`
--> $DIR/issue-39970.rs:10:20
diff --git a/tests/ui/issues/issue-40003.rs b/tests/ui/issues/issue-40003.rs
deleted file mode 100644
index 5e61361f9..000000000
--- a/tests/ui/issues/issue-40003.rs
+++ /dev/null
@@ -1,178 +0,0 @@
-// run-pass
-#![allow(unused_must_use)]
-fn main() {
- if false { test(); }
-}
-
-fn test() {
- let rx = Err::<Vec<usize>, u32>(1).into_future();
-
- rx.map(|l: Vec<usize>| stream::iter(l.into_iter().map(|i| Ok(i))))
- .flatten_stream()
- .chunks(50)
- .buffer_unordered(5);
-}
-
-use future::{Future, IntoFuture};
-mod future {
- use std::result;
-
- use {stream, Stream};
-
- pub trait Future {
- type Item;
- type Error;
-
- fn map<F, U>(self, _: F) -> Map<Self, F>
- where F: FnOnce(Self::Item) -> U,
- Self: Sized,
- {
- panic!()
- }
-
- fn flatten_stream(self) -> FlattenStream<Self>
- where <Self as Future>::Item: stream::Stream<Error=Self::Error>,
- Self: Sized
- {
- panic!()
- }
- }
-
- pub trait IntoFuture {
- type Future: Future<Item=Self::Item, Error=Self::Error>;
- type Item;
- type Error;
- fn into_future(self) -> Self::Future;
- }
-
- impl<F: Future> IntoFuture for F {
- type Future = F;
- type Item = F::Item;
- type Error = F::Error;
-
- fn into_future(self) -> F {
- panic!()
- }
- }
-
- impl<T, E> IntoFuture for result::Result<T, E> {
- type Future = FutureResult<T, E>;
- type Item = T;
- type Error = E;
-
- fn into_future(self) -> FutureResult<T, E> {
- panic!()
- }
- }
-
- pub struct Map<A, F> {
- _a: (A, F),
- }
-
- impl<U, A, F> Future for Map<A, F>
- where A: Future,
- F: FnOnce(A::Item) -> U,
- {
- type Item = U;
- type Error = A::Error;
- }
-
- pub struct FlattenStream<F> {
- _f: F,
- }
-
- impl<F> Stream for FlattenStream<F>
- where F: Future,
- <F as Future>::Item: Stream<Error=F::Error>,
- {
- type Item = <F::Item as Stream>::Item;
- type Error = <F::Item as Stream>::Error;
- }
-
- pub struct FutureResult<T, E> {
- _inner: (T, E),
- }
-
- impl<T, E> Future for FutureResult<T, E> {
- type Item = T;
- type Error = E;
- }
-}
-
-mod stream {
- use IntoFuture;
-
- pub trait Stream {
- type Item;
- type Error;
-
- fn buffer_unordered(self, amt: usize) -> BufferUnordered<Self>
- where Self::Item: IntoFuture<Error = <Self as Stream>::Error>,
- Self: Sized
- {
- new(self, amt)
- }
-
- fn chunks(self, _capacity: usize) -> Chunks<Self>
- where Self: Sized
- {
- panic!()
- }
- }
-
- pub struct IterStream<I> {
- _iter: I,
- }
-
- pub fn iter<J, T, E>(_: J) -> IterStream<J::IntoIter>
- where J: IntoIterator<Item=Result<T, E>>,
- {
- panic!()
- }
-
- impl<I, T, E> Stream for IterStream<I>
- where I: Iterator<Item=Result<T, E>>,
- {
- type Item = T;
- type Error = E;
- }
-
- pub struct Chunks<S> {
- _stream: S
- }
-
- impl<S> Stream for Chunks<S>
- where S: Stream
- {
- type Item = Result<Vec<<S as Stream>::Item>, u32>;
- type Error = <S as Stream>::Error;
- }
-
- pub struct BufferUnordered<S> {
- _stream: S,
- }
-
- enum Slot<T> {
- Next(#[allow(unused_tuple_struct_fields)] usize),
- _Data { _a: T },
- }
-
- fn new<S>(_s: S, _amt: usize) -> BufferUnordered<S>
- where S: Stream,
- S::Item: IntoFuture<Error=<S as Stream>::Error>,
- {
- (0..0).map(|_| {
- Slot::Next::<<S::Item as IntoFuture>::Future>(1)
- }).collect::<Vec<_>>();
- panic!()
- }
-
- impl<S> Stream for BufferUnordered<S>
- where S: Stream,
- S::Item: IntoFuture<Error=<S as Stream>::Error>,
- {
- type Item = <S::Item as IntoFuture>::Item;
- type Error = <S as Stream>::Error;
- }
-}
-use stream::Stream;
diff --git a/tests/ui/issues/issue-40288.stderr b/tests/ui/issues/issue-40288.stderr
index fb4ecab36..db5d06437 100644
--- a/tests/ui/issues/issue-40288.stderr
+++ b/tests/ui/issues/issue-40288.stderr
@@ -2,10 +2,10 @@ error[E0506]: cannot assign to `*refr` because it is borrowed
--> $DIR/issue-40288.rs:16:5
|
LL | save_ref(&*refr, &mut out);
- | ------ borrow of `*refr` occurs here
+ | ------ `*refr` is borrowed here
...
LL | *refr = 3;
- | ^^^^^^^^^ assignment to borrowed `*refr` occurs here
+ | ^^^^^^^^^ `*refr` is assigned to here but it was already borrowed
...
LL | println!("{:?}", out[0]);
| ------ borrow later used here
diff --git a/tests/ui/issues/issue-40749.stderr b/tests/ui/issues/issue-40749.stderr
index fa239f744..afc39adec 100644
--- a/tests/ui/issues/issue-40749.stderr
+++ b/tests/ui/issues/issue-40749.stderr
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
--> $DIR/issue-40749.rs:2:9
|
LL | [0; ..10];
- | ^^^^ expected `usize`, found struct `RangeTo`
+ | ^^^^ expected `usize`, found `RangeTo<{integer}>`
|
= note: expected type `usize`
found struct `RangeTo<{integer}>`
diff --git a/tests/ui/issues/issue-43420-no-over-suggest.stderr b/tests/ui/issues/issue-43420-no-over-suggest.stderr
index 58fd1121a..9b141e2bf 100644
--- a/tests/ui/issues/issue-43420-no-over-suggest.stderr
+++ b/tests/ui/issues/issue-43420-no-over-suggest.stderr
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
--> $DIR/issue-43420-no-over-suggest.rs:8:9
|
LL | foo(&a);
- | --- ^^ expected slice `[u16]`, found struct `Vec`
+ | --- ^^ expected `&[u16]`, found `&Vec<u8>`
| |
| arguments to this function are incorrect
|
diff --git a/tests/ui/issues/issue-4517.rs b/tests/ui/issues/issue-4517.rs
index caf85d44a..469304e2c 100644
--- a/tests/ui/issues/issue-4517.rs
+++ b/tests/ui/issues/issue-4517.rs
@@ -4,5 +4,5 @@ fn main() {
let foo: [u8; 4] = [1; 4];
bar(foo);
//~^ ERROR mismatched types
- //~| expected `usize`, found array `[u8; 4]`
+ //~| expected `usize`, found `[u8; 4]`
}
diff --git a/tests/ui/issues/issue-4517.stderr b/tests/ui/issues/issue-4517.stderr
index 70b4ca5ec..78ee336f1 100644
--- a/tests/ui/issues/issue-4517.stderr
+++ b/tests/ui/issues/issue-4517.stderr
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
--> $DIR/issue-4517.rs:5:9
|
LL | bar(foo);
- | --- ^^^ expected `usize`, found array `[u8; 4]`
+ | --- ^^^ expected `usize`, found `[u8; 4]`
| |
| arguments to this function are incorrect
|
diff --git a/tests/ui/issues/issue-45697-1.stderr b/tests/ui/issues/issue-45697-1.stderr
index 30c69f196..474313398 100644
--- a/tests/ui/issues/issue-45697-1.stderr
+++ b/tests/ui/issues/issue-45697-1.stderr
@@ -2,7 +2,7 @@ error[E0503]: cannot use `*y.pointer` because it was mutably borrowed
--> $DIR/issue-45697-1.rs:20:9
|
LL | let z = copy_borrowed_ptr(&mut y);
- | ------ borrow of `y` occurs here
+ | ------ `y` is borrowed here
LL | *y.pointer += 1;
| ^^^^^^^^^^^^^^^ use of borrowed `y`
...
@@ -13,9 +13,9 @@ error[E0506]: cannot assign to `*y.pointer` because it is borrowed
--> $DIR/issue-45697-1.rs:20:9
|
LL | let z = copy_borrowed_ptr(&mut y);
- | ------ borrow of `*y.pointer` occurs here
+ | ------ `*y.pointer` is borrowed here
LL | *y.pointer += 1;
- | ^^^^^^^^^^^^^^^ assignment to borrowed `*y.pointer` occurs here
+ | ^^^^^^^^^^^^^^^ `*y.pointer` is assigned to here but it was already borrowed
...
LL | *z.pointer += 1;
| --------------- borrow later used here
diff --git a/tests/ui/issues/issue-45697.stderr b/tests/ui/issues/issue-45697.stderr
index 26749d36f..7986fd5c9 100644
--- a/tests/ui/issues/issue-45697.stderr
+++ b/tests/ui/issues/issue-45697.stderr
@@ -2,7 +2,7 @@ error[E0503]: cannot use `*y.pointer` because it was mutably borrowed
--> $DIR/issue-45697.rs:20:9
|
LL | let z = copy_borrowed_ptr(&mut y);
- | ------ borrow of `y` occurs here
+ | ------ `y` is borrowed here
LL | *y.pointer += 1;
| ^^^^^^^^^^^^^^^ use of borrowed `y`
...
@@ -13,9 +13,9 @@ error[E0506]: cannot assign to `*y.pointer` because it is borrowed
--> $DIR/issue-45697.rs:20:9
|
LL | let z = copy_borrowed_ptr(&mut y);
- | ------ borrow of `*y.pointer` occurs here
+ | ------ `*y.pointer` is borrowed here
LL | *y.pointer += 1;
- | ^^^^^^^^^^^^^^^ assignment to borrowed `*y.pointer` occurs here
+ | ^^^^^^^^^^^^^^^ `*y.pointer` is assigned to here but it was already borrowed
...
LL | *z.pointer += 1;
| --------------- borrow later used here
diff --git a/tests/ui/issues/issue-46471-1.stderr b/tests/ui/issues/issue-46471-1.stderr
index b09f31729..2ae6e709d 100644
--- a/tests/ui/issues/issue-46471-1.stderr
+++ b/tests/ui/issues/issue-46471-1.stderr
@@ -1,11 +1,10 @@
error[E0597]: `z` does not live long enough
--> $DIR/issue-46471-1.rs:4:9
|
+LL | let mut z = 0;
+ | ----- binding `z` declared here
LL | &mut z
- | ^^^^^^
- | |
- | borrowed value does not live long enough
- | borrow later used here
+ | ^^^^^^ borrowed value does not live long enough
LL | };
| - `z` dropped here while still borrowed
diff --git a/tests/ui/issues/issue-47715.stderr b/tests/ui/issues/issue-47715.stderr
index 0ee9388bf..dadea34b6 100644
--- a/tests/ui/issues/issue-47715.stderr
+++ b/tests/ui/issues/issue-47715.stderr
@@ -1,22 +1,22 @@
-error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in generic
+error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in generics
--> $DIR/issue-47715.rs:9:37
|
LL | struct Container<T: Iterable<Item = impl Foo>> {
| ^^^^^^^^
-error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in generic
+error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in generics
--> $DIR/issue-47715.rs:14:30
|
LL | enum Enum<T: Iterable<Item = impl Foo>> {
| ^^^^^^^^
-error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in generic
+error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in generics
--> $DIR/issue-47715.rs:19:32
|
LL | union Union<T: Iterable<Item = impl Foo> + Copy> {
| ^^^^^^^^
-error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in generic
+error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in generics
--> $DIR/issue-47715.rs:24:30
|
LL | type Type<T: Iterable<Item = impl Foo>> = T;
diff --git a/tests/ui/issues/issue-48179.rs b/tests/ui/issues/issue-48179.rs
deleted file mode 100644
index f81203dc4..000000000
--- a/tests/ui/issues/issue-48179.rs
+++ /dev/null
@@ -1,38 +0,0 @@
-// Regression test for #48132. This was failing due to problems around
-// the projection caching and dropck type enumeration.
-
-// check-pass
-
-pub struct Container<T: Iterator> {
- value: Option<T::Item>,
-}
-
-impl<T: Iterator> Container<T> {
- pub fn new(iter: T) -> Self {
- panic!()
- }
-}
-
-pub struct Wrapper<'a> {
- content: &'a Content,
-}
-
-impl<'a, 'de> Wrapper<'a> {
- pub fn new(content: &'a Content) -> Self {
- Wrapper {
- content: content,
- }
- }
-}
-
-pub struct Content;
-
-fn crash_it(content: Content) {
- let items = vec![content];
- let map = items.iter().map(|ref o| Wrapper::new(o));
-
- let mut map_visitor = Container::new(map);
-
-}
-
-fn main() {}
diff --git a/tests/ui/issues/issue-48364.stderr b/tests/ui/issues/issue-48364.stderr
index 60bbfc0c6..cac4af6a7 100644
--- a/tests/ui/issues/issue-48364.stderr
+++ b/tests/ui/issues/issue-48364.stderr
@@ -2,13 +2,13 @@ error[E0308]: mismatched types
--> $DIR/issue-48364.rs:2:21
|
LL | b"".starts_with(stringify!(foo))
- | ----------- ^^^^^^^^^^^^^^^ expected slice `[u8]`, found `str`
+ | ----------- ^^^^^^^^^^^^^^^ expected `&[u8]`, found `&str`
| |
| arguments to this method are incorrect
|
= note: expected reference `&[u8]`
found reference `&'static str`
-note: associated function defined here
+note: method defined here
--> $SRC_DIR/core/src/slice/mod.rs:LL:COL
= note: this error originates in the macro `stringify` (in Nightly builds, run with -Z macro-backtrace for more info)
diff --git a/tests/ui/issues/issue-4935.stderr b/tests/ui/issues/issue-4935.stderr
index bb45fa083..e544e4244 100644
--- a/tests/ui/issues/issue-4935.stderr
+++ b/tests/ui/issues/issue-4935.stderr
@@ -2,17 +2,16 @@ error[E0061]: this function takes 1 argument but 2 arguments were supplied
--> $DIR/issue-4935.rs:5:13
|
LL | fn main() { foo(5, 6) }
- | ^^^ - argument of type `{integer}` unexpected
+ | ^^^ ---
+ | | |
+ | | unexpected argument of type `{integer}`
+ | help: remove the extra argument
|
note: function defined here
--> $DIR/issue-4935.rs:3:4
|
LL | fn foo(a: usize) {}
| ^^^ --------
-help: remove the extra argument
- |
-LL | fn main() { foo(5) }
- | ~~~
error: aborting due to previous error
diff --git a/tests/ui/issues/issue-4968.rs b/tests/ui/issues/issue-4968.rs
index 634bd698d..c8df46dc2 100644
--- a/tests/ui/issues/issue-4968.rs
+++ b/tests/ui/issues/issue-4968.rs
@@ -6,5 +6,5 @@ fn main() {
//~^ ERROR mismatched types
//~| expected type `{integer}`
//~| found tuple `(isize, isize)`
- //~| expected integer, found tuple
+ //~| expected integer, found `(isize, isize)`
}
diff --git a/tests/ui/issues/issue-4968.stderr b/tests/ui/issues/issue-4968.stderr
index bbaca4ed2..1ce033384 100644
--- a/tests/ui/issues/issue-4968.stderr
+++ b/tests/ui/issues/issue-4968.stderr
@@ -7,7 +7,7 @@ LL | fn main() {
LL | match 42 { A => () }
| -- ^
| | |
- | | expected integer, found tuple
+ | | expected integer, found `(isize, isize)`
| | `A` is interpreted as a constant, not a new binding
| | help: introduce a new binding instead: `other_a`
| this expression has type `{integer}`
diff --git a/tests/ui/issues/issue-50576.rs b/tests/ui/issues/issue-50576.rs
deleted file mode 100644
index e0c36b827..000000000
--- a/tests/ui/issues/issue-50576.rs
+++ /dev/null
@@ -1,6 +0,0 @@
-fn main() {
- |bool: [u8; break 'L]| 0;
- //~^ ERROR [E0426]
- //~| ERROR [E0268]
- Vec::<[u8; break]>::new(); //~ ERROR [E0268]
-}
diff --git a/tests/ui/issues/issue-50576.stderr b/tests/ui/issues/issue-50576.stderr
deleted file mode 100644
index 4ec22fde9..000000000
--- a/tests/ui/issues/issue-50576.stderr
+++ /dev/null
@@ -1,22 +0,0 @@
-error[E0426]: use of undeclared label `'L`
- --> $DIR/issue-50576.rs:2:23
- |
-LL | |bool: [u8; break 'L]| 0;
- | ^^ undeclared label `'L`
-
-error[E0268]: `break` outside of a loop or labeled block
- --> $DIR/issue-50576.rs:2:17
- |
-LL | |bool: [u8; break 'L]| 0;
- | ^^^^^^^^ cannot `break` outside of a loop or labeled block
-
-error[E0268]: `break` outside of a loop or labeled block
- --> $DIR/issue-50576.rs:5:16
- |
-LL | Vec::<[u8; break]>::new();
- | ^^^^^ cannot `break` outside of a loop or labeled block
-
-error: aborting due to 3 previous errors
-
-Some errors have detailed explanations: E0268, E0426.
-For more information about an error, try `rustc --explain E0268`.
diff --git a/tests/ui/issues/issue-5100.rs b/tests/ui/issues/issue-5100.rs
index 69ed4b0e4..53ebdec81 100644
--- a/tests/ui/issues/issue-5100.rs
+++ b/tests/ui/issues/issue-5100.rs
@@ -7,7 +7,7 @@ fn main() {
match (true, false) {
A::B => (),
//~^ ERROR mismatched types
-//~| expected tuple, found enum `A`
+//~| expected `(bool, bool)`, found `A`
//~| expected tuple `(bool, bool)`
//~| found enum `A`
_ => ()
@@ -39,7 +39,7 @@ fn main() {
match (true, false) {
&(true, false) => ()
//~^ ERROR mismatched types
-//~| expected tuple, found reference
+//~| expected `(bool, bool)`, found `&_`
//~| expected tuple `(bool, bool)`
//~| found reference `&_`
}
diff --git a/tests/ui/issues/issue-5100.stderr b/tests/ui/issues/issue-5100.stderr
index c87a3e348..b1680aacd 100644
--- a/tests/ui/issues/issue-5100.stderr
+++ b/tests/ui/issues/issue-5100.stderr
@@ -7,7 +7,7 @@ LL | enum A { B, C }
LL | match (true, false) {
| ------------- this expression has type `(bool, bool)`
LL | A::B => (),
- | ^^^^ expected tuple, found enum `A`
+ | ^^^^ expected `(bool, bool)`, found `A`
|
= note: expected tuple `(bool, bool)`
found enum `A`
@@ -40,7 +40,7 @@ error[E0308]: mismatched types
LL | match (true, false) {
| ------------- this expression has type `(bool, bool)`
LL | box (true, false) => ()
- | ^^^^^^^^^^^^^^^^^ expected tuple, found struct `Box`
+ | ^^^^^^^^^^^^^^^^^ expected `(bool, bool)`, found `Box<_>`
|
= note: expected tuple `(bool, bool)`
found struct `Box<_>`
@@ -51,7 +51,7 @@ error[E0308]: mismatched types
LL | match (true, false) {
| ------------- this expression has type `(bool, bool)`
LL | &(true, false) => ()
- | ^^^^^^^^^^^^^^ expected tuple, found reference
+ | ^^^^^^^^^^^^^^ expected `(bool, bool)`, found `&_`
|
= note: expected tuple `(bool, bool)`
found reference `&_`
diff --git a/tests/ui/issues/issue-51515.rs b/tests/ui/issues/issue-51515.rs
index 797c1085d..84e09afac 100644
--- a/tests/ui/issues/issue-51515.rs
+++ b/tests/ui/issues/issue-51515.rs
@@ -5,6 +5,7 @@ fn main() {
*foo = 32;
//~^ ERROR cannot assign to `*foo`, which is behind a `&` reference
let bar = foo;
+ //~^ HELP consider specifying this binding's type
*bar = 64;
//~^ ERROR cannot assign to `*bar`, which is behind a `&` reference
}
diff --git a/tests/ui/issues/issue-51515.stderr b/tests/ui/issues/issue-51515.stderr
index c4e61e719..94e5c9f1b 100644
--- a/tests/ui/issues/issue-51515.stderr
+++ b/tests/ui/issues/issue-51515.stderr
@@ -10,12 +10,15 @@ LL | let foo = &mut 16;
| ~~~~~~~
error[E0594]: cannot assign to `*bar`, which is behind a `&` reference
- --> $DIR/issue-51515.rs:8:5
+ --> $DIR/issue-51515.rs:9:5
|
-LL | let bar = foo;
- | --- consider changing this binding's type to be: `&mut i32`
LL | *bar = 64;
| ^^^^^^^^^ `bar` is a `&` reference, so the data it refers to cannot be written
+ |
+help: consider specifying this binding's type
+ |
+LL | let bar: &mut i32 = foo;
+ | ++++++++++
error: aborting due to 2 previous errors
diff --git a/tests/ui/issues/issue-51632-try-desugar-incompatible-types.stderr b/tests/ui/issues/issue-51632-try-desugar-incompatible-types.stderr
index cc0726bca..7180a3d24 100644
--- a/tests/ui/issues/issue-51632-try-desugar-incompatible-types.stderr
+++ b/tests/ui/issues/issue-51632-try-desugar-incompatible-types.stderr
@@ -2,7 +2,7 @@ error[E0308]: `?` operator has incompatible types
--> $DIR/issue-51632-try-desugar-incompatible-types.rs:8:5
|
LL | missing_discourses()?
- | ^^^^^^^^^^^^^^^^^^^^^ expected enum `Result`, found `isize`
+ | ^^^^^^^^^^^^^^^^^^^^^ expected `Result<isize, ()>`, found `isize`
|
= note: `?` operator cannot convert from `isize` to `Result<isize, ()>`
= note: expected enum `Result<isize, ()>`
diff --git a/tests/ui/issues/issue-52126-assign-op-invariance.stderr b/tests/ui/issues/issue-52126-assign-op-invariance.stderr
index d45067577..2d3b48832 100644
--- a/tests/ui/issues/issue-52126-assign-op-invariance.stderr
+++ b/tests/ui/issues/issue-52126-assign-op-invariance.stderr
@@ -1,6 +1,8 @@
error[E0597]: `line` does not live long enough
--> $DIR/issue-52126-assign-op-invariance.rs:34:28
|
+LL | for line in vec!["123456789".to_string(), "12345678".to_string()] {
+ | ---- binding `line` declared here
LL | let v: Vec<&str> = line.split_whitespace().collect();
| ^^^^^^^^^^^^^^^^^^^^^^^ borrowed value does not live long enough
...
diff --git a/tests/ui/issues/issue-53251.rs b/tests/ui/issues/issue-53251.rs
index 240826a16..da3ba63ef 100644
--- a/tests/ui/issues/issue-53251.rs
+++ b/tests/ui/issues/issue-53251.rs
@@ -9,8 +9,8 @@ macro_rules! impl_add {
$(
fn $n() {
S::f::<i64>();
- //~^ ERROR this associated function takes 0 generic
- //~| ERROR this associated function takes 0 generic
+ //~^ ERROR associated function takes 0 generic
+ //~| ERROR associated function takes 0 generic
}
)*
}
diff --git a/tests/ui/issues/issue-53251.stderr b/tests/ui/issues/issue-53251.stderr
index cee9a5deb..d5f14e8de 100644
--- a/tests/ui/issues/issue-53251.stderr
+++ b/tests/ui/issues/issue-53251.stderr
@@ -1,4 +1,4 @@
-error[E0107]: this associated function takes 0 generic arguments but 1 generic argument was supplied
+error[E0107]: associated function takes 0 generic arguments but 1 generic argument was supplied
--> $DIR/issue-53251.rs:11:20
|
LL | S::f::<i64>();
@@ -16,7 +16,7 @@ LL | fn f() {}
| ^
= note: this error originates in the macro `impl_add` (in Nightly builds, run with -Z macro-backtrace for more info)
-error[E0107]: this associated function takes 0 generic arguments but 1 generic argument was supplied
+error[E0107]: associated function takes 0 generic arguments but 1 generic argument was supplied
--> $DIR/issue-53251.rs:11:20
|
LL | S::f::<i64>();
diff --git a/tests/ui/issues/issue-53348.rs b/tests/ui/issues/issue-53348.rs
index d2f8c77c0..66800d9e9 100644
--- a/tests/ui/issues/issue-53348.rs
+++ b/tests/ui/issues/issue-53348.rs
@@ -9,7 +9,7 @@ fn main() {
for i in v {
a = *i.to_string();
//~^ ERROR mismatched types
- //~| NOTE expected struct `String`, found `str`
+ //~| NOTE expected `String`, found `str`
v2.push(a);
}
}
diff --git a/tests/ui/issues/issue-53348.stderr b/tests/ui/issues/issue-53348.stderr
index 71d9f5b3d..e4cdb7e88 100644
--- a/tests/ui/issues/issue-53348.stderr
+++ b/tests/ui/issues/issue-53348.stderr
@@ -5,7 +5,7 @@ LL | let mut a = String::new();
| ------------- expected due to this value
LL | for i in v {
LL | a = *i.to_string();
- | ^^^^^^^^^^^^^^ expected struct `String`, found `str`
+ | ^^^^^^^^^^^^^^ expected `String`, found `str`
error: aborting due to previous error
diff --git a/tests/ui/issues/issue-5358-1.rs b/tests/ui/issues/issue-5358-1.rs
index f5e32e78d..14ee962b7 100644
--- a/tests/ui/issues/issue-5358-1.rs
+++ b/tests/ui/issues/issue-5358-1.rs
@@ -5,7 +5,7 @@ fn main() {
match S(Either::Left(5)) {
Either::Right(_) => {}
//~^ ERROR mismatched types
- //~| expected struct `S`, found enum `Either`
+ //~| expected `S`, found `Either<_, _>`
//~| expected struct `S`
//~| found enum `Either<_, _>`
_ => {}
diff --git a/tests/ui/issues/issue-5358-1.stderr b/tests/ui/issues/issue-5358-1.stderr
index 9d5b8d9d3..059462a36 100644
--- a/tests/ui/issues/issue-5358-1.stderr
+++ b/tests/ui/issues/issue-5358-1.stderr
@@ -4,7 +4,7 @@ error[E0308]: mismatched types
LL | match S(Either::Left(5)) {
| ------------------ this expression has type `S`
LL | Either::Right(_) => {}
- | ^^^^^^^^^^^^^^^^ expected struct `S`, found enum `Either`
+ | ^^^^^^^^^^^^^^^^ expected `S`, found `Either<_, _>`
|
= note: expected struct `S`
found enum `Either<_, _>`
diff --git a/tests/ui/issues/issue-53712.rs b/tests/ui/issues/issue-53712.rs
deleted file mode 100644
index 2353904d7..000000000
--- a/tests/ui/issues/issue-53712.rs
+++ /dev/null
@@ -1,9 +0,0 @@
-// issue #53712: make the error generated by using tuple indexing on an array more specific
-
-fn main() {
- let arr = [10, 20, 30, 40, 50];
- arr.0;
- //~^ ERROR no field `0` on type `[{integer}; 5]` [E0609]
- //~| HELP instead of using tuple indexing, use array indexing
- //~| SUGGESTION arr[0]
-}
diff --git a/tests/ui/issues/issue-53712.stderr b/tests/ui/issues/issue-53712.stderr
deleted file mode 100644
index db85919af..000000000
--- a/tests/ui/issues/issue-53712.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-error[E0609]: no field `0` on type `[{integer}; 5]`
- --> $DIR/issue-53712.rs:5:9
- |
-LL | arr.0;
- | ----^
- | |
- | help: instead of using tuple indexing, use array indexing: `arr[0]`
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0609`.
diff --git a/tests/ui/issues/issue-54582.rs b/tests/ui/issues/issue-54582.rs
deleted file mode 100644
index 8c50cac67..000000000
--- a/tests/ui/issues/issue-54582.rs
+++ /dev/null
@@ -1,16 +0,0 @@
-// run-pass
-
-pub trait Stage: Sync {}
-
-pub enum Enum {
- A,
- B,
-}
-
-impl Stage for Enum {}
-
-pub static ARRAY: [(&dyn Stage, &str); 1] = [
- (&Enum::A, ""),
-];
-
-fn main() {}
diff --git a/tests/ui/issues/issue-56943.stderr b/tests/ui/issues/issue-56943.stderr
index 74ed5ec0f..c394e620b 100644
--- a/tests/ui/issues/issue-56943.stderr
+++ b/tests/ui/issues/issue-56943.stderr
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
--> $DIR/issue-56943.rs:6:29
|
LL | let _: issue_56943::S = issue_56943::S2;
- | -------------- ^^^^^^^^^^^^^^^ expected struct `S`, found struct `S2`
+ | -------------- ^^^^^^^^^^^^^^^ expected `S`, found `S2`
| |
| expected due to this
diff --git a/tests/ui/issues/issue-57362-2.stderr b/tests/ui/issues/issue-57362-2.stderr
index 7d08c4643..37beb587d 100644
--- a/tests/ui/issues/issue-57362-2.stderr
+++ b/tests/ui/issues/issue-57362-2.stderr
@@ -1,8 +1,8 @@
-error[E0599]: the function or associated item `make_g` exists for fn pointer `for<'a> fn(&'a ())`, but its trait bounds were not satisfied
+error[E0599]: the function or associated item `make_g` exists for fn pointer `fn(&())`, but its trait bounds were not satisfied
--> $DIR/issue-57362-2.rs:22:25
|
LL | let x = <fn (&())>::make_g();
- | ^^^^^^ function or associated item cannot be called on `for<'a> fn(&'a ())` due to unsatisfied trait bounds
+ | ^^^^^^ function or associated item cannot be called on `fn(&())` due to unsatisfied trait bounds
|
= note: the following trait bounds were not satisfied:
`for<'a> fn(&'a ()): X`
diff --git a/tests/ui/issues/issue-57741-1.stderr b/tests/ui/issues/issue-57741-1.stderr
index 789a1f44d..76f03bab6 100644
--- a/tests/ui/issues/issue-57741-1.stderr
+++ b/tests/ui/issues/issue-57741-1.stderr
@@ -4,7 +4,7 @@ error[E0308]: mismatched types
LL | let y = match x {
| - this expression has type `Box<u32>`
LL | S::A { a } | S::B { b: a } => a,
- | ^^^^^^^^^^ expected struct `Box`, found enum `S`
+ | ^^^^^^^^^^ expected `Box<u32>`, found `S`
|
= note: expected struct `Box<u32>`
found enum `S`
@@ -15,7 +15,7 @@ error[E0308]: mismatched types
LL | let y = match x {
| - this expression has type `Box<u32>`
LL | S::A { a } | S::B { b: a } => a,
- | ^^^^^^^^^^^^^ expected struct `Box`, found enum `S`
+ | ^^^^^^^^^^^^^ expected `Box<u32>`, found `S`
|
= note: expected struct `Box<u32>`
found enum `S`
diff --git a/tests/ui/issues/issue-57741.stderr b/tests/ui/issues/issue-57741.stderr
index cd277f20e..38014ecce 100644
--- a/tests/ui/issues/issue-57741.stderr
+++ b/tests/ui/issues/issue-57741.stderr
@@ -7,7 +7,7 @@ LL | let y = match x {
| this expression has type `Box<T>`
| help: consider dereferencing the boxed value: `*x`
LL | T::A(a) | T::B(a) => a,
- | ^^^^^^^ expected struct `Box`, found enum `T`
+ | ^^^^^^^ expected `Box<T>`, found `T`
|
= note: expected struct `Box<T>`
found enum `T`
@@ -21,7 +21,7 @@ LL | let y = match x {
| this expression has type `Box<T>`
| help: consider dereferencing the boxed value: `*x`
LL | T::A(a) | T::B(a) => a,
- | ^^^^^^^ expected struct `Box`, found enum `T`
+ | ^^^^^^^ expected `Box<T>`, found `T`
|
= note: expected struct `Box<T>`
found enum `T`
@@ -35,7 +35,7 @@ LL | let y = match x {
| this expression has type `Box<S>`
| help: consider dereferencing the boxed value: `*x`
LL | S::A { a } | S::B { b: a } => a,
- | ^^^^^^^^^^ expected struct `Box`, found enum `S`
+ | ^^^^^^^^^^ expected `Box<S>`, found `S`
|
= note: expected struct `Box<S>`
found enum `S`
@@ -49,7 +49,7 @@ LL | let y = match x {
| this expression has type `Box<S>`
| help: consider dereferencing the boxed value: `*x`
LL | S::A { a } | S::B { b: a } => a,
- | ^^^^^^^^^^^^^ expected struct `Box`, found enum `S`
+ | ^^^^^^^^^^^^^ expected `Box<S>`, found `S`
|
= note: expected struct `Box<S>`
found enum `S`
diff --git a/tests/ui/issues/issue-59488.stderr b/tests/ui/issues/issue-59488.stderr
index f9846b62a..d45beefa4 100644
--- a/tests/ui/issues/issue-59488.stderr
+++ b/tests/ui/issues/issue-59488.stderr
@@ -15,7 +15,7 @@ error[E0308]: mismatched types
--> $DIR/issue-59488.rs:14:11
|
LL | foo > 12;
- | ^^ expected fn item, found integer
+ | ^^ expected fn item, found `i32`
|
= note: expected fn item `fn() -> i32 {foo}`
found type `i32`
@@ -37,7 +37,7 @@ error[E0308]: mismatched types
--> $DIR/issue-59488.rs:18:11
|
LL | bar > 13;
- | ^^ expected fn item, found integer
+ | ^^ expected fn item, found `i64`
|
= note: expected fn item `fn(i64) -> i64 {bar}`
found type `i64`
diff --git a/tests/ui/issues/issue-60218.stderr b/tests/ui/issues/issue-60218.stderr
index dd72b6515..563690c9a 100644
--- a/tests/ui/issues/issue-60218.stderr
+++ b/tests/ui/issues/issue-60218.stderr
@@ -10,7 +10,7 @@ note: required by a bound in `trigger_error`
--> $DIR/issue-60218.rs:13:72
|
LL | pub fn trigger_error<I, F>(iterable: I, functor: F)
- | ------------- required by a bound in this
+ | ------------- required by a bound in this function
...
LL | for<'t> <Map<<&'t I as IntoIterator>::IntoIter, F> as Iterator>::Item: Foo,
| ^^^ required by this bound in `trigger_error`
diff --git a/tests/ui/issues/issue-60622.rs b/tests/ui/issues/issue-60622.rs
index 8e230c615..7b9443eee 100644
--- a/tests/ui/issues/issue-60622.rs
+++ b/tests/ui/issues/issue-60622.rs
@@ -9,7 +9,7 @@ impl Borked {
fn run_wild<T>(b: &Borked) {
b.a::<'_, T>();
//~^ ERROR cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
- //~| ERROR this associated function takes 0 generic arguments but 1 generic argument
+ //~| ERROR method takes 0 generic arguments but 1 generic argument
//~| WARN this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
}
diff --git a/tests/ui/issues/issue-60622.stderr b/tests/ui/issues/issue-60622.stderr
index ecf1ae758..43da27739 100644
--- a/tests/ui/issues/issue-60622.stderr
+++ b/tests/ui/issues/issue-60622.stderr
@@ -16,7 +16,7 @@ LL | #![deny(warnings)]
| ^^^^^^^^
= note: `#[deny(late_bound_lifetime_arguments)]` implied by `#[deny(warnings)]`
-error[E0107]: this associated function takes 0 generic arguments but 1 generic argument was supplied
+error[E0107]: method takes 0 generic arguments but 1 generic argument was supplied
--> $DIR/issue-60622.rs:10:7
|
LL | b.a::<'_, T>();
@@ -24,7 +24,7 @@ LL | b.a::<'_, T>();
| |
| expected 0 generic arguments
|
-note: associated function defined here, with 0 generic parameters
+note: method defined here, with 0 generic parameters
--> $DIR/issue-60622.rs:6:8
|
LL | fn a(&self) {}
diff --git a/tests/ui/issues/issue-61106.stderr b/tests/ui/issues/issue-61106.stderr
index 2bc092341..eff3e6e78 100644
--- a/tests/ui/issues/issue-61106.stderr
+++ b/tests/ui/issues/issue-61106.stderr
@@ -4,7 +4,7 @@ error[E0308]: mismatched types
LL | foo(x.clone());
| --- ^^^^^^^^^
| | |
- | | expected `&str`, found struct `String`
+ | | expected `&str`, found `String`
| | help: consider borrowing here: `&x`
| arguments to this function are incorrect
|
diff --git a/tests/ui/issues/issue-6458-4.stderr b/tests/ui/issues/issue-6458-4.stderr
index 168ececac..66ccfdff2 100644
--- a/tests/ui/issues/issue-6458-4.stderr
+++ b/tests/ui/issues/issue-6458-4.stderr
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
--> $DIR/issue-6458-4.rs:1:20
|
LL | fn foo(b: bool) -> Result<bool,String> {
- | --- ^^^^^^^^^^^^^^^^^^^ expected enum `Result`, found `()`
+ | --- ^^^^^^^^^^^^^^^^^^^ expected `Result<bool, String>`, found `()`
| |
| implicitly returns `()` as its body has no tail or `return` expression
LL | Err("bar".to_string());
diff --git a/tests/ui/issues/issue-65634-raw-ident-suggestion.edition2015.stderr b/tests/ui/issues/issue-65634-raw-ident-suggestion.edition2015.stderr
index d0cb16995..4af3672ef 100644
--- a/tests/ui/issues/issue-65634-raw-ident-suggestion.edition2015.stderr
+++ b/tests/ui/issues/issue-65634-raw-ident-suggestion.edition2015.stderr
@@ -14,11 +14,11 @@ note: candidate #2 is defined in an impl of the trait `await` for the type `r#fn
|
LL | fn r#struct(&self) {
| ^^^^^^^^^^^^^^^^^^
-help: disambiguate the associated function for candidate #1
+help: disambiguate the method for candidate #1
|
LL | async::r#struct(&r#fn {});
| ~~~~~~~~~~~~~~~~~~~~~~~~~
-help: disambiguate the associated function for candidate #2
+help: disambiguate the method for candidate #2
|
LL | await::r#struct(&r#fn {});
| ~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/tests/ui/issues/issue-65634-raw-ident-suggestion.edition2018.stderr b/tests/ui/issues/issue-65634-raw-ident-suggestion.edition2018.stderr
index a75c1c413..2b96a0fb5 100644
--- a/tests/ui/issues/issue-65634-raw-ident-suggestion.edition2018.stderr
+++ b/tests/ui/issues/issue-65634-raw-ident-suggestion.edition2018.stderr
@@ -14,11 +14,11 @@ note: candidate #2 is defined in an impl of the trait `r#await` for the type `r#
|
LL | fn r#struct(&self) {
| ^^^^^^^^^^^^^^^^^^
-help: disambiguate the associated function for candidate #1
+help: disambiguate the method for candidate #1
|
LL | r#async::r#struct(&r#fn {});
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~
-help: disambiguate the associated function for candidate #2
+help: disambiguate the method for candidate #2
|
LL | r#await::r#struct(&r#fn {});
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/tests/ui/issues/issue-67039-unsound-pin-partialeq.stderr b/tests/ui/issues/issue-67039-unsound-pin-partialeq.stderr
index 37e2c3bdd..6fde44eaf 100644
--- a/tests/ui/issues/issue-67039-unsound-pin-partialeq.stderr
+++ b/tests/ui/issues/issue-67039-unsound-pin-partialeq.stderr
@@ -2,7 +2,7 @@ error[E0271]: type mismatch resolving `<Rc<Apple> as Deref>::Target == Rc<Apple>
--> $DIR/issue-67039-unsound-pin-partialeq.rs:25:29
|
LL | let _ = Pin::new(Apple) == Rc::pin(Apple);
- | ^^ expected struct `Apple`, found struct `Rc`
+ | ^^ expected `Apple`, found `Rc<Apple>`
|
= note: expected struct `Apple`
found struct `Rc<Apple>`
diff --git a/tests/ui/issues/issue-69306.stderr b/tests/ui/issues/issue-69306.stderr
index 61ec5d318..570677298 100644
--- a/tests/ui/issues/issue-69306.stderr
+++ b/tests/ui/issues/issue-69306.stderr
@@ -22,7 +22,7 @@ error[E0308]: mismatched types
LL | impl<T> S0<T> {
| - this type parameter
LL | const C: S0<u8> = Self(0);
- | ^^^^^^^ expected `u8`, found type parameter `T`
+ | ^^^^^^^ expected `S0<u8>`, found `S0<T>`
|
= note: expected struct `S0<u8>`
found struct `S0<T>`
@@ -89,7 +89,7 @@ error[E0308]: mismatched types
LL | impl<T> S1<T, u8> {
| - this type parameter
LL | const C: S1<u8, u8> = Self(0, 1);
- | ^^^^^^^^^^ expected `u8`, found type parameter `T`
+ | ^^^^^^^^^^ expected `S1<u8, u8>`, found `S1<T, u8>`
|
= note: expected struct `S1<u8, _>`
found struct `S1<T, _>`
@@ -126,7 +126,7 @@ LL | fn map<U>(x: U) -> S2<U> {
| |
| expected type parameter
LL | Self(x)
- | ^^^^^^^ expected type parameter `U`, found type parameter `T`
+ | ^^^^^^^ expected `S2<U>`, found `S2<T>`
|
= note: expected struct `S2<U>`
found struct `S2<T>`
diff --git a/tests/ui/issues/issue-69455.stderr b/tests/ui/issues/issue-69455.stderr
index fc343bb54..d3e307fba 100644
--- a/tests/ui/issues/issue-69455.stderr
+++ b/tests/ui/issues/issue-69455.stderr
@@ -2,7 +2,7 @@ error[E0284]: type annotations needed
--> $DIR/issue-69455.rs:29:41
|
LL | println!("{}", 23u64.test(xs.iter().sum()));
- | ---- ^^^ cannot infer type of the type parameter `S` declared on the associated function `sum`
+ | ---- ^^^ cannot infer type of the type parameter `S` declared on the method `sum`
| |
| type must be known at this point
|
@@ -16,7 +16,7 @@ error[E0283]: type annotations needed
--> $DIR/issue-69455.rs:29:41
|
LL | println!("{}", 23u64.test(xs.iter().sum()));
- | ---- ^^^ cannot infer type of the type parameter `S` declared on the associated function `sum`
+ | ---- ^^^ cannot infer type of the type parameter `S` declared on the method `sum`
| |
| required by a bound introduced by this call
|
diff --git a/tests/ui/issues/issue-69683.stderr b/tests/ui/issues/issue-69683.stderr
index 193de1a35..c428ea9ea 100644
--- a/tests/ui/issues/issue-69683.stderr
+++ b/tests/ui/issues/issue-69683.stderr
@@ -31,7 +31,7 @@ LL | u8: Element<I>,
| ^^^^^^^^^^ required by this bound in `Foo::foo`
LL | {
LL | fn foo(self, x: <u8 as Element<I>>::Array);
- | --- required by a bound in this
+ | --- required by a bound in this associated function
help: try using a fully qualified path to specify the expected types
|
LL | <u16 as Foo<I>>::foo(0u16, b);
diff --git a/tests/ui/issues/issue-70093/issue-70093-link-directives.rs b/tests/ui/issues/issue-70093/issue-70093-link-directives.rs
new file mode 100644
index 000000000..83f9b16c4
--- /dev/null
+++ b/tests/ui/issues/issue-70093/issue-70093-link-directives.rs
@@ -0,0 +1,10 @@
+// run-pass
+// compile-flags: -Zlink-directives=no
+// ignore-windows - this will probably only work on unixish systems
+// ignore-fuchsia - missing __libc_start_main for some reason (#84733)
+// ignore-cross-compile - default-linker-libraries=yes doesn't play well with cross compiling
+
+#[link(name = "some-random-non-existent-library", kind = "static")]
+extern "C" {}
+
+fn main() {}
diff --git a/tests/ui/issues/issue-70093.rs b/tests/ui/issues/issue-70093/issue-70093.rs
index 86459dc90..86459dc90 100644
--- a/tests/ui/issues/issue-70093.rs
+++ b/tests/ui/issues/issue-70093/issue-70093.rs
diff --git a/tests/ui/issues/issue-7061.stderr b/tests/ui/issues/issue-7061.stderr
index 27034378d..a209f8a42 100644
--- a/tests/ui/issues/issue-7061.stderr
+++ b/tests/ui/issues/issue-7061.stderr
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
--> $DIR/issue-7061.rs:4:46
|
LL | fn foo(&'a mut self) -> Box<BarStruct> { self }
- | -------------- ^^^^ expected struct `Box`, found `&mut BarStruct`
+ | -------------- ^^^^ expected `Box<BarStruct>`, found `&mut BarStruct`
| |
| expected `Box<BarStruct>` because of return type
|
diff --git a/tests/ui/issues/issue-7092.rs b/tests/ui/issues/issue-7092.rs
index 85bfbf90d..c3c96c7d3 100644
--- a/tests/ui/issues/issue-7092.rs
+++ b/tests/ui/issues/issue-7092.rs
@@ -5,7 +5,7 @@ fn foo(x: Whatever) {
match x {
Some(field) =>
//~^ ERROR mismatched types
-//~| expected enum `Whatever`, found enum `Option`
+//~| expected `Whatever`, found `Option<_>`
//~| expected enum `Whatever`
//~| found enum `Option<_>`
field.access(),
diff --git a/tests/ui/issues/issue-7092.stderr b/tests/ui/issues/issue-7092.stderr
index 59e8d75e2..e35379fd1 100644
--- a/tests/ui/issues/issue-7092.stderr
+++ b/tests/ui/issues/issue-7092.stderr
@@ -4,7 +4,7 @@ error[E0308]: mismatched types
LL | match x {
| - this expression has type `Whatever`
LL | Some(field) =>
- | ^^^^^^^^^^^ expected enum `Whatever`, found enum `Option`
+ | ^^^^^^^^^^^ expected `Whatever`, found `Option<_>`
|
= note: expected enum `Whatever`
found enum `Option<_>`
diff --git a/tests/ui/issues/issue-71676-1.stderr b/tests/ui/issues/issue-71676-1.stderr
index 2104634eb..164641ff7 100644
--- a/tests/ui/issues/issue-71676-1.stderr
+++ b/tests/ui/issues/issue-71676-1.stderr
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
--> $DIR/issue-71676-1.rs:43:24
|
LL | let _: *const u8 = &a;
- | --------- ^^ expected `u8`, found struct `Emm`
+ | --------- ^^ expected `*const u8`, found `&Emm`
| |
| expected due to this
|
@@ -32,7 +32,7 @@ error[E0308]: mismatched types
--> $DIR/issue-71676-1.rs:49:24
|
LL | let _: *const u8 = &mut a;
- | --------- ^^^^^^ expected `u8`, found struct `Emm`
+ | --------- ^^^^^^ expected `*const u8`, found `&mut Emm`
| |
| expected due to this
|
@@ -47,7 +47,7 @@ error[E0308]: mismatched types
--> $DIR/issue-71676-1.rs:52:22
|
LL | let _: *mut u8 = &mut a;
- | ------- ^^^^^^ expected `u8`, found struct `Emm`
+ | ------- ^^^^^^ expected `*mut u8`, found `&mut Emm`
| |
| expected due to this
|
diff --git a/tests/ui/issues/issue-7364.stderr b/tests/ui/issues/issue-7364.stderr
index 5dc8c2b60..aee73380f 100644
--- a/tests/ui/issues/issue-7364.stderr
+++ b/tests/ui/issues/issue-7364.stderr
@@ -5,6 +5,7 @@ LL | static boxed: Box<RefCell<isize>> = Box::new(RefCell::new(0));
| ^^^^^^^^^^^^^^^^^^^ `RefCell<isize>` cannot be shared between threads safely
|
= help: the trait `Sync` is not implemented for `RefCell<isize>`
+ = note: if you want to do aliasing and mutation between multiple threads, use `std::sync::RwLock` instead
= note: required for `Unique<RefCell<isize>>` to implement `Sync`
= note: required because it appears within the type `Box<RefCell<isize>>`
= note: shared static variables must have a type that implements `Sync`
diff --git a/tests/ui/issues/issue-74236/main.stderr b/tests/ui/issues/issue-74236/main.stderr
index 55e94ae72..5cd64e48a 100644
--- a/tests/ui/issues/issue-74236/main.stderr
+++ b/tests/ui/issues/issue-74236/main.stderr
@@ -4,7 +4,7 @@ error[E0308]: mismatched types
LL | let () = dep::Renamed;
| ^^ ------------ this expression has type `Renamed`
| |
- | expected struct `Renamed`, found `()`
+ | expected `Renamed`, found `()`
error: aborting due to previous error
diff --git a/tests/ui/issues/issue-75307.rs b/tests/ui/issues/issue-75307.rs
deleted file mode 100644
index cffa6bea8..000000000
--- a/tests/ui/issues/issue-75307.rs
+++ /dev/null
@@ -1,3 +0,0 @@
-fn main() {
- format!(r"{}{}{}", named_arg=1); //~ ERROR 3 positional arguments in format string, but there is 1 argument
-}
diff --git a/tests/ui/issues/issue-75307.stderr b/tests/ui/issues/issue-75307.stderr
deleted file mode 100644
index c5b0b11e7..000000000
--- a/tests/ui/issues/issue-75307.stderr
+++ /dev/null
@@ -1,8 +0,0 @@
-error: 3 positional arguments in format string, but there is 1 argument
- --> $DIR/issue-75307.rs:2:15
- |
-LL | format!(r"{}{}{}", named_arg=1);
- | ^^^^^^ -
-
-error: aborting due to previous error
-
diff --git a/tests/ui/issues/issue-75777.rs b/tests/ui/issues/issue-75777.rs
deleted file mode 100644
index a1e438bc6..000000000
--- a/tests/ui/issues/issue-75777.rs
+++ /dev/null
@@ -1,15 +0,0 @@
-// Regression test for #75777.
-// Checks that a boxed future can be properly constructed.
-
-use std::future::{self, Future};
-use std::pin::Pin;
-
-type BoxFuture<'a, T> = Pin<Box<dyn Future<Output = T> + 'a + Send>>;
-
-fn inject<'a, Env: 'a, A: 'a + Send>(v: A) -> Box<dyn FnOnce(&'a Env) -> BoxFuture<'a, A>> {
- let fut: BoxFuture<'a, A> = Box::pin(future::ready(v));
- Box::new(move |_| fut)
- //~^ ERROR: lifetime may not live long enough
-}
-
-fn main() {}
diff --git a/tests/ui/issues/issue-75777.stderr b/tests/ui/issues/issue-75777.stderr
deleted file mode 100644
index 370cd72fd..000000000
--- a/tests/ui/issues/issue-75777.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-error: lifetime may not live long enough
- --> $DIR/issue-75777.rs:11:5
- |
-LL | fn inject<'a, Env: 'a, A: 'a + Send>(v: A) -> Box<dyn FnOnce(&'a Env) -> BoxFuture<'a, A>> {
- | -- lifetime `'a` defined here
-LL | let fut: BoxFuture<'a, A> = Box::pin(future::ready(v));
-LL | Box::new(move |_| fut)
- | ^^^^^^^^^^^^^^^^^^^^^^ returning this value requires that `'a` must outlive `'static`
-
-error: aborting due to previous error
-
diff --git a/tests/ui/issues/issue-76191.stderr b/tests/ui/issues/issue-76191.stderr
index 137498047..32d9105b2 100644
--- a/tests/ui/issues/issue-76191.stderr
+++ b/tests/ui/issues/issue-76191.stderr
@@ -9,7 +9,7 @@ LL | match n {
LL | RANGE => {}
| ^^^^^
| |
- | expected `i32`, found struct `RangeInclusive`
+ | expected `i32`, found `RangeInclusive<i32>`
| `RANGE` is interpreted as a constant, not a new binding
|
= note: expected type `i32`
@@ -31,7 +31,7 @@ LL | match n {
LL | RANGE2 => {}
| ^^^^^^
| |
- | expected `i32`, found struct `RangeInclusive`
+ | expected `i32`, found `RangeInclusive<i32>`
| `RANGE2` is interpreted as a constant, not a new binding
|
= note: expected type `i32`
diff --git a/tests/ui/issues/issue-7813.rs b/tests/ui/issues/issue-7813.rs
deleted file mode 100644
index ce549bde6..000000000
--- a/tests/ui/issues/issue-7813.rs
+++ /dev/null
@@ -1,4 +0,0 @@
-fn main() {
- let v = &[]; //~ ERROR type annotations needed
- let it = v.iter();
-}
diff --git a/tests/ui/issues/issue-7813.stderr b/tests/ui/issues/issue-7813.stderr
deleted file mode 100644
index 2a747f679..000000000
--- a/tests/ui/issues/issue-7813.stderr
+++ /dev/null
@@ -1,14 +0,0 @@
-error[E0282]: type annotations needed for `&[_; 0]`
- --> $DIR/issue-7813.rs:2:9
- |
-LL | let v = &[];
- | ^ --- type must be known at this point
- |
-help: consider giving `v` an explicit type, where the placeholders `_` are specified
- |
-LL | let v: &[_; 0] = &[];
- | +++++++++
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0282`.
diff --git a/tests/ui/issues/issue-7867.rs b/tests/ui/issues/issue-7867.rs
index 3074052f1..e9fd10c66 100644
--- a/tests/ui/issues/issue-7867.rs
+++ b/tests/ui/issues/issue-7867.rs
@@ -6,7 +6,7 @@ fn main() {
match (true, false) {
A::B => (),
//~^ ERROR mismatched types
- //~| expected tuple, found enum `A`
+ //~| expected `(bool, bool)`, found `A`
//~| expected tuple `(bool, bool)`
//~| found enum `A`
_ => ()
diff --git a/tests/ui/issues/issue-7867.stderr b/tests/ui/issues/issue-7867.stderr
index 0d3121d60..4fb1af344 100644
--- a/tests/ui/issues/issue-7867.stderr
+++ b/tests/ui/issues/issue-7867.stderr
@@ -7,7 +7,7 @@ LL | enum A { B, C }
LL | match (true, false) {
| ------------- this expression has type `(bool, bool)`
LL | A::B => (),
- | ^^^^ expected tuple, found enum `A`
+ | ^^^^ expected `(bool, bool)`, found `A`
|
= note: expected tuple `(bool, bool)`
found enum `A`
diff --git a/tests/ui/issues/issue-83924.fixed b/tests/ui/issues/issue-83924.fixed
deleted file mode 100644
index aa40da12b..000000000
--- a/tests/ui/issues/issue-83924.fixed
+++ /dev/null
@@ -1,20 +0,0 @@
-// run-rustfix
-
-fn main() {
- let mut values = vec![10, 11, 12];
- let v = &mut values;
-
- let mut max = 0;
-
- for n in &mut *v {
- max = std::cmp::max(max, *n);
- }
-
- println!("max is {}", max);
- println!("Converting to percentages of maximum value...");
- for n in v {
- //~^ ERROR: use of moved value: `v` [E0382]
- *n = 100 * (*n) / max;
- }
- println!("values: {:#?}", values);
-}
diff --git a/tests/ui/issues/issue-83924.rs b/tests/ui/issues/issue-83924.rs
deleted file mode 100644
index 22b80fe2f..000000000
--- a/tests/ui/issues/issue-83924.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-// run-rustfix
-
-fn main() {
- let mut values = vec![10, 11, 12];
- let v = &mut values;
-
- let mut max = 0;
-
- for n in v {
- max = std::cmp::max(max, *n);
- }
-
- println!("max is {}", max);
- println!("Converting to percentages of maximum value...");
- for n in v {
- //~^ ERROR: use of moved value: `v` [E0382]
- *n = 100 * (*n) / max;
- }
- println!("values: {:#?}", values);
-}
diff --git a/tests/ui/issues/issue-83924.stderr b/tests/ui/issues/issue-83924.stderr
deleted file mode 100644
index 572414df2..000000000
--- a/tests/ui/issues/issue-83924.stderr
+++ /dev/null
@@ -1,22 +0,0 @@
-error[E0382]: use of moved value: `v`
- --> $DIR/issue-83924.rs:15:14
- |
-LL | let v = &mut values;
- | - move occurs because `v` has type `&mut Vec<i32>`, which does not implement the `Copy` trait
-...
-LL | for n in v {
- | - `v` moved due to this implicit call to `.into_iter()`
-...
-LL | for n in v {
- | ^ value used here after move
- |
-note: `into_iter` takes ownership of the receiver `self`, which moves `v`
- --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL
-help: consider creating a fresh reborrow of `v` here
- |
-LL | for n in &mut *v {
- | ++++++
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0382`.
diff --git a/tests/ui/issues/issue-92741.fixed b/tests/ui/issues/issue-92741.fixed
new file mode 100644
index 000000000..d07aeb6c0
--- /dev/null
+++ b/tests/ui/issues/issue-92741.fixed
@@ -0,0 +1,13 @@
+// run-rustfix
+fn main() {}
+fn _foo() -> bool {
+ if true { true } else { false }
+}
+
+fn _bar() -> bool {
+ if true { true } else { false }
+}
+
+fn _baz() -> bool {
+ if true { true } else { false }
+}
diff --git a/tests/ui/issues/issue-92741.rs b/tests/ui/issues/issue-92741.rs
new file mode 100644
index 000000000..413d5bf04
--- /dev/null
+++ b/tests/ui/issues/issue-92741.rs
@@ -0,0 +1,17 @@
+// run-rustfix
+fn main() {}
+fn _foo() -> bool {
+ & //~ ERROR 4:5: 6:36: mismatched types [E0308]
+ mut
+ if true { true } else { false }
+}
+
+fn _bar() -> bool {
+ & //~ ERROR 10:5: 11:40: mismatched types [E0308]
+ mut if true { true } else { false }
+}
+
+fn _baz() -> bool {
+ & mut //~ ERROR 15:5: 16:36: mismatched types [E0308]
+ if true { true } else { false }
+}
diff --git a/tests/ui/issues/issue-92741.stderr b/tests/ui/issues/issue-92741.stderr
new file mode 100644
index 000000000..49315e7a8
--- /dev/null
+++ b/tests/ui/issues/issue-92741.stderr
@@ -0,0 +1,49 @@
+error[E0308]: mismatched types
+ --> $DIR/issue-92741.rs:4:5
+ |
+LL | fn _foo() -> bool {
+ | ---- expected `bool` because of return type
+LL | / &
+LL | | mut
+LL | | if true { true } else { false }
+ | |___________________________________^ expected `bool`, found `&mut bool`
+ |
+help: consider removing the borrow
+ |
+LL - &
+LL - mut
+ |
+
+error[E0308]: mismatched types
+ --> $DIR/issue-92741.rs:10:5
+ |
+LL | fn _bar() -> bool {
+ | ---- expected `bool` because of return type
+LL | / &
+LL | | mut if true { true } else { false }
+ | |_______________________________________^ expected `bool`, found `&mut bool`
+ |
+help: consider removing the borrow
+ |
+LL - &
+LL - mut if true { true } else { false }
+LL + if true { true } else { false }
+ |
+
+error[E0308]: mismatched types
+ --> $DIR/issue-92741.rs:15:5
+ |
+LL | fn _baz() -> bool {
+ | ---- expected `bool` because of return type
+LL | / & mut
+LL | | if true { true } else { false }
+ | |___________________________________^ expected `bool`, found `&mut bool`
+ |
+help: consider removing the borrow
+ |
+LL - & mut
+ |
+
+error: aborting due to 3 previous errors
+
+For more information about this error, try `rustc --explain E0308`.