Skip to content

tests/ui/issues/: The Issues Strike Back [3/N] #144400

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
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,5 @@
//! Regression test for https://github.com/rust-lang/rust/issues/14845

struct X {
a: [u8; 1]
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
error[E0606]: casting `&[u8; 1]` as `*mut u8` is invalid
--> $DIR/issue-14845.rs:7:14
--> $DIR/array-field-ptr-cast-14845.rs:9:14
|
LL | let _f = &x.a as *mut u8;
| ^^^^^^^^^^^^^^^

error[E0606]: casting `&[u8; 1]` as `*mut u8` is invalid
--> $DIR/issue-14845.rs:10:14
--> $DIR/array-field-ptr-cast-14845.rs:12:14
|
LL | let _v = &local as *mut u8;
| ^^^^^^^^^^^^^^^^^
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/14366

fn main() {
let _x = "test" as &dyn (::std::any::Any);
//~^ ERROR the size for values of type
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0277]: the size for values of type `str` cannot be known at compilation time
--> $DIR/issue-14366.rs:2:14
--> $DIR/trait-object-size-error-14366.rs:4:14
|
LL | let _x = "test" as &dyn (::std::any::Any);
| ^^^^^^ doesn't have a size known at compile-time
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/13808

//@ run-pass
#![allow(dead_code)]
#![allow(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/14399

//@ run-pass
// #14399
// We'd previously ICE if we had a method call whose return
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
warning: method `foo` is never used
--> $DIR/issue-14399.rs:11:14
--> $DIR/method-return-trait-object-14399.rs:13:14
|
LL | trait A { fn foo(&self) {} }
| - ^^^
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/13763

//@ run-pass
#![allow(dead_code)]

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/14875

//@ run-pass
//@ needs-unwind
//@ ignore-backends: gcc
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/14959

//@ check-pass

#![feature(fn_traits, unboxed_closures)]
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/14092

fn fn1(0: Box) {}
//~^ ERROR missing generics for struct `Box`

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0107]: missing generics for struct `Box`
--> $DIR/issue-14092.rs:1:11
--> $DIR/box-missing-generics-14092.rs:3:11
|
LL | fn fn1(0: Box) {}
| ^^^ expected at least 1 generic argument
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/14919

//@ run-pass
#![allow(unused_must_use)]
#![allow(dead_code)]
Expand Down
17 changes: 0 additions & 17 deletions tests/ui/issues/issue-14091-2.rs

This file was deleted.

17 changes: 0 additions & 17 deletions tests/ui/issues/issue-14091-2.stderr

This file was deleted.

4 changes: 0 additions & 4 deletions tests/ui/issues/issue-14091.rs

This file was deleted.

9 changes: 0 additions & 9 deletions tests/ui/issues/issue-14091.stderr

This file was deleted.

6 changes: 0 additions & 6 deletions tests/ui/issues/issue-14330.rs

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//! Regression test for https://github.com/rust-lang/rust/issues/14285

trait Foo {
fn dummy(&self) { }
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0621]: explicit lifetime required in the type of `a`
--> $DIR/issue-14285.rs:12:5
--> $DIR/explicit-lifetime-required-14285.rs:14:5
|
LL | B(a)
| ^^^^ lifetime `'a` required
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/13703

//@ check-pass

pub struct Foo<'a, 'b: 'a> { foo: &'a &'b isize }
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/13497

fn read_lines_borrowed1() -> Vec<
&str //~ ERROR missing lifetime specifier
> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0106]: missing lifetime specifier
--> $DIR/issue-13497.rs:2:5
--> $DIR/missing-lifetime-specifier-13497.rs:4:5
|
LL | &str
| ^ expected named lifetime 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/14901

//@ check-pass
pub trait Reader {}

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/13665

//@ run-pass

fn foo<'r>() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
//! Regression test for https://github.com/rust-lang/rust/issues/13497

fn read_lines_borrowed<'a>() -> Vec<&'a str> {
let rawLines: Vec<String> = vec!["foo ".to_string(), " bar".to_string()];
rawLines //~ ERROR cannot return value referencing local variable `rawLines`
.iter().map(|l| l.trim()).collect()
.iter()
.map(|l| l.trim())
.collect()
}

