diff options
| author | Florian Diebold <flodiebold@gmail.com> | 2016-11-21 20:34:07 +0100 |
|---|---|---|
| committer | Florian Diebold <florian.diebold@freiheit.com> | 2016-11-29 13:04:27 +0100 |
| commit | f75c8a98ddcbe3afa769c82a9196af0dd524f65a (patch) | |
| tree | 420f1643c81e43e3f8421ab11019cb8594d6fc34 /src/librustc_const_eval | |
| parent | 23a8c7d4d9f18703cd6b56ff3edffcec799f90d7 (diff) | |
Add make tidy fixes
Diffstat (limited to 'src/librustc_const_eval')
| -rw-r--r-- | src/librustc_const_eval/eval.rs | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/librustc_const_eval/eval.rs b/src/librustc_const_eval/eval.rs index ccdfb1e69a7..754bb53c29e 100644 --- a/src/librustc_const_eval/eval.rs +++ b/src/librustc_const_eval/eval.rs @@ -109,7 +109,8 @@ pub fn lookup_const_by_id<'a, 'tcx: 'a>(tcx: TyCtxt<'a, 'tcx, 'tcx>, // or the default. let trait_id = tcx.map.get_parent(node_id); let trait_id = tcx.map.local_def_id(trait_id); - let default_value = expr_option.as_ref().map(|expr| (&**expr, tcx.ast_ty_to_prim_ty(ty))); + let default_value = expr_option.as_ref() + .map(|expr| (&**expr, tcx.ast_ty_to_prim_ty(ty))); resolve_trait_associated_const(tcx, def_id, default_value, trait_id, substs) } else { // Technically, without knowing anything about the @@ -141,7 +142,8 @@ pub fn lookup_const_by_id<'a, 'tcx: 'a>(tcx: TyCtxt<'a, 'tcx, 'tcx>, } let mut used_substs = false; let expr_ty = match tcx.sess.cstore.maybe_get_item_ast(tcx, def_id) { - Some((&InlinedItem { body: ref const_expr, kind: InlinedItemKind::Const(ref ty), .. }, _)) => { + Some((&InlinedItem { body: ref const_expr, + kind: InlinedItemKind::Const(ref ty), .. }, _)) => { Some((&**const_expr, tcx.ast_ty_to_prim_ty(ty))) } _ => None @@ -1057,12 +1059,13 @@ fn infer<'a, 'tcx>(i: ConstInt, } } -fn resolve_trait_associated_const<'a, 'tcx: 'a>(tcx: TyCtxt<'a, 'tcx, 'tcx>, - trait_item_id: DefId, - default_value: Option<(&'tcx Expr, Option<ty::Ty<'tcx>>)>, - trait_id: DefId, - rcvr_substs: &'tcx Substs<'tcx>) - -> Option<(&'tcx Expr, Option<ty::Ty<'tcx>>)> +fn resolve_trait_associated_const<'a, 'tcx: 'a>( + tcx: TyCtxt<'a, 'tcx, 'tcx>, + trait_item_id: DefId, + default_value: Option<(&'tcx Expr, Option<ty::Ty<'tcx>>)>, + trait_id: DefId, + rcvr_substs: &'tcx Substs<'tcx> +) -> Option<(&'tcx Expr, Option<ty::Ty<'tcx>>)> { let trait_ref = ty::Binder(ty::TraitRef::new(trait_id, rcvr_substs)); debug!("resolve_trait_associated_const: trait_ref={:?}", |
