Skip to content

Commit 29578e0

Browse files
committed
Minor reformatting
1 parent b434d95 commit 29578e0

File tree

6 files changed

+19
-12
lines changed

6 files changed

+19
-12
lines changed

src/librustc/infer/canonical.rs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,7 @@ pub enum CanonicalTyVarKind {
107107
/// General type variable `?T` that can be unified with arbitrary types.
108108
General,
109109

110-
// TODO(const_generics): make the docs better
111-
/// Const type variable
110+
/// Const type variable `?C` that can be unified with const expressions.
112111
Const,
113112

114113
/// Integral type variable `?I` (that can only be unified with integral types).
@@ -393,22 +392,24 @@ impl<'cx, 'gcx, 'tcx> InferCtxt<'cx, 'gcx, 'tcx> {
393392
let k1 = substitute_value(self.tcx, result_subst, k1);
394393
let r2 = substitute_value(self.tcx, result_subst, r2);
395394
match k1.unpack() {
396-
UnpackedKind::Lifetime(r1) =>
395+
UnpackedKind::Lifetime(r1) => {
397396
Obligation::new(
398397
cause.clone(),
399398
param_env,
400399
ty::Predicate::RegionOutlives(
401400
ty::Binder::dummy(ty::OutlivesPredicate(r1, r2))),
402-
),
403-
404-
UnpackedKind::Type(t1) =>
401+
)
402+
}
403+
UnpackedKind::Type(t1) => {
405404
Obligation::new(
406405
cause.clone(),
407406
param_env,
408407
ty::Predicate::TypeOutlives(
409408
ty::Binder::dummy(ty::OutlivesPredicate(t1, r2))),
410-
),
411-
UnpackedKind::Const(_) => unimplemented!(), // TODO(const_generics): does it even make sense to specify that a const outlives something?
409+
)
410+
}
411+
// TODO(const_generics): does it even make sense to specify that a const outlives something?
412+
UnpackedKind::Const(_) => unimplemented!(),
412413
}
413414
})) as Box<dyn Iterator<Item = _>>
414415
}

src/librustc/ty/relate.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ pub fn super_relate_tys<'a, 'gcx, 'tcx, R>(relation: &mut R,
476476
}
477477
match x.val {
478478
ConstValue::Unevaluated(def_id, substs) => {
479-
// TODO(const_generics): this case should be entirely removed.
479+
// TODO(const_generics)
480480
// FIXME(eddyb) get the right param_env.
481481
let param_env = ty::ParamEnv::empty();
482482
match tcx.lift_to_global(&substs) {

src/librustc_typeck/check/closure.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
110110
span_bug!(expr.span, "closure has region param")
111111
}
112112
GenericParamDefKind::Type { .. } => {
113-
self.infcx
114-
.next_ty_var(TypeVariableOrigin::ClosureSynthetic(expr.span)).into()
113+
self.infcx.next_ty_var(TypeVariableOrigin::ClosureSynthetic(expr.span)).into()
115114
}
116115
GenericParamDefKind::Const { .. } => {
117116
unimplemented!() // TODO(const_generics):

src/librustc_typeck/collect.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -953,6 +953,7 @@ fn generics_of<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
953953
i += 1;
954954
Some(ty_param)
955955
}
956+
956957
// TODO(const_generics): should this be split out to put const parameters after type parameters?
957958
GenericParamKind::Const { ref ty } => {
958959
if param.name.name() == keywords::SelfType.name() {
@@ -974,6 +975,7 @@ fn generics_of<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
974975
i += 1;
975976
Some(const_param)
976977
}
978+
977979
_ => None,
978980
}));
979981

src/librustc_typeck/impl_wf_check.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,8 @@ fn enforce_impl_params_are_constrained<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
136136
}
137137
}
138138
ty::GenericParamDefKind::Const { .. } => {
139-
// TODO(const_generics): This is all right, but the collection of const params in input_parameters is wrong
139+
// TODO(const_generics): This is all right, but the collection
140+
// of const params in input_parameters is wrong
140141
//let param_ct = ty::ParamConst::for_def(param);
141142
//if !input_parameters.contains(&ctp::Parameter::from(param_ct)) {
142143
// report_unused_parameter(tcx,

src/librustdoc/clean/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1251,6 +1251,10 @@ impl<'tcx> Clean<Lifetime> for ty::GenericParamDef<'tcx> {
12511251

12521252
impl Clean<Constant> for hir::ConstArg {
12531253
fn clean(&self, _cx: &DocContext) -> Constant {
1254+
// Constant {
1255+
// type_: ty.clean(cx),
1256+
// expr: print_const_expr(self.value.body),
1257+
// }
12541258
unimplemented!() // TODO(const_generics)
12551259
}
12561260
}

0 commit comments

Comments
 (0)