#![allow(non_camel_case_types, non_snake_case)]
-use rustc::ty::{Ty, TyCtxt};
use rustc::session::Session;
-use syntax_pos::Span;
+use rustc::ty::{Ty, TyCtxt};
+use rustc_errors::struct_span_err;
+use rustc_span::Span;
-use rustc::hir::def_id::DefId;
-use rustc::middle::lang_items::LangItem;
use crate::base;
use crate::traits::*;
+use rustc::middle::lang_items::LangItem;
+use rustc_hir::def_id::DefId;
-use rustc::hir;
use crate::traits::BuilderMethods;
+use rustc_hir as hir;
use rustc_error_codes::*;
IntSGT,
IntSGE,
IntSLT,
- IntSLE
+ IntSLE,
}
-
#[allow(dead_code)]
pub enum RealPredicate {
RealPredicateFalse,
RealULT,
RealULE,
RealUNE,
- RealPredicateTrue
+ RealPredicateTrue,
}
pub enum AtomicRmwBinOp {
AtomicMax,
AtomicMin,
AtomicUMax,
- AtomicUMin
+ AtomicUMin,
}
pub enum AtomicOrdering {
// for now we content ourselves with providing a no-op HashStable
// implementation for CGUs.
mod temp_stable_hash_impls {
- use rustc_data_structures::stable_hasher::{StableHasher, HashStable};
use crate::ModuleCodegen;
+ use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
impl<HCX, M> HashStable<HCX> for ModuleCodegen<M> {
fn hash_stable(&self, _: &mut HCX, _: &mut StableHasher) {
// #1877, #10183: Ensure that input is always valid
let rhs = shift_mask_rhs(bx, rhs);
let is_signed = lhs_t.is_signed();
- if is_signed {
- bx.ashr(lhs, rhs)
- } else {
- bx.lshr(lhs, rhs)
- }
+ if is_signed { bx.ashr(lhs, rhs) } else { bx.lshr(lhs, rhs) }
}
fn shift_mask_rhs<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
} else {
bx.const_uint(mask_llty, val)
}
- },
+ }
TypeKind::Vector => {
- let mask = shift_mask_val(
- bx,
- bx.element_type(llty),
- bx.element_type(mask_llty),
- invert
- );
+ let mask =
+ shift_mask_val(bx, bx.element_type(llty), bx.element_type(mask_llty), invert);
bx.vector_splat(bx.vector_length(mask_llty), mask)
- },
+ }
_ => bug!("shift_mask_val: expected Integer or Vector, found {:?}", kind),
}
}
pub fn span_invalid_monomorphization_error(a: &Session, b: Span, c: &str) {
- span_err!(a, b, E0511, "{}", c);
+ struct_span_err!(a, b, E0511, "{}", c).emit();
}