1 // Copyright 2018 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
10 #![allow(non_camel_case_types, non_snake_case)]
12 use rustc::ty::{self, Ty, TyCtxt};
13 use syntax_pos::DUMMY_SP;
16 pub fn type_needs_drop<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, ty: Ty<'tcx>) -> bool {
17 ty.needs_drop(tcx, ty::ParamEnv::reveal_all())
20 pub fn type_is_sized<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, ty: Ty<'tcx>) -> bool {
21 ty.is_sized(tcx.at(DUMMY_SP), ty::ParamEnv::reveal_all())
24 pub fn type_is_freeze<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, ty: Ty<'tcx>) -> bool {
25 ty.is_freeze(tcx, ty::ParamEnv::reveal_all(), DUMMY_SP)
28 pub enum IntPredicate {
43 pub enum RealPredicate {
62 pub enum AtomicRmwBinOp {
76 pub enum AtomicOrdering {
81 // Consume, // Not specified yet.
85 SequentiallyConsistent,
88 pub enum SynchronizationScope {
89 // FIXME: figure out if this variant is needed at all.
96 #[derive(Copy, Clone, PartialEq, Debug)]
117 // FIXME(mw): Anything that is produced via DepGraph::with_task() must implement
118 // the HashStable trait. Normally DepGraph::with_task() calls are
119 // hidden behind queries, but CGU creation is a special case in two
120 // ways: (1) it's not a query and (2) CGU are output nodes, so their
121 // Fingerprints are not actually needed. It remains to be clarified
122 // how exactly this case will be handled in the red/green system but
123 // for now we content ourselves with providing a no-op HashStable
124 // implementation for CGUs.
125 mod temp_stable_hash_impls {
126 use rustc_data_structures::stable_hasher::{StableHasherResult, StableHasher,
130 impl<HCX, M> HashStable<HCX> for ModuleCodegen<M> {
131 fn hash_stable<W: StableHasherResult>(&self,
133 _: &mut StableHasher<W>) {