Skip to content

Commit f19edd8

Browse files
committed
Auto merge of #131747 - compiler-errors:rollup-0fnymws, r=compiler-errors
Rollup of 7 pull requests Successful merges: - #129794 (uefi: Implement getcwd and chdir) - #130568 (Make some float methods unstable `const fn`) - #131521 (rename RcBox to RcInner for consistency) - #131701 (Don't report `on_unimplemented` message for negative traits) - #131705 (Fix most ui tests on emscripten target) - #131733 (Fix uninlined_format_args in stable_mir) - #131734 (Update `arm64e-apple-tvos` maintainer) r? `@ghost` `@rustbot` modify labels: rollup
2 parents f623241 + e5e26f1 commit f19edd8

File tree

3 files changed

+2
-45
lines changed

3 files changed

+2
-45
lines changed

src/intrinsics/mod.rs

-39
Original file line numberDiff line numberDiff line change
@@ -145,20 +145,6 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
145145
this.write_scalar(Scalar::from_bool(branch), dest)?;
146146
}
147147

148-
// Floating-point operations
149-
"fabsf32" => {
150-
let [f] = check_arg_count(args)?;
151-
let f = this.read_scalar(f)?.to_f32()?;
152-
// This is a "bitwise" operation, so there's no NaN non-determinism.
153-
this.write_scalar(Scalar::from_f32(f.abs()), dest)?;
154-
}
155-
"fabsf64" => {
156-
let [f] = check_arg_count(args)?;
157-
let f = this.read_scalar(f)?.to_f64()?;
158-
// This is a "bitwise" operation, so there's no NaN non-determinism.
159-
this.write_scalar(Scalar::from_f64(f.abs()), dest)?;
160-
}
161-
162148
"floorf32" | "ceilf32" | "truncf32" | "roundf32" | "rintf32" => {
163149
let [f] = check_arg_count(args)?;
164150
let f = this.read_scalar(f)?.to_f32()?;
@@ -249,31 +235,6 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
249235
this.write_scalar(res, dest)?;
250236
}
251237

252-
"minnumf32" | "maxnumf32" | "copysignf32" => {
253-
let [a, b] = check_arg_count(args)?;
254-
let a = this.read_scalar(a)?.to_f32()?;
255-
let b = this.read_scalar(b)?.to_f32()?;
256-
let res = match intrinsic_name {
257-
"minnumf32" => this.adjust_nan(a.min(b), &[a, b]),
258-
"maxnumf32" => this.adjust_nan(a.max(b), &[a, b]),
259-
"copysignf32" => a.copy_sign(b), // bitwise, no NaN adjustments
260-
_ => bug!(),
261-
};
262-
this.write_scalar(Scalar::from_f32(res), dest)?;
263-
}
264-
"minnumf64" | "maxnumf64" | "copysignf64" => {
265-
let [a, b] = check_arg_count(args)?;
266-
let a = this.read_scalar(a)?.to_f64()?;
267-
let b = this.read_scalar(b)?.to_f64()?;
268-
let res = match intrinsic_name {
269-
"minnumf64" => this.adjust_nan(a.min(b), &[a, b]),
270-
"maxnumf64" => this.adjust_nan(a.max(b), &[a, b]),
271-
"copysignf64" => a.copy_sign(b), // bitwise, no NaN adjustments
272-
_ => bug!(),
273-
};
274-
this.write_scalar(Scalar::from_f64(res), dest)?;
275-
}
276-
277238
"fmaf32" => {
278239
let [a, b, c] = check_arg_count(args)?;
279240
let a = this.read_scalar(a)?.to_f32()?;

src/operator.rs

-4
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,4 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
115115
nan
116116
}
117117
}
118-
119-
fn adjust_nan<F1: Float + FloatConvert<F2>, F2: Float>(&self, f: F2, inputs: &[F1]) -> F2 {
120-
if f.is_nan() { self.generate_nan(inputs) } else { f }
121-
}
122118
}

tests/fail/memleak_rc.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
error: memory leaked: ALLOC (Rust heap, SIZE, ALIGN), allocated here:
22
--> RUSTLIB/alloc/src/rc.rs:LL:CC
33
|
4-
LL | Box::leak(Box::new(RcBox { strong: Cell::new(1), weak: Cell::new(1), value }))
5-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4+
LL | Box::leak(Box::new(RcInner { strong: Cell::new(1), weak: Cell::new(1), value }))
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66
|
77
= note: BACKTRACE:
88
= note: inside `std::rc::Rc::<std::cell::RefCell<std::option::Option<Dummy>>>::new` at RUSTLIB/alloc/src/rc.rs:LL:CC

0 commit comments

Comments
 (0)