@@ -23,7 +23,6 @@ use rustc::mir::visit::{PlaceContext, Visitor, MutatingUseContext};
2323
2424use syntax:: ast;
2525use syntax:: symbol:: Symbol ;
26- use syntax:: feature_gate:: { emit_feature_err, GateIssue } ;
2726
2827use std:: ops:: Bound ;
2928
@@ -97,7 +96,7 @@ impl<'a, 'tcx> Visitor<'tcx> for UnsafetyChecker<'a, 'tcx> {
9796 if let hir:: Unsafety :: Unsafe = sig. unsafety ( ) {
9897 self . require_unsafe ( "call to unsafe function" ,
9998 "consult the function's documentation for information on how to avoid \
100- undefined behavior", UnsafetyViolationKind :: GatedConstFnCall )
99+ undefined behavior", UnsafetyViolationKind :: GeneralAndConstFn )
101100 }
102101 }
103102 }
@@ -325,11 +324,6 @@ impl<'a, 'tcx> UnsafetyChecker<'a, 'tcx> {
325324 // compat lint
326325 violation. kind = UnsafetyViolationKind :: General ;
327326 } ,
328- UnsafetyViolationKind :: GatedConstFnCall => {
329- // safe code can't call unsafe const fns, this `UnsafetyViolationKind`
330- // is only relevant for `Safety::ExplicitUnsafe` in `unsafe const fn`s
331- violation. kind = UnsafetyViolationKind :: General ;
332- }
333327 }
334328 if !self . violations . contains ( & violation) {
335329 self . violations . push ( violation)
@@ -346,19 +340,8 @@ impl<'a, 'tcx> UnsafetyChecker<'a, 'tcx> {
346340 }
347341 // only some unsafety is allowed in const fn
348342 if self . min_const_fn {
349- let min_const_unsafe_fn = self . tcx . features ( ) . min_const_unsafe_fn ;
350343 for violation in violations {
351344 match violation. kind {
352- UnsafetyViolationKind :: GatedConstFnCall if min_const_unsafe_fn => {
353- // these function calls to unsafe functions are allowed
354- // if `#![feature(min_const_unsafe_fn)]` is active
355- } ,
356- UnsafetyViolationKind :: GatedConstFnCall => {
357- // without the feature gate, we report errors
358- if !self . violations . contains ( & violation) {
359- self . violations . push ( violation. clone ( ) )
360- }
361- }
362345 // these unsafe things are stable in const fn
363346 UnsafetyViolationKind :: GeneralAndConstFn => { } ,
364347 // these things are forbidden in const fns
@@ -620,16 +603,6 @@ pub fn check_unsafety<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, def_id: DefId) {
620603 . note ( & details. as_str ( ) [ ..] )
621604 . emit ( ) ;
622605 }
623- UnsafetyViolationKind :: GatedConstFnCall => {
624- emit_feature_err (
625- & tcx. sess . parse_sess ,
626- "min_const_unsafe_fn" ,
627- source_info. span ,
628- GateIssue :: Language ,
629- "calls to `const unsafe fn` in const fns are unstable" ,
630- ) ;
631-
632- }
633606 UnsafetyViolationKind :: ExternStatic ( lint_node_id) => {
634607 tcx. lint_node_note ( SAFE_EXTERN_STATICS ,
635608 lint_node_id,
0 commit comments