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/35139>.

use std::fmt;

pub trait MethodType {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0207]: the lifetime parameter `'a` is not constrained by the impl trait, self type, or predicates
--> $DIR/issue-35139.rs:9:6
--> $DIR/unconstrained-dyn-assoc-type-lifetime.rs:11:6
|
LL | impl<'a> MethodType for MTFn {
| ^^ unconstrained lifetime parameter
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//! Regression test for <https://github.com/rust-lang/rust/issues/34334>.
//! Test tuple pattern syntax doesn't ICE on erroneous type.

fn main () {
let sr: Vec<(u32, _, _) = vec![];
//~^ ERROR expected one of
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error: expected one of `,`, `:`, or `>`, found `=`
--> $DIR/issue-34334.rs:2:29
--> $DIR/tuple-binder-on-err-ty.rs:5:29
|
LL | let sr: Vec<(u32, _, _) = vec![];
| - ^ expected one of `,`, `:`, or `>`
Expand All @@ -12,7 +12,7 @@ LL | let sr: Vec<(u32, _, _)> = vec![];
| +

error[E0277]: a value of type `Vec<(u32, _, _)>` cannot be built from an iterator over elements of type `()`
--> $DIR/issue-34334.rs:5:87
--> $DIR/tuple-binder-on-err-ty.rs:8:87
|
LL | let sr2: Vec<(u32, _, _)> = sr.iter().map(|(faction, th_sender, th_receiver)| {}).collect();
| ^^^^^^^ value of type `Vec<(u32, _, _)>` cannot be built from `std::iter::Iterator<Item=()>`
Expand All @@ -22,7 +22,7 @@ help: the trait `FromIterator<()>` is not implemented for `Vec<(u32, _, _)>`
--> $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
= help: for that trait implementation, expected `(u32, _, _)`, found `()`
note: the method call chain might not have had the expected associated types
--> $DIR/issue-34334.rs:5:43
--> $DIR/tuple-binder-on-err-ty.rs:8:43
|
LL | let sr: Vec<(u32, _, _) = vec![];
| ------ this expression has type `Vec<(_, _, _)>`
Expand Down
9 changes: 9 additions & 0 deletions tests/ui/errors/error-count.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
//! Regression test for <https://github.com/rust-lang/rust/issues/33525>.
//! Test rustc emits right error count.
//! (this used to return `aborting due to 2 previous errors`)

fn main() {
a; //~ ERROR cannot find value `a`
"".lorem; //~ ERROR no field
"".ipsum; //~ ERROR no field
}
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
error[E0425]: cannot find value `a` in this scope
--> $DIR/issue-33525.rs:2:5
--> $DIR/error-count.rs:6:5
|
LL | a;
| ^ not found in this scope

error[E0609]: no field `lorem` on type `&'static str`
--> $DIR/issue-33525.rs:3:8
--> $DIR/error-count.rs:7:8
|
LL | "".lorem;
| ^^^^^ unknown field

error[E0609]: no field `ipsum` on type `&'static str`
--> $DIR/issue-33525.rs:4:8
--> $DIR/error-count.rs:8:8
|
LL | "".ipsum;
| ^^^^^ unknown field
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//! Regression test for <https://github.com/rust-lang/rust/issues/34373>.
//! Test cyclic default type param through alias doesn't ICE.

#![allow(warnings)]
//@ ignore-parallel-frontend query cycle
trait Trait<T> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
error[E0391]: cycle detected when computing type of `Foo::T`
--> $DIR/issue-34373.rs:7:34
--> $DIR/cyclic-default-type-param-via-alias.rs:10:34
|
LL | pub struct Foo<T = Box<dyn Trait<DefaultFoo>>>;
| ^^^^^^^^^^
|
note: ...which requires expanding type alias `DefaultFoo`...
--> $DIR/issue-34373.rs:9:19
--> $DIR/cyclic-default-type-param-via-alias.rs:12:19
|
LL | type DefaultFoo = Foo;
| ^^^
= note: ...which again requires computing type of `Foo::T`, completing the cycle
note: cycle used when checking that `Foo` is well-formed
--> $DIR/issue-34373.rs:7:1
--> $DIR/cyclic-default-type-param-via-alias.rs:10:1
|
LL | pub struct Foo<T = Box<dyn Trait<DefaultFoo>>>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down
9 changes: 0 additions & 9 deletions tests/ui/issues/issue-33504.rs

This file was deleted.

5 changes: 0 additions & 5 deletions tests/ui/issues/issue-33525.rs

This file was deleted.

11 changes: 0 additions & 11 deletions tests/ui/issues/issue-34751.rs

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
error[E0271]: expected `Iter<'_, _, _>` to be an iterator that yields `&_`, but it yields `(&_, &_)`
--> $DIR/issue-33941.rs:9:36
--> $DIR/cloned-hashmap-iter-type-mismatch-diag.rs:12:36
|
LL | for _ in HashMap::new().iter().cloned() {}
| ^^^^^^ expected `&_`, found `(&_, &_)`
|
= note: expected reference `&_`
found tuple `(&_, &_)`
note: the method call chain might not have had the expected associated types
--> $DIR/issue-33941.rs:9:29
--> $DIR/cloned-hashmap-iter-type-mismatch-diag.rs:12:29
|
LL | for _ in HashMap::new().iter().cloned() {}
| -------------- ^^^^^^ `Iterator::Item` is `(&_, &_)` here
Expand All @@ -17,7 +17,7 @@ note: required by a bound in `cloned`
--> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL

error[E0271]: expected `Iter<'_, _, _>` to be an iterator that yields `&_`, but it yields `(&_, &_)`
--> $DIR/issue-33941.rs:9:14
--> $DIR/cloned-hashmap-iter-type-mismatch-diag.rs:12:14
|
LL | for _ in HashMap::new().iter().cloned() {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `&_`, found `(&_, &_)`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
error[E0271]: expected `Iter<'_, _, _>` to be an iterator that yields `&_`, but it yields `(&_, &_)`
--> $DIR/issue-33941.rs:9:36
--> $DIR/cloned-hashmap-iter-type-mismatch-diag.rs:12:36
|
LL | for _ in HashMap::new().iter().cloned() {}
| ^^^^^^ expected `&_`, found `(&_, &_)`
|
= note: expected reference `&_`
found tuple `(&_, &_)`
note: the method call chain might not have had the expected associated types
--> $DIR/issue-33941.rs:9:29
--> $DIR/cloned-hashmap-iter-type-mismatch-diag.rs:12:29
|
LL | for _ in HashMap::new().iter().cloned() {}
| -------------- ^^^^^^ `Iterator::Item` is `(&_, &_)` here
Expand All @@ -17,7 +17,7 @@ note: required by a bound in `cloned`
--> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL

error[E0271]: expected `Iter<'_, _, _>` to be an iterator that yields `&_`, but it yields `(&_, &_)`
--> $DIR/issue-33941.rs:9:14
--> $DIR/cloned-hashmap-iter-type-mismatch-diag.rs:12:14
|
LL | for _ in HashMap::new().iter().cloned() {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `&_`, found `(&_, &_)`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//! Regression test for <https://github.com/rust-lang/rust/issues/33941>.
//! Test iterator type mismatch prints pretty error message.
//! This used to emit many duplicated, unhelpful error messages.
//@ revisions: current next
//@ ignore-compare-mode-next-solver (explicit revisions)
//@[next] compile-flags: -Znext-solver
Expand Down
12 changes: 12 additions & 0 deletions tests/ui/lifetimes/lifetime-in-unit-struct-pattern.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
//! Regression test for <https://github.com/rust-lang/rust/issues/34751>.
//! This used to ICE with
//! `assertion failed: !substs.has_regions_escaping_depth(0)`.
//@ check-pass

#![allow(dead_code)]

use std::marker::PhantomData;

fn f<'a>(PhantomData::<&'a u8>: PhantomData<&'a u8>) {}

fn main() {}
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
//! Regression test for <https://github.com/rust-lang/rust/issues/35423>.
//! This used to ICE.
//@ run-pass

fn main () {
let x = 4;
match x {
Expand Down
10 changes: 10 additions & 0 deletions tests/ui/shadowed/shadow-unit-struct-in-closure.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
//! Regression test for <https://github.com/rust-lang/rust/issues/33504>.
//! Test shadowing a unit-like struct in a closure doesn't cause ICE.

struct Test;

fn main() {
|| {
let Test = 1; //~ ERROR mismatched types
};
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0308]: mismatched types
--> $DIR/issue-33504.rs:7:13
--> $DIR/shadow-unit-struct-in-closure.rs:8:13
|
LL | struct Test;
| ----------- unit struct defined here
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
//! Regression test for <https://github.com/rust-lang/rust/issues/3447>.
//! This used to overflow stack.
//@ run-pass

#![allow(dead_code)]
#![allow(non_snake_case)]
#![allow(non_camel_case_types)]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
//! Regression test for <https://github.com/rust-lang/rust/issues/33770>.
//! Ensure both `Mutex` and `RwLock` cannot be locked twice on same
//! thread.
//!
//! This was possible as mutexes were initialized with `PTHREAD_MUTEX_DEFAULT`
//! for which attempt to relock from the same thread is considered undefined
//! behaviour, and during glibc's lock-elision transaction lock appeared
//! unlocked, which allowed to lock it again from the same thread.
//!
//! This resulted in ability to aquire 2 mutable references at the same time.
//@ run-pass
//@ needs-subprocess

Expand Down
Loading