Skip to content
Permalink
Browse files

Address comment and formatting nits

  • Loading branch information...
oli-obk committed May 17, 2019
1 parent f4f957d commit 2d86d040a5472998843008cbb6ffa58de0fd138e
Showing with 3 additions and 3 deletions.
  1. +2 −2 src/librustc/ty/sty.rs
  2. +1 −1 src/test/ui/consts/self_normalization.rs
@@ -2298,6 +2298,7 @@ impl<'tcx> Const<'tcx> {
ty: Ty<'tcx>,
) -> Option<u128> {
assert_eq!(self.ty, ty);
// if `ty` does not depend on generic parameters, use an empty param_env
let size = tcx.layout_of(param_env.with_reveal_all().and(ty)).ok()?.size;
match self.val {
// FIXME(const_generics): this doesn't work right now,
@@ -2315,8 +2316,7 @@ impl<'tcx> Const<'tcx> {
let evaluated = tcx.const_eval(param_env.and(gid)).ok()?;
evaluated.val.try_to_bits(size)
},
// FIXME(const_generics): try to evaluate generic consts with a given param env?
// E.g. when you have an associated constant whose value depends on a generic const
// otherwise just extract a `ConstValue`'s bits if possible
_ => self.val.try_to_bits(size),
}
}
@@ -1,6 +1,6 @@
// compile-pass

fn testfn(_arr: &mut [();0]) {}
fn testfn(_arr: &mut [(); 0]) {}

trait TestTrait {
fn method();

0 comments on commit 2d86d04

Please sign in to comment.
You can’t perform that action at this time.