Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rustup #4092

Merged
merged 17 commits into from
Dec 12, 2024
Merged

Rustup #4092

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion rust-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1b3fb316751227d30b1523ed0e3f00d83956d4d0
903d2976fdb6ceeb65526b7555d8d1e6f8c02134
10 changes: 1 addition & 9 deletions src/shims/backtrace.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use rustc_abi::{ExternAbi, Size};
use rustc_ast::ast::Mutability;
use rustc_middle::ty::layout::LayoutOf as _;
use rustc_middle::ty::{self, Instance, Ty};
use rustc_span::{BytePos, Loc, Symbol, hygiene};
Expand Down Expand Up @@ -179,14 +178,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {

match flags {
0 => {
// These are "mutable" allocations as we consider them to be owned by the callee.
let name_alloc =
this.allocate_str(&name, MiriMemoryKind::Rust.into(), Mutability::Mut)?;
let filename_alloc =
this.allocate_str(&filename, MiriMemoryKind::Rust.into(), Mutability::Mut)?;

this.write_immediate(name_alloc.to_ref(this), &this.project_field(dest, 0)?)?;
this.write_immediate(filename_alloc.to_ref(this), &this.project_field(dest, 1)?)?;
throw_unsup_format!("miri_resolve_frame: v0 is not supported any more");
}
1 => {
this.write_scalar(
Expand Down
5 changes: 2 additions & 3 deletions src/shims/panic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
//! metadata we remembered when pushing said frame.

use rustc_abi::ExternAbi;
use rustc_ast::Mutability;
use rustc_middle::{mir, ty};
use rustc_target::spec::PanicStrategy;

Expand Down Expand Up @@ -161,7 +160,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
let this = self.eval_context_mut();

// First arg: message.
let msg = this.allocate_str(msg, MiriMemoryKind::Machine.into(), Mutability::Not)?;
let msg = this.allocate_str_dedup(msg)?;

// Call the lang item.
let panic = this.tcx.lang_items().panic_fn().unwrap();
Expand All @@ -180,7 +179,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
let this = self.eval_context_mut();

// First arg: message.
let msg = this.allocate_str(msg, MiriMemoryKind::Machine.into(), Mutability::Not)?;
let msg = this.allocate_str_dedup(msg)?;

// Call the lang item.
let panic = this.tcx.lang_items().panic_nounwind().unwrap();
Expand Down
9 changes: 1 addition & 8 deletions src/shims/time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ use std::time::{Duration, SystemTime};

use chrono::{DateTime, Datelike, Offset, Timelike, Utc};
use chrono_tz::Tz;
use rustc_abi::Align;
use rustc_ast::ast::Mutability;

use crate::*;

Expand Down Expand Up @@ -202,12 +200,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
tm_zone.push('\0');

// Deduplicate and allocate the string.
let tm_zone_ptr = this.allocate_bytes(
tm_zone.as_bytes(),
Align::ONE,
MiriMemoryKind::Machine.into(),
Mutability::Not,
)?;
let tm_zone_ptr = this.allocate_bytes_dedup(tm_zone.as_bytes())?;

// Write the timezone pointer and offset into the result structure.
this.write_pointer(tm_zone_ptr, &this.project_field_named(&result, "tm_zone")?)?;
Expand Down
69 changes: 0 additions & 69 deletions tests/pass/backtrace/backtrace-api-v0.rs

This file was deleted.

18 changes: 0 additions & 18 deletions tests/pass/backtrace/backtrace-api-v0.stderr

This file was deleted.

5 changes: 0 additions & 5 deletions tests/pass/backtrace/backtrace-api-v0.stdout

This file was deleted.

Loading