Skip to content

Commit 1c8d2bd

Browse files
committed
Workaround #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).
1 parent ae05961 commit 1c8d2bd

27 files changed

+54
-54
lines changed

src/test/ui/borrowck/borrowck-report-with-custom-diagnostic.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
10-
10+
#![feature(rustc_attrs)]
1111
#![allow(dead_code)]
12-
fn main() {
12+
fn main() { #![rustc_error] // rust-lang/rust#49855
1313
// Original borrow ends at end of function
1414
let mut x = 1;
1515
let y = &mut x;

src/test/ui/borrowck/mut-borrow-outside-loop.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
// except according to those terms.
1010

1111
// ensure borrowck messages are correct outside special case
12-
13-
fn main() {
12+
#![feature(rustc_attrs)]
13+
fn main() { #![rustc_error] // rust-lang/rust#49855
1414
let mut void = ();
1515

1616
let first = &mut void;

src/test/ui/codemap_tests/issue-11715.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@
9393

9494

9595

96-
97-
fn main() {
96+
#![feature(rustc_attrs)]
97+
fn main() { #![rustc_error] // rust-lang/rust#49855
9898
let mut x = "foo";
9999
let y = &mut x;
100100
let z = &mut x; //~ ERROR cannot borrow

src/test/ui/dropck/dropck-eyepatch-extern-crate.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@
1919
//
2020
// See also dropck-eyepatch.rs for more information about the general
2121
// structure of the test.
22-
22+
#![feature(rustc_attrs)]
2323
extern crate dropck_eyepatch_extern_crate as other;
2424

2525
use other::{Dt,Dr,Pt,Pr,St,Sr};
2626

27-
fn main() {
27+
fn main() { #![rustc_error] // rust-lang/rust#49855
2828
use std::cell::Cell;
2929
let c_long;
3030
let (c, mut dt, mut dr, mut pt, mut pr, st, sr)

src/test/ui/dropck/dropck-eyepatch-reorder.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#![feature(dropck_eyepatch)]
11+
#![feature(dropck_eyepatch, rustc_attrs)]
1212

1313
// The point of this test is to test uses of `#[may_dangle]` attribute
1414
// 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> {
4141
fn drop(&mut self) { println!("drop {} {:?}", self.0, self.2); }
4242
}
4343

44-
fn main() {
44+
fn main() { #![rustc_error] // rust-lang/rust#49855
4545
use std::cell::Cell;
4646
let c_long;
4747
let (c, mut dt, mut dr, mut pt, mut pr, st, sr)

src/test/ui/dropck/dropck-eyepatch.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#![feature(dropck_eyepatch)]
11+
#![feature(dropck_eyepatch, rustc_attrs)]
1212

1313
// The point of this test is to illustrate that the `#[may_dangle]`
1414
// 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> {
6464
fn drop(&mut self) { println!("drop {} {:?}", self.0, self.2); }
6565
}
6666

67-
fn main() {
67+
fn main() { #![rustc_error] // rust-lang/rust#49855
6868
use std::cell::Cell;
6969
let c_long;
7070
let (c, mut dt, mut dr, mut pt, mut pr, st, sr)

src/test/ui/error-codes/E0499.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
10-
11-
fn main() {
10+
#![feature(rustc_attrs)]
11+
fn main() { #![rustc_error] // rust-lang/rust#49855
1212
let mut i = 0;
1313
let mut x = &mut i;
1414
let mut a = &mut i; //~ ERROR E0499

src/test/ui/error-codes/E0502.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
10-
10+
#![feature(rustc_attrs)]
1111
fn bar(x: &mut i32) {}
1212
fn foo(a: &mut i32) {
1313
let ref y = a;
1414
bar(a); //~ ERROR E0502
1515
}
1616

17-
fn main() {
17+
fn main() { #![rustc_error] // rust-lang/rust#49855
1818
}

src/test/ui/error-codes/E0503.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
10-
11-
fn main() {
10+
#![feature(rustc_attrs)]
11+
fn main() { #![rustc_error] // rust-lang/rust#49855
1212
let mut value = 3;
1313
let _borrow = &mut value;
1414
let _sum = value + 1; //~ ERROR E0503

src/test/ui/error-codes/E0505.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
10-
10+
#![feature(rustc_attrs)]
1111
struct Value {}
1212

1313
fn eat(val: Value) {}
1414

15-
fn main() {
15+
fn main() { #![rustc_error] // rust-lang/rust#49855
1616
let x = Value{};
1717
{
1818
let _ref_to_val: &Value = &x;

0 commit comments

Comments
 (0)