about summary refs log tree commit diff
diff options
context:
space:
mode:
authorOliver Schneider <github35764891676564198441@oli-obk.de>2018-06-25 15:08:05 +0200
committerOliver Schneider <github35764891676564198441@oli-obk.de>2018-06-28 11:01:35 +0200
commit57e190c85024de27f1c8df8936e0b610a96908f5 (patch)
treef15a274935d85cdc8f2a7cfe822c34a2389968f3
parent6f8fe4eaefe8fbc4f8a8d314ded0fe1a300c35f7 (diff)
downloadrust-57e190c85024de27f1c8df8936e0b610a96908f5.tar.gz
rust-57e190c85024de27f1c8df8936e0b610a96908f5.zip
Address review comments
-rw-r--r--src/librustc/ich/impls_ty.rs2
-rw-r--r--src/librustc/middle/const_val.rs2
-rw-r--r--src/librustc/mir/interpret/error.rs4
-rw-r--r--src/librustc/traits/fulfill.rs4
-rw-r--r--src/librustc/ty/structural_impls.rs2
-rw-r--r--src/librustc_mir/interpret/eval_context.rs4
6 files changed, 9 insertions, 9 deletions
diff --git a/src/librustc/ich/impls_ty.rs b/src/librustc/ich/impls_ty.rs
index 0d3ac8edbd3..8779d3d3f07 100644
--- a/src/librustc/ich/impls_ty.rs
+++ b/src/librustc/ich/impls_ty.rs
@@ -570,7 +570,7 @@ for ::mir::interpret::EvalErrorKind<'gcx, O> {
             ReadFromReturnPointer |
             UnimplementedTraitSelection |
             TypeckError |
-            ResolutionFailed |
+            TooGeneric |
             CheckMatchError |
             DerefFunctionPointer |
             ExecuteMemory |
diff --git a/src/librustc/middle/const_val.rs b/src/librustc/middle/const_val.rs
index 588265dffa7..94273287f07 100644
--- a/src/librustc/middle/const_val.rs
+++ b/src/librustc/middle/const_val.rs
@@ -101,7 +101,7 @@ impl<'a, 'gcx, 'tcx> ConstEvalErr<'tcx> {
     ) -> Option<DiagnosticBuilder<'tcx>> {
         match self.data.0.kind {
             ::mir::interpret::EvalErrorKind::TypeckError |
-            ::mir::interpret::EvalErrorKind::ResolutionFailed |
+            ::mir::interpret::EvalErrorKind::TooGeneric |
             ::mir::interpret::EvalErrorKind::CheckMatchError |
             ::mir::interpret::EvalErrorKind::Layout(_) => return None,
             ::mir::interpret::EvalErrorKind::ReferencedConstant(ref inner) => {
diff --git a/src/librustc/mir/interpret/error.rs b/src/librustc/mir/interpret/error.rs
index 4771875760d..827ac7ef7fc 100644
--- a/src/librustc/mir/interpret/error.rs
+++ b/src/librustc/mir/interpret/error.rs
@@ -151,7 +151,7 @@ pub enum EvalErrorKind<'tcx, O> {
     /// Abort in case type errors are reached
     TypeckError,
     /// Resolution can fail if we are in a too generic context
-    ResolutionFailed,
+    TooGeneric,
     CheckMatchError,
     /// Cannot compute this constant because it depends on another one
     /// which already produced an error
@@ -271,7 +271,7 @@ impl<'tcx, O> EvalErrorKind<'tcx, O> {
                 "there were unresolved type arguments during trait selection",
             TypeckError =>
                 "encountered constants with type errors, stopping evaluation",
-            ResolutionFailed =>
+            TooGeneric =>
                 "encountered overly generic constant",
             CheckMatchError =>
                 "match checking failed",
diff --git a/src/librustc/traits/fulfill.rs b/src/librustc/traits/fulfill.rs
index 288634a800c..c9021bcd410 100644
--- a/src/librustc/traits/fulfill.rs
+++ b/src/librustc/traits/fulfill.rs
@@ -499,11 +499,11 @@ impl<'a, 'b, 'gcx, 'tcx> ObligationProcessor for FulfillProcessor<'a, 'b, 'gcx,
                                             CodeSelectionError(ConstEvalFailure(err)))
                                     }
                                 } else {
-                                    let err = EvalErrorKind::ResolutionFailed.into();
+                                    let err = EvalErrorKind::TooGeneric.into();
                                     ProcessResult::Error(
                                         CodeSelectionError(ConstEvalFailure(ConstEvalErr {
                                             span: obligation.cause.span,
-                                            data: (err, Vec::new()).into(),
+                                            data: (err, vec![]).into(),
                                         }))
                                     )
                                 }
diff --git a/src/librustc/ty/structural_impls.rs b/src/librustc/ty/structural_impls.rs
index 2bc4698c44a..3ff714d89c4 100644
--- a/src/librustc/ty/structural_impls.rs
+++ b/src/librustc/ty/structural_impls.rs
@@ -577,7 +577,7 @@ impl<'a, 'tcx, O: Lift<'tcx>> Lift<'tcx> for interpret::EvalErrorKind<'a, O> {
             PathNotFound(ref v) => PathNotFound(v.clone()),
             UnimplementedTraitSelection => UnimplementedTraitSelection,
             TypeckError => TypeckError,
-            ResolutionFailed => ResolutionFailed,
+            TooGeneric => TooGeneric,
             CheckMatchError => CheckMatchError,
             ReferencedConstant(ref err) => ReferencedConstant(tcx.lift(err)?),
             OverflowNeg => OverflowNeg,
diff --git a/src/librustc_mir/interpret/eval_context.rs b/src/librustc_mir/interpret/eval_context.rs
index 32ec48e15b4..ccdabe86d22 100644
--- a/src/librustc_mir/interpret/eval_context.rs
+++ b/src/librustc_mir/interpret/eval_context.rs
@@ -280,7 +280,7 @@ impl<'a, 'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> EvalContext<'a, 'mir, 'tcx, M
             self.param_env,
             def_id,
             substs,
-        ).ok_or_else(|| EvalErrorKind::ResolutionFailed.into())
+        ).ok_or_else(|| EvalErrorKind::TooGeneric.into())
     }
 
     pub(super) fn type_is_sized(&self, ty: Ty<'tcx>) -> bool {
@@ -739,7 +739,7 @@ impl<'a, 'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> EvalContext<'a, 'mir, 'tcx, M
                                     self.param_env,
                                     def_id,
                                     substs,
-                                ).ok_or_else(|| EvalErrorKind::ResolutionFailed.into());
+                                ).ok_or_else(|| EvalErrorKind::TooGeneric.into());
                                 let fn_ptr = self.memory.create_fn_alloc(instance?);
                                 let valty = ValTy {
                                     value: Value::Scalar(fn_ptr.into()),