Change ty.kind to a method
This commit is contained in:
parent
ef55a0a92f
commit
3e14b684dd
189 changed files with 947 additions and 899 deletions
|
@ -110,7 +110,7 @@ fn get_symbol_hash<'tcx>(
|
|||
// If this is a function, we hash the signature as well.
|
||||
// This is not *strictly* needed, but it may help in some
|
||||
// situations, see the `run-make/a-b-a-linker-guard` test.
|
||||
if let ty::FnDef(..) = item_type.kind {
|
||||
if let ty::FnDef(..) = item_type.kind() {
|
||||
item_type.fn_sig(tcx).hash_stable(&mut hcx, &mut hasher);
|
||||
}
|
||||
|
||||
|
@ -210,7 +210,7 @@ impl Printer<'tcx> for SymbolPrinter<'tcx> {
|
|||
}
|
||||
|
||||
fn print_type(self, ty: Ty<'tcx>) -> Result<Self::Type, Self::Error> {
|
||||
match ty.kind {
|
||||
match *ty.kind() {
|
||||
// Print all nominal types as paths (unlike `pretty_print_type`).
|
||||
ty::FnDef(def_id, substs)
|
||||
| ty::Opaque(def_id, substs)
|
||||
|
@ -258,7 +258,7 @@ impl Printer<'tcx> for SymbolPrinter<'tcx> {
|
|||
) -> Result<Self::Path, Self::Error> {
|
||||
// Similar to `pretty_path_qualified`, but for the other
|
||||
// types that are printed as paths (see `print_type` above).
|
||||
match self_ty.kind {
|
||||
match self_ty.kind() {
|
||||
ty::FnDef(..)
|
||||
| ty::Opaque(..)
|
||||
| ty::Projection(_)
|
||||
|
|
|
@ -323,7 +323,7 @@ impl Printer<'tcx> for SymbolMangler<'tcx> {
|
|||
|
||||
fn print_type(mut self, ty: Ty<'tcx>) -> Result<Self::Type, Self::Error> {
|
||||
// Basic types, never cached (single-character).
|
||||
let basic_type = match ty.kind {
|
||||
let basic_type = match ty.kind() {
|
||||
ty::Bool => "b",
|
||||
ty::Char => "c",
|
||||
ty::Str => "e",
|
||||
|
@ -359,7 +359,7 @@ impl Printer<'tcx> for SymbolMangler<'tcx> {
|
|||
}
|
||||
let start = self.out.len();
|
||||
|
||||
match ty.kind {
|
||||
match *ty.kind() {
|
||||
// Basic types, handled above.
|
||||
ty::Bool | ty::Char | ty::Str | ty::Int(_) | ty::Uint(_) | ty::Float(_) | ty::Never => {
|
||||
unreachable!()
|
||||
|
@ -505,7 +505,7 @@ impl Printer<'tcx> for SymbolMangler<'tcx> {
|
|||
}
|
||||
let start = self.out.len();
|
||||
|
||||
match ct.ty.kind {
|
||||
match ct.ty.kind() {
|
||||
ty::Uint(_) => {}
|
||||
_ => {
|
||||
bug!("symbol_names: unsupported constant of type `{}` ({:?})", ct.ty, ct);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue