about summary refs log tree commit diff
path: root/compiler/stable_mir/src/compiler_interface.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-05-29 03:55:21 +0000
committerbors <bors@rust-lang.org>2024-05-29 03:55:21 +0000
commit751691271d76b8435559200b84d1947c2bd735bd (patch)
tree43c1b958190e9e2b87cea232e2f3ac27df9ecaa8 /compiler/stable_mir/src/compiler_interface.rs
parentda159eb331b27df528185c616b394bb0e1d2a4bd (diff)
parent4c1228276b15c50b991d052d9fc682cc62f90881 (diff)
downloadrust-751691271d76b8435559200b84d1947c2bd735bd.tar.gz
rust-751691271d76b8435559200b84d1947c2bd735bd.zip
Auto merge of #125691 - jieyouxu:rollup-0i3wrc4, r=jieyouxu
Rollup of 8 pull requests

Successful merges:

 - #124251 (Add an intrinsic for `ptr::metadata`)
 - #124320 (Add `--print=check-cfg` to get the expected configs)
 - #125226 (Make more of the test suite run on Mac Catalyst)
 - #125381 (Silence some resolve errors when there have been glob import errors)
 - #125633 (miri: avoid making a full copy of all new allocations)
 - #125638 (Rewrite `lto-smoke`, `simple-rlib` and `mixing-deps` `run-make` tests in `rmake.rs` format)
 - #125639 (Support `./x doc run-make-support --open`)
 - #125664 (Tweak relations to no longer rely on `TypeTrace`)

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/stable_mir/src/compiler_interface.rs')
-rw-r--r--compiler/stable_mir/src/compiler_interface.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/compiler/stable_mir/src/compiler_interface.rs b/compiler/stable_mir/src/compiler_interface.rs
index 4dd64228bba..858ce5301d8 100644
--- a/compiler/stable_mir/src/compiler_interface.rs
+++ b/compiler/stable_mir/src/compiler_interface.rs
@@ -8,7 +8,7 @@ use std::cell::Cell;
 use crate::abi::{FnAbi, Layout, LayoutShape};
 use crate::mir::alloc::{AllocId, GlobalAlloc};
 use crate::mir::mono::{Instance, InstanceDef, StaticDef};
-use crate::mir::{BinOp, Body, Place};
+use crate::mir::{BinOp, Body, Place, UnOp};
 use crate::target::MachineInfo;
 use crate::ty::{
     AdtDef, AdtKind, Allocation, ClosureDef, ClosureKind, Const, FieldDef, FnDef, ForeignDef,
@@ -226,6 +226,9 @@ pub trait Context {
 
     /// Get the resulting type of binary operation.
     fn binop_ty(&self, bin_op: BinOp, rhs: Ty, lhs: Ty) -> Ty;
+
+    /// Get the resulting type of unary operation.
+    fn unop_ty(&self, un_op: UnOp, arg: Ty) -> Ty;
 }
 
 // A thread local variable that stores a pointer to the tables mapping between TyCtxt