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,4 @@
// https://github.com/rust-lang/rust/issues/6738
struct Foo<T> {
x: T,
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0368]: binary assignment operation `+=` cannot be applied to type `T`
--> $DIR/issue-6738.rs:6:9
--> $DIR/struct-field-generic-type-binary-assignment-error-6738.rs:7:9
|
LL | self.x += v.x;
| ------^^^^^^^
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// https://github.com/rust-lang/rust/issues/5884
//@ build-pass
#![allow(dead_code)]

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// https://github.com/rust-lang/rust/issues/5550
//@ run-pass
#![allow(unused_assignments)]

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// https://github.com/rust-lang/rust/issues/5708
//@ run-pass
#![allow(unused_variables)]
/*
Expand All @@ -10,7 +11,6 @@ This does not occur with concrete types, only with references
to traits.
*/


// original
trait Inner {
fn print(&self);
Expand Down Expand Up @@ -38,7 +38,6 @@ pub fn main() {
outer.inner.print();
}


// minimal
pub trait MyTrait<T> {
fn dummy(&self, t: T) -> T { panic!() }
Expand Down
7 changes: 7 additions & 0 deletions tests/ui/borrowck/trait-method-lifetime-substitution-5518.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// https://github.com/rust-lang/rust/issues/5518
//@ run-pass
//@ aux-build:aux-5518.rs

extern crate aux_5518 as other;

fn main() {}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// https://github.com/rust-lang/rust/issues/6557
//@ check-pass
#![allow(dead_code)]

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// https://github.com/rust-lang/rust/issues/6318
//@ run-pass

pub enum Thing {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// https://github.com/rust-lang/rust/issues/6153
//@ run-pass


fn swap<F>(f: F) -> Vec<isize> where F: FnOnce(Vec<isize>) -> Vec<isize> {
let x = vec![1, 2, 3];
f(x)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// https://github.com/rust-lang/rust/issues/7012
//@ run-pass
#![allow(non_camel_case_types)]
#![allow(non_upper_case_globals)]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// https://github.com/rust-lang/rust/issues/5900
//@ check-pass
#![allow(dead_code)]

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// https://github.com/rust-lang/rust/issues/5997
//@ run-pass
#![allow(dead_code)]

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// https://github.com/rust-lang/rust/issues/6117
//@ run-pass
#![allow(dead_code)]

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// https://github.com/rust-lang/rust/issues/5997
fn f<Z>() -> bool {
enum E { V(Z) }
//~^ ERROR can't use generic parameters from outer item
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0401]: can't use generic parameters from outer item
--> $DIR/issue-5997-enum.rs:2:16
--> $DIR/enum-definition-with-outer-generic-parameter-5997.rs:3:16
|
LL | fn f<Z>() -> bool {
| - type parameter from outer item
Expand Down
7 changes: 0 additions & 7 deletions tests/ui/issues/issue-5518.rs

This file was deleted.

7 changes: 0 additions & 7 deletions tests/ui/issues/issue-5844.rs

This file was deleted.

This file was deleted.

This file was deleted.

18 changes: 0 additions & 18 deletions tests/ui/issues/issue-6344-match.rs

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// https://github.com/rust-lang/rust/issues/5741
//@ run-pass
#![allow(while_true)]
#![allow(unreachable_code)]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// https://github.com/rust-lang/rust/issues/5554
//@ run-pass
#![allow(dead_code)]


pub struct X<T> {
a: T,
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// https://github.com/rust-lang/rust/issues/5718
//@ run-pass

struct Element;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
enum Either<T, U> { Left(T), Right(U) }
// https://github.com/rust-lang/rust/issues/5358
enum Either<T, U> {
Left(T),
Right(U),
}
struct S(Either<usize, usize>);

fn main() {
match S(Either::Left(5)) { //~ NOTE this expression has type `S`
match S(Either::Left(5)) {
//~^ NOTE this expression has type `S`
Either::Right(_) => {}
//~^ ERROR mismatched types
//~| NOTE expected `S`, found `Either<_, _>`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
error[E0308]: mismatched types
--> $DIR/issue-5358-1.rs:6:9
--> $DIR/mismatched-types-in-match-5358.rs:11:9
|
LL | match S(Either::Left(5)) {
| ------------------ this expression has type `S`
LL |
LL | Either::Right(_) => {}
| ^^^^^^^^^^^^^^^^ expected `S`, found `Either<_, _>`
|
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// https://github.com/rust-lang/rust/issues/5950
//@ check-pass


pub use local as local_alias;

pub mod local { }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// https://github.com/rust-lang/rust/issues/6130
//@ run-pass

pub 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/5572
//@ check-pass
#![allow(dead_code)]

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// https://github.com/rust-lang/rust/issues/6919
//@ run-pass
#![allow(unused_attributes)]
//@ aux-build:iss.rs

//@ aux-build:iss-6919.rs

extern crate issue6919_3;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// https://github.com/rust-lang/rust/issues/6936
struct T;

mod t1 {
Expand Down Expand Up @@ -30,5 +31,4 @@ mod t6 {
impl Foo {} // ok
}


fn main() {}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0428]: the name `Foo` is defined multiple times
--> $DIR/issue-6936.rs:5:5
--> $DIR/duplicate-name-in-module-6936.rs:6:5
|
LL | type Foo = crate::T;
| -------------------- previous definition of the type `Foo` here
Expand All @@ -9,7 +9,7 @@ LL | mod Foo {}
= note: `Foo` must be defined only once in the type namespace of this module

error[E0428]: the name `Foo` is defined multiple times
--> $DIR/issue-6936.rs:10:5
--> $DIR/duplicate-name-in-module-6936.rs:11:5
|
LL | type Foo = crate::T;
| -------------------- previous definition of the type `Foo` here
Expand All @@ -19,7 +19,7 @@ LL | struct Foo;
= note: `Foo` must be defined only once in the type namespace of this module

error[E0428]: the name `Foo` is defined multiple times
--> $DIR/issue-6936.rs:15:5
--> $DIR/duplicate-name-in-module-6936.rs:16:5
|
LL | type Foo = crate::T;
| -------------------- previous definition of the type `Foo` here
Expand All @@ -29,7 +29,7 @@ LL | enum Foo {}
= note: `Foo` must be defined only once in the type namespace of this module

error[E0428]: the name `Bar` is defined multiple times
--> $DIR/issue-6936.rs:25:5
--> $DIR/duplicate-name-in-module-6936.rs:26:5
|
LL | type Bar<T> = T;
| ---------------- previous definition of the type `Bar` here
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// https://github.com/rust-lang/rust/issues/5917
//@ run-pass
#![allow(non_upper_case_globals)]

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// https://github.com/rust-lang/rust/issues/5688
//@ run-pass
/*
# Corrupted initialization in the static struct
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// https://github.com/rust-lang/rust/issues/6344
//@ run-pass
#![allow(non_shorthand_field_patterns)]

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// https://github.com/rust-lang/rust/issues/5439
struct Foo {
foo: isize,
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0560]: struct `Foo` has no field named `nonexistent`
--> $DIR/issue-5439.rs:11:31
--> $DIR/nonexistent-struct-field-error-5439.rs:12:31
|
LL | return Box::new(Foo { nonexistent: self, foo: i });
| ^^^^^^^^^^^ `Foo` does not have this field
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// https://github.com/rust-lang/rust/issues/5666
//@ run-pass

struct Dog {
Expand All @@ -14,7 +15,6 @@ impl Barks for Dog {
}
}


pub fn main() {
let snoopy = Box::new(Dog{name: "snoopy".to_string()});
let bubbles = Box::new(Dog{name: "bubbles".to_string()});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// https://github.com/rust-lang/rust/issues/5883
trait A {}

struct Struct {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
error[E0277]: the size for values of type `(dyn A + 'static)` cannot be known at compilation time
--> $DIR/issue-5883.rs:9:6
--> $DIR/opaque-trait-size-error-5883.rs:10:6
|
LL | ) -> Struct {
| ^^^^^^ doesn't have a size known at compile-time
|
= help: within `Struct`, the trait `Sized` is not implemented for `(dyn A + 'static)`
note: required because it appears within the type `Struct`
--> $DIR/issue-5883.rs:3:8
--> $DIR/opaque-trait-size-error-5883.rs:4:8
|
LL | struct Struct {
| ^^^^^^
= note: the return type of a function must have a statically known size

error[E0277]: the size for values of type `(dyn A + 'static)` cannot be known at compilation time
--> $DIR/issue-5883.rs:8:8
--> $DIR/opaque-trait-size-error-5883.rs:9:8
|
LL | r: dyn A + 'static
| ^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// https://github.com/rust-lang/rust/issues/6898
//@ check-pass

use std::mem;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// https://github.com/rust-lang/rust/issues/5988
//@ run-pass

trait B {
Expand Down
8 changes: 8 additions & 0 deletions tests/ui/unsafe/extern-function-requires-unsafe-5844.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// https://github.com/rust-lang/rust/issues/5844
//@aux-build:aux-5844.rs

extern crate aux_5844;

fn main() {
aux_5844::rand(); //~ ERROR: requires unsafe
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
error[E0133]: call to unsafe function `rand` is unsafe and requires unsafe function or block
--> $DIR/issue-5844.rs:6:5
--> $DIR/extern-function-requires-unsafe-5844.rs:7:5
|
LL | issue_5844_aux::rand();
| ^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function
LL | aux_5844::rand();
| ^^^^^^^^^^^^^^^^ call to unsafe function
|
= note: consult the function's documentation for information on how to avoid undefined behavior

Expand Down
Loading