Auto merge of #103693 - HKalbasi:master, r=oli-obk
Make rustc_target usable outside of rustc I'm working on showing type size in rust-analyzer (https://github.com/rust-lang/rust-analyzer/pull/13490) and I currently copied rustc code inside rust-analyzer, which works, but is bad. With this change, I would become able to use `rustc_target` and `rustc_index` directly in r-a, reducing the amount of copy needed. This PR contains some feature flag to put nightly features behind them to make crates buildable on the stable compiler + makes layout related types generic over index type + removes interning of nested layouts.
This commit is contained in:
commit
b3bc6bf312
31 changed files with 2725 additions and 2538 deletions
|
@ -9,9 +9,9 @@
|
|||
use rustc_middle::traits::ChalkRustInterner as RustInterner;
|
||||
use rustc_middle::ty::{self, AssocKind, EarlyBinder, Ty, TyCtxt, TypeFoldable, TypeSuperFoldable};
|
||||
use rustc_middle::ty::{InternalSubsts, SubstsRef};
|
||||
use rustc_target::abi::{Integer, IntegerType};
|
||||
|
||||
use rustc_ast::ast;
|
||||
use rustc_attr as attr;
|
||||
|
||||
use rustc_hir::def_id::DefId;
|
||||
|
||||
|
@ -218,21 +218,21 @@ impl<'tcx> chalk_solve::RustIrDatabase<RustInterner<'tcx>> for RustIrDatabase<'t
|
|||
c: adt_def.repr().c(),
|
||||
packed: adt_def.repr().packed(),
|
||||
int: adt_def.repr().int.map(|i| match i {
|
||||
attr::IntType::SignedInt(ty) => match ty {
|
||||
ast::IntTy::Isize => int(chalk_ir::IntTy::Isize),
|
||||
ast::IntTy::I8 => int(chalk_ir::IntTy::I8),
|
||||
ast::IntTy::I16 => int(chalk_ir::IntTy::I16),
|
||||
ast::IntTy::I32 => int(chalk_ir::IntTy::I32),
|
||||
ast::IntTy::I64 => int(chalk_ir::IntTy::I64),
|
||||
ast::IntTy::I128 => int(chalk_ir::IntTy::I128),
|
||||
IntegerType::Pointer(true) => int(chalk_ir::IntTy::Isize),
|
||||
IntegerType::Pointer(false) => uint(chalk_ir::UintTy::Usize),
|
||||
IntegerType::Fixed(i, true) => match i {
|
||||
Integer::I8 => int(chalk_ir::IntTy::I8),
|
||||
Integer::I16 => int(chalk_ir::IntTy::I16),
|
||||
Integer::I32 => int(chalk_ir::IntTy::I32),
|
||||
Integer::I64 => int(chalk_ir::IntTy::I64),
|
||||
Integer::I128 => int(chalk_ir::IntTy::I128),
|
||||
},
|
||||
attr::IntType::UnsignedInt(ty) => match ty {
|
||||
ast::UintTy::Usize => uint(chalk_ir::UintTy::Usize),
|
||||
ast::UintTy::U8 => uint(chalk_ir::UintTy::U8),
|
||||
ast::UintTy::U16 => uint(chalk_ir::UintTy::U16),
|
||||
ast::UintTy::U32 => uint(chalk_ir::UintTy::U32),
|
||||
ast::UintTy::U64 => uint(chalk_ir::UintTy::U64),
|
||||
ast::UintTy::U128 => uint(chalk_ir::UintTy::U128),
|
||||
IntegerType::Fixed(i, false) => match i {
|
||||
Integer::I8 => uint(chalk_ir::UintTy::U8),
|
||||
Integer::I16 => uint(chalk_ir::UintTy::U16),
|
||||
Integer::I32 => uint(chalk_ir::UintTy::U32),
|
||||
Integer::I64 => uint(chalk_ir::UintTy::U64),
|
||||
Integer::I128 => uint(chalk_ir::UintTy::U128),
|
||||
},
|
||||
}),
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue