Skip to content

Commit 7c5527d

Browse files
oli-obkfee1-dead
authored andcommitted
Now that constness is optional, we default to not-const if it isn't there
1 parent e70e92e commit 7c5527d

File tree

1 file changed

+1
-2
lines changed
  • compiler/rustc_middle/src/ty

1 file changed

+1
-2
lines changed

compiler/rustc_middle/src/ty/sty.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -816,10 +816,9 @@ impl<'tcx> TraitRef<'tcx> {
816816
}
817817

818818
pub fn constness(self) -> ty::ConstnessArg {
819-
// TODO remove panic
820819
match self.substs.last().expect("constness").unpack() {
821820
ty::subst::GenericArgKind::Constness(constness) => constness,
822-
_ => panic!("?"),
821+
_ => ty::ConstnessArg::Not,
823822
}
824823
}
825824

0 commit comments

Comments
 (0)