|
1 | 1 | // ignore-tidy-filelength
|
2 | 2 |
|
3 |
| -#![cfg_attr(not(bootstrap), allow(rustc::usage_of_ty_tykind))] |
4 |
| - |
5 | 3 | pub use self::Variance::*;
|
6 | 4 | pub use self::AssocItemContainer::*;
|
7 | 5 | pub use self::BorrowKind::*;
|
@@ -484,6 +482,7 @@ bitflags! {
|
484 | 482 | }
|
485 | 483 | }
|
486 | 484 |
|
| 485 | +#[cfg_attr(not(bootstrap), allow(rustc::usage_of_ty_tykind))] |
487 | 486 | pub struct TyS<'tcx> {
|
488 | 487 | pub sty: TyKind<'tcx>,
|
489 | 488 | pub flags: TypeFlags,
|
@@ -541,29 +540,29 @@ impl<'tcx> Hash for TyS<'tcx> {
|
541 | 540 | impl<'tcx> TyS<'tcx> {
|
542 | 541 | pub fn is_primitive_ty(&self) -> bool {
|
543 | 542 | match self.sty {
|
544 |
| - TyKind::Bool | |
545 |
| - TyKind::Char | |
546 |
| - TyKind::Int(_) | |
547 |
| - TyKind::Uint(_) | |
548 |
| - TyKind::Float(_) | |
549 |
| - TyKind::Infer(InferTy::IntVar(_)) | |
550 |
| - TyKind::Infer(InferTy::FloatVar(_)) | |
551 |
| - TyKind::Infer(InferTy::FreshIntTy(_)) | |
552 |
| - TyKind::Infer(InferTy::FreshFloatTy(_)) => true, |
553 |
| - TyKind::Ref(_, x, _) => x.is_primitive_ty(), |
| 543 | + Bool | |
| 544 | + Char | |
| 545 | + Int(_) | |
| 546 | + Uint(_) | |
| 547 | + Float(_) | |
| 548 | + Infer(InferTy::IntVar(_)) | |
| 549 | + Infer(InferTy::FloatVar(_)) | |
| 550 | + Infer(InferTy::FreshIntTy(_)) | |
| 551 | + Infer(InferTy::FreshFloatTy(_)) => true, |
| 552 | + Ref(_, x, _) => x.is_primitive_ty(), |
554 | 553 | _ => false,
|
555 | 554 | }
|
556 | 555 | }
|
557 | 556 |
|
558 | 557 | pub fn is_suggestable(&self) -> bool {
|
559 | 558 | match self.sty {
|
560 |
| - TyKind::Opaque(..) | |
561 |
| - TyKind::FnDef(..) | |
562 |
| - TyKind::FnPtr(..) | |
563 |
| - TyKind::Dynamic(..) | |
564 |
| - TyKind::Closure(..) | |
565 |
| - TyKind::Infer(..) | |
566 |
| - TyKind::Projection(..) => false, |
| 559 | + Opaque(..) | |
| 560 | + FnDef(..) | |
| 561 | + FnPtr(..) | |
| 562 | + Dynamic(..) | |
| 563 | + Closure(..) | |
| 564 | + Infer(..) | |
| 565 | + Projection(..) => false, |
567 | 566 | _ => true,
|
568 | 567 | }
|
569 | 568 | }
|
|
0 commit comments