}
pub mod middle {
+ pub mod expr_use_visitor; // STAGE0: increase glitch immunity
pub mod astconv_util;
pub mod astencode;
pub mod cfg;
pub mod dependency_format;
pub mod effect;
pub mod entry;
- pub mod expr_use_visitor;
pub mod free_region;
pub mod intrinsicck;
pub mod infer;
}
}
hir::ExprCall(ref base, _) => {
- let base_type = self.tcx.node_id_to_type(base.id);
+ let base_type = self.tcx.expr_ty_adjusted(base);
debug!("effect: call case, base type is {:?}",
base_type);
if type_is_unsafe_function(base_type) {
}
}
hir::ExprUnary(hir::UnDeref, ref base) => {
- let base_type = self.tcx.node_id_to_type(base.id);
+ let base_type = self.tcx.expr_ty_adjusted(base);
debug!("effect: unary case, base type is {:?}",
base_type);
if let ty::TyRawPtr(_) = base_type.sty {
--- /dev/null
+// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+use std::ptr;
+
+fn main() {
+ (&ptr::write)(1 as *mut _, 42); //~ ERROR E0133
+}