/// Qualify a whole const, static initializer or const fn.
fn qualify_const(&mut self) -> Qualif {
- debug!("qualifying {} {}", self.mode, self.tcx.item_path_str(self.def_id));
+ debug!("qualifying {} {:?}", self.mode, self.def_id);
let mir = self.mir;
match *rvalue {
Rvalue::Use(_) |
Rvalue::Repeat(..) |
- Rvalue::UnaryOp(..) |
+ Rvalue::UnaryOp(UnOp::Neg, _) |
+ Rvalue::UnaryOp(UnOp::Not, _) |
+ Rvalue::NullaryOp(NullOp::SizeOf, _) |
Rvalue::CheckedBinaryOp(..) |
Rvalue::Cast(CastKind::ReifyFnPointer, ..) |
Rvalue::Cast(CastKind::UnsafeFnPointer, ..) |
if let ty::TyRawPtr(_) = lhs.ty(self.mir, self.tcx).sty {
assert!(op == BinOp::Eq || op == BinOp::Ne ||
op == BinOp::Le || op == BinOp::Lt ||
- op == BinOp::Ge || op == BinOp::Gt);
+ op == BinOp::Ge || op == BinOp::Gt ||
+ op == BinOp::Offset);
self.add(Qualif::NOT_CONST);
if self.mode != Mode::Fn {
}
}
- Rvalue::Box(_) => {
+ Rvalue::NullaryOp(NullOp::Box, _) => {
self.add(Qualif::NOT_CONST);
if self.mode != Mode::Fn {
struct_span_err!(self.tcx.sess, self.span, E0010,
// Statics must be Sync.
if mode == Mode::Static {
let ty = mir.return_ty;
- tcx.infer_ctxt((), Reveal::UserFacing).enter(|infcx| {
+ tcx.infer_ctxt(Reveal::UserFacing).enter(|infcx| {
let cause = traits::ObligationCause::new(mir.span, id, traits::SharedStatic);
let mut fulfillment_cx = traits::FulfillmentContext::new();
fulfillment_cx.register_bound(&infcx, ty,