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,5 +1,5 @@
// Regression test for #48728, an ICE that occurred computing
// coherence "help" information.
//! Regression test for <https://github.com/rust-lang/rust/issues/48728>.
//! ICE occurred computing coherence "help" information.

//@ check-pass
#[derive(Clone)]
Expand Down
4 changes: 0 additions & 4 deletions tests/ui/issues/issue-46771.rs

This file was deleted.

4 changes: 0 additions & 4 deletions tests/ui/issues/issue-4759-1.rs

This file was deleted.

7 changes: 7 additions & 0 deletions tests/ui/methods/by-value-self-method-on-int.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
//! Regression test for <https://github.com/rust-lang/rust/issues/4759>.
//! This used to trigger LLVM assertion.
//@ run-pass

trait U { fn f(self); }
impl U for isize { fn f(self) {} }
pub fn main() { 4.f(); }
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
//! Regression test for <https://github.com/rust-lang/rust/issues/4759>.
//! Destructuring a struct and calling consuming method used to segfault.
//@ run-pass

#![allow(non_shorthand_field_patterns)]

struct T { a: Box<isize> }
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/50415>.
//! Test inclusive ranges in closures don't ICE.
//@ run-pass

fn main() {
// Simplified test case
let _ = || 0..=1;
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/47094>.
//! Test `conflicting representation hints` warning is being triggered
//! when there are multiple repr attributes.

#[repr(C, u8)] //~ ERROR conflicting representation hints
//~^ WARN this was previously accepted
enum Foo {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0566]: conflicting representation hints
--> $DIR/issue-47094.rs:1:8
--> $DIR/conflicting-repr-enum-attrs.rs:5:8
|
LL | #[repr(C, u8)]
| ^ ^^
Expand All @@ -9,7 +9,7 @@ LL | #[repr(C, u8)]
= note: `#[deny(conflicting_repr_hints)]` (part of `#[deny(future_incompatible)]`) on by default

error[E0566]: conflicting representation hints
--> $DIR/issue-47094.rs:8:8
--> $DIR/conflicting-repr-enum-attrs.rs:12:8
|
LL | #[repr(C)]
| ^
Expand All @@ -25,7 +25,7 @@ error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0566`.
Future incompatibility report: Future breakage diagnostic:
error[E0566]: conflicting representation hints
--> $DIR/issue-47094.rs:1:8
--> $DIR/conflicting-repr-enum-attrs.rs:5:8
|
LL | #[repr(C, u8)]
| ^ ^^
Expand All @@ -36,7 +36,7 @@ LL | #[repr(C, u8)]

Future breakage diagnostic:
error[E0566]: conflicting representation hints
--> $DIR/issue-47094.rs:8:8
--> $DIR/conflicting-repr-enum-attrs.rs:12:8
|
LL | #[repr(C)]
| ^
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/4736>.
//! This used to ICE.

struct NonCopyable(());

fn main() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0560]: struct `NonCopyable` has no field named `p`
--> $DIR/issue-4736.rs:4:26
--> $DIR/tuple-struct-init-with-named-field.rs:7:26
|
LL | struct NonCopyable(());
| ----------- `NonCopyable` 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/46756>.
//! Test reference suggestion correctly puts cast in parentheses.
//@ run-rustfix

#![allow(unused)]
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/46756>.
//! Test reference suggestion correctly puts cast in parentheses.
//@ run-rustfix

#![allow(unused)]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
error[E0308]: mismatched types
--> $DIR/issue-46756-consider-borrowing-cast-or-binexpr.rs:12:42
--> $DIR/borrow-cast-or-binexpr-with-parens.rs:14:42
|
LL | light_flows_our_war_of_mocking_words(behold as usize);
| ------------------------------------ ^^^^^^^^^^^^^^^ expected `&usize`, found `usize`
| |
| arguments to this function are incorrect
|
note: function defined here
--> $DIR/issue-46756-consider-borrowing-cast-or-binexpr.rs:5:4
--> $DIR/borrow-cast-or-binexpr-with-parens.rs:7:4
|
LL | fn light_flows_our_war_of_mocking_words(and_yet: &usize) -> usize {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ---------------
Expand All @@ -17,15 +17,15 @@ LL | light_flows_our_war_of_mocking_words(&(behold as usize));
| ++ +

error[E0308]: mismatched types
--> $DIR/issue-46756-consider-borrowing-cast-or-binexpr.rs:14:42
--> $DIR/borrow-cast-or-binexpr-with-parens.rs:16:42
|
LL | light_flows_our_war_of_mocking_words(with_tears + 4);
| ------------------------------------ ^^^^^^^^^^^^^^ expected `&usize`, found `usize`
| |
| arguments to this function are incorrect
|
note: function defined here
--> $DIR/issue-46756-consider-borrowing-cast-or-binexpr.rs:5:4
--> $DIR/borrow-cast-or-binexpr-with-parens.rs:7:4
|
LL | fn light_flows_our_war_of_mocking_words(and_yet: &usize) -> usize {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ---------------
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Make sure that the mono-item collector does not crash when trying to
// instantiate a default impl of a method with lifetime parameters.
// See https://github.com/rust-lang/rust/issues/47309
//! Regression test for <https://github.com/rust-lang/rust/issues/47309>.
//! Make sure that the mono-item collector does not crash when trying to
//! instantiate a default impl of a method with lifetime parameters.

//@ compile-flags:-Clink-dead-code
//@ build-pass
Expand Down
7 changes: 7 additions & 0 deletions tests/ui/typeck/call-unit-struct-as-fn.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
//! Regression test for <https://github.com/rust-lang/rust/issues/46771>.
//! Test calling unit struct as fn doesn't ICE.

fn main() {
struct Foo;
(1 .. 2).find(|_| Foo(0) == 0); //~ ERROR expected function, found `Foo`
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0618]: expected function, found `Foo`
--> $DIR/issue-46771.rs:3:23
--> $DIR/call-unit-struct-as-fn.rs:6:23
|
LL | struct Foo;
| ---------- `Foo` 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/48131>.

// This note is annotated because the purpose of the test
// is to ensure that certain other notes are not generated.
#![deny(unused_unsafe)]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
error: unnecessary `unsafe` block
--> $DIR/issue-48131.rs:9:9
--> $DIR/unused-unsafe-in-nested-fn-lint.rs:11:9
|
LL | unsafe { /* unnecessary */ }
| ^^^^^^ unnecessary `unsafe` block
|
note: the lint level is defined here
--> $DIR/issue-48131.rs:3:9
--> $DIR/unused-unsafe-in-nested-fn-lint.rs:5:9
|
LL | #![deny(unused_unsafe)]
| ^^^^^^^^^^^^^

error: unnecessary `unsafe` block
--> $DIR/issue-48131.rs:19:13
--> $DIR/unused-unsafe-in-nested-fn-lint.rs:21:13
|
LL | unsafe { /* unnecessary */ }
| ^^^^^^ unnecessary `unsafe` block
Expand Down
Loading