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,4 +1,8 @@
//! Regression test for <https://github.com/rust-lang/rust/issues/36474>.
//! This used to trigger LLVM assertion when compiled with opt level 3.
//@ compile-flags: -Copt-level=3
//@ run-pass

fn main() {
remove_axis(&3, 0);
}
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/3559>.
//! Test hashmap debug format doesn't ICE.
//@ run-pass

use std::collections::HashMap;

fn check_strs(actual: &str, expected: &str) -> bool {
Expand Down
16 changes: 16 additions & 0 deletions tests/ui/derived-errors/no-spurious-unconstrained-param.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
//! Regression test for <https://github.com/rust-lang/rust/issues/36836>.
//! Previously, in addition to the real cause of the problem as seen below,
//! the compiler would tell the user:
//!
//! ```
//! error[E0207]: the type parameter `T` is not constrained by the impl trait, self type, or
//! predicates
//! ```
//!
//! With this test, we check that only the relevant error is emitted.

trait Foo {}

impl<T> Foo for Bar<T> {} //~ ERROR cannot find type `Bar` in this scope

fn main() {}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0425]: cannot find type `Bar` in this scope
--> $DIR/issue-36836.rs:13:17
--> $DIR/no-spurious-unconstrained-param.rs:14:17
|
LL | impl<T> Foo for Bar<T> {}
| ^^^ not found in this scope
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/36299>.
//! This used to ICE.

struct Foo<'a, A> {}
//~^ ERROR parameter `'a` is never used
//~| ERROR parameter `A` is never used
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
error[E0392]: lifetime parameter `'a` is never used
--> $DIR/issue-36299.rs:1:12
--> $DIR/unused-type-and-lifetime-param.rs:4:12
|
LL | struct Foo<'a, A> {}
| ^^ unused lifetime parameter
|
= help: consider removing `'a`, referring to it in a field, or using a marker such as `PhantomData`

error[E0392]: type parameter `A` is never used
--> $DIR/issue-36299.rs:1:16
--> $DIR/unused-type-and-lifetime-param.rs:4:16
|
LL | struct Foo<'a, A> {}
| ^ unused type parameter
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
//! Regression test for <https://github.com/rust-lang/rust/issues/35570>.
//! Test associated type projection under `for<'a>` binder in the return
//! type of fn parameter and inside trait object doesn't ICE.

use std::mem;

trait Trait1<T> {}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
error[E0277]: the trait bound `for<'a> (): Trait2<'a>` is not satisfied
--> $DIR/issue-35570.rs:8:40
--> $DIR/assoc-type-projection-in-dyn-and-fn.rs:12:40
|
LL | fn _ice(param: Box<dyn for <'a> Trait1<<() as Trait2<'a>>::Ty>>) {
| ^^^^^^^^^^^^^^^^^^^^^^ the trait `for<'a> Trait2<'a>` is not implemented for `()`
|
help: this trait has no implementations, consider adding one
--> $DIR/issue-35570.rs:4:1
--> $DIR/assoc-type-projection-in-dyn-and-fn.rs:8:1
|
LL | trait Trait2<'a> {
| ^^^^^^^^^^^^^^^^

error[E0277]: the trait bound `for<'a> (): Trait2<'a>` is not satisfied
--> $DIR/issue-35570.rs:8:16
--> $DIR/assoc-type-projection-in-dyn-and-fn.rs:12:16
|
LL | fn _ice(param: Box<dyn for <'a> Trait1<<() as Trait2<'a>>::Ty>>) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `for<'a> Trait2<'a>` is not implemented for `()`
|
help: this trait has no implementations, consider adding one
--> $DIR/issue-35570.rs:4:1
--> $DIR/assoc-type-projection-in-dyn-and-fn.rs:8:1
|
LL | trait Trait2<'a> {
| ^^^^^^^^^^^^^^^^
Expand Down
7 changes: 0 additions & 7 deletions tests/ui/issues/issue-36816.rs

This file was deleted.

15 changes: 0 additions & 15 deletions tests/ui/issues/issue-36836.rs

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
//! Regression test for <https://github.com/rust-lang/rust/issues/36744>.
//! This tests for an ICE (and, if ignored, subsequent LLVM abort) when
//! a lifetime-parametric fn is passed into a context whose expected
//! type has a differing lifetime parameterization.
//@ run-pass
// This tests for an ICE (and, if ignored, subsequent LLVM abort) when
// a lifetime-parametric fn is passed into a context whose expected
// type has a differing lifetime parameterization.

struct A<'a> {
_a: &'a i32,
Expand Down
10 changes: 10 additions & 0 deletions tests/ui/macros/macro-in-array-len-expr.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/36816>.
//! Macro invocation in len position in arrays used to ICE.
//@ run-pass

macro_rules! m { () => { 1 } }
macro_rules! n { () => { 1 + m!() } }

fn main() {
let _: [u32; n!()] = [0, 0];
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! Regression test for <https://github.com/rust-lang/rust/issues/3574>.
//! Test pattern-matching on `&str` doesn't ICE.
//@ run-pass
// rustc --test match_borrowed_str.rs.rs && ./match_borrowed_str.rs


fn compare(x: &str, y: &str) -> bool {
match x {
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/35976>.
//! This used to emit spurious `Sized` bound unsatisfied error when trait
//! was not imported, instead of suggestion to import it.
//@ edition:2015
//@ revisions: imported unimported
//@[imported] check-pass
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error: the `wait` method cannot be invoked on a trait object
--> $DIR/issue-35976.rs:21:9
--> $DIR/trait-object-import-suggestion-on-method.rs:24:9
|
LL | fn wait(&self) where Self: Sized;
| ----- this has a `Sized` requirement
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
//! Regression test for <https://github.com/rust-lang/rust/issues/34503>.
//! `(T, Option<T>)` falsly marked Option<T> as proved when T failed,
//! this made use of invalid Option<T> bound possible anywhere.
//@ run-pass

fn main() {
struct X;
trait Foo<T> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
warning: methods `foo` and `bar` are never used
--> $DIR/issue-34503.rs:5:12
--> $DIR/obligation-error-propagation.rs:9:12
|
LL | trait Foo<T> {
| --- methods in this trait
Expand Down
Loading