]> git.lizzy.rs Git - rust.git/commitdiff
initial cleanup
authorBastian Kauschke <bastian_kauschke@hotmail.de>
Tue, 5 May 2020 15:57:23 +0000 (17:57 +0200)
committerBastian Kauschke <bastian_kauschke@hotmail.de>
Sun, 17 May 2020 09:05:04 +0000 (11:05 +0200)
src/librustc_feature/active.rs
src/librustc_infer/infer/nll_relate/mod.rs
src/librustc_session/options.rs
src/librustc_trait_selection/traits/error_reporting/mod.rs
src/librustc_trait_selection/traits/fulfill.rs
src/librustc_trait_selection/traits/object_safety.rs
src/librustc_typeck/collect.rs

index f075988099b9e0d54c5f0353083c55bb6320922e..894b392f1c036a8e2d741eb99225bb050c9edce3 100644 (file)
@@ -558,7 +558,7 @@ pub fn set(&self, features: &mut Features, span: Span) {
 
     /// Allow negative trait implementations.
     (active, negative_impls, "1.44.0", Some(68318), None),
-    
+
     /// Lazily evaluate constants. Which allows constants to depend on type parameters.
     (active, lazy_normalization_consts, "1.44.0", Some(60471), None),
 
index 58acca7004154d91670eedfa6752d6a5bfdb7e03..e67ea56cf891167e73af6967d44d9d61103cb986 100644 (file)
@@ -595,8 +595,8 @@ fn consts(
             b = self.infcx.shallow_resolve(b);
         }
 
-        match (a.val, b.val) {
-            (_, ty::ConstKind::Infer(InferConst::Var(_))) if D::forbid_inference_vars() => {
+        match b.val {
+            ty::ConstKind::Infer(InferConst::Var(_)) if D::forbid_inference_vars() => {
                 // Forbid inference variables in the RHS.
                 bug!("unexpected inference var {:?}", b)
             }
index f02659cdb994b4b9b2a1ef1fd4203a51acb63fce..e2c82a397c7384c150db62c9fa0f5d55de309acf 100644 (file)
@@ -870,7 +870,7 @@ fn parse_target_feature(slot: &mut String, v: Option<&str>) -> bool {
     instrument_mcount: bool = (false, parse_bool, [TRACKED],
         "insert function instrument code for mcount-based tracing (default: no)"),
     keep_hygiene_data: bool = (false, parse_bool, [UNTRACKED],
-        "lazily evaluate constants (experimental)"),
+        "keep hygiene data after analysis (default: no)"),
     link_native_libraries: bool = (true, parse_bool, [UNTRACKED],
         "link native libraries in the linker invocation (default: yes)"),
     link_only: bool = (false, parse_bool, [TRACKED],
index 1b8f2e1ae9fd41581e62321dec688594da2761e5..139b86007222447b02bc49be1fee5fe3a289021a 100644 (file)
@@ -616,7 +616,6 @@ fn report_selection_error(
                         )
                     }
 
-                    
                     ty::Predicate::ConstEquate(..) => {
                         // Errors for `ConstEquate` predicates show up as
                         // `SelectionError::ConstEvalFailure`,
index 18ba46dce23d38a809d6476ef57764a7b3a120ff..cf107a6c5b5abbf80c194ddad0c94bc5a451cf98 100644 (file)
@@ -539,7 +539,10 @@ fn process_obligation(
                             Ok(val) => Ok(Const::from_value(self.selcx.tcx(), val, c.ty)),
                             Err(ErrorHandled::TooGeneric) => {
                                 stalled_on.append(
-                                    &mut substs.types().filter_map(|ty| TyOrConstInferVar::maybe_from_ty(ty)).collect(),
+                                    &mut substs
+                                        .types()
+                                        .filter_map(|ty| TyOrConstInferVar::maybe_from_ty(ty))
+                                        .collect(),
                                 );
                                 Err(ProcessResult::Unchanged)
                             }
index 3b4533b04ba4c19c4cbc7ca0d1935ad3d6cbb33c..a34006dd4fc06b54000ac93fbb22ad90054c34ae 100644 (file)
@@ -17,7 +17,8 @@
 use rustc_hir as hir;
 use rustc_hir::def_id::DefId;
 use rustc_middle::ty::subst::{GenericArg, InternalSubsts, Subst};
-use rustc_middle::ty::{self, Predicate, ToPredicate, Ty, TyCtxt, TypeFoldable, TypeVisitor, WithConstness};
+use rustc_middle::ty::{self, Ty, TyCtxt, TypeFoldable, TypeVisitor, WithConstness};
+use rustc_middle::ty::{Predicate, ToPredicate};
 use rustc_session::lint::builtin::WHERE_CLAUSES_OBJECT_SAFETY;
 use rustc_span::symbol::Symbol;
 use rustc_span::Span;
index 55ba008e35961821d20180b93161739f675c69ec..a29a9a6a99750d2e88ba28e58e26242166c6afa8 100644 (file)
@@ -1168,7 +1168,7 @@ fn generics_of(tcx: TyCtxt<'_>, def_id: DefId) -> ty::Generics {
         Node::AnonConst(_) => {
             if tcx.features().lazy_normalization_consts {
                 let parent_id = tcx.hir().get_parent_item(hir_id);
-                Some(tcx.hir().local_def_id(parent_id))
+                Some(tcx.hir().local_def_id(parent_id).to_def_id())
             } else {
                 None
             }