Update tests

This commit is contained in:
Seiichi Uchida 2017-07-10 02:25:26 +09:00
parent bc63d69c3f
commit 78224a0644
2 changed files with 23 additions and 15 deletions

View File

@ -48,8 +48,8 @@ fn foo() -> bool {
// Nothing
}
if let Some(x) = (aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)
if let Some(x) =
(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)
{}
if let (

View File

@ -24,14 +24,13 @@ fn foo() {
Patternnnnnnnnnnnnnnnnnnn |
Patternnnnnnnnnnnnnnnnnnn => meh,
Patternnnnnnnnnnnnnnnnnnn |
Patternnnnnnnnnnnnnnnnnnn if looooooooooooooooooong_guard => meh,
Patternnnnnnnnnnnnnnnnnnnnnnnnn |
Patternnnnnnnnnnnnnnnnnnnnnnnnn if looooooooooooooooooooooooooooooooooooooooong_guard => {
Patternnnnnnnnnnnnnnnnnnn | Patternnnnnnnnnnnnnnnnnnn if looooooooooooooooooong_guard => {
meh
}
Patternnnnnnnnnnnnnnnnnnnnnnnnn | Patternnnnnnnnnnnnnnnnnnnnnnnnn
if looooooooooooooooooooooooooooooooooooooooong_guard => meh,
// Test that earlier patterns can take the guard space
(aaaa, bbbbb, ccccccc, aaaaa, bbbbbbbb, cccccc, aaaa, bbbbbbbb, cccccc, dddddd) |
Patternnnnnnnnnnnnnnnnnnnnnnnnn if loooooooooooooooooooooooooooooooooooooooooong_guard => {}
@ -230,8 +229,9 @@ fn issue355() {
fn issue280() {
{
match x {
CompressionMode::DiscardNewline |
CompressionMode::CompressWhitespaceNewline => ch == '\n',
CompressionMode::DiscardNewline | CompressionMode::CompressWhitespaceNewline => {
ch == '\n'
}
ast::ItemConst(ref typ, ref expr) => {
self.process_static_or_const_item(item, &typ, &expr)
}
@ -270,8 +270,7 @@ fn issue496() {
{
{
match def {
def::DefConst(def_id) |
def::DefAssociatedConst(def_id) => {
def::DefConst(def_id) | def::DefAssociatedConst(def_id) => {
match const_eval::lookup_const_by_id(cx.tcx, def_id, Some(self.pat.id)) {
Some(const_expr) => x,
}
@ -285,8 +284,7 @@ fn issue496() {
fn issue494() {
{
match stmt.node {
hir::StmtExpr(ref expr, id) |
hir::StmtSemi(ref expr, id) => {
hir::StmtExpr(ref expr, id) | hir::StmtSemi(ref expr, id) => {
result.push(StmtRef::Mirror(Box::new(Stmt {
span: stmt.span,
kind: StmtKind::Expr {
@ -302,8 +300,18 @@ fn issue494() {
fn issue386() {
match foo {
BiEq | BiLt | BiLe | BiNe | BiGt | BiGe => true,
BiAnd | BiOr | BiAdd | BiSub | BiMul | BiDiv | BiRem | BiBitXor | BiBitAnd | BiBitOr |
BiShl | BiShr => false,
BiAnd |
BiOr |
BiAdd |
BiSub |
BiMul |
BiDiv |
BiRem |
BiBitXor |
BiBitAnd |
BiBitOr |
BiShl |
BiShr => false,
}
}