Change ty.kind to a method

This commit is contained in:
LeSeulArtichaut
2020-08-03 00:49:11 +02:00
parent ef55a0a92f
commit 3e14b684dd
189 changed files with 947 additions and 899 deletions

View File

@@ -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);