Auto merge of #49900 - pnkfelix:compare-mode-nll-followup-3, r=nikomatsakis

Add src/test/ui regression testing for NLL

This PR changes `x.py test` so that when you are running the `ui` test suite, it will also always run `compiletest` in the new `--compare-mode=nll`, which just double-checks that when running under the experimental NLL mode, the output matches the `<source-name>.nll.stderr` file, if present.

In order to reduce the chance of a developer revolt in response to this change, this PR also includes some changes to make the `--compare-mode=nll` more user-friendly:

 1. It now generates nll-specific .stamp files, and uses them (so that repeated runs can reuse previously cached results).
 2. Each line of terminal output distinguishes whether we are running under `--compare-mode=nll` by printing with the prefix `[ui (nll)]` instead of just the prefix `[ui]`.

Subtask of rust-lang/rust#48879
This commit is contained in:
bors 2018-04-19 11:13:10 +00:00
commit 8a28d94ea1
79 changed files with 327 additions and 268 deletions

View File

@ -538,6 +538,7 @@ impl Step for RustdocUi {
target: self.target,
mode: "ui",
suite: "rustdoc-ui",
compare_mode: None,
})
}
}
@ -590,6 +591,14 @@ macro_rules! default_test {
}
}
macro_rules! default_test_with_compare_mode {
($name:ident { path: $path:expr, mode: $mode:expr, suite: $suite:expr,
compare_mode: $compare_mode:expr }) => {
test_with_compare_mode!($name { path: $path, mode: $mode, suite: $suite, default: true,
host: false, compare_mode: $compare_mode });
}
}
macro_rules! host_test {
($name:ident { path: $path:expr, mode: $mode:expr, suite: $suite:expr }) => {
test!($name { path: $path, mode: $mode, suite: $suite, default: true, host: true });
@ -597,12 +606,29 @@ macro_rules! host_test {
}
macro_rules! test {
($name:ident { path: $path:expr, mode: $mode:expr, suite: $suite:expr, default: $default:expr,
host: $host:expr }) => {
test_definitions!($name { path: $path, mode: $mode, suite: $suite, default: $default,
host: $host, compare_mode: None });
}
}
macro_rules! test_with_compare_mode {
($name:ident { path: $path:expr, mode: $mode:expr, suite: $suite:expr, default: $default:expr,
host: $host:expr, compare_mode: $compare_mode:expr }) => {
test_definitions!($name { path: $path, mode: $mode, suite: $suite, default: $default,
host: $host, compare_mode: Some($compare_mode) });
}
}
macro_rules! test_definitions {
($name:ident {
path: $path:expr,
mode: $mode:expr,
suite: $suite:expr,
default: $default:expr,
host: $host:expr
host: $host:expr,
compare_mode: $compare_mode:expr
}) => {
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub struct $name {
@ -634,16 +660,18 @@ macro_rules! test {
target: self.target,
mode: $mode,
suite: $suite,
compare_mode: $compare_mode,
})
}
}
}
}
default_test!(Ui {
default_test_with_compare_mode!(Ui {
path: "src/test/ui",
mode: "ui",
suite: "ui"
suite: "ui",
compare_mode: "nll"
});
default_test!(RunPass {
@ -804,6 +832,7 @@ struct Compiletest {
target: Interned<String>,
mode: &'static str,
suite: &'static str,
compare_mode: Option<&'static str>,
}
impl Step for Compiletest {
@ -823,6 +852,7 @@ impl Step for Compiletest {
let target = self.target;
let mode = self.mode;
let suite = self.suite;
let compare_mode = self.compare_mode;
// Skip codegen tests if they aren't enabled in configuration.
if !builder.config.codegen_tests && suite == "codegen" {
@ -1044,6 +1074,15 @@ impl Step for Compiletest {
suite, mode, &compiler.host, target));
let _time = util::timeit(&builder);
try_run(builder, &mut cmd);
if let Some(compare_mode) = compare_mode {
cmd.arg("--compare-mode").arg(compare_mode);
let _folder = builder.fold_output(|| format!("test_{}_{}", suite, compare_mode));
builder.info(&format!("Check compiletest suite={} mode={} compare_mode={} ({} -> {})",
suite, mode, compare_mode, &compiler.host, target));
let _time = util::timeit(&builder);
try_run(builder, &mut cmd);
}
}
}

View File

@ -1259,6 +1259,8 @@ options! {DebuggingOptions, DebuggingSetter, basic_debugging_options,
useful for profiling / PGO."),
relro_level: Option<RelroLevel> = (None, parse_relro_level, [TRACKED],
"choose which RELRO level to use"),
nll_subminimal_causes: bool = (false, parse_bool, [UNTRACKED],
"when tracking region error causes, accept subminimal results for faster execution."),
disable_nll_user_type_assert: bool = (false, parse_bool, [UNTRACKED],
"disable user provided type assertion in NLL"),
trans_time_graph: bool = (false, parse_bool, [UNTRACKED],

View File

@ -14,7 +14,7 @@ use rustc_data_structures::fx::FxHashMap;
use rustc_data_structures::indexed_vec::Idx;
use rustc_data_structures::indexed_vec::IndexVec;
use rustc::mir::{BasicBlock, Location, Mir};
use rustc::ty::RegionVid;
use rustc::ty::{self, RegionVid};
use syntax::codemap::Span;
use super::{Cause, CauseExt, TrackCauses};
@ -263,7 +263,17 @@ impl RegionValues {
if let Some(causes) = &mut self.causes {
let cause = make_cause(causes);
let old_cause = causes.get_mut(&(r, i)).unwrap();
if cause < **old_cause {
// #49998: compare using root cause alone to avoid
// useless traffic from similar outlives chains.
let overwrite = if ty::tls::with(|tcx| {
tcx.sess.opts.debugging_opts.nll_subminimal_causes
}) {
cause.root_cause() < old_cause.root_cause()
} else {
cause < **old_cause
};
if overwrite {
*old_cause = Rc::new(cause);
return true;
}

View File

@ -1,78 +0,0 @@
error[E0499]: cannot borrow `x` as mutable more than once at a time (Ast)
--> $DIR/borrowck-closures-two-mut.rs:24:24
|
LL | let c1 = to_fn_mut(|| x = 4);
| -- - previous borrow occurs due to use of `x` in closure
| |
| first mutable borrow occurs here
LL | let c2 = to_fn_mut(|| x = 5); //~ ERROR cannot borrow `x` as mutable more than once
| ^^ - borrow occurs due to use of `x` in closure
| |
| second mutable borrow occurs here
LL | //~| ERROR cannot borrow `x` as mutable more than once
LL | }
| - first borrow ends here
error[E0499]: cannot borrow `x` as mutable more than once at a time (Ast)
--> $DIR/borrowck-closures-two-mut.rs:35:24
|
LL | let c1 = to_fn_mut(|| set(&mut x));
| -- - previous borrow occurs due to use of `x` in closure
| |
| first mutable borrow occurs here
LL | let c2 = to_fn_mut(|| set(&mut x)); //~ ERROR cannot borrow `x` as mutable more than once
| ^^ - borrow occurs due to use of `x` in closure
| |
| second mutable borrow occurs here
LL | //~| ERROR cannot borrow `x` as mutable more than once
LL | }
| - first borrow ends here
error[E0499]: cannot borrow `x` as mutable more than once at a time (Ast)
--> $DIR/borrowck-closures-two-mut.rs:42:24
|
LL | let c1 = to_fn_mut(|| x = 5);
| -- - previous borrow occurs due to use of `x` in closure
| |
| first mutable borrow occurs here
LL | let c2 = to_fn_mut(|| set(&mut x)); //~ ERROR cannot borrow `x` as mutable more than once
| ^^ - borrow occurs due to use of `x` in closure
| |
| second mutable borrow occurs here
LL | //~| ERROR cannot borrow `x` as mutable more than once
LL | }
| - first borrow ends here
error[E0499]: cannot borrow `x` as mutable more than once at a time (Ast)
--> $DIR/borrowck-closures-two-mut.rs:49:24
|
LL | let c1 = to_fn_mut(|| x = 5);
| -- - previous borrow occurs due to use of `x` in closure
| |
| first mutable borrow occurs here
LL | let c2 = to_fn_mut(|| { let _y = to_fn_mut(|| set(&mut x)); }); // (nested closure)
| ^^ - borrow occurs due to use of `x` in closure
| |
| second mutable borrow occurs here
...
LL | }
| - first borrow ends here
error[E0499]: cannot borrow `x` as mutable more than once at a time (Ast)
--> $DIR/borrowck-closures-two-mut.rs:61:24
|
LL | let c1 = to_fn_mut(|| set(&mut *x.f));
| -- - previous borrow occurs due to use of `x` in closure
| |
| first mutable borrow occurs here
LL | let c2 = to_fn_mut(|| set(&mut *x.f));
| ^^ - borrow occurs due to use of `x` in closure
| |
| second mutable borrow occurs here
...
LL | }
| - first borrow ends here
error: aborting due to 5 previous errors
For more information about this error, try `rustc --explain E0499`.

View File

@ -1,4 +1,4 @@
warning: not reporting region error due to -Znll
warning: not reporting region error due to nll
--> $DIR/issue-45983.rs:17:27
|
LL | give_any(|y| x = Some(y));
@ -16,7 +16,7 @@ error[E0594]: cannot assign to immutable item `x`
LL | give_any(|y| x = Some(y));
| ^^^^^^^^^^^ cannot mutate
|
= note: Value not mutable causing this error: `x`
= note: the value which is causing this path not to be mutable is...: `x`
error[E0596]: cannot borrow immutable item `x` as mutable
--> $DIR/issue-45983.rs:17:14

View File

@ -1,4 +1,4 @@
warning: not reporting region error due to -Znll
warning: not reporting region error due to nll
--> $DIR/issue-7573.rs:27:31
|
LL | let mut lines_to_use: Vec<&CrateId> = Vec::new();

View File

@ -1,4 +1,4 @@
warning: not reporting region error due to -Znll
warning: not reporting region error due to nll
--> $DIR/regions-escape-bound-fn-2.rs:18:27
|
LL | with_int(|y| x = Some(y));

View File

@ -1,4 +1,4 @@
warning: not reporting region error due to -Znll
warning: not reporting region error due to nll
--> $DIR/regions-escape-bound-fn.rs:18:22
|
LL | with_int(|y| x = Some(y));

View File

@ -1,4 +1,4 @@
warning: not reporting region error due to -Znll
warning: not reporting region error due to nll
--> $DIR/regions-escape-unboxed-closure.rs:16:27
|
LL | with_int(&mut |y| x = Some(y));

View File

@ -1,22 +1,22 @@
warning: not reporting region error due to -Znll
warning: not reporting region error due to nll
--> $DIR/expect-region-supply-region.rs:28:13
|
LL | f = Some(x); //~ ERROR borrowed data cannot be stored outside of its closure
| ^^^^^^^
warning: not reporting region error due to -Znll
warning: not reporting region error due to nll
--> $DIR/expect-region-supply-region.rs:38:13
|
LL | f = Some(x); //~ ERROR borrowed data cannot be stored outside of its closure
| ^^^^^^^
warning: not reporting region error due to -Znll
warning: not reporting region error due to nll
--> $DIR/expect-region-supply-region.rs:47:33
|
LL | closure_expecting_bound(|x: &'x u32| {
| ^^^^^^^
warning: not reporting region error due to -Znll
warning: not reporting region error due to nll
--> $DIR/expect-region-supply-region.rs:52:13
|
LL | f = Some(x);

View File

@ -1,3 +1,9 @@
error[E0596]: cannot borrow immutable item `self` as mutable
--> $DIR/issue-34126.rs:16:18
|
LL | self.run(&mut self); //~ ERROR cannot borrow
| ^^^^^^^^^ cannot borrow as mutable
error[E0502]: cannot borrow `self` as mutable because it is also borrowed as immutable
--> $DIR/issue-34126.rs:16:18
|
@ -8,6 +14,7 @@ LL | self.run(&mut self); //~ ERROR cannot borrow
| immutable borrow occurs here
| borrow later used here
error: aborting due to previous error
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0502`.
Some errors occurred: E0502, E0596.
For more information about an error, try `rustc --explain E0502`.

View File

@ -4,7 +4,7 @@ error[E0596]: cannot borrow immutable item `f.v` as mutable
LL | f.v.push("cat".to_string()); //~ ERROR cannot borrow
| ^^^ cannot borrow as mutable
|
= note: Value not mutable causing this error: `f`
= note: the value which is causing this path not to be mutable is...: `f`
error[E0384]: cannot assign twice to immutable variable `s.x`
--> $DIR/issue-35937.rs:26:5

View File

@ -4,7 +4,7 @@ error[E0596]: cannot borrow immutable item `*self.s` as mutable
LL | self.s.push('x'); //~ ERROR cannot borrow data mutably
| ^^^^^^ cannot borrow as mutable
|
= note: Value not mutable causing this error: `*self`
= note: the value which is causing this path not to be mutable is...: `*self`
error: aborting due to previous error

View File

@ -4,7 +4,7 @@ error[E0596]: cannot borrow immutable item `*f.s` as mutable
LL | f.s.push('x'); //~ ERROR cannot borrow data mutably
| ^^^ cannot borrow as mutable
|
= note: Value not mutable causing this error: `*f`
= note: the value which is causing this path not to be mutable is...: `*f`
error: aborting due to previous error

View File

@ -4,7 +4,7 @@ error[E0596]: cannot borrow immutable item `z.x` as mutable
LL | let _ = &mut z.x; //~ ERROR cannot borrow
| ^^^^^^^^ cannot borrow as mutable
|
= note: Value not mutable causing this error: `z`
= note: the value which is causing this path not to be mutable is...: `z`
error[E0596]: cannot borrow immutable item `self.x` as mutable
--> $DIR/issue-39544.rs:26:17
@ -12,7 +12,7 @@ error[E0596]: cannot borrow immutable item `self.x` as mutable
LL | let _ = &mut self.x; //~ ERROR cannot borrow
| ^^^^^^^^^^^ cannot borrow as mutable
|
= note: Value not mutable causing this error: `*self`
= note: the value which is causing this path not to be mutable is...: `*self`
error[E0596]: cannot borrow immutable item `self.x` as mutable
--> $DIR/issue-39544.rs:30:17
@ -20,7 +20,7 @@ error[E0596]: cannot borrow immutable item `self.x` as mutable
LL | let _ = &mut self.x; //~ ERROR cannot borrow
| ^^^^^^^^^^^ cannot borrow as mutable
|
= note: Value not mutable causing this error: `*self`
= note: the value which is causing this path not to be mutable is...: `*self`
error[E0596]: cannot borrow immutable item `other.x` as mutable
--> $DIR/issue-39544.rs:31:17
@ -28,7 +28,7 @@ error[E0596]: cannot borrow immutable item `other.x` as mutable
LL | let _ = &mut other.x; //~ ERROR cannot borrow
| ^^^^^^^^^^^^ cannot borrow as mutable
|
= note: Value not mutable causing this error: `*other`
= note: the value which is causing this path not to be mutable is...: `*other`
error[E0596]: cannot borrow immutable item `self.x` as mutable
--> $DIR/issue-39544.rs:35:17
@ -36,7 +36,7 @@ error[E0596]: cannot borrow immutable item `self.x` as mutable
LL | let _ = &mut self.x; //~ ERROR cannot borrow
| ^^^^^^^^^^^ cannot borrow as mutable
|
= note: Value not mutable causing this error: `*self`
= note: the value which is causing this path not to be mutable is...: `*self`
error[E0596]: cannot borrow immutable item `other.x` as mutable
--> $DIR/issue-39544.rs:36:17
@ -44,7 +44,7 @@ error[E0596]: cannot borrow immutable item `other.x` as mutable
LL | let _ = &mut other.x; //~ ERROR cannot borrow
| ^^^^^^^^^^^^ cannot borrow as mutable
|
= note: Value not mutable causing this error: `*other`
= note: the value which is causing this path not to be mutable is...: `*other`
error[E0596]: cannot borrow immutable item `self.x` as mutable
--> $DIR/issue-39544.rs:40:17
@ -52,7 +52,7 @@ error[E0596]: cannot borrow immutable item `self.x` as mutable
LL | let _ = &mut self.x; //~ ERROR cannot borrow
| ^^^^^^^^^^^ cannot borrow as mutable
|
= note: Value not mutable causing this error: `*self`
= note: the value which is causing this path not to be mutable is...: `*self`
error[E0596]: cannot borrow immutable item `other.x` as mutable
--> $DIR/issue-39544.rs:41:17
@ -60,7 +60,7 @@ error[E0596]: cannot borrow immutable item `other.x` as mutable
LL | let _ = &mut other.x; //~ ERROR cannot borrow
| ^^^^^^^^^^^^ cannot borrow as mutable
|
= note: Value not mutable causing this error: `*other`
= note: the value which is causing this path not to be mutable is...: `*other`
error[E0596]: cannot borrow immutable item `other.x` as mutable
--> $DIR/issue-39544.rs:45:17
@ -68,7 +68,7 @@ error[E0596]: cannot borrow immutable item `other.x` as mutable
LL | let _ = &mut other.x; //~ ERROR cannot borrow
| ^^^^^^^^^^^^ cannot borrow as mutable
|
= note: Value not mutable causing this error: `*other`
= note: the value which is causing this path not to be mutable is...: `*other`
error[E0596]: cannot borrow immutable item `z.x` as mutable
--> $DIR/issue-39544.rs:51:13
@ -76,7 +76,7 @@ error[E0596]: cannot borrow immutable item `z.x` as mutable
LL | let _ = &mut z.x; //~ ERROR cannot borrow
| ^^^^^^^^ cannot borrow as mutable
|
= note: Value not mutable causing this error: `z`
= note: the value which is causing this path not to be mutable is...: `z`
error[E0596]: cannot borrow immutable item `w.x` as mutable
--> $DIR/issue-39544.rs:52:13
@ -84,7 +84,7 @@ error[E0596]: cannot borrow immutable item `w.x` as mutable
LL | let _ = &mut w.x; //~ ERROR cannot borrow
| ^^^^^^^^ cannot borrow as mutable
|
= note: Value not mutable causing this error: `*w`
= note: the value which is causing this path not to be mutable is...: `*w`
error[E0594]: cannot assign to immutable item `*x.0`
--> $DIR/issue-39544.rs:58:5

View File

@ -1,10 +1,10 @@
error[E0594]: cannot assign to immutable item `fancy_ref.num`
error[E0594]: cannot assign to data in a `&` reference
--> $DIR/E0389.rs:18:5
|
LL | let fancy_ref = &(&mut fancy);
| ------------- help: consider changing this to be a mutable reference: `&mut (&mut fancy)`
LL | fancy_ref.num = 6; //~ ERROR E0389
| ^^^^^^^^^^^^^^^^^ cannot mutate
|
= note: Value not mutable causing this error: `*fancy_ref`
| ^^^^^^^^^^^^^^^^^ `fancy_ref` is a `&` reference, so the data it refers to cannot be written
error: aborting due to previous error

View File

@ -1,4 +1,4 @@
warning: not reporting region error due to -Znll
warning: not reporting region error due to nll
--> $DIR/E0621-does-not-trigger-for-closures.rs:25:5
|
LL | invoke(&x, |a, b| if a > b { a } else { b }); //~ ERROR E0495

View File

@ -0,0 +1,46 @@
error[E0382]: use of moved value: `foo.x`
--> $DIR/fields-move.rs:38:42
|
LL | $foo.x
| ------ value moved here
...
LL | assert_two_copies(copy_modern!(foo), foo.x); //~ ERROR use of moved value: `foo.x`
| ^^^^^ value used here after move
|
= note: move occurs because `foo.x` has type `NonCopy`, which does not implement the `Copy` trait
error[E0382]: use of moved value: `foo.x`
--> $DIR/fields-move.rs:28:9
|
LL | $foo.x
| ------ value moved here
...
LL | $foo.x //~ ERROR use of moved value: `foo.x`
| ^^^^^^ value used here after move
...
LL | assert_two_copies(copy_modern!(foo), foo.x); //~ ERROR use of moved value: `foo.x`
| ----- value moved here
LL | assert_two_copies(copy_legacy!(foo), foo.x); //~ ERROR use of moved value: `foo.x`
| ----------------- in this macro invocation
|
= note: move occurs because `foo.x` has type `NonCopy`, which does not implement the `Copy` trait
error[E0382]: use of moved value: `foo.x`
--> $DIR/fields-move.rs:39:42
|
LL | $foo.x
| ------ value moved here
...
LL | $foo.x //~ ERROR use of moved value: `foo.x`
| ------ value moved here
...
LL | assert_two_copies(copy_modern!(foo), foo.x); //~ ERROR use of moved value: `foo.x`
| ----- value moved here
LL | assert_two_copies(copy_legacy!(foo), foo.x); //~ ERROR use of moved value: `foo.x`
| ^^^^^ value used here after move
|
= note: move occurs because `foo.x` has type `NonCopy`, which does not implement the `Copy` trait
error: aborting due to 3 previous errors
For more information about this error, try `rustc --explain E0382`.

View File

@ -0,0 +1,13 @@
error: compilation successful
--> $DIR/fields-numeric-borrowck.rs:13:1
|
LL | / fn main() { #![rustc_error] // rust-lang/rust#49855
LL | | let mut s = S(0);
LL | | let borrow1 = &mut s.0;
LL | | let S { 0: ref mut borrow2 } = s;
LL | | //~^ ERROR cannot borrow `s.0` as mutable more than once at a time
LL | | }
| |_^
error: aborting due to previous error

View File

@ -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)]
struct S(u8);
fn main() {
fn main() { #![rustc_error] // rust-lang/rust#49855
let mut s = S(0);
let borrow1 = &mut s.0;
let S { 0: ref mut borrow2 } = s;

View File

@ -1,4 +1,4 @@
warning: not reporting region error due to -Znll
warning: not reporting region error due to nll
--> $DIR/dyn-trait.rs:33:16
|
LL | static_val(x); //~ ERROR cannot infer

View File

@ -1,10 +1,10 @@
warning: not reporting region error due to -Znll
warning: not reporting region error due to nll
--> $DIR/mismatched.rs:14:42
|
LL | fn foo(x: &'a u32, y: &u32) -> &'a u32 { y } //~ ERROR explicit lifetime required
| ^
warning: not reporting region error due to -Znll
warning: not reporting region error due to nll
--> $DIR/mismatched.rs:16:46
|
LL | fn foo2(x: &'a u32, y: &'b u32) -> &'a u32 { y } //~ ERROR lifetime mismatch

View File

@ -1,4 +1,4 @@
warning: not reporting region error due to -Znll
warning: not reporting region error due to nll
--> $DIR/mismatched_trait.rs:16:9
|
LL | y //~ ERROR explicit lifetime required

View File

@ -1,10 +1,10 @@
warning: not reporting region error due to -Znll
warning: not reporting region error due to nll
--> $DIR/issue-13058.rs:24:21
|
LL | let cont_iter = cont.iter();
| ^^^^
warning: not reporting region error due to -Znll
warning: not reporting region error due to nll
--> $DIR/issue-13058.rs:24:26
|
LL | let cont_iter = cont.iter();

View File

@ -4,7 +4,7 @@ error[E0596]: cannot borrow immutable item `*x` as mutable
LL | f(&mut *x); //~ ERROR cannot borrow immutable
| ^^^^^^^ cannot borrow as mutable
|
= note: Value not mutable causing this error: `x`
= note: the value which is causing this path not to be mutable is...: `x`
error: aborting due to previous error

View File

@ -1,34 +0,0 @@
error[E0506]: cannot assign to `*y.pointer` because it is borrowed (Ast)
--> $DIR/issue-45697-1.rs:30:9
|
LL | let z = copy_borrowed_ptr(&mut y);
| - borrow of `*y.pointer` occurs here
LL | *y.pointer += 1;
| ^^^^^^^^^^^^^^^ assignment to borrowed `*y.pointer` occurs here
error[E0503]: cannot use `*y.pointer` because it was mutably borrowed (Mir)
--> $DIR/issue-45697-1.rs:30:9
|
LL | let z = copy_borrowed_ptr(&mut y);
| ------ borrow of `y` occurs here
LL | *y.pointer += 1;
| ^^^^^^^^^^^^^^^ use of borrowed `y`
...
LL | *z.pointer += 1;
| --------------- borrow later used here
error[E0506]: cannot assign to `*y.pointer` because it is borrowed (Mir)
--> $DIR/issue-45697-1.rs:30:9
|
LL | let z = copy_borrowed_ptr(&mut y);
| ------ borrow of `*y.pointer` occurs here
LL | *y.pointer += 1;
| ^^^^^^^^^^^^^^^ assignment to borrowed `*y.pointer` occurs here
...
LL | *z.pointer += 1;
| --------------- borrow later used here
error: aborting due to 3 previous errors
Some errors occurred: E0503, E0506.
For more information about an error, try `rustc --explain E0503`.

View File

@ -1,28 +0,0 @@
error[E0597]: `z` does not live long enough (Ast)
--> $DIR/issue-46471-1.rs:16:14
|
LL | &mut z
| ^ borrowed value does not live long enough
LL | };
| - `z` dropped here while still borrowed
...
LL | }
| - borrowed value needs to live until here
error[E0597]: `z` does not live long enough (Mir)
--> $DIR/issue-46471-1.rs:16:9
|
LL | let y = {
| _____________-
LL | | let mut z = 0;
LL | | &mut z
| | ^^^^^^ borrowed value does not live long enough
LL | | };
| | -
| | |
| |_____borrowed value only lives until here
| borrow later used here
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0597`.

View File

@ -1,4 +1,4 @@
warning: not reporting region error due to -Znll
warning: not reporting region error due to nll
--> $DIR/42701_one_named_and_one_anonymous.rs:20:9
|
LL | &*x //~ ERROR explicit lifetime

View File

@ -1,4 +1,4 @@
warning: not reporting region error due to -Znll
warning: not reporting region error due to nll
--> $DIR/ex1-return-one-existing-name-early-bound-in-struct.rs:21:21
|
LL | other //~ ERROR explicit lifetime

View File

@ -1,4 +1,4 @@
warning: not reporting region error due to -Znll
warning: not reporting region error due to nll
--> $DIR/ex1-return-one-existing-name-if-else-2.rs:12:16
|
LL | if x > y { x } else { y } //~ ERROR explicit lifetime

View File

@ -1,4 +1,4 @@
warning: not reporting region error due to -Znll
warning: not reporting region error due to nll
--> $DIR/ex1-return-one-existing-name-if-else-3.rs:12:27
|
LL | if x > y { x } else { y } //~ ERROR explicit lifetime

View File

@ -1,4 +1,4 @@
warning: not reporting region error due to -Znll
warning: not reporting region error due to nll
--> $DIR/ex1-return-one-existing-name-if-else-using-impl-2.rs:14:15
|
LL | if x > y { x } else { y } //~ ERROR explicit lifetime

View File

@ -1,4 +1,4 @@
warning: not reporting region error due to -Znll
warning: not reporting region error due to nll
--> $DIR/ex1-return-one-existing-name-if-else-using-impl-3.rs:18:36
|
LL | if true { &self.field } else { x } //~ ERROR explicit lifetime

View File

@ -1,4 +1,4 @@
warning: not reporting region error due to -Znll
warning: not reporting region error due to nll
--> $DIR/ex1-return-one-existing-name-if-else-using-impl.rs:21:20
|
LL | if x > y { x } else { y } //~ ERROR lifetime mismatch

View File

@ -1,4 +1,4 @@
warning: not reporting region error due to -Znll
warning: not reporting region error due to nll
--> $DIR/ex1-return-one-existing-name-if-else.rs:12:27
|
LL | if x > y { x } else { y } //~ ERROR explicit lifetime

View File

@ -1,4 +1,4 @@
warning: not reporting region error due to -Znll
warning: not reporting region error due to nll
--> $DIR/ex1-return-one-existing-name-return-type-is-anon.rs:18:5
|
LL | x //~ ERROR lifetime mismatch

View File

@ -1,4 +1,4 @@
warning: not reporting region error due to -Znll
warning: not reporting region error due to nll
--> $DIR/ex1-return-one-existing-name-self-is-anon.rs:18:30
|
LL | if true { x } else { self } //~ ERROR lifetime mismatch

View File

@ -1,4 +1,4 @@
warning: not reporting region error due to -Znll
warning: not reporting region error due to nll
--> $DIR/ex2a-push-one-existing-name-2.rs:16:12
|
LL | y.push(x); //~ ERROR explicit lifetime

View File

@ -1,4 +1,4 @@
warning: not reporting region error due to -Znll
warning: not reporting region error due to nll
--> $DIR/ex2a-push-one-existing-name-early-bound.rs:17:12
|
LL | x.push(y); //~ ERROR explicit lifetime required

View File

@ -1,4 +1,4 @@
warning: not reporting region error due to -Znll
warning: not reporting region error due to nll
--> $DIR/ex2a-push-one-existing-name.rs:16:12
|
LL | x.push(y); //~ ERROR explicit lifetime

View File

@ -1,4 +1,4 @@
warning: not reporting region error due to -Znll
warning: not reporting region error due to nll
--> $DIR/ex2b-push-no-existing-names.rs:16:12
|
LL | x.push(y); //~ ERROR lifetime mismatch

View File

@ -1,4 +1,4 @@
warning: not reporting region error due to -Znll
warning: not reporting region error due to nll
--> $DIR/ex2c-push-inference-variable.rs:16:13
|
LL | let z = Ref { data: y.data };

View File

@ -1,4 +1,4 @@
warning: not reporting region error due to -Znll
warning: not reporting region error due to nll
--> $DIR/ex2d-push-inference-variable-2.rs:17:13
|
LL | let b = Ref { data: y.data };

View File

@ -1,4 +1,4 @@
warning: not reporting region error due to -Znll
warning: not reporting region error due to nll
--> $DIR/ex2e-push-inference-variable-3.rs:17:13
|
LL | let b = Ref { data: y.data };

View File

@ -1,4 +1,4 @@
warning: not reporting region error due to -Znll
warning: not reporting region error due to nll
--> $DIR/ex3-both-anon-regions-2.rs:12:9
|
LL | v = x; //~ ERROR lifetime mismatch

View File

@ -1,10 +1,10 @@
warning: not reporting region error due to -Znll
warning: not reporting region error due to nll
--> $DIR/ex3-both-anon-regions-3.rs:12:13
|
LL | z.push((x,y)); //~ ERROR lifetime mismatch
| ^
warning: not reporting region error due to -Znll
warning: not reporting region error due to nll
--> $DIR/ex3-both-anon-regions-3.rs:12:15
|
LL | z.push((x,y)); //~ ERROR lifetime mismatch

View File

@ -1,4 +1,4 @@
warning: not reporting region error due to -Znll
warning: not reporting region error due to nll
--> $DIR/ex3-both-anon-regions-both-are-structs-2.rs:16:11
|
LL | x.b = y.b; //~ ERROR lifetime mismatch

View File

@ -1,4 +1,4 @@
warning: not reporting region error due to -Znll
warning: not reporting region error due to nll
--> $DIR/ex3-both-anon-regions-both-are-structs-3.rs:16:11
|
LL | x.a = x.b; //~ ERROR lifetime mismatch

View File

@ -1,4 +1,4 @@
warning: not reporting region error due to -Znll
warning: not reporting region error due to nll
--> $DIR/ex3-both-anon-regions-both-are-structs-4.rs:16:11
|
LL | x.a = x.b; //~ ERROR lifetime mismatch

View File

@ -1,4 +1,4 @@
warning: not reporting region error due to -Znll
warning: not reporting region error due to nll
--> $DIR/ex3-both-anon-regions-both-are-structs-earlybound-regions.rs:18:12
|
LL | x.push(y); //~ ERROR lifetime mismatch

View File

@ -1,4 +1,4 @@
warning: not reporting region error due to -Znll
warning: not reporting region error due to nll
--> $DIR/ex3-both-anon-regions-both-are-structs-latebound-regions.rs:15:12
|
LL | x.push(y); //~ ERROR lifetime mismatch

View File

@ -1,4 +1,4 @@
warning: not reporting region error due to -Znll
warning: not reporting region error due to nll
--> $DIR/ex3-both-anon-regions-both-are-structs.rs:15:12
|
LL | x.push(y); //~ ERROR lifetime mismatch

View File

@ -1,4 +1,4 @@
warning: not reporting region error due to -Znll
warning: not reporting region error due to nll
--> $DIR/ex3-both-anon-regions-latebound-regions.rs:12:12
|
LL | x.push(y); //~ ERROR lifetime mismatch

View File

@ -1,4 +1,4 @@
warning: not reporting region error due to -Znll
warning: not reporting region error due to nll
--> $DIR/ex3-both-anon-regions-one-is-struct-2.rs:14:9
|
LL | y = x.b; //~ ERROR lifetime mismatch

View File

@ -1,4 +1,4 @@
warning: not reporting region error due to -Znll
warning: not reporting region error due to nll
--> $DIR/ex3-both-anon-regions-one-is-struct-3.rs:14:11
|
LL | y.b = x; //~ ERROR lifetime mismatch

View File

@ -1,4 +1,4 @@
warning: not reporting region error due to -Znll
warning: not reporting region error due to nll
--> $DIR/ex3-both-anon-regions-one-is-struct-4.rs:14:11
|
LL | y.b = x; //~ ERROR lifetime mismatch

View File

@ -1,4 +1,4 @@
warning: not reporting region error due to -Znll
warning: not reporting region error due to nll
--> $DIR/ex3-both-anon-regions-one-is-struct.rs:17:11
|
LL | x.b = y; //~ ERROR lifetime mismatch

View File

@ -1,4 +1,4 @@
warning: not reporting region error due to -Znll
warning: not reporting region error due to nll
--> $DIR/ex3-both-anon-regions-return-type-is-anon.rs:17:5
|
LL | x //~ ERROR lifetime mismatch

View File

@ -1,4 +1,4 @@
warning: not reporting region error due to -Znll
warning: not reporting region error due to nll
--> $DIR/ex3-both-anon-regions-self-is-anon.rs:17:19
|
LL | if true { x } else { self } //~ ERROR lifetime mismatch

View File

@ -1,4 +1,4 @@
warning: not reporting region error due to -Znll
warning: not reporting region error due to nll
--> $DIR/ex3-both-anon-regions-using-fn-items.rs:11:10
|
LL | y.push(z); //~ ERROR lifetime mismatch

View File

@ -1,4 +1,4 @@
warning: not reporting region error due to -Znll
warning: not reporting region error due to nll
--> $DIR/ex3-both-anon-regions-using-impl-items.rs:15:16
|
LL | x.push(y); //~ ERROR lifetime mismatch

View File

@ -1,4 +1,4 @@
warning: not reporting region error due to -Znll
warning: not reporting region error due to nll
--> $DIR/ex3-both-anon-regions-using-trait-objects.rs:11:10
|
LL | y.push(z); //~ ERROR lifetime mismatch

View File

@ -1,4 +1,4 @@
warning: not reporting region error due to -Znll
warning: not reporting region error due to nll
--> $DIR/ex3-both-anon-regions.rs:12:12
|
LL | x.push(y); //~ ERROR lifetime mismatch

View File

@ -1,20 +1,26 @@
error[E0594]: cannot assign to immutable item `*x`
error[E0594]: cannot assign to data in a `&` reference
--> $DIR/enum.rs:19:5
|
LL | let Wrap(x) = &Wrap(3);
| - help: consider changing this to be a mutable reference: `&mut`
LL | *x += 1; //~ ERROR cannot assign to immutable
| ^^^^^^^ cannot mutate
| ^^^^^^^
error[E0594]: cannot assign to immutable item `*x`
error[E0594]: cannot assign to data in a `&` reference
--> $DIR/enum.rs:23:9
|
LL | if let Some(x) = &Some(3) {
| - help: consider changing this to be a mutable reference: `&mut`
LL | *x += 1; //~ ERROR cannot assign to immutable
| ^^^^^^^ cannot mutate
| ^^^^^^^
error[E0594]: cannot assign to immutable item `*x`
error[E0594]: cannot assign to data in a `&` reference
--> $DIR/enum.rs:29:9
|
LL | while let Some(x) = &Some(3) {
| - help: consider changing this to be a mutable reference: `&mut`
LL | *x += 1; //~ ERROR cannot assign to immutable
| ^^^^^^^ cannot mutate
| ^^^^^^^
error: aborting due to 3 previous errors

View File

@ -1,20 +1,26 @@
error[E0594]: cannot assign to immutable item `*n`
error[E0594]: cannot assign to data in a `&` reference
--> $DIR/explicit-mut.rs:17:13
|
LL | Some(n) => {
| - help: consider changing this to be a mutable reference: `&mut`
LL | *n += 1; //~ ERROR cannot assign to immutable
| ^^^^^^^ cannot mutate
| ^^^^^^^
error[E0594]: cannot assign to immutable item `*n`
error[E0594]: cannot assign to data in a `&` reference
--> $DIR/explicit-mut.rs:25:13
|
LL | Some(n) => {
| - help: consider changing this to be a mutable reference: `&mut`
LL | *n += 1; //~ ERROR cannot assign to immutable
| ^^^^^^^ cannot mutate
| ^^^^^^^
error[E0594]: cannot assign to immutable item `*n`
error[E0594]: cannot assign to data in a `&` reference
--> $DIR/explicit-mut.rs:33:13
|
LL | Some(n) => {
| - help: consider changing this to be a mutable reference: `&mut`
LL | *n += 1; //~ ERROR cannot assign to immutable
| ^^^^^^^ cannot mutate
| ^^^^^^^
error: aborting due to 3 previous errors

View File

@ -24,7 +24,7 @@ error[E0596]: cannot borrow immutable item `*f.f` as mutable
LL | f.f.call_mut(())
| ^^^ cannot borrow as mutable
|
= note: Value not mutable causing this error: `*f`
= note: the value which is causing this path not to be mutable is...: `*f`
error[E0507]: cannot move out of borrowed content
--> $DIR/borrowck-call-is-borrow-issue-12224.rs:66:13

View File

@ -10,7 +10,7 @@ error[E0596]: cannot borrow immutable item `*x` as mutable
LL | x.borrowed_mut(); //~ ERROR cannot borrow
| ^ cannot borrow as mutable
|
= note: Value not mutable causing this error: `x`
= note: the value which is causing this path not to be mutable is...: `x`
error: aborting due to 2 previous errors

View File

@ -0,0 +1,16 @@
error[E0597]: `*a` does not live long enough
--> $DIR/destructor-restrictions.rs:18:10
|
LL | *a.borrow() + 1
| ^---------
| |
| borrowed value does not live long enough
| borrow may end up in a temporary, created here
LL | }; //~^ ERROR `*a` does not live long enough
| -- temporary later dropped here, potentially using the reference
| |
| borrowed value only lives until here
error: aborting due to previous error
For more information about this error, try `rustc --explain E0597`.

View File

@ -1,5 +1,5 @@
error[E0597]: `c1` does not live long enough
--> $DIR/dropck_vec_cycle_checked.rs:118:24
--> $DIR/dropck_vec_cycle_checked.rs:121:24
|
LL | c3.v[0].v.set(Some(&c1));
| ^^^ borrowed value does not live long enough
@ -11,7 +11,7 @@ LL | }
| borrow later used here, when `c1` is dropped
error[E0597]: `c2` does not live long enough
--> $DIR/dropck_vec_cycle_checked.rs:110:24
--> $DIR/dropck_vec_cycle_checked.rs:113:24
|
LL | c1.v[0].v.set(Some(&c2));
| ^^^ borrowed value does not live long enough
@ -23,7 +23,7 @@ LL | }
| borrow later used here, when `c1` is dropped
error[E0597]: `c3` does not live long enough
--> $DIR/dropck_vec_cycle_checked.rs:112:24
--> $DIR/dropck_vec_cycle_checked.rs:115:24
|
LL | c1.v[1].v.set(Some(&c3));
| ^^^ borrowed value does not live long enough

View File

@ -8,6 +8,9 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// compile-flags: -Z nll-subminimal-causes
// (Work around rust-lang/rust#49998 by opting into nll-subminimal-causes.)
// Reject mixing cyclic structure and Drop when using Vec.
//
// (Compare against compile-fail/dropck_arr_cycle_checked.rs)

View File

@ -1,5 +1,5 @@
error[E0597]: `c2` does not live long enough
--> $DIR/dropck_vec_cycle_checked.rs:110:25
--> $DIR/dropck_vec_cycle_checked.rs:113:25
|
LL | c1.v[0].v.set(Some(&c2));
| ^^ borrowed value does not live long enough
@ -10,7 +10,7 @@ LL | }
= note: values in a scope are dropped in the opposite order they are created
error[E0597]: `c3` does not live long enough
--> $DIR/dropck_vec_cycle_checked.rs:112:25
--> $DIR/dropck_vec_cycle_checked.rs:115:25
|
LL | c1.v[1].v.set(Some(&c3));
| ^^ borrowed value does not live long enough
@ -21,7 +21,7 @@ LL | }
= note: values in a scope are dropped in the opposite order they are created
error[E0597]: `c2` does not live long enough
--> $DIR/dropck_vec_cycle_checked.rs:114:25
--> $DIR/dropck_vec_cycle_checked.rs:117:25
|
LL | c2.v[0].v.set(Some(&c2));
| ^^ borrowed value does not live long enough
@ -32,7 +32,7 @@ LL | }
= note: values in a scope are dropped in the opposite order they are created
error[E0597]: `c3` does not live long enough
--> $DIR/dropck_vec_cycle_checked.rs:116:25
--> $DIR/dropck_vec_cycle_checked.rs:119:25
|
LL | c2.v[1].v.set(Some(&c3));
| ^^ borrowed value does not live long enough
@ -43,7 +43,7 @@ LL | }
= note: values in a scope are dropped in the opposite order they are created
error[E0597]: `c1` does not live long enough
--> $DIR/dropck_vec_cycle_checked.rs:118:25
--> $DIR/dropck_vec_cycle_checked.rs:121:25
|
LL | c3.v[0].v.set(Some(&c1));
| ^^ borrowed value does not live long enough
@ -54,7 +54,7 @@ LL | }
= note: values in a scope are dropped in the opposite order they are created
error[E0597]: `c2` does not live long enough
--> $DIR/dropck_vec_cycle_checked.rs:120:25
--> $DIR/dropck_vec_cycle_checked.rs:123:25
|
LL | c3.v[1].v.set(Some(&c2));
| ^^ borrowed value does not live long enough

View File

@ -0,0 +1,30 @@
error[E0597]: `y` does not live long enough
--> $DIR/issue-23338-locals-die-before-temps-of-body.rs:20:5
|
LL | y.borrow().clone()
| ^---------
| |
| borrowed value does not live long enough
| borrow may end up in a temporary, created here
LL | }
| -
| |
| borrowed value only lives until here
| temporary later dropped here, potentially using the reference
error[E0597]: `y` does not live long enough
--> $DIR/issue-23338-locals-die-before-temps-of-body.rs:27:9
|
LL | y.borrow().clone()
| ^---------
| |
| borrowed value does not live long enough
| borrow may end up in a temporary, created here
LL | };
| -- temporary later dropped here, potentially using the reference
| |
| borrowed value only lives until here
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0597`.

View File

@ -1,14 +1,14 @@
error: compilation successful
--> $DIR/wf-method-late-bound-regions.rs:25:1
error[E0597]: `pointer` does not live long enough
--> $DIR/wf-method-late-bound-regions.rs:30:18
|
LL | / fn main() { #![rustc_error] // rust-lang/rust#49855
LL | | let f = Foo(None);
LL | | let f2 = f;
LL | | let dangling = {
... |
LL | | println!("{}", dangling);
LL | | }
| |_^
LL | f2.xmute(&pointer)
| ^^^^^^^^ borrowed value does not live long enough
LL | };
| - borrowed value only lives until here
LL | //~^^ ERROR `pointer` does not live long enough
LL | println!("{}", dangling);
| -------- borrow later used here
error: aborting due to previous error
For more information about this error, try `rustc --explain E0597`.

View File

@ -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() { #![rustc_error] // rust-lang/rust#49855
fn main() {
let f = Foo(None);
let f2 = f;
let dangling = {

View File

@ -1,22 +1,22 @@
warning: not reporting region error due to -Znll
warning: not reporting region error due to nll
--> $DIR/dyn-trait-underscore.rs:20:14
|
LL | Box::new(items.iter()) //~ ERROR cannot infer an appropriate lifetime
| ^^^^^
warning: not reporting region error due to -Znll
warning: not reporting region error due to nll
--> $DIR/dyn-trait-underscore.rs:20:20
|
LL | Box::new(items.iter()) //~ ERROR cannot infer an appropriate lifetime
| ^^^^
warning: not reporting region error due to -Znll
warning: not reporting region error due to nll
--> $DIR/dyn-trait-underscore.rs:20:5
|
LL | Box::new(items.iter()) //~ ERROR cannot infer an appropriate lifetime
| ^^^^^^^^
warning: not reporting region error due to -Znll
warning: not reporting region error due to nll
--> $DIR/dyn-trait-underscore.rs:20:5
|
LL | Box::new(items.iter()) //~ ERROR cannot infer an appropriate lifetime

View File

@ -33,6 +33,7 @@ shift
while [[ "$1" != "" ]]; do
STDERR_NAME="${1/%.rs/.stderr}"
STDERR_NLL_NAME="${1/%.rs/.nll.stderr}"
STDOUT_NAME="${1/%.rs/.stdout}"
shift
if [ -f $BUILD_DIR/$STDOUT_NAME ] && \
@ -45,4 +46,9 @@ while [[ "$1" != "" ]]; do
echo updating $MYDIR/$STDERR_NAME
cp $BUILD_DIR/$STDERR_NAME $MYDIR/$STDERR_NAME
fi
if [ -f $BUILD_DIR/$STDERR_NLL_NAME ] && \
! (diff $BUILD_DIR/$STDERR_NLL_NAME $MYDIR/$STDERR_NLL_NAME >& /dev/null); then
echo updating $MYDIR/$STDERR_NLL_NAME
cp $BUILD_DIR/$STDERR_NLL_NAME $MYDIR/$STDERR_NLL_NAME
fi
done

View File

@ -101,7 +101,7 @@ pub enum CompareMode {
}
impl CompareMode {
fn to_str(&self) -> &'static str {
pub(crate) fn to_str(&self) -> &'static str {
match *self {
CompareMode::Nll => "nll"
}

View File

@ -626,7 +626,7 @@ pub fn make_test(config: &Config, testpaths: &TestPaths) -> test::TestDescAndFn
// Debugging emscripten code doesn't make sense today
let ignore = early_props.ignore
|| (!up_to_date(config, testpaths, &early_props) && config.compare_mode.is_none())
|| !up_to_date(config, testpaths, &early_props)
|| (config.mode == DebugInfoGdb || config.mode == DebugInfoLldb)
&& config.target.contains("emscripten");
@ -642,10 +642,15 @@ pub fn make_test(config: &Config, testpaths: &TestPaths) -> test::TestDescAndFn
}
fn stamp(config: &Config, testpaths: &TestPaths) -> PathBuf {
let mode_suffix = match config.compare_mode {
Some(ref mode) => format!("-{}", mode.to_str()),
None => format!(""),
};
let stamp_name = format!(
"{}-{}.stamp",
"{}-{}{}.stamp",
testpaths.file.file_name().unwrap().to_str().unwrap(),
config.stage_id
config.stage_id,
mode_suffix
);
config
.build_base
@ -728,7 +733,11 @@ pub fn make_test_name(config: &Config, testpaths: &TestPaths) -> test::TestName
let path = PathBuf::from(config.src_base.file_name().unwrap())
.join(&testpaths.relative_dir)
.join(&testpaths.file.file_name().unwrap());
test::DynTestName(format!("[{}] {}", config.mode, path.display()))
let mode_suffix = match config.compare_mode {
Some(ref mode) => format!(" ({})", mode.to_str()),
None => format!(""),
};
test::DynTestName(format!("[{}{}] {}", config.mode, mode_suffix, path.display()))
}
pub fn make_test_closure(config: &Config, testpaths: &TestPaths) -> test::TestFn {

View File

@ -2811,7 +2811,7 @@ impl<'test> TestCx<'test> {
normalized
}
fn load_expected_output(&self, kind: &str) -> String {
fn expected_output_path(&self, kind: &str) -> PathBuf {
let mut path = expected_output_path(&self.testpaths,
self.revision,
&self.config.compare_mode,
@ -2822,6 +2822,11 @@ impl<'test> TestCx<'test> {
path = expected_output_path(&self.testpaths, self.revision, &None, kind);
}
path
}
fn load_expected_output(&self, kind: &str) -> String {
let path = self.expected_output_path(kind);
if path.exists() {
match self.load_expected_output_from_path(&path) {
Ok(x) => x,
@ -2875,7 +2880,8 @@ impl<'test> TestCx<'test> {
}
}
let output_file = self.output_base_name().with_extension(kind);
let expected_output_path = self.expected_output_path(kind);
let output_file = self.output_base_name().with_file_name(&expected_output_path);
match File::create(&output_file).and_then(|mut f| f.write_all(actual.as_bytes())) {
Ok(()) => {}
Err(e) => self.fatal(&format!(