diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:43 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:43 +0000 |
commit | 3e3e70d529d8c7d7c4d7bc4fefc9f109393b9245 (patch) | |
tree | daf049b282ab10e8c3d03e409b3cd84ff3f7690c /compiler/rustc_transmute | |
parent | Adding debian version 1.68.2+dfsg1-1. (diff) | |
download | rustc-3e3e70d529d8c7d7c4d7bc4fefc9f109393b9245.tar.xz rustc-3e3e70d529d8c7d7c4d7bc4fefc9f109393b9245.zip |
Merging upstream version 1.69.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'compiler/rustc_transmute')
-rw-r--r-- | compiler/rustc_transmute/src/layout/tree.rs | 5 | ||||
-rw-r--r-- | compiler/rustc_transmute/src/lib.rs | 2 |
2 files changed, 4 insertions, 3 deletions
diff --git a/compiler/rustc_transmute/src/layout/tree.rs b/compiler/rustc_transmute/src/layout/tree.rs index 30e20ba6f..295b65c2c 100644 --- a/compiler/rustc_transmute/src/layout/tree.rs +++ b/compiler/rustc_transmute/src/layout/tree.rs @@ -284,8 +284,9 @@ pub(crate) mod rustc { } ty::Array(ty, len) => { - let len = - len.try_eval_usize(tcx, ParamEnv::reveal_all()).ok_or(Err::Unspecified)?; + let len = len + .try_eval_target_usize(tcx, ParamEnv::reveal_all()) + .ok_or(Err::Unspecified)?; let elt = Tree::from_ty(*ty, tcx)?; Ok(std::iter::repeat(elt) .take(len as usize) diff --git a/compiler/rustc_transmute/src/lib.rs b/compiler/rustc_transmute/src/lib.rs index b3b9a67b2..4b4a8ebd0 100644 --- a/compiler/rustc_transmute/src/lib.rs +++ b/compiler/rustc_transmute/src/lib.rs @@ -117,7 +117,7 @@ mod rustc { c: Const<'tcx>, ) -> Option<Self> { use rustc_middle::ty::ScalarInt; - use rustc_middle::ty::TypeVisitable; + use rustc_middle::ty::TypeVisitableExt; use rustc_span::symbol::sym; let c = c.eval(tcx, param_env); |