diff options
| author | Karan Janthe <karanjanthe@gmail.com> | 2025-09-01 06:17:34 +0000 | 
|---|---|---|
| committer | Karan Janthe <karanjanthe@gmail.com> | 2025-09-19 04:11:35 +0000 | 
| commit | be3617b04031c7d4f227ce54c4ce6ceeae00981c (patch) | |
| tree | ce3502d323ec6a9f20cfdedbc96d8f12538c7058 /compiler/rustc_middle/src | |
| parent | 31541feb6f7e46c23141bdeb3e35ecd305bf8762 (diff) | |
| download | rust-be3617b04031c7d4f227ce54c4ce6ceeae00981c.tar.gz rust-be3617b04031c7d4f227ce54c4ce6ceeae00981c.zip | |
autodiff: slice support in typetree
Diffstat (limited to 'compiler/rustc_middle/src')
| -rw-r--r-- | compiler/rustc_middle/src/ty/mod.rs | 7 | 
1 files changed, 7 insertions, 0 deletions
| diff --git a/compiler/rustc_middle/src/ty/mod.rs b/compiler/rustc_middle/src/ty/mod.rs index 02a4e4e2b15..82a41f403f8 100644 --- a/compiler/rustc_middle/src/ty/mod.rs +++ b/compiler/rustc_middle/src/ty/mod.rs @@ -2327,5 +2327,12 @@ pub fn typetree_from_ty<'tcx>(tcx: TyCtxt<'tcx>, ty: Ty<'tcx>) -> TypeTree { } } + if ty.is_slice() { + if let ty::Slice(element_ty) = ty.kind() { + let element_tree = typetree_from_ty(tcx, *element_ty); + return element_tree; + } + } + TypeTree::new() } | 
