Skip to content

Commit fd36bb0

Browse files
committed
Auto merge of #2762 - RalfJung:rustup, r=RalfJung
Rustup
2 parents f76c608 + d88f78d commit fd36bb0

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

rust-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
9e75dddf609c0201d03f9792e850f95d6a283d11
1+
a5fa99eed20a46a88c0c85eed6552a94b6656634

src/bin/miri.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,12 @@ impl rustc_driver::Callbacks for MiriCompilerCalls {
5656

5757
fn after_analysis<'tcx>(
5858
&mut self,
59-
compiler: &rustc_interface::interface::Compiler,
59+
_: &rustc_interface::interface::Compiler,
6060
queries: &'tcx rustc_interface::Queries<'tcx>,
6161
) -> Compilation {
62-
compiler.session().abort_if_errors();
63-
6462
queries.global_ctxt().unwrap().enter(|tcx| {
63+
tcx.sess.abort_if_errors();
64+
6565
init_late_loggers(tcx);
6666
if !tcx.sess.crate_types().contains(&CrateType::Executable) {
6767
tcx.sess.fatal("miri only makes sense on bin crates");
@@ -75,7 +75,7 @@ impl rustc_driver::Callbacks for MiriCompilerCalls {
7575
let mut config = self.miri_config.clone();
7676

7777
// Add filename to `miri` arguments.
78-
config.args.insert(0, compiler.input().filestem().to_string());
78+
config.args.insert(0, tcx.sess.io.input.filestem().to_string());
7979

8080
// Adjust working directory for interpretation.
8181
if let Some(cwd) = env::var_os("MIRI_CWD") {
@@ -87,10 +87,9 @@ impl rustc_driver::Callbacks for MiriCompilerCalls {
8787
i32::try_from(return_code).expect("Return value was too large!"),
8888
);
8989
}
90+
tcx.sess.abort_if_errors();
9091
});
9192

92-
compiler.session().abort_if_errors();
93-
9493
Compilation::Stop
9594
}
9695
}

tests/pass/vec.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,11 @@ fn reverse() {
162162
assert!(v[0].0 == 49);
163163
}
164164

165+
fn miri_issue_2759() {
166+
let mut input = "1".to_string();
167+
input.replace_range(0..0, "0");
168+
}
169+
165170
fn main() {
166171
assert_eq!(vec_reallocate().len(), 5);
167172

@@ -191,4 +196,5 @@ fn main() {
191196
swap();
192197
swap_remove();
193198
reverse();
199+
miri_issue_2759();
194200
}

0 commit comments

Comments
 (0)