Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// https://github.com/rust-lang/rust/issues/68010
//@ build-pass

fn main() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// https://github.com/rust-lang/rust/issues/65230
trait T0 {}
trait T1: T0 {}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
error[E0308]: mismatched types
--> $DIR/issue-65230.rs:8:13
--> $DIR/mismatched-types-in-trait-impl-65230.rs:9:13
|
LL | impl T1 for &dyn T2 {}
| ^^^^^^^ lifetime mismatch
|
= note: expected trait `<&dyn T2 as T0>`
found trait `<&(dyn T2 + 'static) as T0>`
note: the anonymous lifetime as defined here...
--> $DIR/issue-65230.rs:8:13
--> $DIR/mismatched-types-in-trait-impl-65230.rs:9:13
|
LL | impl T1 for &dyn T2 {}
| ^
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// https://github.com/rust-lang/rust/issues/66702
// Breaks with values inside closures used to ICE (#66863)

fn main() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0767]: use of unreachable label `'some_label`
--> $DIR/issue-66702-break-outside-loop-val.rs:5:18
--> $DIR/labeled-break-in-async-fn-ice-66702.rs:6:18
|
LL | 'some_label: loop {
| ----------- unreachable label defined here
Expand All @@ -9,7 +9,7 @@ LL | || break 'some_label ();
= note: labels are unreachable through functions, closures, async blocks and modules

error[E0267]: `break` inside of a closure
--> $DIR/issue-66702-break-outside-loop-val.rs:5:12
--> $DIR/labeled-break-in-async-fn-ice-66702.rs:6:12
|
LL | || break 'some_label ();
| -- ^^^^^^^^^^^^^^^^^^^^ cannot `break` inside of a closure
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// https://github.com/rust-lang/rust/issues/61108
fn main() {
let mut bad_letters = vec!['e', 't', 'o', 'i'];
for l in bad_letters {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0382]: borrow of moved value: `bad_letters`
--> $DIR/issue-61108.rs:6:5
--> $DIR/borrow-of-moved-value-in-for-loop-61108.rs:7:5
|
LL | let mut bad_letters = vec!['e', 't', 'o', 'i'];
| --------------- move occurs because `bad_letters` has type `Vec<char>`, which does not implement the `Copy` trait
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// https://github.com/rust-lang/rust/issues/64559
fn main() {
let orig = vec![true];
for _val in orig {}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0382]: use of moved value: `orig`
--> $DIR/issue-64559.rs:4:20
--> $DIR/moved-value-in-closure-suggestion-64559.rs:5:20
|
LL | let orig = vec![true];
| ---- move occurs because `orig` has type `Vec<bool>`, which does not implement the `Copy` trait
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// https://github.com/rust-lang/rust/issues/65131
fn get_pair(_a: &mut u32, _b: &mut u32) {}

macro_rules! x10 {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0499]: cannot borrow `x` as mutable more than once at a time
--> $DIR/issue-65131.rs:14:22
--> $DIR/multiple-mutable-borrows-error-65131.rs:15:22
|
LL | get_pair(&mut x, &mut x);
| -------- ------ ^^^^^^ second mutable borrow occurs here
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// https://github.com/rust-lang/rust/issues/61623
fn f1<'a>(_: &'a mut ()) {}

fn f2<P>(_: P, _: ()) {}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0596]: cannot borrow `*x.1` as mutable, as it is behind a `&` reference
--> $DIR/issue-61623.rs:6:19
--> $DIR/mutable-borrow-behind-reference-61623.rs:7:19
|
LL | f2(|| x.0, f1(x.1))
| ^^^ `x` is a `&` reference, so the data it refers to cannot be borrowed as mutable
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// https://github.com/rust-lang/rust/issues/62480
fn main() {
// This used to ICE during liveness check because `target_id` passed to
// `propagate_through_expr` would be the closure and not the `loop`, which wouldn't be found in
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0767]: use of unreachable label `'a`
--> $DIR/issue-62480.rs:6:18
--> $DIR/labeled-break-inside-closure-62480.rs:7:18
|
LL | 'a: {
| -- unreachable label defined here
Expand All @@ -9,7 +9,7 @@ LL | || break 'a
= note: labels are unreachable through functions, closures, async blocks and modules

