Skip to content

tests/ui/issues/: The Issues Strike Back [4/N] #144403

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

//@ run-pass

fn main() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
warning: unused closure that must be used
--> $DIR/issue-16256.rs:5:5
--> $DIR/unused-closure-warning-16256.rs:7:5
|
LL | |c: u8| buf.push(c);
| ^^^^^^^^^^^^^^^^^^^
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/15783

//@ dont-require-annotations: NOTE

pub fn foo(params: Option<&[&str]>) -> usize {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0308]: mismatched types
--> $DIR/issue-15783.rs:10:19
--> $DIR/array-slice-coercion-mismatch-15783.rs:12:19
|
LL | let msg = foo(x);
| --- ^ expected `Option<&[&str]>`, found `Option<&[&str; 1]>`
Expand All @@ -9,7 +9,7 @@ LL | let msg = foo(x);
= note: expected enum `Option<&[&str]>`
found enum `Option<&[&str; 1]>`
note: function defined here
--> $DIR/issue-15783.rs:3:8
--> $DIR/array-slice-coercion-mismatch-15783.rs:5:8
|
LL | pub fn foo(params: Option<&[&str]>) -> 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/15523

//@ run-pass
// Issue 15523: derive(PartialOrd) should use the provided
// discriminant values for the derived ordering.
Expand Down Expand Up @@ -28,7 +30,6 @@ fn main() {
assert!(Eu64::Pos2 < Eu64::PosMax);
assert!(Eu64::Pos1 < Eu64::PosMax);


assert!(Ei64::Pos2 > Ei64::Pos1);
assert!(Ei64::Pos2 > Ei64::Neg1);
assert!(Ei64::Pos1 > Ei64::Neg1);
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/15523

//@ run-pass
// Issue 15523: derive(PartialOrd) should use the provided
// discriminant values for the derived ordering.
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/15763

//@ run-pass
#![allow(unreachable_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/15063

//@ 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/15858

//@ run-pass
// FIXME(static_mut_refs): this could use an atomic
#![allow(static_mut_refs)]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
warning: method `do_something` is never used
--> $DIR/issue-15858.rs:7:8
--> $DIR/generic-drop-trait-bound-15858.rs:9:8
|
LL | trait Bar {
| --- method in this 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/16492

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

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

//@ run-pass

// FIXME(static_mut_refs): Do not allow `static_mut_refs` lint
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/16441

//@ 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/15094

#![feature(fn_traits, unboxed_closures)]

use std::{fmt, ops};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0053]: method `call_once` has an incompatible type for trait
--> $DIR/issue-15094.rs:11:5
--> $DIR/fn-traits-call-once-signature.rs:13:5
|
LL | fn call_once(self, _args: ()) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected "rust-call" fn, found "Rust" fn
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/15774

//@ edition: 2015
//@ run-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/15965

fn main() {
return
{ return () }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0282]: type annotations needed
--> $DIR/issue-15965.rs:3:9
--> $DIR/return-block-type-inference-15965.rs:5:9
|
LL | / { return () }
LL | |
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/15756

use std::slice::Chunks;
use std::slice::ChunksMut;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0277]: the size for values of type `[T]` cannot be known at compilation time
--> $DIR/issue-15756.rs:7:10
--> $DIR/chunk-iterator-mut-pattern.rs:9:10
|
LL | &mut something
| ^^^^^^^^^ 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/15673

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

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

pub struct Lexer<'a> {
input: &'a str,
}
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 `lexer`
--> $DIR/issue-15034.rs:17:9
--> $DIR/explicit-lifetime-required-15034.rs:19:9
|
LL | Parser { lexer: lexer }
| ^^^^^^^^^^^^^^^^^^^^^^^ 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/15735

//@ check-pass
#![allow(dead_code)]
struct A<'a> {
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/15167

// macro f should not be able to inject a reference to 'n'.

macro_rules! f { () => (n) }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0425]: cannot find value `n` in this scope
--> $DIR/issue-15167.rs:3:25
--> $DIR/macro-hygiene-scope-15167.rs:5:25
|
LL | macro_rules! f { () => (n) }
| ^ not found in this scope
Expand All @@ -10,7 +10,7 @@ LL | println!("{}", f!());
= note: this error originates in the macro `f` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0425]: cannot find value `n` in this scope
--> $DIR/issue-15167.rs:3:25
--> $DIR/macro-hygiene-scope-15167.rs:5:25
|
LL | macro_rules! f { () => (n) }
| ^ not found in this scope
Expand All @@ -21,7 +21,7 @@ LL | println!("{}", f!());
= note: this error originates in the macro `f` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0425]: cannot find value `n` in this scope
--> $DIR/issue-15167.rs:3:25
--> $DIR/macro-hygiene-scope-15167.rs:5:25
|
LL | macro_rules! f { () => (n) }
| ^ not found in this scope
Expand All @@ -32,7 +32,7 @@ LL | println!("{}", f!());
= note: this error originates in the macro `f` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0425]: cannot find value `n` in this scope
--> $DIR/issue-15167.rs:3:25
--> $DIR/macro-hygiene-scope-15167.rs:5:25
|
LL | macro_rules! f { () => (n) }
| ^ not found in this scope
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/15189

