diff options
| author | bors <bors@rust-lang.org> | 2017-04-05 16:47:45 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2017-04-05 16:47:45 +0000 |
| commit | 46f71a03f9b7bad2fa469113e3858ea2bdbbb5e5 (patch) | |
| tree | f1781c8eee2c19a80fc40159ebe7c9de37817f31 /src/test | |
| parent | ad5dfecc6ae23bb7d2b8075d705011918ab4f399 (diff) | |
| parent | 97a1f4b1f4e2acc25f939ea08ff634f70e1ab58d (diff) | |
| download | rust-46f71a03f9b7bad2fa469113e3858ea2bdbbb5e5.tar.gz rust-46f71a03f9b7bad2fa469113e3858ea2bdbbb5e5.zip | |
Auto merge of #41086 - frewsxcv:rollup, r=frewsxcv
Rollup of 19 pull requests - Successful merges: #40608, #40870, #40949, #40977, #40981, #40988, #40992, #40997, #40999, #41007, #41014, #41019, #41035, #41043, #41049, #41062, #41066, #41076, #41085 - Failed merges:
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/compile-fail/windows-subsystem-invalid.rs | 1 | ||||
| -rw-r--r-- | src/test/run-make/multiple-emits/Makefile | 7 | ||||
| -rw-r--r-- | src/test/run-make/multiple-emits/foo.rs (renamed from src/test/compile-fail/windows-subsystem-gated.rs) | 7 | ||||
| -rw-r--r-- | src/test/run-make/windows-subsystem/console.rs | 1 | ||||
| -rw-r--r-- | src/test/run-make/windows-subsystem/windows.rs | 1 | ||||
| -rw-r--r-- | src/test/rustdoc/test-lists.rs | 32 | ||||
| -rw-r--r-- | src/test/ui/suggestions/confuse-field-and-method/private-field.rs | 29 | ||||
| -rw-r--r-- | src/test/ui/suggestions/confuse-field-and-method/private-field.stderr | 8 |
8 files changed, 77 insertions, 9 deletions
diff --git a/src/test/compile-fail/windows-subsystem-invalid.rs b/src/test/compile-fail/windows-subsystem-invalid.rs index e0003440719..7772cfd6a2c 100644 --- a/src/test/compile-fail/windows-subsystem-invalid.rs +++ b/src/test/compile-fail/windows-subsystem-invalid.rs @@ -10,7 +10,6 @@ // error-pattern: invalid windows subsystem `wrong`, only `windows` and `console` are allowed -#![feature(windows_subsystem)] #![windows_subsystem = "wrong"] fn main() {} diff --git a/src/test/run-make/multiple-emits/Makefile b/src/test/run-make/multiple-emits/Makefile new file mode 100644 index 00000000000..e126422835c --- /dev/null +++ b/src/test/run-make/multiple-emits/Makefile @@ -0,0 +1,7 @@ +-include ../tools.mk + +all: + $(RUSTC) foo.rs --emit=asm,llvm-ir -o $(TMPDIR)/out 2>&1 + rm $(TMPDIR)/out.ll $(TMPDIR)/out.s + $(RUSTC) foo.rs --emit=asm,llvm-ir -o $(TMPDIR)/out2.ext 2>&1 + rm $(TMPDIR)/out2.ll $(TMPDIR)/out2.s diff --git a/src/test/compile-fail/windows-subsystem-gated.rs b/src/test/run-make/multiple-emits/foo.rs index 63f891a2af7..8ae3d072362 100644 --- a/src/test/compile-fail/windows-subsystem-gated.rs +++ b/src/test/run-make/multiple-emits/foo.rs @@ -1,4 +1,4 @@ -// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// 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. // @@ -8,9 +8,4 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// gate-test-windows_subsystem - -#![windows_subsystem = "console"] -//~^ ERROR: the windows subsystem attribute is currently unstable - fn main() {} diff --git a/src/test/run-make/windows-subsystem/console.rs b/src/test/run-make/windows-subsystem/console.rs index 3aedb0ecab7..ffad1e35ee6 100644 --- a/src/test/run-make/windows-subsystem/console.rs +++ b/src/test/run-make/windows-subsystem/console.rs @@ -8,7 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(windows_subsystem)] #![windows_subsystem = "console"] fn main() {} diff --git a/src/test/run-make/windows-subsystem/windows.rs b/src/test/run-make/windows-subsystem/windows.rs index 5d875a5a1bf..33cbe320591 100644 --- a/src/test/run-make/windows-subsystem/windows.rs +++ b/src/test/run-make/windows-subsystem/windows.rs @@ -8,7 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(windows_subsystem)] #![windows_subsystem = "windows"] fn main() {} diff --git a/src/test/rustdoc/test-lists.rs b/src/test/rustdoc/test-lists.rs new file mode 100644 index 00000000000..71a826a2bed --- /dev/null +++ b/src/test/rustdoc/test-lists.rs @@ -0,0 +1,32 @@ +// Copyright 2017 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_name = "foo"] + +// ignore-tidy-linelength + +// @has foo/fn.f.html +// @has - "<pre class='rust fn'>pub fn f()</pre><div class='docblock'><ol><li>list<ol><li>fooooo</li><li>x</li></ol></li><li>foo</li></ol>" +/// 1. list +/// 1. fooooo +/// 2. x +/// 2. foo +pub fn f() {} + +// @has foo/fn.foo2.html +// @has - "<pre class='rust fn'>pub fn foo2()</pre><div class='docblock'><ul><li>normal list<ul><li><p>sub list</p></li><li><p>new elem still same elem</p><p>and again same elem!</p></li></ul></li><li>new big elem</li></ul>" +/// * normal list +/// * sub list +/// * new elem +/// still same elem +/// +/// and again same elem! +/// * new big elem +pub fn foo2() {} \ No newline at end of file diff --git a/src/test/ui/suggestions/confuse-field-and-method/private-field.rs b/src/test/ui/suggestions/confuse-field-and-method/private-field.rs new file mode 100644 index 00000000000..94cf38fb32f --- /dev/null +++ b/src/test/ui/suggestions/confuse-field-and-method/private-field.rs @@ -0,0 +1,29 @@ +// Copyright 2017 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 animal { + pub struct Dog { + pub age: usize, + dog_age: usize, + } + + impl Dog { + pub fn new(age: usize) -> Dog { + Dog { age: age, dog_age: age * 7 } + } + } +} + +fn main() { + let dog = animal::Dog::new(3); + let dog_age = dog.dog_age(); + //let dog_age = dog.dog_age; + println!("{}", dog_age); +} diff --git a/src/test/ui/suggestions/confuse-field-and-method/private-field.stderr b/src/test/ui/suggestions/confuse-field-and-method/private-field.stderr new file mode 100644 index 00000000000..d07885915d2 --- /dev/null +++ b/src/test/ui/suggestions/confuse-field-and-method/private-field.stderr @@ -0,0 +1,8 @@ +error: no method named `dog_age` found for type `animal::Dog` in the current scope + --> $DIR/private-field.rs:26:23 + | +26 | let dog_age = dog.dog_age(); + | ^^^^^^^ private field, not a method + +error: aborting due to previous error + |