error[E0267]: `break` inside of a closure
--> $DIR/issue-62480.rs:6:12
--> $DIR/labeled-break-inside-closure-62480.rs:7:12
|
LL | || break 'a
| -- ^^^^^^^^ cannot `break` inside of a closure
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// https://github.com/rust-lang/rust/issues/66308
//@ build-pass
//@ compile-flags: --crate-type lib -C opt-level=0

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// https://github.com/rust-lang/rust/issues/66706
fn a() {
[0; [|_: _ &_| ()].len()]
//~^ ERROR expected one of `,` or `|`, found `&`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,41 +1,41 @@
error: expected one of `,` or `|`, found `&`
--> $DIR/issue-66706.rs:2:16
--> $DIR/closure-type-error-during-const-eval-66706.rs:3:16
|
LL | [0; [|_: _ &_| ()].len()]
| -^ expected one of `,` or `|`
| |
| help: missing `,`

error: expected identifier, found reserved identifier `_`
--> $DIR/issue-66706.rs:8:20
--> $DIR/closure-type-error-during-const-eval-66706.rs:9:20
|
LL | [0; [|f @ &ref _| {} ; 0 ].len() ];
| ^ expected identifier, found reserved identifier

error: expected one of `,` or `|`, found `&`
--> $DIR/issue-66706.rs:13:17
--> $DIR/closure-type-error-during-const-eval-66706.rs:14:17
|
LL | [0; [|&_: _ &_| {}; 0 ].len()]
| -^ expected one of `,` or `|`
| |
| help: missing `,`

error: expected identifier, found reserved identifier `_`
--> $DIR/issue-66706.rs:19:26
--> $DIR/closure-type-error-during-const-eval-66706.rs:20:26
|
LL | [0; match [|f @ &ref _| () ] {} ]
| ----- ^ expected identifier, found reserved identifier
| |
| while parsing this `match` expression

error[E0282]: type annotations needed
--> $DIR/issue-66706.rs:2:14
--> $DIR/closure-type-error-during-const-eval-66706.rs:3:14
|
LL | [0; [|_: _ &_| ()].len()]
| ^ cannot infer type

error[E0282]: type annotations needed
--> $DIR/issue-66706.rs:13:11
--> $DIR/closure-type-error-during-const-eval-66706.rs:14:11
|
LL | [0; [|&_: _ &_| {}; 0 ].len()]
| ^^^^^ cannot infer type
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// https://github.com/rust-lang/rust/issues/66667
fn first() {
second == 1 //~ ERROR binary operation
//~^ ERROR mismatched types
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
error[E0369]: binary operation `==` cannot be applied to type `fn() {second}`
--> $DIR/issue-66667-function-cmp-cycle.rs:2:12
--> $DIR/cycle-error-comparing-function-inside-itself-66667.rs:3:12
|
LL | second == 1
| ------ ^^ - {integer}
| |
| fn() {second}

error[E0308]: mismatched types
--> $DIR/issue-66667-function-cmp-cycle.rs:2:15
--> $DIR/cycle-error-comparing-function-inside-itself-66667.rs:3:15
|
LL | second == 1
| ^ expected fn item, found integer
Expand All @@ -16,23 +16,23 @@ LL | second == 1
found type `{integer}`

error[E0308]: mismatched types
--> $DIR/issue-66667-function-cmp-cycle.rs:2:5
--> $DIR/cycle-error-comparing-function-inside-itself-66667.rs:3:5
|
LL | fn first() {
| - help: try adding a return type: `-> bool`
LL | second == 1
| ^^^^^^^^^^^ expected `()`, found `bool`

error[E0369]: binary operation `==` cannot be applied to type `fn() {first}`
--> $DIR/issue-66667-function-cmp-cycle.rs:8:11
--> $DIR/cycle-error-comparing-function-inside-itself-66667.rs:9:11
|
LL | first == 1
| ----- ^^ - {integer}
| |
| fn() {first}

error[E0308]: mismatched types
--> $DIR/issue-66667-function-cmp-cycle.rs:8:14
--> $DIR/cycle-error-comparing-function-inside-itself-66667.rs:9:14
|
LL | first == 1
| ^ expected fn item, found integer
Expand All @@ -41,23 +41,23 @@ LL | first == 1
found type `{integer}`

error[E0308]: mismatched types
--> $DIR/issue-66667-function-cmp-cycle.rs:8:5
--> $DIR/cycle-error-comparing-function-inside-itself-66667.rs:9:5
|
LL | fn second() {
| - help: try adding a return type: `-> bool`
LL | first == 1
| ^^^^^^^^^^ expected `()`, found `bool`

error[E0369]: binary operation `==` cannot be applied to type `fn() {bar}`
--> $DIR/issue-66667-function-cmp-cycle.rs:14:9
--> $DIR/cycle-error-comparing-function-inside-itself-66667.rs:15:9
|
LL | bar == 1
| --- ^^ - {integer}
| |
| fn() {bar}

error[E0308]: mismatched types
--> $DIR/issue-66667-function-cmp-cycle.rs:14:12
--> $DIR/cycle-error-comparing-function-inside-itself-66667.rs:15:12
|
LL | bar == 1
| ^ expected fn item, found integer
Expand All @@ -66,7 +66,7 @@ LL | bar == 1
found type `{integer}`

error[E0308]: mismatched types
--> $DIR/issue-66667-function-cmp-cycle.rs:14:5
--> $DIR/cycle-error-comparing-function-inside-itself-66667.rs:15:5
|
LL | fn bar() {
| - help: try adding a return type: `-> bool`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// https://github.com/rust-lang/rust/issues/64593
//@ check-pass
#![deny(improper_ctypes)]

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// https://github.com/rust-lang/rust/issues/69306
fn main() {}

struct S0<T>(T);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0308]: mismatched types
--> $DIR/issue-69306.rs:5:28
--> $DIR/generic-struct-self-unconstrained-inference-vars-69306:6:28
|
LL | impl<T> S0<T> {
| - expected this type parameter
Expand All @@ -11,13 +11,13 @@ LL | const C: S0<u8> = Self(0);
= note: expected type parameter `T`
found type `{integer}`
note: tuple struct defined here
--> $DIR/issue-69306.rs:3:8
--> $DIR/generic-struct-self-unconstrained-inference-vars-69306:4:8
|
LL | struct S0<T>(T);
| ^^

error[E0308]: mismatched types
--> $DIR/issue-69306.rs:5:23
--> $DIR/generic-struct-self-unconstrained-inference-vars-69306:6:23
|
LL | impl<T> S0<T> {
| - found this type parameter
Expand All @@ -28,7 +28,7 @@ LL | const C: S0<u8> = Self(0);
found struct `S0<T>`

error[E0308]: mismatched types
--> $DIR/issue-69306.rs:10:14
--> $DIR/generic-struct-self-unconstrained-inference-vars-69306:11:14
|
LL | impl<T> S0<T> {
| - expected this type parameter
Expand All @@ -41,13 +41,13 @@ LL | Self(0);
= note: expected type parameter `T`
found type `{integer}`
note: tuple struct defined here
--> $DIR/issue-69306.rs:3:8
--> $DIR/generic-struct-self-unconstrained-inference-vars-69306:4:8
|
LL | struct S0<T>(T);
| ^^

error[E0308]: mismatched types
--> $DIR/issue-69306.rs:27:14
--> $DIR/generic-struct-self-unconstrained-inference-vars-69306:28:14
|
LL | impl<T> Foo<T> for <S0<T> as Fun>::Out {
| - expected this type parameter
Expand All @@ -60,13 +60,13 @@ LL | Self(0);
= note: expected type parameter `T`
found type `{integer}`
note: tuple struct defined here
--> $DIR/issue-69306.rs:3:8
--> $DIR/generic-struct-self-unconstrained-inference-vars-69306:4:8
|
LL | struct S0<T>(T);
| ^^

error[E0308]: mismatched types
--> $DIR/issue-69306.rs:33:32
--> $DIR/generic-struct-self-unconstrained-inference-vars-69306:34:32
|
LL | impl<T> S1<T, u8> {
| - expected this type parameter
Expand All @@ -78,13 +78,13 @@ LL | const C: S1<u8, u8> = Self(0, 1);
= note: expected type parameter `T`
found type `{integer}`
note: tuple struct defined here
--> $DIR/issue-69306.rs:31:8
--> $DIR/generic-struct-self-unconstrained-inference-vars-69306:32:8
|
LL | struct S1<T, U>(T, U);
| ^^

error[E0308]: mismatched types
--> $DIR/issue-69306.rs:33:27
--> $DIR/generic-struct-self-unconstrained-inference-vars-69306:34:27
|
LL | impl<T> S1<T, u8> {
| - found this type parameter
Expand All @@ -95,7 +95,7 @@ LL | const C: S1<u8, u8> = Self(0, 1);
found struct `S1<T, _>`

error[E0308]: mismatched types
--> $DIR/issue-69306.rs:41:14
--> $DIR/generic-struct-self-unconstrained-inference-vars-69306:42:14
|
LL | impl<T> S2<T> {
| - expected type parameter
Expand All @@ -111,13 +111,13 @@ LL | Self(x)
= note: a type parameter was expected, but a different one was found; you might be missing a type parameter or trait bound
= note: for more information, visit https://doc.rust-lang.org/book/ch10-02-traits.html#traits-as-parameters
note: tuple struct defined here
--> $DIR/issue-69306.rs:38:8
--> $DIR/generic-struct-self-unconstrained-inference-vars-69306:39:8
|
LL | struct S2<T>(T);
| ^^

error[E0308]: mismatched types
--> $DIR/issue-69306.rs:41:9
--> $DIR/generic-struct-self-unconstrained-inference-vars-69306:42:9
|
LL | impl<T> S2<T> {
| - found type parameter
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// https://github.com/rust-lang/rust/issues/68951
//@ check-pass

fn main() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// https://github.com/rust-lang/rust/issues/60622
#![deny(warnings)]

struct Borked {}
Expand Down
Loading
Loading