fn main() {}
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
error[E0515]: cannot return value referencing local variable `rawLines`
--> $DIR/issue-13497-2.rs:3:5
--> $DIR/return-reference-local-variable-13497.rs:5:5
|
LL | rawLines
| ^-------
| |
| _____`rawLines` is borrowed here
| |
LL | | .iter().map(|l| l.trim()).collect()
| |___________________________________________^ returns a value referencing data owned by the current function
LL | | .iter()
LL | | .map(|l| l.trim())
LL | | .collect()
| |__________________^ returns a value referencing data owned by the current function

error: aborting due to 1 previous error

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/14821

//@ run-pass
#![allow(dead_code)]
#![allow(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/14865

//@ run-pass
#![allow(dead_code)]

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/13867

//@ run-pass
// Test that codegen works correctly when there are multiple refutable
// patterns in match expression.
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/14393

//@ run-pass

fn main() {
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/13847

fn main() {
return.is_failure //~ ERROR no field `is_failure` on type `!`
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0609]: no field `is_failure` on type `!`
--> $DIR/issue-13847.rs:2:12
--> $DIR/field-access-never-type-13847.rs:4:12
|
LL | return.is_failure
| ^^^^^^^^^^ unknown field
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/14915

fn main() {
let x: Box<isize> = Box::new(0);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0369]: cannot add `{integer}` to `Box<isize>`
--> $DIR/issue-14915.rs:4:22
--> $DIR/box-arithmetic-14915.rs:6:22
|
LL | println!("{}", x + 1);
| - ^ - {integer}
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/13482

fn main() {
let x = [1,2];
let y = match x {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0527]: pattern requires 0 elements but array has 2
--> $DIR/issue-13482.rs:4:5
--> $DIR/array-length-mismatch-13482.rs:6:5
|
LL | [] => None,
| ^^ expected 2 elements
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0527]: pattern requires 0 elements but array has 2
--> $DIR/issue-13482-2.rs:6:9
--> $DIR/array-length-mismatch-verbose-13482.rs:6:9
|
LL | [] => None,
| ^^ expected 2 elements
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/14541

struct Vec2 { y: f32 }
struct Vec3 { y: f32, z: f32 }

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0308]: mismatched types
--> $DIR/issue-14541.rs:5:9
--> $DIR/struct-mismatch-destructure-14541.rs:7:9
|
LL | let Vec3 { y: _, z: _ } = v;
| ^^^^^^^^^^^^^^^^^^^ - this expression has type `Vec2`
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/14308

//@ run-pass

struct A(isize);
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/14254

//@ check-pass

trait Foo: Sized {
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/14082

//@ check-pass

#![allow(unused_imports, dead_code)]
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/13775

//@ edition: 2015
//@ check-pass

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/14229

//@ run-pass
trait Foo: Sized {
fn foo(self) {}
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/14853

use std::fmt::Debug;

trait Str {}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0276]: impl has stricter requirements than trait
--> $DIR/issue-14853.rs:12:15
--> $DIR/trait-bound-mismatch-14853.rs:14:15
|
LL | fn yay<T: Debug>(_: Option<Self>, thing: &[T]);
| ----------------------------------------------- definition of `yay` from trait
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/14382

//@ run-pass
#[derive(Debug)]
struct Matrix4<S>(#[allow(dead_code)] S);
Expand All @@ -13,5 +15,3 @@ fn main() {
let m : Matrix4<f32> = translate(x);
println!("m: {:?}", m);
}

// https://github.com/rust-lang/rust/issues/14382
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//! Regression test for https://github.com/rust-lang/rust/issues/14721

fn main() {
let foo = "str";
println!("{}", foo.desc); //~ ERROR no field `desc` on type `&str`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0609]: no field `desc` on type `&str`
--> $DIR/issue-14721.rs:3:24
--> $DIR/str-no-field-desc-14721.rs:5:24
|
LL | println!("{}", foo.desc);
| ^^^^ unknown field
Expand Down
Loading