about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2024-02-12 18:04:09 +0100
committerGitHub <noreply@github.com>2024-02-12 18:04:09 +0100
commit3f67169a5fa1996d121de2464e04096f4c305c85 (patch)
treecd37609a517be22c80f221c5f5183cabbe1f9e31
parent02c1e3ed07afddfb8fa9394b599764d142d55156 (diff)
parente13de311d58467a61ca1b33adedeec5f62fd1cad (diff)
downloadrust-3f67169a5fa1996d121de2464e04096f4c305c85.tar.gz
rust-3f67169a5fa1996d121de2464e04096f4c305c85.zip
Rollup merge of #120933 - RalfJung:const-check-misc, r=oli-obk
check_consts: fix duplicate errors, make importance consistent

This is stuff I noticed while working on https://github.com/rust-lang/rust/pull/120932, but it's orthogonal to that PR.

r? ``@oli-obk``
-rw-r--r--compiler/rustc_const_eval/src/transform/check_consts/check.rs8
-rw-r--r--compiler/rustc_const_eval/src/transform/check_consts/ops.rs14
-rw-r--r--tests/ui/consts/issue-17718-const-bad-values.rs1
-rw-r--r--tests/ui/consts/issue-17718-const-bad-values.stderr15
-rw-r--r--tests/ui/consts/miri_unleashed/const_refers_to_static.32bit.stderr5
-rw-r--r--tests/ui/consts/miri_unleashed/const_refers_to_static.64bit.stderr5
-rw-r--r--tests/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.32bit.stderr35
-rw-r--r--tests/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.64bit.stderr35
-rw-r--r--tests/ui/consts/miri_unleashed/mutable_references_err.32bit.stderr15
-rw-r--r--tests/ui/consts/miri_unleashed/mutable_references_err.64bit.stderr15
-rw-r--r--tests/ui/feature-gates/feature-gate-const-refs-to-static.rs1
-rw-r--r--tests/ui/feature-gates/feature-gate-const-refs-to-static.stderr15
-rw-r--r--tests/ui/thread-local/thread-local-static.rs1
-rw-r--r--tests/ui/thread-local/thread-local-static.stderr14
14 files changed, 15 insertions, 164 deletions
diff --git a/compiler/rustc_const_eval/src/transform/check_consts/check.rs b/compiler/rustc_const_eval/src/transform/check_consts/check.rs
index 28dc69859fd..43048dc41d3 100644
--- a/compiler/rustc_const_eval/src/transform/check_consts/check.rs
+++ b/compiler/rustc_const_eval/src/transform/check_consts/check.rs
@@ -619,9 +619,11 @@ impl<'tcx> Visitor<'tcx> for Checker<'_, 'tcx> {
                 if base_ty.is_unsafe_ptr() {
                     if place_ref.projection.is_empty() {
                         let decl = &self.body.local_decls[place_ref.local];
-                        if let LocalInfo::StaticRef { def_id, .. } = *decl.local_info() {
-                            let span = decl.source_info.span;
-                            self.check_static(def_id, span);
+                        // If this is a static, then this is not really dereferencing a pointer,
+                        // just directly accessing a static. That is not subject to any feature
+                        // gates (except for the one about whether statics can even be used, but
+                        // that is checked already by `visit_operand`).
+                        if let LocalInfo::StaticRef { .. } = *decl.local_info() {
                             return;
                         }
                     }
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 a9d472d377c..0c93cfaa546 100644
--- a/compiler/rustc_const_eval/src/transform/check_consts/ops.rs
+++ b/compiler/rustc_const_eval/src/transform/check_consts/ops.rs
@@ -409,11 +409,6 @@ impl<'tcx> NonConstOp<'tcx> for TransientCellBorrow {
     fn status_in_item(&self, _: &ConstCx<'_, 'tcx>) -> Status {
         Status::Unstable(sym::const_refs_to_cell)
     }
-    fn importance(&self) -> DiagnosticImportance {
-        // The cases that cannot possibly work will already emit a `CellBorrow`, so we should
-        // not additionally emit a feature gate error if activating the feature gate won't work.
-        DiagnosticImportance::Secondary
-    }
     fn build_error(&self, ccx: &ConstCx<'_, 'tcx>, span: Span) -> DiagnosticBuilder<'tcx> {
         ccx.tcx
             .sess
@@ -427,6 +422,11 @@ impl<'tcx> NonConstOp<'tcx> for TransientCellBorrow {
 /// it in the future for static items.
 pub struct CellBorrow;
 impl<'tcx> NonConstOp<'tcx> for CellBorrow {
+    fn importance(&self) -> DiagnosticImportance {
+        // Most likely the code will try to do mutation with these borrows, which
+        // triggers its own errors. Only show this one if that does not happen.
+        DiagnosticImportance::Secondary
+    }
     fn build_error(&self, ccx: &ConstCx<'_, 'tcx>, span: Span) -> DiagnosticBuilder<'tcx> {
         // FIXME: Maybe a more elegant solution to this if else case
         if let hir::ConstContext::Static(_) = ccx.const_kind() {
@@ -459,8 +459,8 @@ impl<'tcx> NonConstOp<'tcx> for MutBorrow {
     }
 
     fn importance(&self) -> DiagnosticImportance {
-        // If there were primary errors (like non-const function calls), do not emit further
-        // errors about mutable references.
+        // Most likely the code will try to do mutation with these borrows, which
+        // triggers its own errors. Only show this one if that does not happen.
         DiagnosticImportance::Secondary
     }
 
diff --git a/tests/ui/consts/issue-17718-const-bad-values.rs b/tests/ui/consts/issue-17718-const-bad-values.rs
index af50fed972d..2b593a192ee 100644
--- a/tests/ui/consts/issue-17718-const-bad-values.rs
+++ b/tests/ui/consts/issue-17718-const-bad-values.rs
@@ -4,7 +4,6 @@ const C1: &'static mut [usize] = &mut [];
 static mut S: usize = 3;
 const C2: &'static mut usize = unsafe { &mut S };
 //~^ ERROR: referencing statics in constants
-//~| ERROR: referencing statics in constants
 //~| WARN mutable reference of mutable static is discouraged [static_mut_ref]
 
 fn main() {}
diff --git a/tests/ui/consts/issue-17718-const-bad-values.stderr b/tests/ui/consts/issue-17718-const-bad-values.stderr
index cda94490155..92bab1ab53e 100644
--- a/tests/ui/consts/issue-17718-const-bad-values.stderr
+++ b/tests/ui/consts/issue-17718-const-bad-values.stderr
@@ -31,20 +31,7 @@ LL | const C2: &'static mut usize = unsafe { &mut S };
    = note: `static` and `const` variables can refer to other `const` variables. A `const` variable, however, cannot refer to a `static` variable.
    = help: to fix this, the value can be extracted to a `const` and then used.
 
-error[E0658]: referencing statics in constants is unstable
-  --> $DIR/issue-17718-const-bad-values.rs:5:46
-   |
-LL | const C2: &'static mut usize = unsafe { &mut S };
-   |                                              ^
-   |
-   = note: see issue #119618 <https://github.com/rust-lang/rust/issues/119618> for more information
-   = help: add `#![feature(const_refs_to_static)]` to the crate attributes to enable
-   = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
-   = note: `static` and `const` variables can refer to other `const` variables. A `const` variable, however, cannot refer to a `static` variable.
-   = help: to fix this, the value can be extracted to a `const` and then used.
-   = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
-
-error: aborting due to 3 previous errors; 1 warning emitted
+error: aborting due to 2 previous errors; 1 warning emitted
 
 Some errors have detailed explanations: E0658, E0764.
 For more information about an error, try `rustc --explain E0658`.
diff --git a/tests/ui/consts/miri_unleashed/const_refers_to_static.32bit.stderr b/tests/ui/consts/miri_unleashed/const_refers_to_static.32bit.stderr
index 35b9ed6735e..9e76b873858 100644
--- a/tests/ui/consts/miri_unleashed/const_refers_to_static.32bit.stderr
+++ b/tests/ui/consts/miri_unleashed/const_refers_to_static.32bit.stderr
@@ -50,11 +50,6 @@ help: skipping check for `const_refs_to_static` feature
 LL | const READ_MUT: u32 = unsafe { MUTABLE };
    |                                ^^^^^^^
 help: skipping check for `const_refs_to_static` feature
-  --> $DIR/const_refers_to_static.rs:18:32
-   |
-LL | const READ_MUT: u32 = unsafe { MUTABLE };
-   |                                ^^^^^^^
-help: skipping check for `const_refs_to_static` feature
   --> $DIR/const_refers_to_static.rs:24:18
    |
 LL |     unsafe { &*(&FOO as *const _ as *const usize) }
diff --git a/tests/ui/consts/miri_unleashed/const_refers_to_static.64bit.stderr b/tests/ui/consts/miri_unleashed/const_refers_to_static.64bit.stderr
index 8511673b684..989d3c75cd6 100644
--- a/tests/ui/consts/miri_unleashed/const_refers_to_static.64bit.stderr
+++ b/tests/ui/consts/miri_unleashed/const_refers_to_static.64bit.stderr
@@ -50,11 +50,6 @@ help: skipping check for `const_refs_to_static` feature
 LL | const READ_MUT: u32 = unsafe { MUTABLE };
    |                                ^^^^^^^
 help: skipping check for `const_refs_to_static` feature
-  --> $DIR/const_refers_to_static.rs:18:32
-   |
-LL | const READ_MUT: u32 = unsafe { MUTABLE };
-   |                                ^^^^^^^
-help: skipping check for `const_refs_to_static` feature
   --> $DIR/const_refers_to_static.rs:24:18
    |
 LL |     unsafe { &*(&FOO as *const _ as *const usize) }
diff --git a/tests/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.32bit.stderr b/tests/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.32bit.stderr
index a2c9034c831..e280fe622ec 100644
--- a/tests/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.32bit.stderr
+++ b/tests/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.32bit.stderr
@@ -84,21 +84,6 @@ help: skipping check for `const_refs_to_static` feature
 LL |     unsafe { &static_cross_crate::ZERO }
    |               ^^^^^^^^^^^^^^^^^^^^^^^^
 help: skipping check for `const_refs_to_static` feature
-  --> $DIR/const_refers_to_static_cross_crate.rs:12:15
-   |
-LL |     unsafe { &static_cross_crate::ZERO }
-   |               ^^^^^^^^^^^^^^^^^^^^^^^^
-help: skipping check for `const_refs_to_static` feature
-  --> $DIR/const_refers_to_static_cross_crate.rs:18:15
-   |
-LL |     unsafe { &static_cross_crate::ZERO[0] }
-   |               ^^^^^^^^^^^^^^^^^^^^^^^^
-help: skipping check for `const_refs_to_static` feature
-  --> $DIR/const_refers_to_static_cross_crate.rs:18:15
-   |
-LL |     unsafe { &static_cross_crate::ZERO[0] }
-   |               ^^^^^^^^^^^^^^^^^^^^^^^^
-help: skipping check for `const_refs_to_static` feature
   --> $DIR/const_refers_to_static_cross_crate.rs:18:15
    |
 LL |     unsafe { &static_cross_crate::ZERO[0] }
@@ -113,26 +98,6 @@ help: skipping check for `const_refs_to_static` feature
    |
 LL |         match static_cross_crate::OPT_ZERO {
    |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-help: skipping check for `const_refs_to_static` feature
-  --> $DIR/const_refers_to_static_cross_crate.rs:28:15
-   |
-LL |         match static_cross_crate::OPT_ZERO {
-   |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-help: skipping check for `const_refs_to_static` feature
-  --> $DIR/const_refers_to_static_cross_crate.rs:28:15
-   |
-LL |         match static_cross_crate::OPT_ZERO {
-   |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-help: skipping check for `const_refs_to_static` feature
-  --> $DIR/const_refers_to_static_cross_crate.rs:28:15
-   |
-LL |         match static_cross_crate::OPT_ZERO {
-   |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-help: skipping check for `const_refs_to_static` feature
-  --> $DIR/const_refers_to_static_cross_crate.rs:28:15
-   |
-LL |         match static_cross_crate::OPT_ZERO {
-   |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: aborting due to 8 previous errors; 2 warnings emitted
 
diff --git a/tests/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.64bit.stderr b/tests/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.64bit.stderr
index 2b44a8b12fa..9bca60485c0 100644
--- a/tests/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.64bit.stderr
+++ b/tests/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.64bit.stderr
@@ -84,21 +84,6 @@ help: skipping check for `const_refs_to_static` feature
 LL |     unsafe { &static_cross_crate::ZERO }
    |               ^^^^^^^^^^^^^^^^^^^^^^^^
 help: skipping check for `const_refs_to_static` feature
-  --> $DIR/const_refers_to_static_cross_crate.rs:12:15
-   |
-LL |     unsafe { &static_cross_crate::ZERO }
-   |               ^^^^^^^^^^^^^^^^^^^^^^^^
-help: skipping check for `const_refs_to_static` feature
-  --> $DIR/const_refers_to_static_cross_crate.rs:18:15
-   |
-LL |     unsafe { &static_cross_crate::ZERO[0] }
-   |               ^^^^^^^^^^^^^^^^^^^^^^^^
-help: skipping check for `const_refs_to_static` feature
-  --> $DIR/const_refers_to_static_cross_crate.rs:18:15
-   |
-LL |     unsafe { &static_cross_crate::ZERO[0] }
-   |               ^^^^^^^^^^^^^^^^^^^^^^^^
-help: skipping check for `const_refs_to_static` feature
   --> $DIR/const_refers_to_static_cross_crate.rs:18:15
    |
 LL |     unsafe { &static_cross_crate::ZERO[0] }
@@ -113,26 +98,6 @@ help: skipping check for `const_refs_to_static` feature
    |
 LL |         match static_cross_crate::OPT_ZERO {
    |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-help: skipping check for `const_refs_to_static` feature
-  --> $DIR/const_refers_to_static_cross_crate.rs:28:15
-   |
-LL |         match static_cross_crate::OPT_ZERO {
-   |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-help: skipping check for `const_refs_to_static` feature
-  --> $DIR/const_refers_to_static_cross_crate.rs:28:15
-   |
-LL |         match static_cross_crate::OPT_ZERO {
-   |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-help: skipping check for `const_refs_to_static` feature
-  --> $DIR/const_refers_to_static_cross_crate.rs:28:15
-   |
-LL |         match static_cross_crate::OPT_ZERO {
-   |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-help: skipping check for `const_refs_to_static` feature
-  --> $DIR/const_refers_to_static_cross_crate.rs:28:15
-   |
-LL |         match static_cross_crate::OPT_ZERO {
-   |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: aborting due to 8 previous errors; 2 warnings emitted
 
diff --git a/tests/ui/consts/miri_unleashed/mutable_references_err.32bit.stderr b/tests/ui/consts/miri_unleashed/mutable_references_err.32bit.stderr
index b60f9a24f8c..401cf46710a 100644
--- a/tests/ui/consts/miri_unleashed/mutable_references_err.32bit.stderr
+++ b/tests/ui/consts/miri_unleashed/mutable_references_err.32bit.stderr
@@ -114,11 +114,6 @@ help: skipping check for `const_refs_to_static` feature
    |
 LL | const SUBTLE: &mut i32 = unsafe { &mut FOO };
    |                                        ^^^
-help: skipping check for `const_refs_to_static` feature
-  --> $DIR/mutable_references_err.rs:32:40
-   |
-LL | const SUBTLE: &mut i32 = unsafe { &mut FOO };
-   |                                        ^^^
 help: skipping check that does not even have a feature gate
   --> $DIR/mutable_references_err.rs:32:35
    |
@@ -145,16 +140,6 @@ help: skipping check for `const_refs_to_static` feature
 LL | const POINTS_TO_MUTABLE1: &i32 = unsafe { &MUTABLE };
    |                                            ^^^^^^^
 help: skipping check for `const_refs_to_static` feature
-  --> $DIR/mutable_references_err.rs:47:44
-   |
-LL | const POINTS_TO_MUTABLE1: &i32 = unsafe { &MUTABLE };
-   |                                            ^^^^^^^
-help: skipping check for `const_refs_to_static` feature
-  --> $DIR/mutable_references_err.rs:51:45
-   |
-LL | const POINTS_TO_MUTABLE2: &i32 = unsafe { &*MUTABLE_REF };
-   |                                             ^^^^^^^^^^^
-help: skipping check for `const_refs_to_static` feature
   --> $DIR/mutable_references_err.rs:51:45
    |
 LL | const POINTS_TO_MUTABLE2: &i32 = unsafe { &*MUTABLE_REF };
diff --git a/tests/ui/consts/miri_unleashed/mutable_references_err.64bit.stderr b/tests/ui/consts/miri_unleashed/mutable_references_err.64bit.stderr
index 1e5d4bd890b..0eb01f5b773 100644
--- a/tests/ui/consts/miri_unleashed/mutable_references_err.64bit.stderr
+++ b/tests/ui/consts/miri_unleashed/mutable_references_err.64bit.stderr
@@ -114,11 +114,6 @@ help: skipping check for `const_refs_to_static` feature
    |
 LL | const SUBTLE: &mut i32 = unsafe { &mut FOO };
    |                                        ^^^
-help: skipping check for `const_refs_to_static` feature
-  --> $DIR/mutable_references_err.rs:32:40
-   |
-LL | const SUBTLE: &mut i32 = unsafe { &mut FOO };
-   |                                        ^^^
 help: skipping check that does not even have a feature gate
   --> $DIR/mutable_references_err.rs:32:35
    |
@@ -145,16 +140,6 @@ help: skipping check for `const_refs_to_static` feature
 LL | const POINTS_TO_MUTABLE1: &i32 = unsafe { &MUTABLE };
    |                                            ^^^^^^^
 help: skipping check for `const_refs_to_static` feature
-  --> $DIR/mutable_references_err.rs:47:44
-   |
-LL | const POINTS_TO_MUTABLE1: &i32 = unsafe { &MUTABLE };
-   |                                            ^^^^^^^
-help: skipping check for `const_refs_to_static` feature
-  --> $DIR/mutable_references_err.rs:51:45
-   |
-LL | const POINTS_TO_MUTABLE2: &i32 = unsafe { &*MUTABLE_REF };
-   |                                             ^^^^^^^^^^^
-help: skipping check for `const_refs_to_static` feature
   --> $DIR/mutable_references_err.rs:51:45
    |
 LL | const POINTS_TO_MUTABLE2: &i32 = unsafe { &*MUTABLE_REF };
diff --git a/tests/ui/feature-gates/feature-gate-const-refs-to-static.rs b/tests/ui/feature-gates/feature-gate-const-refs-to-static.rs
index c020bb37a99..008b754dc6c 100644
--- a/tests/ui/feature-gates/feature-gate-const-refs-to-static.rs
+++ b/tests/ui/feature-gates/feature-gate-const-refs-to-static.rs
@@ -6,7 +6,6 @@ const C1_READ: () = {
     assert!(*C1 == 0);
 };
 const C2: *const i32 = unsafe { std::ptr::addr_of!(S_MUT) }; //~ERROR:  referencing statics in constants is unstable
-//~^ERROR:  referencing statics in constants is unstable
 
 fn main() {
 }
diff --git a/tests/ui/feature-gates/feature-gate-const-refs-to-static.stderr b/tests/ui/feature-gates/feature-gate-const-refs-to-static.stderr
index f94cff5b550..5af48471250 100644
--- a/tests/ui/feature-gates/feature-gate-const-refs-to-static.stderr
+++ b/tests/ui/feature-gates/feature-gate-const-refs-to-static.stderr
@@ -22,19 +22,6 @@ LL | const C2: *const i32 = unsafe { std::ptr::addr_of!(S_MUT) };
    = note: `static` and `const` variables can refer to other `const` variables. A `const` variable, however, cannot refer to a `static` variable.
    = help: to fix this, the value can be extracted to a `const` and then used.
 
-error[E0658]: referencing statics in constants is unstable
-  --> $DIR/feature-gate-const-refs-to-static.rs:8:52
-   |
-LL | const C2: *const i32 = unsafe { std::ptr::addr_of!(S_MUT) };
-   |                                                    ^^^^^
-   |
-   = note: see issue #119618 <https://github.com/rust-lang/rust/issues/119618> for more information
-   = help: add `#![feature(const_refs_to_static)]` to the crate attributes to enable
-   = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
-   = note: `static` and `const` variables can refer to other `const` variables. A `const` variable, however, cannot refer to a `static` variable.
-   = help: to fix this, the value can be extracted to a `const` and then used.
-   = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
-
-error: aborting due to 3 previous errors
+error: aborting due to 2 previous errors
 
 For more information about this error, try `rustc --explain E0658`.
diff --git a/tests/ui/thread-local/thread-local-static.rs b/tests/ui/thread-local/thread-local-static.rs
index 7b69ffed197..dac9259a6a6 100644
--- a/tests/ui/thread-local/thread-local-static.rs
+++ b/tests/ui/thread-local/thread-local-static.rs
@@ -12,7 +12,6 @@ const fn g(x: &mut [u32; 8]) {
     //~^^ ERROR thread-local statics cannot be accessed
     //~| ERROR mutable references are not allowed
     //~| ERROR use of mutable static is unsafe
-    //~| referencing statics
 }
 
 fn main() {}
diff --git a/tests/ui/thread-local/thread-local-static.stderr b/tests/ui/thread-local/thread-local-static.stderr
index d91742686c6..3dd1e2d4000 100644
--- a/tests/ui/thread-local/thread-local-static.stderr
+++ b/tests/ui/thread-local/thread-local-static.stderr
@@ -37,18 +37,6 @@ error[E0625]: thread-local statics cannot be accessed at compile-time
 LL |     std::mem::swap(x, &mut STATIC_VAR_2)
    |                            ^^^^^^^^^^^^
 
-error[E0658]: referencing statics in constant functions is unstable
-  --> $DIR/thread-local-static.rs:10:28
-   |
-LL |     std::mem::swap(x, &mut STATIC_VAR_2)
-   |                            ^^^^^^^^^^^^
-   |
-   = note: see issue #119618 <https://github.com/rust-lang/rust/issues/119618> for more information
-   = help: add `#![feature(const_refs_to_static)]` to the crate attributes to enable
-   = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
-   = note: `static` and `const` variables can refer to other `const` variables. A `const` variable, however, cannot refer to a `static` variable.
-   = help: to fix this, the value can be extracted to a `const` and then used.
-
 error[E0658]: mutable references are not allowed in constant functions
   --> $DIR/thread-local-static.rs:10:23
    |
@@ -59,7 +47,7 @@ LL |     std::mem::swap(x, &mut STATIC_VAR_2)
    = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
-error: aborting due to 5 previous errors; 1 warning emitted
+error: aborting due to 4 previous errors; 1 warning emitted
 
 Some errors have detailed explanations: E0133, E0625, E0658.
 For more information about an error, try `rustc --explain E0133`.