Skip to content
Merged
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,5 @@
//! regression test for <https://github.com/rust-lang/rust/issues/38919>

fn foo<T: Iterator>() {
T::Item; //~ ERROR no associated item named `Item` found
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0599]: no associated item named `Item` found for type parameter `T` in the current scope
--> $DIR/issue-38919.rs:2:8
--> $DIR/associated-type-as-value.rs:4:8
|
LL | fn foo<T: Iterator>() {
| - associated item `Item` not found for this type parameter
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//! regression test for <https://github.com/rust-lang/rust/issues/17441>

fn main() {
let _foo = &[1_usize, 2] as [usize];
//~^ ERROR cast to unsized type: `&[usize; 2]` as `[usize]`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0620]: cast to unsized type: `&[usize; 2]` as `[usize]`
--> $DIR/issue-17441.rs:2:16
--> $DIR/cast-to-unsized-type.rs:4:16
|
LL | let _foo = &[1_usize, 2] as [usize];
| ^^^^^^^^^^^^^^^^^^^^^^^^
Expand All @@ -10,7 +10,7 @@ LL | let _foo = &[1_usize, 2] as &[usize];
| +

error[E0620]: cast to unsized type: `Box<usize>` as `dyn Debug`
--> $DIR/issue-17441.rs:5:16
--> $DIR/cast-to-unsized-type.rs:7:16
|
LL | let _bar = Box::new(1_usize) as dyn std::fmt::Debug;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand All @@ -21,25 +21,25 @@ LL | let _bar = Box::new(1_usize) as Box<dyn std::fmt::Debug>;
| ++++ +

error[E0620]: cast to unsized type: `usize` as `dyn Debug`
--> $DIR/issue-17441.rs:8:16
--> $DIR/cast-to-unsized-type.rs:10:16
|
LL | let _baz = 1_usize as dyn std::fmt::Debug;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
help: consider using a box or reference as appropriate
--> $DIR/issue-17441.rs:8:16
--> $DIR/cast-to-unsized-type.rs:10:16
|
LL | let _baz = 1_usize as dyn std::fmt::Debug;
| ^^^^^^^

error[E0620]: cast to unsized type: `[usize; 2]` as `[usize]`
--> $DIR/issue-17441.rs:11:17
--> $DIR/cast-to-unsized-type.rs:13:17
|
LL | let _quux = [1_usize, 2] as [usize];
| ^^^^^^^^^^^^^^^^^^^^^^^
|
help: consider using a box or reference as appropriate
--> $DIR/issue-17441.rs:11:17
--> $DIR/cast-to-unsized-type.rs:13:17
|
LL | let _quux = [1_usize, 2] as [usize];
| ^^^^^^^^^^^^
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//! regression test for <https://github.com/rust-lang/rust/issues/2995>

fn bad (p: *const isize) {
let _q: &isize = p as &isize; //~ ERROR non-primitive cast
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0605]: non-primitive cast: `*const isize` as `&isize`
--> $DIR/issue-2995.rs:2:22
--> $DIR/non-primitive-isize-ref-cast.rs:4:22
|
LL | let _q: &isize = p as &isize;
| ^^^^^^^^^^^ invalid cast
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//! regression test for <https://github.com/rust-lang/rust/issues/19922>

enum Homura {
Akemi { madoka: () }
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0559]: variant `Homura::Akemi` has no field named `kaname`
--> $DIR/issue-19922.rs:6:34
--> $DIR/enum-nonexisting-field.rs:8:34
|
LL | let homura = Homura::Akemi { kaname: () };
| ^^^^^^ `Homura::Akemi` does not have this field
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//! regression test for <https://github.com/rust-lang/rust/issues/17351>
//@ run-pass

trait Str { fn foo(&self) {} } //~ WARN method `foo` is never used
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
warning: method `foo` is never used
--> $DIR/issue-17351.rs:3:16
--> $DIR/unused-trait-fn.rs:4:16
|
LL | trait Str { fn foo(&self) {} }
| --- ^^^
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//! regression test for <https://github.com/rust-lang/rust/issues/22599>
#![deny(unused_variables)]

fn f(_: i32) {}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
error: unused variable: `a`
--> $DIR/issue-22599.rs:8:19
--> $DIR/unused-var-in-match-arm.rs:9:19
|
LL | v = match 0 { a => 0 };
| ^ help: if this is intentional, prefix it with an underscore: `_a`
|
note: the lint level is defined here
--> $DIR/issue-22599.rs:1:9
--> $DIR/unused-var-in-match-arm.rs:2:9
|
LL | #![deny(unused_variables)]
| ^^^^^^^^^^^^^^^^
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//! regression test for <https://github.com/rust-lang/rust/issues/19692>

struct Homura;

fn akemi(homura: Homura) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0599]: no method named `kaname` found for struct `Homura` in the current scope
--> $DIR/issue-19692.rs:4:40
--> $DIR/method-not-found-on-struct.rs:6:40
|
LL | struct Homura;
| ------------- method `kaname` not found for this struct
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//! regression test for <https://github.com/rust-lang/rust/issues/34209>
enum S {
A,
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0599]: no variant named `B` found for enum `S`
--> $DIR/issue-34209.rs:7:12
--> $DIR/enum-variant-not-found.rs:9:12
|
LL | enum S {
| ------ variant `B` not found here
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//! regression test for <https://github.com/rust-lang/rust/issues/16745>
//@ run-pass
fn main() {
const X: u8 = 0;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//! auxiliary crate for <https://github.com/rust-lang/rust/issues/11680>

enum Foo {
Bar(isize)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
//@ aux-build:issue-11680.rs
//! regression test for <https://github.com/rust-lang/rust/issues/11680>
//@ aux-build:imported-enum-is-private.rs

extern crate issue_11680 as other;
extern crate imported_enum_is_private as other;

fn main() {
let _b = other::Foo::Bar(1);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
error[E0603]: enum `Foo` is private
--> $DIR/issue-11680.rs:6:21
--> $DIR/imported-enum-is-private.rs:7:21
|
LL | let _b = other::Foo::Bar(1);
| ^^^ --- tuple variant `Bar` is not publicly re-exported
| |
| private enum
|
note: the enum `Foo` is defined here
--> $DIR/auxiliary/issue-11680.rs:1:1
--> $DIR/auxiliary/imported-enum-is-private.rs:3:1
|
LL | enum Foo {
| ^^^^^^^^

error[E0603]: enum `Foo` is private
--> $DIR/issue-11680.rs:9:27
--> $DIR/imported-enum-is-private.rs:10:27
|
LL | let _b = other::test::Foo::Bar(1);
| ^^^ --- tuple variant `Bar` is not publicly re-exported
| |
| private enum
|
note: the enum `Foo` is defined here
--> $DIR/auxiliary/issue-11680.rs:6:5
--> $DIR/auxiliary/imported-enum-is-private.rs:8:5
|
LL | enum Foo {
| ^^^^^^^^
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//! regression test for <https://github.com/rust-lang/rust/issues/26472>

mod sub {
pub struct S { len: usize }
impl S {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0616]: field `len` of struct `S` is private
--> $DIR/issue-26472.rs:11:15
--> $DIR/private-struct-field-in-module.rs:13:15
|
LL | let v = s.len;
| ^^^ private field
Expand All @@ -10,7 +10,7 @@ LL | let v = s.len();
| ++

error[E0616]: field `len` of struct `S` is private
--> $DIR/issue-26472.rs:12:7
--> $DIR/private-struct-field-in-module.rs:14:7
|
LL | s.len = v;
| ^^^ private field
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//! regression test for <https://github.com/rust-lang/rust/issues/16966>
//@ edition:2015..2021
fn main() {
panic!(std::default::Default::default());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0283]: type annotations needed
--> $DIR/issue-16966.rs:3:12
--> $DIR/panic-with-unspecified-type.rs:4:12
|
LL | panic!(std::default::Default::default());
| -------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//! regression test for <https://github.com/rust-lang/rust/issues/25368>

use std::sync::mpsc::channel;
use std::thread::spawn;
use std::marker::PhantomData;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0282]: type annotations needed
--> $DIR/issue-25368.rs:11:27
--> $DIR/send-with-unspecified-type.rs:13:27
|
LL | tx.send(Foo{ foo: PhantomData });
| ^^^^^^^^^^^ cannot infer type of the type parameter `T` declared on the struct `PhantomData`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//! regression test for <https://github.com/rust-lang/rust/issues/24013>

fn main() {
use std::mem::{transmute, swap};
let a = 1;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0282]: type annotations needed
--> $DIR/issue-24013.rs:5:13
--> $DIR/swap-with-unspecified-type.rs:7:13
|
LL | unsafe {swap::<&mut _>(transmute(&a), transmute(&b))};
| ^^^^^^^^^^^^^^ cannot infer type of the type parameter `T` declared on the function `swap`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//! regression test for <https://github.com/rust-lang/rust/issues/35241>

struct Foo(u32);

fn test() -> Foo { Foo } //~ ERROR mismatched types
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0308]: mismatched types
--> $DIR/issue-35241.rs:3:20
--> $DIR/struct-constructor-as-value.rs:5:20
|
LL | struct Foo(u32);
| ---------- `Foo` defines a struct constructor here, which should be called
Expand Down
Loading