@@ -29,7 +29,7 @@ pub enum Status {
29
29
}
30
30
31
31
#[ derive( Clone , Copy ) ]
32
- pub enum DiagnosticImportance {
32
+ pub enum DiagImportance {
33
33
/// An operation that must be removed for const-checking to pass.
34
34
Primary ,
35
35
@@ -44,8 +44,8 @@ pub trait NonConstOp<'tcx>: std::fmt::Debug {
44
44
Status :: Forbidden
45
45
}
46
46
47
- fn importance ( & self ) -> DiagnosticImportance {
48
- DiagnosticImportance :: Primary
47
+ fn importance ( & self ) -> DiagImportance {
48
+ DiagImportance :: Primary
49
49
}
50
50
51
51
fn build_error ( & self , ccx : & ConstCx < ' _ , ' tcx > , span : Span ) -> Diag < ' tcx > ;
@@ -427,10 +427,10 @@ impl<'tcx> NonConstOp<'tcx> for TransientCellBorrow {
427
427
/// it in the future for static items.
428
428
pub struct CellBorrow ;
429
429
impl < ' tcx > NonConstOp < ' tcx > for CellBorrow {
430
- fn importance ( & self ) -> DiagnosticImportance {
430
+ fn importance ( & self ) -> DiagImportance {
431
431
// Most likely the code will try to do mutation with these borrows, which
432
432
// triggers its own errors. Only show this one if that does not happen.
433
- DiagnosticImportance :: Secondary
433
+ DiagImportance :: Secondary
434
434
}
435
435
fn build_error ( & self , ccx : & ConstCx < ' _ , ' tcx > , span : Span ) -> Diag < ' tcx > {
436
436
// FIXME: Maybe a more elegant solution to this if else case
@@ -463,10 +463,10 @@ impl<'tcx> NonConstOp<'tcx> for MutBorrow {
463
463
Status :: Forbidden
464
464
}
465
465
466
- fn importance ( & self ) -> DiagnosticImportance {
466
+ fn importance ( & self ) -> DiagImportance {
467
467
// Most likely the code will try to do mutation with these borrows, which
468
468
// triggers its own errors. Only show this one if that does not happen.
469
- DiagnosticImportance :: Secondary
469
+ DiagImportance :: Secondary
470
470
}
471
471
472
472
fn build_error ( & self , ccx : & ConstCx < ' _ , ' tcx > , span : Span ) -> Diag < ' tcx > {
@@ -515,9 +515,9 @@ impl<'tcx> NonConstOp<'tcx> for MutDeref {
515
515
Status :: Unstable ( sym:: const_mut_refs)
516
516
}
517
517
518
- fn importance ( & self ) -> DiagnosticImportance {
518
+ fn importance ( & self ) -> DiagImportance {
519
519
// Usually a side-effect of a `TransientMutBorrow` somewhere.
520
- DiagnosticImportance :: Secondary
520
+ DiagImportance :: Secondary
521
521
}
522
522
523
523
fn build_error ( & self , ccx : & ConstCx < ' _ , ' tcx > , span : Span ) -> Diag < ' tcx > {
@@ -625,12 +625,10 @@ pub mod ty {
625
625
Status :: Unstable ( sym:: const_mut_refs)
626
626
}
627
627
628
- fn importance ( & self ) -> DiagnosticImportance {
628
+ fn importance ( & self ) -> DiagImportance {
629
629
match self . 0 {
630
- mir:: LocalKind :: Temp => DiagnosticImportance :: Secondary ,
631
- mir:: LocalKind :: ReturnPointer | mir:: LocalKind :: Arg => {
632
- DiagnosticImportance :: Primary
633
- }
630
+ mir:: LocalKind :: Temp => DiagImportance :: Secondary ,
631
+ mir:: LocalKind :: ReturnPointer | mir:: LocalKind :: Arg => DiagImportance :: Primary ,
634
632
}
635
633
}
636
634
0 commit comments