Skip to content

Commit 64e95f8

Browse files
committed
Fix rebase error
1 parent 5cf61b1 commit 64e95f8

File tree

6 files changed

+14
-38
lines changed

6 files changed

+14
-38
lines changed

src/tools/miri/src/shims/backtrace.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
use rustc_abi::{ExternAbi, Size};
2-
use rustc_ast::ast::Mutability;
1+
use rustc_abi::Size;
32
use rustc_middle::ty::layout::LayoutOf as _;
43
use rustc_middle::ty::{self, Instance, Ty};
54
use rustc_span::{BytePos, Loc, Symbol, hygiene};

src/tools/miri/src/shims/panic.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
//! gets popped *during unwinding*, we take the panic payload and store it according to the extra
1212
//! metadata we remembered when pushing said frame.
1313
14-
use rustc_ast::Mutability;
14+
1515
use rustc_middle::{mir, ty};
1616
use rustc_target::spec::PanicStrategy;
1717
use rustc_abi::ExternAbi;

src/tools/miri/src/shims/unix/android/foreign_items.rs

+5-4
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ use rustc_target::callconv::FnAbi;
44
use rustc_middle::ty::Ty;
55
use rustc_target::callconv::Conv;
66

7+
78
use crate::shims::unix::android::thread::prctl;
89
use crate::shims::unix::linux_like::epoll::EvalContextExt as _;
910
use crate::shims::unix::linux_like::eventfd::EvalContextExt as _;
@@ -28,24 +29,24 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
2829
// epoll, eventfd
2930
"epoll_create1" => {
3031
let [flag] =
31-
this.check_shim(abi, ExternAbi::C { unwind: false }, link_name, args)?;
32+
this.check_shim(abi, Conv::C, link_name, args)?;
3233
let result = this.epoll_create1(flag)?;
3334
this.write_scalar(result, dest)?;
3435
}
3536
"epoll_ctl" => {
3637
let [epfd, op, fd, event] =
37-
this.check_shim(abi, ExternAbi::C { unwind: false }, link_name, args)?;
38+
this.check_shim(abi, Conv::C, link_name, args)?;
3839
let result = this.epoll_ctl(epfd, op, fd, event)?;
3940
this.write_scalar(result, dest)?;
4041
}
4142
"epoll_wait" => {
4243
let [epfd, events, maxevents, timeout] =
43-
this.check_shim(abi, ExternAbi::C { unwind: false }, link_name, args)?;
44+
this.check_shim(abi, Conv::C, link_name, args)?;
4445
this.epoll_wait(epfd, events, maxevents, timeout, dest)?;
4546
}
4647
"eventfd" => {
4748
let [val, flag] =
48-
this.check_shim(abi, ExternAbi::C { unwind: false }, link_name, args)?;
49+
this.check_shim(abi, Conv::C, link_name, args)?;
4950
let result = this.eventfd(val, flag)?;
5051
this.write_scalar(result, dest)?;
5152
}

src/tools/miri/src/shims/unix/foreign_items.rs

+1-26
Original file line numberDiff line numberDiff line change
@@ -144,14 +144,6 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
144144
let result = this.getpid()?;
145145
this.write_scalar(result, dest)?;
146146
}
147-
148-
"sysconf" => {
149-
let [val] =
150-
this.check_shim(abi, ExternAbi::C { unwind: false }, link_name, args)?;
151-
let result = this.sysconf(val)?;
152-
this.write_scalar(result, dest)?;
153-
}
154-
155147
// File descriptors
156148
"read" => {
157149
let [fd, buf, count] = this.check_shim(abi, Conv::C , link_name, args)?;
@@ -792,24 +784,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
792784
// We do not support forking, so there is nothing to do here.
793785
this.write_null(dest)?;
794786
}
795-
<<<<<<< HEAD
796-
=======
797-
"strerror_r" | "__xpg_strerror_r" => {
798-
let [errnum, buf, buflen] = this.check_shim(abi, Conv::C , link_name, args)?;
799-
let errnum = this.read_scalar(errnum)?;
800-
let buf = this.read_pointer(buf)?;
801-
let buflen = this.read_target_usize(buflen)?;
802787

803-
let error = this.try_errnum_to_io_error(errnum)?;
804-
let formatted = match error {
805-
Some(err) => format!("{err}"),
806-
None => format!("<unknown errnum in strerror_r: {errnum}>"),
807-
};
808-
let (complete, _) = this.write_os_str_to_c_str(OsStr::new(&formatted), buf, buflen)?;
809-
let ret = if complete { 0 } else { this.eval_libc_i32("ERANGE") };
810-
this.write_int(ret, dest)?;
811-
}
812-
>>>>>>> 3750176dbd2 (Pass FnAbi to find_mir_or_eval_fn)
813788
"getentropy" => {
814789
// This function is non-standard but exists with the same signature and behavior on
815790
// Linux, macOS, FreeBSD and Solaris/Illumos.
@@ -840,7 +815,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
840815

841816
"strerror_r" => {
842817
let [errnum, buf, buflen] =
843-
this.check_shim(abi, ExternAbi::C { unwind: false }, link_name, args)?;
818+
this.check_shim(abi, Conv::C, link_name, args)?;
844819
let result = this.strerror_r(errnum, buf, buflen)?;
845820
this.write_scalar(result, dest)?;
846821
}

src/tools/miri/src/shims/unix/linux/foreign_items.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
148148
}
149149
"__xpg_strerror_r" => {
150150
let [errnum, buf, buflen] =
151-
this.check_shim(abi, ExternAbi::C { unwind: false }, link_name, args)?;
151+
this.check_shim(abi, Conv::C, link_name, args)?;
152152
let result = this.strerror_r(errnum, buf, buflen)?;
153153
this.write_scalar(result, dest)?;
154154
}

src/tools/miri/src/shims/unix/solarish/foreign_items.rs

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
use rustc_target::callconv::Conv;
23
use rustc_span::Symbol;
34
use rustc_target::callconv::FnAbi;
@@ -62,19 +63,19 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
6263
// File related shims
6364
"stat" | "stat64" => {
6465
let [path, buf] =
65-
this.check_shim(abi, ExternAbi::C { unwind: false }, link_name, args)?;
66+
this.check_shim(abi, Conv::C, link_name, args)?;
6667
let result = this.macos_fbsd_solaris_stat(path, buf)?;
6768
this.write_scalar(result, dest)?;
6869
}
6970
"lstat" | "lstat64" => {
7071
let [path, buf] =
71-
this.check_shim(abi, ExternAbi::C { unwind: false }, link_name, args)?;
72+
this.check_shim(abi, Conv::C, link_name, args)?;
7273
let result = this.macos_fbsd_solaris_lstat(path, buf)?;
7374
this.write_scalar(result, dest)?;
7475
}
7576
"fstat" | "fstat64" => {
7677
let [fd, buf] =
77-
this.check_shim(abi, ExternAbi::C { unwind: false }, link_name, args)?;
78+
this.check_shim(abi, Conv::C, link_name, args)?;
7879
let result = this.macos_fbsd_solaris_fstat(fd, buf)?;
7980
this.write_scalar(result, dest)?;
8081
}
@@ -137,7 +138,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
137138

138139
"__sysconf_xpg7" => {
139140
let [val] =
140-
this.check_shim(abi, ExternAbi::C { unwind: false }, link_name, args)?;
141+
this.check_shim(abi, Conv::C, link_name, args)?;
141142
let result = this.sysconf(val)?;
142143
this.write_scalar(result, dest)?;
143144
}

0 commit comments

Comments
 (0)