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
12 changes: 12 additions & 0 deletions tests/ui/codegen/trait-objects-slice-coercion.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/41744>.
//! This used to trigger LLVM assertion
//! `SrcTy must be larger than DestTy for Trunc`
//! because of a redundant truncate call when value is boolean.
//@ run-pass

trait Tc {}
impl Tc for bool {}

fn main() {
let _: &[&dyn Tc] = &[&true];
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
//! Regression test for <https://github.com/rust-lang/rust/issues/41298>.
//! Two impl blocks with same generics caused ICE during coherence overlap
//! check.
//@ check-pass

#![allow(dead_code)]
struct Function<T, F> { t: T, f: F }

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
//! Regression test for <https://github.com/rust-lang/rust/issues/41849>.
//! Evaluating const required to evaluate trait, which required variance
//! information, which required const to be evaluated.
//@ run-pass

#![allow(dead_code)]
// Regression test for #41849.

use std::ops::Mul;

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/41742>.
//! Test indexing with the wrong type doesn't cause ICE.

use std::ops::{Index, IndexMut};

struct S;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0308]: mismatched types
--> $DIR/issue-41742.rs:24:7
--> $DIR/index-with-wrong-type.rs:27:7
|
LL | H["?"].f();
| ^^^ expected `u32`, found `&str`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
//! Regression test for <https://github.com/rust-lang/rust/issues/41677>.
//! The local variable was winding up with a type `Receiver<?T, H>` where
//! `?T` was unconstrained, because we failed to enforce the WF obligations
//! and `?T` is a bivariant type parameter position.
//@ run-pass
// Regression test for #41677. The local variable was winding up with
// a type `Receiver<?T, H>` where `?T` was unconstrained, because we
// failed to enforce the WF obligations and `?T` is a bivariant type
// parameter position.

#![allow(unused_variables, dead_code)]

Expand Down
14 changes: 14 additions & 0 deletions tests/ui/inference/infer-result-type-through-dead-code.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
//! Regression test for <https://github.com/rust-lang/rust/issues/39984>.
//! The key here is that the error type of the `Ok` call ought to be
//! constrained to `String`, even though it is dead-code.
//@ check-pass

#![allow(dead_code)]
#![allow(unreachable_code)]

fn main() {}

fn t() -> Result<(), String> {
return Err("".into());
Ok(())
}
14 changes: 0 additions & 14 deletions tests/ui/issues/issue-39984.rs

This file was deleted.

9 changes: 0 additions & 9 deletions tests/ui/issues/issue-41479.rs

This file was deleted.

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

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
//! Regression test for <https://github.com/rust-lang/rust/issues/4025>.
//! `if` expression requires both paths to have a common supertype.
//@ check-pass

#![allow(dead_code)]
#![allow(unused_mut)]
/*
# if b { x } else { y } requires identical types for x and y
*/

fn print1(b: bool, s1: &str, s2: &str) {
println!("{}", if b { s1 } else { s2 });
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/40288>.
//! We were subtyping in the wrong direction, allowing any lifetime to
//! become 'static, which made use-after-free possible.

fn prove_static<T: 'static + ?Sized>(_: &'static T) {}

fn lifetime_transmute_slice<'a, T: ?Sized>(x: &'a T, y: &T) -> &'a T {
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 `y`
--> $DIR/issue-40288-2.rs:9:5
--> $DIR/mut-slice-struct-lifetime-transmute.rs:13:5
|
LL | out[0]
| ^^^^^^ lifetime `'a` required
Expand All @@ -10,7 +10,7 @@ LL | fn lifetime_transmute_slice<'a, T: ?Sized>(x: &'a T, y: &'a T) -> &'a T {
| ++

error[E0621]: explicit lifetime required in the type of `y`
--> $DIR/issue-40288-2.rs:24:5
--> $DIR/mut-slice-struct-lifetime-transmute.rs:28:5
|
LL | out.head
| ^^^^^^^^ lifetime `'a` required
Expand Down
12 changes: 12 additions & 0 deletions tests/ui/tuple/nested-zst-tuple-fields.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/41479>.
//! Field access on zst tuple items used to trigger LLVM assertion.
//@ run-pass

fn split<A, B>(pair: (A, B)) {
let _a = pair.0;
let _b = pair.1;
}

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

struct B;

impl B {
Expand Down
Loading