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,10 +1,13 @@
//@ run-pass
//! Regression test for <https://github.com/rust-lang/rust/issues/45731>.
//! This used to `SIGBUS` on darwin when DWARF binary was corrupted.

#![allow(unused_variables)]
//@ compile-flags:--test -g
//@ ignore-ios needs the `.dSYM` files to be moved to the device
//@ ignore-tvos needs the `.dSYM` files to be moved to the device
//@ ignore-watchos needs the `.dSYM` files to be moved to the device
//@ ignore-visionos needs the `.dSYM` files to be moved to the device
//@ run-pass

#[cfg(target_vendor = "apple")]
#[test]
Expand Down
12 changes: 12 additions & 0 deletions tests/ui/expr/if/if-branch-unsized-str-mismatch.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/46302>.
//! This used to emit incorrect type mismatch label pointing at return type.

fn foo() {
let s = "abc";
let u: &str = if true { s[..2] } else { s };
//~^ ERROR mismatched types
}

fn main() {
foo();
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0308]: mismatched types
--> $DIR/issue-46302.rs:3:27
--> $DIR/if-branch-unsized-str-mismatch.rs:6:27
|
LL | let u: &str = if true { s[..2] } else { s };
| ^^^^^^ expected `&str`, found `str`
Expand Down
9 changes: 0 additions & 9 deletions tests/ui/issues/issue-46302.rs

This file was deleted.

14 changes: 0 additions & 14 deletions tests/ui/issues/issue-4875.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/44730>.
//! Test `#[doc = $expr]` generates docs.
//@ check-pass
//! dox

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/44851>.
//! Test doc attr macro doesn't ICE with macro as an argument.
//@ check-pass

macro_rules! 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/4542>.
//! Test matching cloned `String` doesn't segfault.
//@ run-pass

use std::env;
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/4541>.
//! This used to segfault caused by double-free.
//@ run-pass

fn parse_args() -> String {
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/45801>.
//! This used to ICE.

struct Params;

pub trait Plugin<E: ?Sized> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
error[E0277]: the trait bound `Params: Plugin<i32>` is not satisfied
--> $DIR/issue-45801.rs:21:9
--> $DIR/generic-method-unsatisfied-bound.rs:24:9
|
LL | req.get_ref::<Params>();
| ^^^^^^^ unsatisfied trait bound
|
help: the trait `Plugin<i32>` is not implemented for `Params`
but trait `Plugin<Foo>` is implemented for it
--> $DIR/issue-45801.rs:14:1
--> $DIR/generic-method-unsatisfied-bound.rs:17:1
|
LL | impl Plugin<Foo> for Params {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
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/4517>.
//! Test error message use correct array syntax.
//@ dont-require-annotations: NOTE

fn bar(int_param: usize) {}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
error[E0308]: mismatched types
--> $DIR/issue-4517.rs:7:9
--> $DIR/array-arg-expected-usize.rs:9:9
|
LL | bar(foo);
| --- ^^^ expected `usize`, found `[u8; 4]`
| |
| arguments to this function are incorrect
|
note: function defined here
--> $DIR/issue-4517.rs:3:4
--> $DIR/array-arg-expected-usize.rs:5:4
|
LL | fn bar(int_param: usize) {}
| ^^^ ----------------
Expand Down
15 changes: 15 additions & 0 deletions tests/ui/pattern/struct-pattern-in-fn-arg.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
//! Regression test for <https://github.com/rust-lang/rust/issues/4875>.
//! Test struct patterns as fn arguments don't ICE.
//@ run-pass
#![allow(dead_code)]


pub struct Foo<T> {
data: T,
}

fn foo<T>(Foo{..}: Foo<T>) {
}

pub fn main() {
}
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
//! Regression test for <https://github.com/rust-lang/rust/issues/49298>.
//!
//! This test is checking that the space allocated for `x.1` does not
//! overlap with `y`. (The reason why such a thing happened at one
//! point was because `x.0: Void` and thus the whole type of `x` was
//! uninhabited, and so the compiler thought it was safe to use the
//! space of `x.1` to hold `y`.)
//!
//! That's a fine thing to test when this code is accepted by the
//! compiler, and this code is being transcribed accordingly into
//! the ui test issue-21232-partial-init-and-use.rs
//!
//! This test is bogus (i.e., should be check-fail) during the period
//! where #54986 is implemented and #54987 is *not* implemented. For
//! now: just ignore it
//!
//@ ignore-test (#54987)
//@ run-pass

#![feature(test)]
#![allow(unused_mut)] // under NLL we get warning about `x` below: rust-lang/rust#54499

// This test is bogus (i.e., should be check-fail) during the period
// where #54986 is implemented and #54987 is *not* implemented. For
// now: just ignore it
//
//@ ignore-test (#54987)

// This test is checking that the space allocated for `x.1` does not
// overlap with `y`. (The reason why such a thing happened at one
// point was because `x.0: Void` and thus the whole type of `x` was
// uninhabited, and so the compiler thought it was safe to use the
// space of `x.1` to hold `y`.)
//
// That's a fine thing to test when this code is accepted by the
// compiler, and this code is being transcribed accordingly into
// the ui test issue-21232-partial-init-and-use.rs

extern crate test;

enum Void {}
Expand Down
Loading