about summary refs log tree commit diff
path: root/compiler/rustc_const_eval/src/transform
diff options
context:
space:
mode:
authornidnogg <henriquevt98@gmail.com>2022-08-20 16:27:41 -0300
committernidnogg <henriquevt98@gmail.com>2022-08-21 23:22:55 -0300
commit4c82845b3ac583377b871bf01dc07ec513c466fe (patch)
treeededbf4ca5f0fb7512322e75dc7059e7fd28d489 /compiler/rustc_const_eval/src/transform
parentd1f14ee1b01dd39cd79cd9cdd71e91ba521901fe (diff)
downloadrust-4c82845b3ac583377b871bf01dc07ec513c466fe.tar.gz
rust-4c82845b3ac583377b871bf01dc07ec513c466fe.zip
Fixed failing tests (missing labels), added automatic error code in create_feature_err() builder
Diffstat (limited to 'compiler/rustc_const_eval/src/transform')
-rw-r--r--compiler/rustc_const_eval/src/transform/check_consts/ops.rs17
1 files changed, 4 insertions, 13 deletions
diff --git a/compiler/rustc_const_eval/src/transform/check_consts/ops.rs b/compiler/rustc_const_eval/src/transform/check_consts/ops.rs
index e2cf9b2b3c1..5fb4bf638b3 100644
--- a/compiler/rustc_const_eval/src/transform/check_consts/ops.rs
+++ b/compiler/rustc_const_eval/src/transform/check_consts/ops.rs
@@ -345,8 +345,10 @@ impl<'tcx> NonConstOp<'tcx> for FnCallUnstable {
     ) -> DiagnosticBuilder<'tcx, ErrorGuaranteed> {
         let FnCallUnstable(def_id, feature) = *self;
 
-        let mut err =
-            ccx.tcx.sess.create_err(UnstableConstFn { span, def_id: ccx.tcx.def_path_str(def_id) });
+        let mut err = ccx
+            .tcx
+            .sess
+            .create_err(UnstableConstFn { span, def_path: ccx.tcx.def_path_str(def_id) });
 
         if ccx.is_const_stable_const_fn() {
             err.help("const-stable functions can only call other const-stable functions");
@@ -517,17 +519,6 @@ impl<'tcx> NonConstOp<'tcx> for MutBorrow {
         ccx: &ConstCx<'_, 'tcx>,
         span: Span,
     ) -> DiagnosticBuilder<'tcx, ErrorGuaranteed> {
-        // let raw = match self.0 {
-        //     hir::BorrowKind::Raw => "raw ",
-        //     hir::BorrowKind::Ref => "",
-        // };
-
-        // ccx.tcx.sess.create_err(UnallowedMutableRefs {
-        //     span,
-        //     raw,
-        //     kind: ccx.const_kind(),
-        //     teach: ccx.tcx.sess.teach(&error_code!(E0764)).then_some(()),
-        // })
         match self.0 {
             hir::BorrowKind::Raw => ccx.tcx.sess.create_err(UnallowedMutableRefsRaw {
                 span,