@@ -29,7 +29,7 @@ pub enum Status {
2929}
3030
3131#[ derive( Clone , Copy ) ]
32- pub enum DiagnosticImportance {
32+ pub enum DiagImportance {
3333 /// An operation that must be removed for const-checking to pass.
3434 Primary ,
3535
@@ -44,8 +44,8 @@ pub trait NonConstOp<'tcx>: std::fmt::Debug {
4444 Status :: Forbidden
4545 }
4646
47- fn importance ( & self ) -> DiagnosticImportance {
48- DiagnosticImportance :: Primary
47+ fn importance ( & self ) -> DiagImportance {
48+ DiagImportance :: Primary
4949 }
5050
5151 fn build_error ( & self , ccx : & ConstCx < ' _ , ' tcx > , span : Span ) -> Diag < ' tcx > ;
@@ -427,10 +427,10 @@ impl<'tcx> NonConstOp<'tcx> for TransientCellBorrow {
427427/// it in the future for static items.
428428pub struct CellBorrow ;
429429impl < ' tcx > NonConstOp < ' tcx > for CellBorrow {
430- fn importance ( & self ) -> DiagnosticImportance {
430+ fn importance ( & self ) -> DiagImportance {
431431 // Most likely the code will try to do mutation with these borrows, which
432432 // triggers its own errors. Only show this one if that does not happen.
433- DiagnosticImportance :: Secondary
433+ DiagImportance :: Secondary
434434 }
435435 fn build_error ( & self , ccx : & ConstCx < ' _ , ' tcx > , span : Span ) -> Diag < ' tcx > {
436436 // FIXME: Maybe a more elegant solution to this if else case
@@ -463,10 +463,10 @@ impl<'tcx> NonConstOp<'tcx> for MutBorrow {
463463 Status :: Forbidden
464464 }
465465
466- fn importance ( & self ) -> DiagnosticImportance {
466+ fn importance ( & self ) -> DiagImportance {
467467 // Most likely the code will try to do mutation with these borrows, which
468468 // triggers its own errors. Only show this one if that does not happen.
469- DiagnosticImportance :: Secondary
469+ DiagImportance :: Secondary
470470 }
471471
472472 fn build_error ( & self , ccx : & ConstCx < ' _ , ' tcx > , span : Span ) -> Diag < ' tcx > {
@@ -515,9 +515,9 @@ impl<'tcx> NonConstOp<'tcx> for MutDeref {
515515 Status :: Unstable ( sym:: const_mut_refs)
516516 }
517517
518- fn importance ( & self ) -> DiagnosticImportance {
518+ fn importance ( & self ) -> DiagImportance {
519519 // Usually a side-effect of a `TransientMutBorrow` somewhere.
520- DiagnosticImportance :: Secondary
520+ DiagImportance :: Secondary
521521 }
522522
523523 fn build_error ( & self , ccx : & ConstCx < ' _ , ' tcx > , span : Span ) -> Diag < ' tcx > {
@@ -625,12 +625,10 @@ pub mod ty {
625625 Status :: Unstable ( sym:: const_mut_refs)
626626 }
627627
628- fn importance ( & self ) -> DiagnosticImportance {
628+ fn importance ( & self ) -> DiagImportance {
629629 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 ,
634632 }
635633 }
636634
0 commit comments