@@ -23,7 +23,7 @@ use rustc_feature::{
2323use rustc_hir:: attrs:: diagnostic:: Directive ;
2424use rustc_hir:: attrs:: {
2525 AttributeKind , DocAttribute , DocInline , EiiDecl , EiiImpl , EiiImplResolution , InlineAttr ,
26- MirDialect , MirPhase , ReprAttr , SanitizerSet ,
26+ ReprAttr , SanitizerSet ,
2727} ;
2828use rustc_hir:: def:: DefKind ;
2929use rustc_hir:: def_id:: LocalModDefId ;
@@ -208,9 +208,6 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
208208 Attribute :: Parsed ( AttributeKind :: MayDangle ( attr_span) ) => {
209209 self . check_may_dangle ( hir_id, * attr_span)
210210 }
211- & Attribute :: Parsed ( AttributeKind :: CustomMir ( dialect, phase, attr_span) ) => {
212- self . check_custom_mir ( dialect, phase, attr_span)
213- }
214211 & Attribute :: Parsed ( AttributeKind :: Sanitize { on_set, off_set, rtsan : _, span : attr_span} ) => {
215212 self . check_sanitize ( attr_span, on_set | off_set, span, target) ;
216213 } ,
@@ -247,6 +244,7 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
247244 | AttributeKind :: Coverage ( ..)
248245 | AttributeKind :: CrateName { .. }
249246 | AttributeKind :: CrateType ( ..)
247+ | AttributeKind :: CustomMir ( ..)
250248 | AttributeKind :: DebuggerVisualizer ( ..)
251249 | AttributeKind :: DefaultLibAllocator
252250 // `#[doc]` is actually a lot more than just doc comments, so is checked below
@@ -1856,48 +1854,6 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
18561854 self . dcx ( ) . emit_err ( errors:: ConstContinueAttr { attr_span, node_span } ) ;
18571855 } ;
18581856 }
1859-
1860- fn check_custom_mir (
1861- & self ,
1862- dialect : Option < ( MirDialect , Span ) > ,
1863- phase : Option < ( MirPhase , Span ) > ,
1864- attr_span : Span ,
1865- ) {
1866- let Some ( ( dialect, dialect_span) ) = dialect else {
1867- if let Some ( ( _, phase_span) ) = phase {
1868- self . dcx ( )
1869- . emit_err ( errors:: CustomMirPhaseRequiresDialect { attr_span, phase_span } ) ;
1870- }
1871- return ;
1872- } ;
1873-
1874- match dialect {
1875- MirDialect :: Analysis => {
1876- if let Some ( ( MirPhase :: Optimized , phase_span) ) = phase {
1877- self . dcx ( ) . emit_err ( errors:: CustomMirIncompatibleDialectAndPhase {
1878- dialect,
1879- phase : MirPhase :: Optimized ,
1880- attr_span,
1881- dialect_span,
1882- phase_span,
1883- } ) ;
1884- }
1885- }
1886-
1887- MirDialect :: Built => {
1888- if let Some ( ( phase, phase_span) ) = phase {
1889- self . dcx ( ) . emit_err ( errors:: CustomMirIncompatibleDialectAndPhase {
1890- dialect,
1891- phase,
1892- attr_span,
1893- dialect_span,
1894- phase_span,
1895- } ) ;
1896- }
1897- }
1898- MirDialect :: Runtime => { }
1899- }
1900- }
19011857}
19021858
19031859impl < ' tcx > Visitor < ' tcx > for CheckAttrVisitor < ' tcx > {
0 commit comments