diff options
| author | Felix S. Klock II <pnkfelix@pnkfx.org> | 2018-04-11 00:20:05 +0200 |
|---|---|---|
| committer | Felix S. Klock II <pnkfelix@pnkfx.org> | 2018-04-11 00:20:05 +0200 |
| commit | 1c8d2bdda16854743069988fdb50a0185dfcb472 (patch) | |
| tree | 1864594cd2b846ec2bc878ac058ff9b560944756 | |
| parent | ae05961fdf5048cb5af27621390dd6c22aaee102 (diff) | |
| download | rust-1c8d2bdda16854743069988fdb50a0185dfcb472.tar.gz rust-1c8d2bdda16854743069988fdb50a0185dfcb472.zip | |
Workaround rust-lang/rust#49855 by forcing rustc_error in any mode, including NLL.
NOTE: I was careful to make each change in a manner that preserves the existing diagnostic output (usually by ensuring that no lines were added or removed). This means that the resulting source files are not as nice to read as they were at the start. But we will have to review these cases by hand anyway as follow-up work, so cleanup could reasonably happen then (or not at all).
27 files changed, 54 insertions, 54 deletions
diff --git a/src/test/ui/borrowck/borrowck-report-with-custom-diagnostic.rs b/src/test/ui/borrowck/borrowck-report-with-custom-diagnostic.rs index a6553160557..cdfee2e8a70 100644 --- a/src/test/ui/borrowck/borrowck-report-with-custom-diagnostic.rs +++ b/src/test/ui/borrowck/borrowck-report-with-custom-diagnostic.rs @@ -7,9 +7,9 @@ // <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(rustc_attrs)] #![allow(dead_code)] -fn main() { +fn main() { #![rustc_error] // rust-lang/rust#49855 // Original borrow ends at end of function let mut x = 1; let y = &mut x; diff --git a/src/test/ui/borrowck/mut-borrow-outside-loop.rs b/src/test/ui/borrowck/mut-borrow-outside-loop.rs index a1ab41bab33..edc877718ad 100644 --- a/src/test/ui/borrowck/mut-borrow-outside-loop.rs +++ b/src/test/ui/borrowck/mut-borrow-outside-loop.rs @@ -9,8 +9,8 @@ // except according to those terms. // ensure borrowck messages are correct outside special case - -fn main() { +#![feature(rustc_attrs)] +fn main() { #![rustc_error] // rust-lang/rust#49855 let mut void = (); let first = &mut void; diff --git a/src/test/ui/codemap_tests/issue-11715.rs b/src/test/ui/codemap_tests/issue-11715.rs index 75581d38927..03c85fbfcd7 100644 --- a/src/test/ui/codemap_tests/issue-11715.rs +++ b/src/test/ui/codemap_tests/issue-11715.rs @@ -93,8 +93,8 @@ - -fn main() { +#![feature(rustc_attrs)] +fn main() { #![rustc_error] // rust-lang/rust#49855 let mut x = "foo"; let y = &mut x; let z = &mut x; //~ ERROR cannot borrow diff --git a/src/test/ui/dropck/dropck-eyepatch-extern-crate.rs b/src/test/ui/dropck/dropck-eyepatch-extern-crate.rs index 4f88b0e6fcc..e06b47a8d79 100644 --- a/src/test/ui/dropck/dropck-eyepatch-extern-crate.rs +++ b/src/test/ui/dropck/dropck-eyepatch-extern-crate.rs @@ -19,12 +19,12 @@ // // See also dropck-eyepatch.rs for more information about the general // structure of the test. - +#![feature(rustc_attrs)] extern crate dropck_eyepatch_extern_crate as other; use other::{Dt,Dr,Pt,Pr,St,Sr}; -fn main() { +fn main() { #![rustc_error] // rust-lang/rust#49855 use std::cell::Cell; let c_long; let (c, mut dt, mut dr, mut pt, mut pr, st, sr) diff --git a/src/test/ui/dropck/dropck-eyepatch-reorder.rs b/src/test/ui/dropck/dropck-eyepatch-reorder.rs index eda8d85f6ec..832eeacbec5 100644 --- a/src/test/ui/dropck/dropck-eyepatch-reorder.rs +++ b/src/test/ui/dropck/dropck-eyepatch-reorder.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(dropck_eyepatch)] +#![feature(dropck_eyepatch, rustc_attrs)] // The point of this test is to test uses of `#[may_dangle]` attribute // where the formal declaration order (in the impl generics) does not @@ -41,7 +41,7 @@ unsafe impl<'b, #[may_dangle] 'a, B: fmt::Debug> Drop for Pr<'a, 'b, B> { fn drop(&mut self) { println!("drop {} {:?}", self.0, self.2); } } -fn main() { +fn main() { #![rustc_error] // rust-lang/rust#49855 use std::cell::Cell; let c_long; let (c, mut dt, mut dr, mut pt, mut pr, st, sr) diff --git a/src/test/ui/dropck/dropck-eyepatch.rs b/src/test/ui/dropck/dropck-eyepatch.rs index af173a2e979..cfa67837485 100644 --- a/src/test/ui/dropck/dropck-eyepatch.rs +++ b/src/test/ui/dropck/dropck-eyepatch.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(dropck_eyepatch)] +#![feature(dropck_eyepatch, rustc_attrs)] // The point of this test is to illustrate that the `#[may_dangle]` // attribute specifically allows, in the context of a type @@ -64,7 +64,7 @@ unsafe impl<#[may_dangle] 'a, 'b, B: fmt::Debug> Drop for Pr<'a, 'b, B> { fn drop(&mut self) { println!("drop {} {:?}", self.0, self.2); } } -fn main() { +fn main() { #![rustc_error] // rust-lang/rust#49855 use std::cell::Cell; let c_long; let (c, mut dt, mut dr, mut pt, mut pr, st, sr) diff --git a/src/test/ui/error-codes/E0499.rs b/src/test/ui/error-codes/E0499.rs index 9a64bfe2ea9..c3997236934 100644 --- a/src/test/ui/error-codes/E0499.rs +++ b/src/test/ui/error-codes/E0499.rs @@ -7,8 +7,8 @@ // <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() { +#![feature(rustc_attrs)] +fn main() { #![rustc_error] // rust-lang/rust#49855 let mut i = 0; let mut x = &mut i; let mut a = &mut i; //~ ERROR E0499 diff --git a/src/test/ui/error-codes/E0502.rs b/src/test/ui/error-codes/E0502.rs index fce8513ca64..9c126bdcde8 100644 --- a/src/test/ui/error-codes/E0502.rs +++ b/src/test/ui/error-codes/E0502.rs @@ -7,12 +7,12 @@ // <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(rustc_attrs)] fn bar(x: &mut i32) {} fn foo(a: &mut i32) { let ref y = a; bar(a); //~ ERROR E0502 } -fn main() { +fn main() { #![rustc_error] // rust-lang/rust#49855 } diff --git a/src/test/ui/error-codes/E0503.rs b/src/test/ui/error-codes/E0503.rs index 810eb8d9b07..1822a8925d3 100644 --- a/src/test/ui/error-codes/E0503.rs +++ b/src/test/ui/error-codes/E0503.rs @@ -7,8 +7,8 @@ // <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() { +#![feature(rustc_attrs)] +fn main() { #![rustc_error] // rust-lang/rust#49855 let mut value = 3; let _borrow = &mut value; let _sum = value + 1; //~ ERROR E0503 diff --git a/src/test/ui/error-codes/E0505.rs b/src/test/ui/error-codes/E0505.rs index 2d534b8a44a..dd2980936c0 100644 --- a/src/test/ui/error-codes/E0505.rs +++ b/src/test/ui/error-codes/E0505.rs @@ -7,12 +7,12 @@ // <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(rustc_attrs)] struct Value {} fn eat(val: Value) {} -fn main() { +fn main() { #![rustc_error] // rust-lang/rust#49855 let x = Value{}; { let _ref_to_val: &Value = &x; diff --git a/src/test/ui/error-codes/E0597.rs b/src/test/ui/error-codes/E0597.rs index 2f4a1da91d8..74178a69444 100644 --- a/src/test/ui/error-codes/E0597.rs +++ b/src/test/ui/error-codes/E0597.rs @@ -7,12 +7,12 @@ // <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(rustc_attrs)] struct Foo<'a> { x: Option<&'a u32>, } -fn main() { +fn main() { #![rustc_error] // rust-lang/rust#49855 let mut x = Foo { x: None }; let y = 0; x.x = Some(&y); diff --git a/src/test/ui/feature-gate-nll.rs b/src/test/ui/feature-gate-nll.rs index f34a9cddf98..752b1fa821f 100644 --- a/src/test/ui/feature-gate-nll.rs +++ b/src/test/ui/feature-gate-nll.rs @@ -7,10 +7,10 @@ // <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(rustc_attrs)] #![allow(dead_code)] -fn main() { +fn main() { #![rustc_error] // rust-lang/rust#49855 let mut x = 33; let p = &x; diff --git a/src/test/ui/generator/borrowing.rs b/src/test/ui/generator/borrowing.rs index e56927d8182..f80aca9fb00 100644 --- a/src/test/ui/generator/borrowing.rs +++ b/src/test/ui/generator/borrowing.rs @@ -8,11 +8,11 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(generators, generator_trait)] +#![feature(generators, generator_trait, rustc_attrs)] use std::ops::Generator; -fn main() { +fn main() { #![rustc_error] // rust-lang/rust#49855 let _b = { let a = 3; unsafe { (|| yield &a).resume() } diff --git a/src/test/ui/generator/dropck.rs b/src/test/ui/generator/dropck.rs index b2240fb225f..8f4ba64fd57 100644 --- a/src/test/ui/generator/dropck.rs +++ b/src/test/ui/generator/dropck.rs @@ -8,12 +8,12 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(generators, generator_trait, box_leak)] +#![feature(generators, generator_trait, box_leak, rustc_attrs)] use std::cell::RefCell; use std::ops::Generator; -fn main() { +fn main() { #![rustc_error] // rust-lang/rust#49855 let (cell, mut gen); cell = Box::new(RefCell::new(0)); let ref_ = Box::leak(Box::new(Some(cell.borrow_mut()))); diff --git a/src/test/ui/generator/pattern-borrow.rs b/src/test/ui/generator/pattern-borrow.rs index 557a5e62f7e..dd63b9eaa5b 100644 --- a/src/test/ui/generator/pattern-borrow.rs +++ b/src/test/ui/generator/pattern-borrow.rs @@ -8,11 +8,11 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(generators)] +#![feature(generators, rustc_attrs)] enum Test { A(i32), B, } -fn main() { } +fn main() { #![rustc_error] } // rust-lang/rust#49855 fn fun(test: Test) { move || { diff --git a/src/test/ui/issue-17263.rs b/src/test/ui/issue-17263.rs index 242327e93ce..b251f9a4152 100644 --- a/src/test/ui/issue-17263.rs +++ b/src/test/ui/issue-17263.rs @@ -8,11 +8,11 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(box_syntax)] +#![feature(box_syntax, rustc_attrs)] struct Foo { a: isize, b: isize } -fn main() { +fn main() { #![rustc_error] // rust-lang/rust#49855 let mut x: Box<_> = box Foo { a: 1, b: 2 }; let (a, b) = (&mut x.a, &mut x.b); //~^ ERROR cannot borrow `x` (via `x.b`) as mutable more than once at a time diff --git a/src/test/ui/issue-25793.rs b/src/test/ui/issue-25793.rs index 4f3d29216e4..8624527145c 100644 --- a/src/test/ui/issue-25793.rs +++ b/src/test/ui/issue-25793.rs @@ -7,7 +7,7 @@ // <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(rustc_attrs)] macro_rules! width( ($this:expr) => { $this.width.unwrap() @@ -29,4 +29,4 @@ impl HasInfo { } } -fn main() {} +fn main() { #![rustc_error] } // rust-lang/rust#49855 diff --git a/src/test/ui/issue-42106.rs b/src/test/ui/issue-42106.rs index f35eee186a2..96f410578ce 100644 --- a/src/test/ui/issue-42106.rs +++ b/src/test/ui/issue-42106.rs @@ -7,10 +7,10 @@ // <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(rustc_attrs)] fn do_something<T>(collection: &mut Vec<T>) { let _a = &collection; collection.swap(1, 2); //~ ERROR also borrowed as immutable } -fn main() {} +fn main() { #![rustc_error] } // rust-lang/rust#49855 diff --git a/src/test/ui/lifetimes/borrowck-let-suggestion.rs b/src/test/ui/lifetimes/borrowck-let-suggestion.rs index 1c904648f9e..a7a7d5c5035 100644 --- a/src/test/ui/lifetimes/borrowck-let-suggestion.rs +++ b/src/test/ui/lifetimes/borrowck-let-suggestion.rs @@ -7,11 +7,11 @@ // <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(rustc_attrs)] fn f() { let x = vec![1].iter(); } -fn main() { +fn main() { #![rustc_error] // rust-lang/rust#49855 f(); } diff --git a/src/test/ui/span/borrowck-let-suggestion-suffixes.rs b/src/test/ui/span/borrowck-let-suggestion-suffixes.rs index 8a27af0119a..60e6c6e2989 100644 --- a/src/test/ui/span/borrowck-let-suggestion-suffixes.rs +++ b/src/test/ui/span/borrowck-let-suggestion-suffixes.rs @@ -7,7 +7,7 @@ // <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(rustc_attrs)] fn id<T>(x: T) -> T { x } fn f() { @@ -58,6 +58,6 @@ fn f() { //~| NOTE temporary value needs to live until here //~| NOTE temporary value needs to live until here -fn main() { +fn main() { #![rustc_error] // rust-lang/rust#49855 f(); } diff --git a/src/test/ui/span/issue-36537.rs b/src/test/ui/span/issue-36537.rs index 3eac0106b18..ca04101cf56 100644 --- a/src/test/ui/span/issue-36537.rs +++ b/src/test/ui/span/issue-36537.rs @@ -7,8 +7,8 @@ // <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() { +#![feature(rustc_attrs)] +fn main() { #![rustc_error] // rust-lang/rust#49855 let p; let a = 42; p = &a; diff --git a/src/test/ui/span/mut-ptr-cant-outlive-ref.rs b/src/test/ui/span/mut-ptr-cant-outlive-ref.rs index 9dc0836c5e0..9774303197c 100644 --- a/src/test/ui/span/mut-ptr-cant-outlive-ref.rs +++ b/src/test/ui/span/mut-ptr-cant-outlive-ref.rs @@ -7,10 +7,10 @@ // <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(rustc_attrs)] use std::cell::RefCell; -fn main() { +fn main() { #![rustc_error] // rust-lang/rust#49855 let m = RefCell::new(0); let p; { diff --git a/src/test/ui/span/range-2.rs b/src/test/ui/span/range-2.rs index d69b3ea098c..a1ed9bc6aa8 100644 --- a/src/test/ui/span/range-2.rs +++ b/src/test/ui/span/range-2.rs @@ -9,8 +9,8 @@ // except according to those terms. // Test range syntax - borrow errors. - -pub fn main() { +#![feature(rustc_attrs)] +pub fn main() { #![rustc_error] // rust-lang/rust#49855 let r = { let a = 42; let b = 42; diff --git a/src/test/ui/span/regionck-unboxed-closure-lifetimes.rs b/src/test/ui/span/regionck-unboxed-closure-lifetimes.rs index 93b3d673359..c814941c811 100644 --- a/src/test/ui/span/regionck-unboxed-closure-lifetimes.rs +++ b/src/test/ui/span/regionck-unboxed-closure-lifetimes.rs @@ -7,10 +7,10 @@ // <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(rustc_attrs)] use std::ops::FnMut; -fn main() { +fn main() { #![rustc_error] // rust-lang/rust#49855 let mut f; { let c = 1; diff --git a/src/test/ui/span/slice-borrow.rs b/src/test/ui/span/slice-borrow.rs index 1b022f23246..45dff62672b 100644 --- a/src/test/ui/span/slice-borrow.rs +++ b/src/test/ui/span/slice-borrow.rs @@ -7,10 +7,10 @@ // <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(rustc_attrs)] // Test slicing expressions doesn't defeat the borrow checker. -fn main() { +fn main() { #![rustc_error] // rust-lang/rust#49855 let y; { let x: &[isize] = &vec![1, 2, 3, 4, 5]; diff --git a/src/test/ui/span/vec_refs_data_with_early_death.rs b/src/test/ui/span/vec_refs_data_with_early_death.rs index 42373a87a6c..a3532d919bc 100644 --- a/src/test/ui/span/vec_refs_data_with_early_death.rs +++ b/src/test/ui/span/vec_refs_data_with_early_death.rs @@ -17,8 +17,8 @@ // element it owns; thus, for data like this, it seems like we could // loosen the restrictions here if we wanted. But it also is not // clear whether such loosening is terribly important.) - -fn main() { +#![feature(rustc_attrs)] +fn main() { #![rustc_error] // rust-lang/rust#49855 let mut v = Vec::new(); let x: i8 = 3; diff --git a/src/test/ui/span/wf-method-late-bound-regions.rs b/src/test/ui/span/wf-method-late-bound-regions.rs index d58c29d4a32..317cd395d0a 100644 --- a/src/test/ui/span/wf-method-late-bound-regions.rs +++ b/src/test/ui/span/wf-method-late-bound-regions.rs @@ -11,7 +11,7 @@ // A method's receiver must be well-formed, even if it has late-bound regions. // Because of this, a method's substs being well-formed does not imply that // the method's implied bounds are met. - +#![feature(rustc_attrs)] struct Foo<'b>(Option<&'b ()>); trait Bar<'b> { @@ -22,7 +22,7 @@ impl<'b> Bar<'b> for Foo<'b> { fn xmute<'a>(&'a self, u: &'b u32) -> &'a u32 { u } } -fn main() { +fn main() { #![rustc_error] // rust-lang/rust#49855 let f = Foo(None); let f2 = f; let dangling = { |
