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
13 changes: 13 additions & 0 deletions tests/ui/expr/if/if-let-missing-else-clause.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//! Regression test for <https://github.com/rust-lang/rust/issues/19991>.
//!
//! Test if the sugared `if let` construct correctly prints "missing an else clause" when an else
//! clause does not exist, instead of the unsympathetic "`match` arms have incompatible types"

//@ dont-require-annotations: NOTE

fn main() {
if let Some(homura) = Some("madoka") { //~ ERROR missing an `else` clause
//~| NOTE expected integer, found `()`
765
};
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0317]: `if` may be missing an `else` clause
--> $DIR/issue-19991.rs:7:5
--> $DIR/if-let-missing-else-clause.rs:9:5
|
LL | / if let Some(homura) = Some("madoka") {
LL | |
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//! <https://github.com/rust-lang/rust/issues/20313>.

//@ run-pass
#![allow(dead_code)]
#![feature(link_llvm_intrinsics)]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//! <https://github.com/rust-lang/rust/issues/20313>.

extern "C" {
#[link_name = "llvm.sqrt.f32"]
fn sqrt(x: f32) -> f32; //~ ERROR linking to LLVM intrinsics is experimental
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0658]: linking to LLVM intrinsics is experimental
--> $DIR/issue-20313.rs:3:5
--> $DIR/link-llvm-intrinsics-no-gate.rs:5:5
|
LL | fn sqrt(x: f32) -> f32;
| ^^^^^^^^^^^^^^^^^^^^^^^
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/20225>.

#![feature(fn_traits, unboxed_closures)]

struct Foo;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0053]: method `call` has an incompatible type for trait
--> $DIR/issue-20225.rs:6:43
--> $DIR/fn-impl-mismatched-param-type.rs:8:43
|
LL | impl<'a, T> Fn<(&'a T,)> for Foo {
| - found this type parameter
Expand All @@ -14,7 +14,7 @@ LL | extern "rust-call" fn call(&self, (_,): (&'a T,)) {}
| +++

error[E0053]: method `call_mut` has an incompatible type for trait
--> $DIR/issue-20225.rs:11:51
--> $DIR/fn-impl-mismatched-param-type.rs:13:51
|
LL | impl<'a, T> FnMut<(&'a T,)> for Foo {
| - found this type parameter
Expand All @@ -29,7 +29,7 @@ LL | extern "rust-call" fn call_mut(&mut self, (_,): (&'a T,)) {}
| +++

error[E0053]: method `call_once` has an incompatible type for trait
--> $DIR/issue-20225.rs:18:47
--> $DIR/fn-impl-mismatched-param-type.rs:20:47
|
LL | impl<'a, T> FnOnce<(&'a T,)> for Foo {
| - found this type parameter
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/20261>.

fn main() {
// N.B., this (almost) typechecks when default binding modes are enabled.
for (ref i,) in [].iter() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0282]: type annotations needed
--> $DIR/issue-20261.rs:4:9
--> $DIR/for-loop-ref-pattern-inference.rs:6:9
|
LL | i.clone();
| ^ cannot infer type
Expand Down
11 changes: 0 additions & 11 deletions tests/ui/issues/issue-19991.rs

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
//! Regression test for <https://github.com/rust-lang/rust/issues/20414>.
//!
//! Test both UFCS and dot syntax should work for trait methods when the
//! impl has a where-clause bound on a reference type.

//@ check-pass
#![allow(dead_code)]

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

//@ check-pass
#![allow(dead_code)]
#![allow(unused_variables)]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//! Regression test for <https://github.com/rust-lang/rust/issues/21361>.
//@ run-pass

fn main() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//! Regression test for <https://github.com/rust-lang/rust/issues/20396>.
//@ check-pass

#![allow(dead_code)]
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/20433>.

fn main() {}

struct The;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0277]: the size for values of type `[i32]` cannot be known at compilation time
--> $DIR/issue-20433.rs:6:18
--> $DIR/vec-of-unsized-type.rs:8:18
|
LL | fn iceman(c: Vec<[i32]>) {}
| ^^^^^^^^^^ doesn't have a size known at compile-time
Expand Down
Loading