diff options
| author | Niko Matsakis <niko@alum.mit.edu> | 2018-11-20 11:59:06 -0500 |
|---|---|---|
| committer | Niko Matsakis <niko@alum.mit.edu> | 2019-01-02 17:35:06 -0500 |
| commit | 8e89184a7beb03d58d3a3969dddc1d78964dec37 (patch) | |
| tree | 284381ebb0d87d42d785a1d93defc80917234336 /src/librustc/ty | |
| parent | 4c8fd2e80af577b105428ae5403ba13f289a7cf5 (diff) | |
| download | rust-8e89184a7beb03d58d3a3969dddc1d78964dec37.tar.gz rust-8e89184a7beb03d58d3a3969dddc1d78964dec37.zip | |
rename `type_moves_by_default` to `type_is_copy_modulo_regions`
Diffstat (limited to 'src/librustc/ty')
| -rw-r--r-- | src/librustc/ty/query/mod.rs | 2 | ||||
| -rw-r--r-- | src/librustc/ty/util.rs | 18 |
2 files changed, 10 insertions, 10 deletions
diff --git a/src/librustc/ty/query/mod.rs b/src/librustc/ty/query/mod.rs index 842aea07614..4d026b97233 100644 --- a/src/librustc/ty/query/mod.rs +++ b/src/librustc/ty/query/mod.rs @@ -382,7 +382,7 @@ define_queries! { <'tcx> /// might want to use `reveal_all()` method to change modes. [] fn param_env: ParamEnv(DefId) -> ty::ParamEnv<'tcx>, - /// Trait selection queries. These are best used by invoking `ty.moves_by_default()`, + /// Trait selection queries. These are best used by invoking `ty.is_copy_modulo_regions()`, /// `ty.is_copy()`, etc, since that will prune the environment where possible. [] fn is_copy_raw: is_copy_dep_node(ty::ParamEnvAnd<'tcx, Ty<'tcx>>) -> bool, [] fn is_sized_raw: is_sized_dep_node(ty::ParamEnvAnd<'tcx, Ty<'tcx>>) -> bool, diff --git a/src/librustc/ty/util.rs b/src/librustc/ty/util.rs index c98c575fce2..ac062a23786 100644 --- a/src/librustc/ty/util.rs +++ b/src/librustc/ty/util.rs @@ -203,7 +203,7 @@ impl<'tcx> ty::ParamEnv<'tcx> { let cause = ObligationCause { span, ..ObligationCause::dummy() }; let ctx = traits::FulfillmentContext::new(); match traits::fully_normalize(&infcx, ctx, cause, self, &ty) { - Ok(ty) => if infcx.type_moves_by_default(self, ty, span) { + Ok(ty) => if !infcx.type_is_copy_modulo_regions(self, ty, span) { infringing.push(field); } Err(errors) => { @@ -628,12 +628,12 @@ impl<'a, 'tcx> ty::TyS<'tcx> { /// does copies even when the type actually doesn't satisfy the /// full requirements for the `Copy` trait (cc #29149) -- this /// winds up being reported as an error during NLL borrow check. - pub fn moves_by_default(&'tcx self, - tcx: TyCtxt<'a, 'tcx, 'tcx>, - param_env: ty::ParamEnv<'tcx>, - span: Span) - -> bool { - !tcx.at(span).is_copy_raw(param_env.and(self)) + pub fn is_copy_modulo_regions(&'tcx self, + tcx: TyCtxt<'a, 'tcx, 'tcx>, + param_env: ty::ParamEnv<'tcx>, + span: Span) + -> bool { + tcx.at(span).is_copy_raw(param_env.and(self)) } /// Checks whether values of this type `T` have a size known at @@ -947,11 +947,11 @@ fn needs_drop_raw<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, // `ManuallyDrop` doesn't have a destructor regardless of field types. ty::Adt(def, _) if Some(def.did) == tcx.lang_items().manually_drop() => false, - // Issue #22536: We first query type_moves_by_default. It sees a + // Issue #22536: We first query `is_copy_modulo_regions`. It sees a // normalized version of the type, and therefore will definitely // know whether the type implements Copy (and thus needs no // cleanup/drop/zeroing) ... - _ if !ty.moves_by_default(tcx, param_env, DUMMY_SP) => false, + _ if ty.is_copy_modulo_regions(tcx, param_env, DUMMY_SP) => false, // ... (issue #22536 continued) but as an optimization, still use // prior logic of asking for the structural "may drop". |
