mirror of
https://github.com/rust-lang/rust.git
synced 2025-06-19 19:17:31 +00:00
auto merge of #12055 : dguenther/rust/tidy_test, r=alexcrichton
This PR extends the tidy formatting check to rust files in the test folder. To facilitate this, a few flags were added to tidy: * `xfail-tidy-cr` - Disables the check for CR characters for all following lines in the file * `xfail-tidy-tab` - Disables the check for tab characters for all following lines in the file * `xfail-tidy-linelength` - Disables the line length check for all following lines in the file Checks should not have to be disabled often. I disabled line length checks in `debug-info` tests that use `debugger:` checks, but aside from that, there were relatively few exclusions. Running tidy on all the tests does slow down the formatting check, so it may be worth investigating further optimization. cc #4534
This commit is contained in:
commit
56565eb129
@ -242,7 +242,6 @@ ALL_HS := $(filter-out $(S)src/rt/vg/valgrind.h \
|
|||||||
tidy:
|
tidy:
|
||||||
@$(call E, check: formatting)
|
@$(call E, check: formatting)
|
||||||
$(Q)find $(S)src -name '*.r[sc]' \
|
$(Q)find $(S)src -name '*.r[sc]' \
|
||||||
| grep '^$(S)src/test' -v \
|
|
||||||
| grep '^$(S)src/libuv' -v \
|
| grep '^$(S)src/libuv' -v \
|
||||||
| grep '^$(S)src/llvm' -v \
|
| grep '^$(S)src/llvm' -v \
|
||||||
| grep '^$(S)src/gyp' -v \
|
| grep '^$(S)src/gyp' -v \
|
||||||
|
@ -14,6 +14,9 @@ import snapshot
|
|||||||
|
|
||||||
err=0
|
err=0
|
||||||
cols=100
|
cols=100
|
||||||
|
cr_flag="xfail-tidy-cr"
|
||||||
|
tab_flag="xfail-tidy-tab"
|
||||||
|
linelength_flag="xfail-tidy-linelength"
|
||||||
|
|
||||||
# Be careful to support Python 2.4, 2.6, and 3.x here!
|
# Be careful to support Python 2.4, 2.6, and 3.x here!
|
||||||
config_proc=subprocess.Popen([ "git", "config", "core.autocrlf" ],
|
config_proc=subprocess.Popen([ "git", "config", "core.autocrlf" ],
|
||||||
@ -46,12 +49,22 @@ file_names = [s for s in sys.argv[1:] if (not s.endswith("_gen.rs"))
|
|||||||
|
|
||||||
current_name = ""
|
current_name = ""
|
||||||
current_contents = ""
|
current_contents = ""
|
||||||
|
check_tab = True
|
||||||
|
check_cr = True
|
||||||
|
check_linelength = True
|
||||||
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
for line in fileinput.input(file_names,
|
for line in fileinput.input(file_names,
|
||||||
openhook=fileinput.hook_encoded("utf-8")):
|
openhook=fileinput.hook_encoded("utf-8")):
|
||||||
|
|
||||||
if fileinput.filename().find("tidy.py") == -1:
|
if fileinput.filename().find("tidy.py") == -1:
|
||||||
|
if line.find(cr_flag) != -1:
|
||||||
|
check_cr = False
|
||||||
|
if line.find(tab_flag) != -1:
|
||||||
|
check_tab = False
|
||||||
|
if line.find(linelength_flag) != -1:
|
||||||
|
check_linelength = False
|
||||||
if line.find("// XXX") != -1:
|
if line.find("// XXX") != -1:
|
||||||
report_err("XXX is no longer necessary, use FIXME")
|
report_err("XXX is no longer necessary, use FIXME")
|
||||||
if line.find("TODO") != -1:
|
if line.find("TODO") != -1:
|
||||||
@ -72,16 +85,16 @@ try:
|
|||||||
if "SNAP" in line:
|
if "SNAP" in line:
|
||||||
report_warn("unmatched SNAP line: " + line)
|
report_warn("unmatched SNAP line: " + line)
|
||||||
|
|
||||||
if (line.find('\t') != -1 and
|
if check_tab and (line.find('\t') != -1 and
|
||||||
fileinput.filename().find("Makefile") == -1):
|
fileinput.filename().find("Makefile") == -1):
|
||||||
report_err("tab character")
|
report_err("tab character")
|
||||||
if not autocrlf and line.find('\r') != -1:
|
if check_cr and not autocrlf and line.find('\r') != -1:
|
||||||
report_err("CR character")
|
report_err("CR character")
|
||||||
if line.endswith(" \n") or line.endswith("\t\n"):
|
if line.endswith(" \n") or line.endswith("\t\n"):
|
||||||
report_err("trailing whitespace")
|
report_err("trailing whitespace")
|
||||||
line_len = len(line)-2 if autocrlf else len(line)-1
|
line_len = len(line)-2 if autocrlf else len(line)-1
|
||||||
|
|
||||||
if line_len > cols:
|
if check_linelength and line_len > cols:
|
||||||
report_err("line longer than %d chars" % cols)
|
report_err("line longer than %d chars" % cols)
|
||||||
|
|
||||||
if fileinput.isfirstline() and current_name != "":
|
if fileinput.isfirstline() and current_name != "":
|
||||||
@ -90,6 +103,9 @@ try:
|
|||||||
if fileinput.isfirstline():
|
if fileinput.isfirstline():
|
||||||
current_name = fileinput.filename()
|
current_name = fileinput.filename()
|
||||||
current_contents = ""
|
current_contents = ""
|
||||||
|
check_cr = True
|
||||||
|
check_tab = True
|
||||||
|
check_linelength = True
|
||||||
|
|
||||||
current_contents += line
|
current_contents += line
|
||||||
|
|
||||||
|
@ -1,3 +1,13 @@
|
|||||||
|
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||||
|
// file at the top-level directory of this distribution and at
|
||||||
|
// http://rust-lang.org/COPYRIGHT.
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||||
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||||
|
// option. This file may not be copied, modified, or distributed
|
||||||
|
// except according to those terms.
|
||||||
|
|
||||||
#[crate_type="lib"];
|
#[crate_type="lib"];
|
||||||
|
|
||||||
pub mod extern_mod_ordering_lib {
|
pub mod extern_mod_ordering_lib {
|
||||||
|
@ -1,3 +1,13 @@
|
|||||||
|
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||||
|
// file at the top-level directory of this distribution and at
|
||||||
|
// http://rust-lang.org/COPYRIGHT.
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||||
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||||
|
// option. This file may not be copied, modified, or distributed
|
||||||
|
// except according to those terms.
|
||||||
|
|
||||||
#[crate_type = "lib"];
|
#[crate_type = "lib"];
|
||||||
|
|
||||||
pub struct Fish {
|
pub struct Fish {
|
||||||
|
@ -1,3 +1,13 @@
|
|||||||
|
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||||
|
// file at the top-level directory of this distribution and at
|
||||||
|
// http://rust-lang.org/COPYRIGHT.
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||||
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||||
|
// option. This file may not be copied, modified, or distributed
|
||||||
|
// except according to those terms.
|
||||||
|
|
||||||
#[crate_type = "lib"];
|
#[crate_type = "lib"];
|
||||||
|
|
||||||
pub struct Fish {
|
pub struct Fish {
|
||||||
|
@ -1,3 +1,13 @@
|
|||||||
|
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||||
|
// file at the top-level directory of this distribution and at
|
||||||
|
// http://rust-lang.org/COPYRIGHT.
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||||
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||||
|
// option. This file may not be copied, modified, or distributed
|
||||||
|
// except according to those terms.
|
||||||
|
|
||||||
pub trait Foo {
|
pub trait Foo {
|
||||||
fn bar();
|
fn bar();
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,13 @@
|
|||||||
|
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||||
|
// file at the top-level directory of this distribution and at
|
||||||
|
// http://rust-lang.org/COPYRIGHT.
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||||
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||||
|
// option. This file may not be copied, modified, or distributed
|
||||||
|
// except according to those terms.
|
||||||
|
|
||||||
/* Any copyright is dedicated to the Public Domain.
|
/* Any copyright is dedicated to the Public Domain.
|
||||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||||
|
|
||||||
|
@ -1,3 +1,13 @@
|
|||||||
|
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||||
|
// file at the top-level directory of this distribution and at
|
||||||
|
// http://rust-lang.org/COPYRIGHT.
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||||
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||||
|
// option. This file may not be copied, modified, or distributed
|
||||||
|
// except according to those terms.
|
||||||
|
|
||||||
#[crate_type="lib"];
|
#[crate_type="lib"];
|
||||||
|
|
||||||
pub struct Au(int);
|
pub struct Au(int);
|
||||||
|
@ -1,3 +1,13 @@
|
|||||||
|
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||||
|
// file at the top-level directory of this distribution and at
|
||||||
|
// http://rust-lang.org/COPYRIGHT.
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||||
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||||
|
// option. This file may not be copied, modified, or distributed
|
||||||
|
// except according to those terms.
|
||||||
|
|
||||||
#[no_std];
|
#[no_std];
|
||||||
|
|
||||||
pub fn foo() {}
|
pub fn foo() {}
|
||||||
|
@ -1,3 +1,13 @@
|
|||||||
|
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||||
|
// file at the top-level directory of this distribution and at
|
||||||
|
// http://rust-lang.org/COPYRIGHT.
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||||
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||||
|
// option. This file may not be copied, modified, or distributed
|
||||||
|
// except according to those terms.
|
||||||
|
|
||||||
#[packed]
|
#[packed]
|
||||||
pub struct S {
|
pub struct S {
|
||||||
a: u8,
|
a: u8,
|
||||||
|
@ -1,3 +1,13 @@
|
|||||||
|
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||||
|
// file at the top-level directory of this distribution and at
|
||||||
|
// http://rust-lang.org/COPYRIGHT.
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||||
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||||
|
// option. This file may not be copied, modified, or distributed
|
||||||
|
// except according to those terms.
|
||||||
|
|
||||||
pub enum Foo {
|
pub enum Foo {
|
||||||
Bar,
|
Bar,
|
||||||
priv Baz,
|
priv Baz,
|
||||||
|
@ -1,3 +1,13 @@
|
|||||||
|
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||||
|
// file at the top-level directory of this distribution and at
|
||||||
|
// http://rust-lang.org/COPYRIGHT.
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||||
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||||
|
// option. This file may not be copied, modified, or distributed
|
||||||
|
// except according to those terms.
|
||||||
|
|
||||||
pub mod num {
|
pub mod num {
|
||||||
pub trait Num2 {
|
pub trait Num2 {
|
||||||
fn from_int2(n: int) -> Self;
|
fn from_int2(n: int) -> Self;
|
||||||
|
@ -1 +1,11 @@
|
|||||||
|
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||||
|
// file at the top-level directory of this distribution and at
|
||||||
|
// http://rust-lang.org/COPYRIGHT.
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||||
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||||
|
// option. This file may not be copied, modified, or distributed
|
||||||
|
// except according to those terms.
|
||||||
|
|
||||||
pub static mut a: int = 3;
|
pub static mut a: int = 3;
|
||||||
|
@ -1,3 +1,13 @@
|
|||||||
|
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||||
|
// file at the top-level directory of this distribution and at
|
||||||
|
// http://rust-lang.org/COPYRIGHT.
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||||
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||||
|
// option. This file may not be copied, modified, or distributed
|
||||||
|
// except according to those terms.
|
||||||
|
|
||||||
#[crate_id="trait_default_method_xc_aux"];
|
#[crate_id="trait_default_method_xc_aux"];
|
||||||
|
|
||||||
pub struct Something { x: int }
|
pub struct Something { x: int }
|
||||||
|
@ -1,3 +1,13 @@
|
|||||||
|
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||||
|
// file at the top-level directory of this distribution and at
|
||||||
|
// http://rust-lang.org/COPYRIGHT.
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||||
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||||
|
// option. This file may not be copied, modified, or distributed
|
||||||
|
// except according to those terms.
|
||||||
|
|
||||||
// aux-build:trait_default_method_xc_aux.rs
|
// aux-build:trait_default_method_xc_aux.rs
|
||||||
|
|
||||||
extern mod aux = "trait_default_method_xc_aux";
|
extern mod aux = "trait_default_method_xc_aux";
|
||||||
|
@ -1,3 +1,13 @@
|
|||||||
|
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||||
|
// file at the top-level directory of this distribution and at
|
||||||
|
// http://rust-lang.org/COPYRIGHT.
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||||
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||||
|
// option. This file may not be copied, modified, or distributed
|
||||||
|
// except according to those terms.
|
||||||
|
|
||||||
pub trait Trait {
|
pub trait Trait {
|
||||||
fn foo();
|
fn foo();
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,13 @@
|
|||||||
|
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||||
|
// file at the top-level directory of this distribution and at
|
||||||
|
// http://rust-lang.org/COPYRIGHT.
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||||
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||||
|
// option. This file may not be copied, modified, or distributed
|
||||||
|
// except according to those terms.
|
||||||
|
|
||||||
#[crate_type="lib"];
|
#[crate_type="lib"];
|
||||||
|
|
||||||
pub struct Struct {
|
pub struct Struct {
|
||||||
|
@ -1,3 +1,13 @@
|
|||||||
|
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||||
|
// file at the top-level directory of this distribution and at
|
||||||
|
// http://rust-lang.org/COPYRIGHT.
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||||
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||||
|
// option. This file may not be copied, modified, or distributed
|
||||||
|
// except according to those terms.
|
||||||
|
|
||||||
// Perlin noise benchmark from https://gist.github.com/1170424
|
// Perlin noise benchmark from https://gist.github.com/1170424
|
||||||
|
|
||||||
use std::f64;
|
use std::f64;
|
||||||
|
@ -1,3 +1,13 @@
|
|||||||
|
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||||
|
// file at the top-level directory of this distribution and at
|
||||||
|
// http://rust-lang.org/COPYRIGHT.
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||||
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||||
|
// option. This file may not be copied, modified, or distributed
|
||||||
|
// except according to those terms.
|
||||||
|
|
||||||
// file at the top-level directory of this distribution and at
|
// file at the top-level directory of this distribution and at
|
||||||
// http://rust-lang.org/COPYRIGHT.
|
// http://rust-lang.org/COPYRIGHT.
|
||||||
//
|
//
|
||||||
|
@ -1,3 +1,13 @@
|
|||||||
|
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||||
|
// file at the top-level directory of this distribution and at
|
||||||
|
// http://rust-lang.org/COPYRIGHT.
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||||
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||||
|
// option. This file may not be copied, modified, or distributed
|
||||||
|
// except according to those terms.
|
||||||
|
|
||||||
// xfail-test reading from os::args()[1] - bogus!
|
// xfail-test reading from os::args()[1] - bogus!
|
||||||
|
|
||||||
use std::from_str::FromStr;
|
use std::from_str::FromStr;
|
||||||
|
@ -1,3 +1,13 @@
|
|||||||
|
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||||
|
// file at the top-level directory of this distribution and at
|
||||||
|
// http://rust-lang.org/COPYRIGHT.
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||||
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||||
|
// option. This file may not be copied, modified, or distributed
|
||||||
|
// except according to those terms.
|
||||||
|
|
||||||
// xfail-test reading from os::args()[1] - bogus!
|
// xfail-test reading from os::args()[1] - bogus!
|
||||||
|
|
||||||
use std::cast::transmute;
|
use std::cast::transmute;
|
||||||
|
@ -1,3 +1,13 @@
|
|||||||
|
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||||
|
// file at the top-level directory of this distribution and at
|
||||||
|
// http://rust-lang.org/COPYRIGHT.
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||||
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||||
|
// option. This file may not be copied, modified, or distributed
|
||||||
|
// except according to those terms.
|
||||||
|
|
||||||
// xfail-test
|
// xfail-test
|
||||||
|
|
||||||
extern mod extra;
|
extern mod extra;
|
||||||
|
@ -1,3 +1,13 @@
|
|||||||
|
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||||
|
// file at the top-level directory of this distribution and at
|
||||||
|
// http://rust-lang.org/COPYRIGHT.
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||||
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||||
|
// option. This file may not be copied, modified, or distributed
|
||||||
|
// except according to those terms.
|
||||||
|
|
||||||
use std::os;
|
use std::os;
|
||||||
|
|
||||||
static PI: f64 = 3.141592653589793;
|
static PI: f64 = 3.141592653589793;
|
||||||
|
@ -1,3 +1,13 @@
|
|||||||
|
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||||
|
// file at the top-level directory of this distribution and at
|
||||||
|
// http://rust-lang.org/COPYRIGHT.
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||||
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||||
|
// option. This file may not be copied, modified, or distributed
|
||||||
|
// except according to those terms.
|
||||||
|
|
||||||
// xfail-pretty
|
// xfail-pretty
|
||||||
// xfail-test linked failure
|
// xfail-test linked failure
|
||||||
|
|
||||||
|
@ -27,7 +27,8 @@ fn main() {
|
|||||||
assert_eq!(z, 21);
|
assert_eq!(z, 21);
|
||||||
let forty: fish = fish{a: @40};
|
let forty: fish = fish{a: @40};
|
||||||
let two: fish = fish{a: @2};
|
let two: fish = fish{a: @2};
|
||||||
let answer: int = forty.a + two.a; //~ ERROR binary operation `+` cannot be applied to type `@int`
|
let answer: int = forty.a + two.a;
|
||||||
|
//~^ ERROR binary operation `+` cannot be applied to type `@int`
|
||||||
info!("{:?}", answer);
|
info!("{:?}", answer);
|
||||||
assert_eq!(answer, 42);
|
assert_eq!(answer, 42);
|
||||||
}
|
}
|
||||||
|
@ -8,8 +8,9 @@
|
|||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
|
// xfail-tidy-cr
|
||||||
fn main() {
|
fn main() {
|
||||||
// note that this is a literal "\r" byte
|
// note that this is a literal "\r" byte
|
||||||
'
';
|
'
|
||||||
//~^ ERROR: character constant must be escaped
|
'; //~^ ERROR: character constant must be escaped
|
||||||
}
|
}
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
|
// xfail-tidy-tab
|
||||||
fn main() {
|
fn main() {
|
||||||
// note that this is a literal tab character here
|
// note that this is a literal tab character here
|
||||||
' ';
|
' ';
|
||||||
|
@ -1,3 +1,13 @@
|
|||||||
|
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||||
|
// file at the top-level directory of this distribution and at
|
||||||
|
// http://rust-lang.org/COPYRIGHT.
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||||
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||||
|
// option. This file may not be copied, modified, or distributed
|
||||||
|
// except according to those terms.
|
||||||
|
|
||||||
// error-pattern: expected
|
// error-pattern: expected
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
@ -1,3 +1,15 @@
|
|||||||
|
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||||
|
// file at the top-level directory of this distribution and at
|
||||||
|
// http://rust-lang.org/COPYRIGHT.
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||||
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||||
|
// option. This file may not be copied, modified, or distributed
|
||||||
|
// except according to those terms.
|
||||||
|
|
||||||
|
// xfail-tidy-linelength
|
||||||
|
|
||||||
#[no_std];
|
#[no_std];
|
||||||
|
|
||||||
struct S<T> {
|
struct S<T> {
|
||||||
@ -29,10 +41,12 @@ impl Trait<int> for S2 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn foo<'a>() {
|
fn foo<'a>() {
|
||||||
let _ = S::new::<int,f64>(1, 1.0); //~ ERROR the impl referenced by this path needs 1 type parameter, but 0 type parameters were supplied
|
let _ = S::new::<int,f64>(1, 1.0);
|
||||||
let _ = S::<'a,int>::new::<f64>(1, 1.0); //~ ERROR expected 0 lifetime parameter(s)
|
//~^ ERROR the impl referenced by this path needs 1 type parameter, but 0 type parameters were supplied
|
||||||
let _: S2 = Trait::new::<int,f64>(1, 1.0); //~ ERROR the trait referenced by this path needs 1 type parameter, but 0 type parameters were supplied
|
let _ = S::<'a,int>::new::<f64>(1, 1.0); //~ ERROR expected 0 lifetime parameter(s)
|
||||||
let _: S2 = Trait::<'a,int>::new::<f64>(1, 1.0); //~ ERROR expected 0 lifetime parameter(s)
|
let _: S2 = Trait::new::<int,f64>(1, 1.0);
|
||||||
|
//~^ ERROR the trait referenced by this path needs 1 type parameter, but 0 type parameters were supplied
|
||||||
|
let _: S2 = Trait::<'a,int>::new::<f64>(1, 1.0); //~ ERROR expected 0 lifetime parameter(s)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() {}
|
fn main() {}
|
||||||
|
@ -1,3 +1,13 @@
|
|||||||
|
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||||
|
// file at the top-level directory of this distribution and at
|
||||||
|
// http://rust-lang.org/COPYRIGHT.
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||||
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||||
|
// option. This file may not be copied, modified, or distributed
|
||||||
|
// except according to those terms.
|
||||||
|
|
||||||
// Tests that we are able to distinguish when loans borrow different
|
// Tests that we are able to distinguish when loans borrow different
|
||||||
// anonymous fields of a tuple vs the same anonymous field.
|
// anonymous fields of a tuple vs the same anonymous field.
|
||||||
|
|
||||||
|
@ -1,3 +1,13 @@
|
|||||||
|
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||||
|
// file at the top-level directory of this distribution and at
|
||||||
|
// http://rust-lang.org/COPYRIGHT.
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||||
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||||
|
// option. This file may not be copied, modified, or distributed
|
||||||
|
// except according to those terms.
|
||||||
|
|
||||||
// Tests that we are able to distinguish when loans borrow different
|
// Tests that we are able to distinguish when loans borrow different
|
||||||
// anonymous fields of a tuple vs the same anonymous field.
|
// anonymous fields of a tuple vs the same anonymous field.
|
||||||
|
|
||||||
|
@ -1,3 +1,13 @@
|
|||||||
|
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||||
|
// file at the top-level directory of this distribution and at
|
||||||
|
// http://rust-lang.org/COPYRIGHT.
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||||
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||||
|
// option. This file may not be copied, modified, or distributed
|
||||||
|
// except according to those terms.
|
||||||
|
|
||||||
// Tests that we are able to distinguish when loans borrow different
|
// Tests that we are able to distinguish when loans borrow different
|
||||||
// anonymous fields of an enum variant vs the same anonymous field.
|
// anonymous fields of an enum variant vs the same anonymous field.
|
||||||
|
|
||||||
|
@ -1,3 +1,13 @@
|
|||||||
|
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||||
|
// file at the top-level directory of this distribution and at
|
||||||
|
// http://rust-lang.org/COPYRIGHT.
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||||
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||||
|
// option. This file may not be copied, modified, or distributed
|
||||||
|
// except according to those terms.
|
||||||
|
|
||||||
pub fn main() {
|
pub fn main() {
|
||||||
// FIXME(#2202) - Due to the way that borrowck treats closures,
|
// FIXME(#2202) - Due to the way that borrowck treats closures,
|
||||||
// you get two error reports here.
|
// you get two error reports here.
|
||||||
|
@ -1,3 +1,13 @@
|
|||||||
|
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||||
|
// file at the top-level directory of this distribution and at
|
||||||
|
// http://rust-lang.org/COPYRIGHT.
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||||
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||||
|
// option. This file may not be copied, modified, or distributed
|
||||||
|
// except according to those terms.
|
||||||
|
|
||||||
fn with(f: |&~str|) {}
|
fn with(f: |&~str|) {}
|
||||||
|
|
||||||
fn arg_item(&_x: &~str) {}
|
fn arg_item(&_x: &~str) {}
|
||||||
|
@ -1,3 +1,13 @@
|
|||||||
|
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||||
|
// file at the top-level directory of this distribution and at
|
||||||
|
// http://rust-lang.org/COPYRIGHT.
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||||
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||||
|
// option. This file may not be copied, modified, or distributed
|
||||||
|
// except according to those terms.
|
||||||
|
|
||||||
fn call_f(f: proc() -> int) -> int {
|
fn call_f(f: proc() -> int) -> int {
|
||||||
f()
|
f()
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,13 @@
|
|||||||
|
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||||
|
// file at the top-level directory of this distribution and at
|
||||||
|
// http://rust-lang.org/COPYRIGHT.
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||||
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||||
|
// option. This file may not be copied, modified, or distributed
|
||||||
|
// except according to those terms.
|
||||||
|
|
||||||
// Test that attempt to move `&mut` pointer while pointee is borrowed
|
// Test that attempt to move `&mut` pointer while pointee is borrowed
|
||||||
// yields an error.
|
// yields an error.
|
||||||
//
|
//
|
||||||
|
@ -1,3 +1,13 @@
|
|||||||
|
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||||
|
// file at the top-level directory of this distribution and at
|
||||||
|
// http://rust-lang.org/COPYRIGHT.
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||||
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||||
|
// option. This file may not be copied, modified, or distributed
|
||||||
|
// except according to those terms.
|
||||||
|
|
||||||
struct S {f:~str}
|
struct S {f:~str}
|
||||||
impl Drop for S {
|
impl Drop for S {
|
||||||
fn drop(&mut self) { println!("{}", self.f); }
|
fn drop(&mut self) { println!("{}", self.f); }
|
||||||
|
@ -1,3 +1,13 @@
|
|||||||
|
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||||
|
// file at the top-level directory of this distribution and at
|
||||||
|
// http://rust-lang.org/COPYRIGHT.
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||||
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||||
|
// option. This file may not be copied, modified, or distributed
|
||||||
|
// except according to those terms.
|
||||||
|
|
||||||
struct S(~str);
|
struct S(~str);
|
||||||
impl Drop for S {
|
impl Drop for S {
|
||||||
fn drop(&mut self) { }
|
fn drop(&mut self) { }
|
||||||
|
@ -1,3 +1,13 @@
|
|||||||
|
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||||
|
// file at the top-level directory of this distribution and at
|
||||||
|
// http://rust-lang.org/COPYRIGHT.
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||||
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||||
|
// option. This file may not be copied, modified, or distributed
|
||||||
|
// except according to those terms.
|
||||||
|
|
||||||
// Test that we do not permit moves from &[] matched by a vec pattern.
|
// Test that we do not permit moves from &[] matched by a vec pattern.
|
||||||
|
|
||||||
#[deriving(Clone)]
|
#[deriving(Clone)]
|
||||||
|
@ -16,7 +16,8 @@ struct S<'a> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn copy_borrowed_ptr<'a,'b>(p: &'a mut S<'b>) -> S<'b> {
|
fn copy_borrowed_ptr<'a,'b>(p: &'a mut S<'b>) -> S<'b> {
|
||||||
S { pointer: &mut *p.pointer } //~ ERROR lifetime of `p` is too short to guarantee its contents can be safely reborrowed
|
S { pointer: &mut *p.pointer }
|
||||||
|
//~^ ERROR lifetime of `p` is too short to guarantee its contents can be safely reborrowed
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
@ -1,3 +1,13 @@
|
|||||||
|
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||||
|
// file at the top-level directory of this distribution and at
|
||||||
|
// http://rust-lang.org/COPYRIGHT.
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||||
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||||
|
// option. This file may not be copied, modified, or distributed
|
||||||
|
// except according to those terms.
|
||||||
|
|
||||||
#[allow(dead_code)];
|
#[allow(dead_code)];
|
||||||
fn main() {
|
fn main() {
|
||||||
// Original borrow ends at end of function
|
// Original borrow ends at end of function
|
||||||
|
@ -1,3 +1,13 @@
|
|||||||
|
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||||
|
// file at the top-level directory of this distribution and at
|
||||||
|
// http://rust-lang.org/COPYRIGHT.
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||||
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||||
|
// option. This file may not be copied, modified, or distributed
|
||||||
|
// except according to those terms.
|
||||||
|
|
||||||
// Test that attempt to swap `&mut` pointer while pointee is borrowed
|
// Test that attempt to swap `&mut` pointer while pointee is borrowed
|
||||||
// yields an error.
|
// yields an error.
|
||||||
//
|
//
|
||||||
|
@ -1,3 +1,13 @@
|
|||||||
|
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||||
|
// file at the top-level directory of this distribution and at
|
||||||
|
// http://rust-lang.org/COPYRIGHT.
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||||
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||||
|
// option. This file may not be copied, modified, or distributed
|
||||||
|
// except according to those terms.
|
||||||
|
|
||||||
fn a() -> &[int] {
|
fn a() -> &[int] {
|
||||||
let vec = ~[1, 2, 3, 4];
|
let vec = ~[1, 2, 3, 4];
|
||||||
let tail = match vec {
|
let tail = match vec {
|
||||||
|
@ -1,3 +1,13 @@
|
|||||||
|
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||||
|
// file at the top-level directory of this distribution and at
|
||||||
|
// http://rust-lang.org/COPYRIGHT.
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||||
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||||
|
// option. This file may not be copied, modified, or distributed
|
||||||
|
// except according to those terms.
|
||||||
|
|
||||||
fn a() {
|
fn a() {
|
||||||
let mut v = ~[1, 2, 3];
|
let mut v = ~[1, 2, 3];
|
||||||
match v {
|
match v {
|
||||||
|
@ -1,3 +1,13 @@
|
|||||||
|
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||||
|
// file at the top-level directory of this distribution and at
|
||||||
|
// http://rust-lang.org/COPYRIGHT.
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||||
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||||
|
// option. This file may not be copied, modified, or distributed
|
||||||
|
// except according to those terms.
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let mut a = [1, 2, 3, 4];
|
let mut a = [1, 2, 3, 4];
|
||||||
let t = match a {
|
let t = match a {
|
||||||
|
@ -1,3 +1,13 @@
|
|||||||
|
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||||
|
// file at the top-level directory of this distribution and at
|
||||||
|
// http://rust-lang.org/COPYRIGHT.
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||||
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||||
|
// option. This file may not be copied, modified, or distributed
|
||||||
|
// except according to those terms.
|
||||||
|
|
||||||
fn a() {
|
fn a() {
|
||||||
let mut vec = ~[~1, ~2, ~3];
|
let mut vec = ~[~1, ~2, ~3];
|
||||||
match vec {
|
match vec {
|
||||||
|
@ -1,3 +1,13 @@
|
|||||||
|
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||||
|
// file at the top-level directory of this distribution and at
|
||||||
|
// http://rust-lang.org/COPYRIGHT.
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||||
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||||
|
// option. This file may not be copied, modified, or distributed
|
||||||
|
// except according to those terms.
|
||||||
|
|
||||||
fn a() -> &int {
|
fn a() -> &int {
|
||||||
let vec = ~[1, 2, 3, 4];
|
let vec = ~[1, 2, 3, 4];
|
||||||
let tail = match vec {
|
let tail = match vec {
|
||||||
|
@ -1,3 +1,13 @@
|
|||||||
|
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||||
|
// file at the top-level directory of this distribution and at
|
||||||
|
// http://rust-lang.org/COPYRIGHT.
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||||
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||||
|
// option. This file may not be copied, modified, or distributed
|
||||||
|
// except according to those terms.
|
||||||
|
|
||||||
#[feature(managed_boxes)];
|
#[feature(managed_boxes)];
|
||||||
|
|
||||||
fn f<T>(x: T) -> @T {
|
fn f<T>(x: T) -> @T {
|
||||||
|
@ -1,3 +1,13 @@
|
|||||||
|
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||||
|
// file at the top-level directory of this distribution and at
|
||||||
|
// http://rust-lang.org/COPYRIGHT.
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||||
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||||
|
// option. This file may not be copied, modified, or distributed
|
||||||
|
// except according to those terms.
|
||||||
|
|
||||||
enum E {
|
enum E {
|
||||||
Foo,
|
Foo,
|
||||||
Bar(~str)
|
Bar(~str)
|
||||||
|
@ -1,3 +1,13 @@
|
|||||||
|
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||||
|
// file at the top-level directory of this distribution and at
|
||||||
|
// http://rust-lang.org/COPYRIGHT.
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||||
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||||
|
// option. This file may not be copied, modified, or distributed
|
||||||
|
// except according to those terms.
|
||||||
|
|
||||||
|
|
||||||
trait Foo {}
|
trait Foo {}
|
||||||
|
|
||||||
|
@ -1,3 +1,13 @@
|
|||||||
|
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||||
|
// file at the top-level directory of this distribution and at
|
||||||
|
// http://rust-lang.org/COPYRIGHT.
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||||
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||||
|
// option. This file may not be copied, modified, or distributed
|
||||||
|
// except according to those terms.
|
||||||
|
|
||||||
|
|
||||||
fn take_any(_: ||:) {
|
fn take_any(_: ||:) {
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,13 @@
|
|||||||
|
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||||
|
// file at the top-level directory of this distribution and at
|
||||||
|
// http://rust-lang.org/COPYRIGHT.
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||||
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||||
|
// option. This file may not be copied, modified, or distributed
|
||||||
|
// except according to those terms.
|
||||||
|
|
||||||
/* Any copyright is dedicated to the Public Domain.
|
/* Any copyright is dedicated to the Public Domain.
|
||||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||||
|
|
||||||
|
@ -1,3 +1,13 @@
|
|||||||
|
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||||
|
// file at the top-level directory of this distribution and at
|
||||||
|
// http://rust-lang.org/COPYRIGHT.
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||||
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||||
|
// option. This file may not be copied, modified, or distributed
|
||||||
|
// except according to those terms.
|
||||||
|
|
||||||
fn foo(f: || -> !) {}
|
fn foo(f: || -> !) {}
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
@ -1 +1,11 @@
|
|||||||
# //~ ERROR 1:1: 1:2 error: expected item
|
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||||
|
// file at the top-level directory of this distribution and at
|
||||||
|
// http://rust-lang.org/COPYRIGHT.
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||||
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||||
|
// option. This file may not be copied, modified, or distributed
|
||||||
|
// except according to those terms.
|
||||||
|
|
||||||
|
# //~ ERROR 11:1: 11:2 error: expected item
|
||||||
|
@ -17,7 +17,8 @@ use trait_impl_conflict::Foo;
|
|||||||
|
|
||||||
impl<A> Foo for A {
|
impl<A> Foo for A {
|
||||||
//~^ ERROR conflicting implementations for trait `trait_impl_conflict::Foo`
|
//~^ ERROR conflicting implementations for trait `trait_impl_conflict::Foo`
|
||||||
//~^^ ERROR cannot provide an extension implementation where both trait and type are not defined in this crate
|
//~^^ ERROR cannot provide an extension implementation where both trait and type
|
||||||
|
// are not defined in this crate
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
@ -1,3 +1,13 @@
|
|||||||
|
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||||
|
// file at the top-level directory of this distribution and at
|
||||||
|
// http://rust-lang.org/COPYRIGHT.
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||||
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||||
|
// option. This file may not be copied, modified, or distributed
|
||||||
|
// except according to those terms.
|
||||||
|
|
||||||
// xfail-test
|
// xfail-test
|
||||||
|
|
||||||
// xfail'd because the lint pass doesn't know to ignore standard library
|
// xfail'd because the lint pass doesn't know to ignore standard library
|
||||||
|
@ -1,2 +1,12 @@
|
|||||||
|
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||||
|
// file at the top-level directory of this distribution and at
|
||||||
|
// http://rust-lang.org/COPYRIGHT.
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||||
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||||
|
// option. This file may not be copied, modified, or distributed
|
||||||
|
// except according to those terms.
|
||||||
|
|
||||||
// error-pattern: unresolved name `this_does_nothing_what_the`.
|
// error-pattern: unresolved name `this_does_nothing_what_the`.
|
||||||
fn main() { info!("doing"); this_does_nothing_what_the; info!("boing"); }
|
fn main() { info!("doing"); this_does_nothing_what_the; info!("boing"); }
|
||||||
|
@ -1,3 +1,13 @@
|
|||||||
|
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||||
|
// file at the top-level directory of this distribution and at
|
||||||
|
// http://rust-lang.org/COPYRIGHT.
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||||
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||||
|
// option. This file may not be copied, modified, or distributed
|
||||||
|
// except according to those terms.
|
||||||
|
|
||||||
enum test {
|
enum test {
|
||||||
div_zero = 1/0, //~ERROR expected constant: attempted to divide by zero
|
div_zero = 1/0, //~ERROR expected constant: attempted to divide by zero
|
||||||
rem_zero = 1%0 //~ERROR expected constant: attempted remainder with a divisor of zero
|
rem_zero = 1%0 //~ERROR expected constant: attempted remainder with a divisor of zero
|
||||||
|
@ -8,4 +8,7 @@
|
|||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
fn main() { env!("__HOPEFULLY_NOT_DEFINED__"); } //~ ERROR: environment variable `__HOPEFULLY_NOT_DEFINED__` not defined
|
fn main() {
|
||||||
|
env!("__HOPEFULLY_NOT_DEFINED__");
|
||||||
|
//~^ ERROR: environment variable `__HOPEFULLY_NOT_DEFINED__` not defined
|
||||||
|
}
|
||||||
|
@ -17,6 +17,8 @@ impl<A, B, C = (A, B)> Foo<A, B, C> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
Foo::<int>::new(); //~ ERROR the impl referenced by this path needs at least 2 type parameters, but 1 type parameter were supplied
|
Foo::<int>::new();
|
||||||
//~^ ERROR not enough type parameters provided: expected at least 2, found 1
|
//~^ ERROR the impl referenced by this path needs at least 2 type parameters,
|
||||||
|
// but 1 was supplied
|
||||||
|
//~^^^ ERROR not enough type parameters provided: expected at least 2, found 1
|
||||||
}
|
}
|
||||||
|
@ -19,6 +19,8 @@ impl<T, A = Heap> Vec<T, A> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
Vec::<int, Heap, bool>::new(); //~ ERROR the impl referenced by this path needs at most 2 type parameters, but 3 type parameters were supplied
|
Vec::<int, Heap, bool>::new();
|
||||||
//~^ ERROR too many type parameters provided: expected at most 2, found 3
|
//~^ ERROR the impl referenced by this path needs at most 2 type parameters,
|
||||||
|
// but 3 were supplied
|
||||||
|
//~^^^ ERROR too many type parameters provided: expected at most 2, found 3
|
||||||
}
|
}
|
||||||
|
@ -15,5 +15,6 @@ struct Heap;
|
|||||||
struct Vec<T, A = Heap>;
|
struct Vec<T, A = Heap>;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let _: Vec<int, Heap, bool>; //~ ERROR wrong number of type arguments: expected at most 2 but found 3
|
let _: Vec<int, Heap, bool>;
|
||||||
|
//~^ ERROR wrong number of type arguments: expected at most 2 but found 3
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,13 @@
|
|||||||
|
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||||
|
// file at the top-level directory of this distribution and at
|
||||||
|
// http://rust-lang.org/COPYRIGHT.
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||||
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||||
|
// option. This file may not be copied, modified, or distributed
|
||||||
|
// except according to those terms.
|
||||||
|
|
||||||
// regression test for issue 11256
|
// regression test for issue 11256
|
||||||
#[crate_type="foo"]; //~ ERROR invalid `crate_type` value
|
#[crate_type="foo"]; //~ ERROR invalid `crate_type` value
|
||||||
|
|
||||||
|
@ -18,7 +18,8 @@ pub struct send_packet<T> {
|
|||||||
mod pingpong {
|
mod pingpong {
|
||||||
use send_packet;
|
use send_packet;
|
||||||
pub type ping = send_packet<pong>;
|
pub type ping = send_packet<pong>;
|
||||||
pub struct pong(send_packet<ping>); //~ ERROR illegal recursive enum type; wrap the inner value in a box to make it representable
|
pub struct pong(send_packet<ping>);
|
||||||
|
//~^ ERROR illegal recursive enum type; wrap the inner value in a box to make it representable
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() {}
|
fn main() {}
|
||||||
|
@ -9,7 +9,8 @@
|
|||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
enum foo { foo(bar) }
|
enum foo { foo(bar) }
|
||||||
enum bar { bar_none, bar_some(bar) } //~ ERROR illegal recursive enum type; wrap the inner value in a box to make it representable
|
enum bar { bar_none, bar_some(bar) }
|
||||||
|
//~^ ERROR illegal recursive enum type; wrap the inner value in a box to make it representable
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
}
|
}
|
||||||
|
@ -9,8 +9,9 @@
|
|||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
enum foo { foo(bar) }
|
enum foo { foo(bar) }
|
||||||
struct bar { x: bar } //~ ERROR illegal recursive struct type; wrap the inner value in a box to make it representable
|
struct bar { x: bar }
|
||||||
//~^ ERROR this type cannot be instantiated without an instance of itself
|
//~^ ERROR illegal recursive struct type; wrap the inner value in a box to make it representable
|
||||||
|
//~^^ ERROR this type cannot be instantiated without an instance of itself
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,8 @@
|
|||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
enum E1 { V1(E2<E1>), }
|
enum E1 { V1(E2<E1>), }
|
||||||
enum E2<T> { V2(E2<E1>), } //~ ERROR illegal recursive enum type; wrap the inner value in a box to make it representable
|
enum E2<T> { V2(E2<E1>), }
|
||||||
|
//~^ ERROR illegal recursive enum type; wrap the inner value in a box to make it representable
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,13 @@
|
|||||||
|
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||||
|
// file at the top-level directory of this distribution and at
|
||||||
|
// http://rust-lang.org/COPYRIGHT.
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||||
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||||
|
// option. This file may not be copied, modified, or distributed
|
||||||
|
// except according to those terms.
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let _p: char = 100; //~ ERROR mismatched types: expected `char` but found
|
let _p: char = 100; //~ ERROR mismatched types: expected `char` but found
|
||||||
}
|
}
|
||||||
|
@ -17,7 +17,8 @@ trait PTrait {
|
|||||||
|
|
||||||
impl PTrait for P {
|
impl PTrait for P {
|
||||||
fn getChildOption(&self) -> Option<@P> {
|
fn getChildOption(&self) -> Option<@P> {
|
||||||
static childVal: @P = self.child.get(); //~ ERROR attempt to use a non-constant value in a constant
|
static childVal: @P = self.child.get();
|
||||||
|
//~^ ERROR attempt to use a non-constant value in a constant
|
||||||
fail!();
|
fail!();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10,6 +10,8 @@
|
|||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
match None {
|
match None {
|
||||||
Err(_) => () //~ ERROR mismatched types: expected `std::option::Option<<generic #1>>` but found `std::result::Result<<generic #2>,<generic #3>>`
|
Err(_) => ()
|
||||||
|
//~^ ERROR mismatched types: expected `std::option::Option<<generic #1>>`
|
||||||
|
// but found `std::result::Result<<generic #2>,<generic #3>>`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,8 @@
|
|||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
struct S { //~ ERROR illegal recursive struct type; wrap the inner value in a box to make it representable
|
struct S {
|
||||||
|
//~^ ERROR illegal recursive struct type; wrap the inner value in a box to make it representable
|
||||||
element: Option<S>
|
element: Option<S>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,18 @@
|
|||||||
|
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||||
|
// file at the top-level directory of this distribution and at
|
||||||
|
// http://rust-lang.org/COPYRIGHT.
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||||
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||||
|
// option. This file may not be copied, modified, or distributed
|
||||||
|
// except according to those terms.
|
||||||
|
|
||||||
fn bar(int_param: int) {}
|
fn bar(int_param: int) {}
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let foo: [u8, ..4] = [1u8, ..4u8];
|
let foo: [u8, ..4] = [1u8, ..4u8];
|
||||||
bar(foo); //~ ERROR mismatched types: expected `int` but found `[u8, .. 4]` (expected int but found vector)
|
bar(foo);
|
||||||
|
//~^ ERROR mismatched types: expected `int` but found `[u8, .. 4]`
|
||||||
|
// (expected int but found vector)
|
||||||
}
|
}
|
||||||
|
@ -12,5 +12,7 @@
|
|||||||
|
|
||||||
static A: (int,int) = (4,2);
|
static A: (int,int) = (4,2);
|
||||||
fn main() {
|
fn main() {
|
||||||
match 42 { A => () } //~ ERROR mismatched types: expected `<generic integer #0>` but found `(int,int)` (expected integral variable but found tuple)
|
match 42 { A => () }
|
||||||
|
//~^ ERROR mismatched types: expected `<generic integer #0>` but found `(int,int)`
|
||||||
|
// (expected integral variable but found tuple)
|
||||||
}
|
}
|
||||||
|
@ -17,15 +17,19 @@ fn main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
match (true, false) {
|
match (true, false) {
|
||||||
(true, false, false) => () //~ ERROR mismatched types: expected `(bool,bool)` but found tuple (expected a tuple with 2 elements but found one with 3 elements)
|
(true, false, false) => ()
|
||||||
|
//~^ ERROR mismatched types: expected `(bool,bool)` but found tuple
|
||||||
|
// (expected a tuple with 2 elements but found one with 3 elements)
|
||||||
}
|
}
|
||||||
|
|
||||||
match (true, false) {
|
match (true, false) {
|
||||||
~(true, false) => () //~ ERROR mismatched types: expected `(bool,bool)` but found a ~-box pattern
|
~(true, false) => ()
|
||||||
|
//~^ ERROR mismatched types: expected `(bool,bool)` but found a ~-box pattern
|
||||||
}
|
}
|
||||||
|
|
||||||
match (true, false) {
|
match (true, false) {
|
||||||
&(true, false) => () //~ ERROR mismatched types: expected `(bool,bool)` but found an &-pointer pattern
|
&(true, false) => ()
|
||||||
|
//~^ ERROR mismatched types: expected `(bool,bool)` but found an &-pointer pattern
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -11,5 +11,6 @@
|
|||||||
// Regression test for issue #5239
|
// Regression test for issue #5239
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let x: |int| -> int = |ref x| { x += 1; }; //~ ERROR binary assignment operation `+=` cannot be applied to type `&int`
|
let x: |int| -> int = |ref x| { x += 1; };
|
||||||
|
//~^ ERROR binary assignment operation `+=` cannot be applied to type `&int`
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,13 @@
|
|||||||
|
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||||
|
// file at the top-level directory of this distribution and at
|
||||||
|
// http://rust-lang.org/COPYRIGHT.
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||||
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||||
|
// option. This file may not be copied, modified, or distributed
|
||||||
|
// except according to those terms.
|
||||||
|
|
||||||
// opyright 2013 The Rust Project Developers. See the COPYRIGHT
|
// opyright 2013 The Rust Project Developers. See the COPYRIGHT
|
||||||
// file at the top-level directory of this distribution and at
|
// file at the top-level directory of this distribution and at
|
||||||
// http://rust-lang.org/COPYRIGHT.
|
// http://rust-lang.org/COPYRIGHT.
|
||||||
|
@ -1,3 +1,13 @@
|
|||||||
|
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||||
|
// file at the top-level directory of this distribution and at
|
||||||
|
// http://rust-lang.org/COPYRIGHT.
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||||
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||||
|
// option. This file may not be copied, modified, or distributed
|
||||||
|
// except according to those terms.
|
||||||
|
|
||||||
#[feature(macro_rules)];
|
#[feature(macro_rules)];
|
||||||
|
|
||||||
// error-pattern: unknown macro variable `nonexistent`
|
// error-pattern: unknown macro variable `nonexistent`
|
||||||
|
@ -1,3 +1,13 @@
|
|||||||
|
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||||
|
// file at the top-level directory of this distribution and at
|
||||||
|
// http://rust-lang.org/COPYRIGHT.
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||||
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||||
|
// option. This file may not be copied, modified, or distributed
|
||||||
|
// except according to those terms.
|
||||||
|
|
||||||
//xfail-test
|
//xfail-test
|
||||||
|
|
||||||
// Creating a stack closure which references an owned pointer and then
|
// Creating a stack closure which references an owned pointer and then
|
||||||
|
@ -1,3 +1,13 @@
|
|||||||
|
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||||
|
// file at the top-level directory of this distribution and at
|
||||||
|
// http://rust-lang.org/COPYRIGHT.
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||||
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||||
|
// option. This file may not be copied, modified, or distributed
|
||||||
|
// except according to those terms.
|
||||||
|
|
||||||
#[allow(dead_code)];
|
#[allow(dead_code)];
|
||||||
|
|
||||||
// Matching against NaN should result in a warning
|
// Matching against NaN should result in a warning
|
||||||
|
@ -1,3 +1,13 @@
|
|||||||
|
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||||
|
// file at the top-level directory of this distribution and at
|
||||||
|
// http://rust-lang.org/COPYRIGHT.
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||||
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||||
|
// option. This file may not be copied, modified, or distributed
|
||||||
|
// except according to those terms.
|
||||||
|
|
||||||
// Trying to create a fixed-length vector with a negative size
|
// Trying to create a fixed-length vector with a negative size
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
@ -36,7 +36,8 @@ struct A
|
|||||||
|
|
||||||
fn main()
|
fn main()
|
||||||
{
|
{
|
||||||
let a = A {v: ~B{v: None} as ~Foo}; //~ ERROR cannot pack type `~B`, which does not fulfill `Send`
|
let a = A {v: ~B{v: None} as ~Foo};
|
||||||
|
//~^ ERROR cannot pack type `~B`, which does not fulfill `Send`
|
||||||
let v = Rc::new(RefCell::new(a));
|
let v = Rc::new(RefCell::new(a));
|
||||||
let w = v.clone();
|
let w = v.clone();
|
||||||
let b = v.borrow();
|
let b = v.borrow();
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
use std::ptr;
|
use std::ptr;
|
||||||
pub unsafe fn g() {
|
pub unsafe fn g() {
|
||||||
return;
|
return;
|
||||||
if *ptr::null() {}; //~ ERROR unreachable
|
if *ptr::null() {}; //~ ERROR unreachable
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,3 +1,13 @@
|
|||||||
|
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||||
|
// file at the top-level directory of this distribution and at
|
||||||
|
// http://rust-lang.org/COPYRIGHT.
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||||
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||||
|
// option. This file may not be copied, modified, or distributed
|
||||||
|
// except according to those terms.
|
||||||
|
|
||||||
// xfail-test
|
// xfail-test
|
||||||
// xfail'd because the lint pass doesn't know to ignore standard library
|
// xfail'd because the lint pass doesn't know to ignore standard library
|
||||||
// stuff.
|
// stuff.
|
||||||
|
@ -1,3 +1,13 @@
|
|||||||
|
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||||
|
// file at the top-level directory of this distribution and at
|
||||||
|
// http://rust-lang.org/COPYRIGHT.
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||||
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||||
|
// option. This file may not be copied, modified, or distributed
|
||||||
|
// except according to those terms.
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let super: int; //~ ERROR found `super` in ident position
|
let super: int; //~ ERROR found `super` in ident position
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1,21 @@
|
|||||||
|
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||||
|
// file at the top-level directory of this distribution and at
|
||||||
|
// http://rust-lang.org/COPYRIGHT.
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||||
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||||
|
// option. This file may not be copied, modified, or distributed
|
||||||
|
// except according to those terms.
|
||||||
|
|
||||||
#[feature(managed_boxes)];
|
#[feature(managed_boxes)];
|
||||||
|
|
||||||
struct Foo {
|
struct Foo {
|
||||||
f: @int,
|
f: @int,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Drop for Foo { //~ ERROR cannot implement a destructor on a structure that does not satisfy Send
|
impl Drop for Foo {
|
||||||
|
//~^ ERROR cannot implement a destructor on a structure that does not satisfy Send
|
||||||
fn drop(&mut self) {
|
fn drop(&mut self) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,13 @@
|
|||||||
|
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||||
|
// file at the top-level directory of this distribution and at
|
||||||
|
// http://rust-lang.org/COPYRIGHT.
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||||
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||||
|
// option. This file may not be copied, modified, or distributed
|
||||||
|
// except according to those terms.
|
||||||
|
|
||||||
// xfail-test
|
// xfail-test
|
||||||
// xfail'd because to_foo() doesn't work.
|
// xfail'd because to_foo() doesn't work.
|
||||||
|
|
||||||
|
@ -34,9 +34,9 @@ fn main() {
|
|||||||
test(1000); //~ error: literal out of range for its type
|
test(1000); //~ error: literal out of range for its type
|
||||||
|
|
||||||
let x = 128_i8; //~ error: literal out of range for its type
|
let x = 128_i8; //~ error: literal out of range for its type
|
||||||
let x = 127_i8;
|
let x = 127_i8;
|
||||||
let x = -128_i8;
|
let x = -128_i8;
|
||||||
let x = -(128_i8);
|
let x = -(128_i8);
|
||||||
let x = -129_i8; //~ error: literal out of range for its type
|
let x = -129_i8; //~ error: literal out of range for its type
|
||||||
|
|
||||||
let x: i32 = 2147483647; // should be OK
|
let x: i32 = 2147483647; // should be OK
|
||||||
|
@ -12,8 +12,9 @@
|
|||||||
|
|
||||||
#[feature(macro_rules)];
|
#[feature(macro_rules)];
|
||||||
|
|
||||||
macro_rules! test ( () => { fn foo() -> int { 1i; } } ) //~ ERROR not all control paths return a value
|
macro_rules! test ( () => { fn foo() -> int { 1i; } } )
|
||||||
//~^ NOTE consider removing this semicolon
|
//~^ ERROR not all control paths return a value
|
||||||
|
//~^^ NOTE consider removing this semicolon
|
||||||
|
|
||||||
fn no_return() -> int {} //~ ERROR not all control paths return a value
|
fn no_return() -> int {} //~ ERROR not all control paths return a value
|
||||||
|
|
||||||
|
@ -1,3 +1,13 @@
|
|||||||
|
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||||
|
// file at the top-level directory of this distribution and at
|
||||||
|
// http://rust-lang.org/COPYRIGHT.
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||||
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||||
|
// option. This file may not be copied, modified, or distributed
|
||||||
|
// except according to those terms.
|
||||||
|
|
||||||
// xfail-test
|
// xfail-test
|
||||||
// xfail'd because lint is messed up with the new visitor transition
|
// xfail'd because lint is messed up with the new visitor transition
|
||||||
|
|
||||||
|
@ -1,3 +1,13 @@
|
|||||||
|
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||||
|
// file at the top-level directory of this distribution and at
|
||||||
|
// http://rust-lang.org/COPYRIGHT.
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||||
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||||
|
// option. This file may not be copied, modified, or distributed
|
||||||
|
// except according to those terms.
|
||||||
|
|
||||||
#[feature(macro_rules)];
|
#[feature(macro_rules)];
|
||||||
|
|
||||||
macro_rules! test ( ($nm:ident,
|
macro_rules! test ( ($nm:ident,
|
||||||
|
@ -1,3 +1,13 @@
|
|||||||
|
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||||
|
// file at the top-level directory of this distribution and at
|
||||||
|
// http://rust-lang.org/COPYRIGHT.
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||||
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||||
|
// option. This file may not be copied, modified, or distributed
|
||||||
|
// except according to those terms.
|
||||||
|
|
||||||
#[feature(macro_rules)];
|
#[feature(macro_rules)];
|
||||||
|
|
||||||
macro_rules! test ( ($nm:ident,
|
macro_rules! test ( ($nm:ident,
|
||||||
|
@ -17,5 +17,6 @@ fn main() {
|
|||||||
let x: ~HashMap<~str, ~str> = ~HashMap::new();
|
let x: ~HashMap<~str, ~str> = ~HashMap::new();
|
||||||
let x: ~Map<~str, ~str> = x;
|
let x: ~Map<~str, ~str> = x;
|
||||||
let y: ~Map<uint, ~str> = ~x;
|
let y: ~Map<uint, ~str> = ~x;
|
||||||
//~^ ERROR failed to find an implementation of trait std::container::Map<uint,~str> for ~std::container::Map<~str,~str>:Send
|
//~^ ERROR failed to find an implementation of trait std::container::Map<uint,~str>
|
||||||
|
// for ~std::container::Map<~str,~str>:Send
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,13 @@
|
|||||||
|
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||||
|
// file at the top-level directory of this distribution and at
|
||||||
|
// http://rust-lang.org/COPYRIGHT.
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||||
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||||
|
// option. This file may not be copied, modified, or distributed
|
||||||
|
// except according to those terms.
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
match 1 {
|
match 1 {
|
||||||
1..2u => 1, //~ ERROR mismatched types in range
|
1..2u => 1, //~ ERROR mismatched types in range
|
||||||
|
@ -1,3 +1,13 @@
|
|||||||
|
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||||
|
// file at the top-level directory of this distribution and at
|
||||||
|
// http://rust-lang.org/COPYRIGHT.
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||||
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||||
|
// option. This file may not be copied, modified, or distributed
|
||||||
|
// except according to those terms.
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
match 1 {
|
match 1 {
|
||||||
1 => 1, //~ ERROR mismatched types between arms
|
1 => 1, //~ ERROR mismatched types between arms
|
||||||
|
@ -1,3 +1,13 @@
|
|||||||
|
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||||
|
// file at the top-level directory of this distribution and at
|
||||||
|
// http://rust-lang.org/COPYRIGHT.
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||||
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||||
|
// option. This file may not be copied, modified, or distributed
|
||||||
|
// except according to those terms.
|
||||||
|
|
||||||
|
|
||||||
struct S { a: int }
|
struct S { a: int }
|
||||||
enum E { C(int) }
|
enum E { C(int) }
|
||||||
|
@ -1,3 +1,13 @@
|
|||||||
|
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||||
|
// file at the top-level directory of this distribution and at
|
||||||
|
// http://rust-lang.org/COPYRIGHT.
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||||
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||||
|
// option. This file may not be copied, modified, or distributed
|
||||||
|
// except according to those terms.
|
||||||
|
|
||||||
fn a() {
|
fn a() {
|
||||||
let v = [1, 2, 3];
|
let v = [1, 2, 3];
|
||||||
match v {
|
match v {
|
||||||
|
@ -1,3 +1,13 @@
|
|||||||
|
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||||
|
// file at the top-level directory of this distribution and at
|
||||||
|
// http://rust-lang.org/COPYRIGHT.
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||||
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||||
|
// option. This file may not be copied, modified, or distributed
|
||||||
|
// except according to those terms.
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let a = ~[];
|
let a = ~[];
|
||||||
match a {
|
match a {
|
||||||
|
@ -1,3 +1,13 @@
|
|||||||
|
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||||
|
// file at the top-level directory of this distribution and at
|
||||||
|
// http://rust-lang.org/COPYRIGHT.
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||||
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||||
|
// option. This file may not be copied, modified, or distributed
|
||||||
|
// except according to those terms.
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
match () {
|
match () {
|
||||||
[()] => { } //~ ERROR mismatched types: expected `()` but found a vector pattern
|
[()] => { } //~ ERROR mismatched types: expected `()` but found a vector pattern
|
||||||
|
@ -1,3 +1,13 @@
|
|||||||
|
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||||
|
// file at the top-level directory of this distribution and at
|
||||||
|
// http://rust-lang.org/COPYRIGHT.
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||||
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||||
|
// option. This file may not be copied, modified, or distributed
|
||||||
|
// except according to those terms.
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
match ~"foo" {
|
match ~"foo" {
|
||||||
['f', 'o', ..] => { } //~ ERROR mismatched types: expected `~str` but found a vector pattern
|
['f', 'o', ..] => { } //~ ERROR mismatched types: expected `~str` but found a vector pattern
|
||||||
|
@ -1,3 +1,13 @@
|
|||||||
|
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||||
|
// file at the top-level directory of this distribution and at
|
||||||
|
// http://rust-lang.org/COPYRIGHT.
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||||
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||||
|
// option. This file may not be copied, modified, or distributed
|
||||||
|
// except according to those terms.
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let x: ~[(int, int)] = ~[];
|
let x: ~[(int, int)] = ~[];
|
||||||
match x {
|
match x {
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user