//@ run-pass
macro_rules! third {
($e:expr) => ({let x = 2; $e[x]})
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/15793

//@ 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/15571

//@ run-pass

fn match_on_local() {
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/15207

fn main() {
loop {
break.push(1) //~ ERROR no method named `push` found for type `!`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0599]: no method named `push` found for type `!` in the current scope
--> $DIR/issue-15207.rs:3:15
--> $DIR/never-type-method-call-15207.rs:5:15
|
LL | break.push(1)
| ^^^^ method not found in `!`
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/15896

// Regression test for #15896. It used to ICE rustc.

fn main() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0308]: mismatched types
--> $DIR/issue-15896.rs:11:11
--> $DIR/enum-struct-pattern-mismatch.rs:13:11
|
LL | let u = match e {
| - this expression has type `E`
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/15381

fn main() {
let values: Vec<u8> = vec![1,2,3,4,5,6,7,8];

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0005]: refutable pattern in `for` loop binding
--> $DIR/issue-15381.rs:4:9
--> $DIR/refutable-pattern-for-loop-15381.rs:6:9
|
LL | for &[x,y,z] in values.chunks(3).filter(|&xs| xs.len() == 3) {
| ^^^^^^^^ patterns `&[]`, `&[_]`, `&[_, _]` and 1 more not covered
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/15104

//@ 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/16149

extern "C" {
static externalValue: isize;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0530]: match bindings cannot shadow statics
--> $DIR/issue-16149.rs:7:9
--> $DIR/static-binding-shadow-16149.rs:9:9
|
LL | static externalValue: isize;
| ---------------------------- the static `externalValue` is defined here
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/15260

struct Foo {
a: usize,
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
error[E0025]: field `a` bound multiple times in the pattern
--> $DIR/issue-15260.rs:8:9
--> $DIR/struct-field-duplicate-binding.rs:10:9
|
LL | a: _,
| ---- first use of `a`
LL | a: _
| ^^^^ multiple uses of `a` in pattern

error[E0025]: field `a` bound multiple times in the pattern
--> $DIR/issue-15260.rs:14:9
--> $DIR/struct-field-duplicate-binding.rs:16:9
|
LL | a,
| - first use of `a`
LL | a: _
| ^^^^ multiple uses of `a` in pattern

error[E0025]: field `a` bound multiple times in the pattern
--> $DIR/issue-15260.rs:20:9
--> $DIR/struct-field-duplicate-binding.rs:22:9
|
LL | a,
| - first use of `a`
LL | a: _,
| ^^^^ multiple uses of `a` in pattern

error[E0025]: field `a` bound multiple times in the pattern
--> $DIR/issue-15260.rs:22:9
--> $DIR/struct-field-duplicate-binding.rs:24:9
|
LL | a,
| - first use of `a`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
//! Regression test for https://github.com/rust-lang/rust/issues/15129

//@ run-pass

pub enum T {
T1(()),
T2(())
T2(()),
}

pub enum V {
V1(isize),
V2(bool)
V2(bool),
}

fn foo(x: (T, V)) -> String {
match x {
(T::T1(()), V::V1(i)) => format!("T1(()), V1({})", i),
(T::T2(()), V::V2(b)) => format!("T2(()), V2({})", b),
_ => String::new()
(T::T1(()), V::V1(i)) => format!("T1(()), V1({})", i),
(T::T2(()), V::V2(b)) => format!("T2(()), V2({})", b),
_ => String::new(),
}
}


fn main() {
assert_eq!(foo((T::T1(()), V::V1(99))), "T1(()), V1(99)".to_string());
assert_eq!(foo((T::T2(()), V::V2(true))), "T2(()), V2(true)".to_string());
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/16401

struct Slice<T> {
data: *const T,
len: usize,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0308]: mismatched types
--> $DIR/issue-16401.rs:8:9
--> $DIR/unit-type-struct-pattern-mismatch.rs:10:9
|
LL | match () {
| -- this expression has type `()`
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/16452

//@ 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/15043

//@ run-pass

#![allow(warnings)]
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/15444

//@ run-pass

trait MyTrait {
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/15734

//@ run-pass
//@ revisions: current next
//@ ignore-compare-mode-next-solver (explicit revisions)
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/16048

trait NoLifetime {
fn get<'p, T : Test<'p>>(&self) -> T;
//~^ NOTE lifetimes in impl do not match this method in trait
Expand Down
Loading
Loading