Skip to content

Commit 9317d37

Browse files
committed
two more style nits
1 parent 45dd063 commit 9317d37

File tree

2 files changed

+14
-15
lines changed

2 files changed

+14
-15
lines changed

src/librustc/traits/README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -418,16 +418,16 @@ before, and hence the cache lookup would succeed, yielding
418418
One subtle interaction is that the results of trait lookup will vary
419419
depending on what where clauses are in scope. Therefore, we actually
420420
have *two* caches, a local and a global cache. The local cache is
421-
attached to ParamEnv` and the global cache attached
422-
to the `tcx`. We use the local cache whenever the result might depend
423-
on the where clauses that are in scope. The determination of which
424-
cache to use is done by the method `pick_candidate_cache` in
425-
`select.rs`. At the moment, we use a very simple, conservative rule:
426-
if there are any where-clauses in scope, then we use the local cache.
427-
We used to try and draw finer-grained distinctions, but that led to a
428-
serious of annoying and weird bugs like #22019 and #18290. This simple
429-
rule seems to be pretty clearly safe and also still retains a very
430-
high hit rate (~95% when compiling rustc).
421+
attached to the `ParamEnv` and the global cache attached to the
422+
`tcx`. We use the local cache whenever the result might depend on the
423+
where clauses that are in scope. The determination of which cache to
424+
use is done by the method `pick_candidate_cache` in `select.rs`. At
425+
the moment, we use a very simple, conservative rule: if there are any
426+
where-clauses in scope, then we use the local cache. We used to try
427+
and draw finer-grained distinctions, but that led to a serious of
428+
annoying and weird bugs like #22019 and #18290. This simple rule seems
429+
to be pretty clearly safe and also still retains a very high hit rate
430+
(~95% when compiling rustc).
431431

432432
# Specialization
433433

src/librustc/ty/util.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ use infer::InferCtxt;
1616
use ich::{StableHashingContext, NodeIdHashingMode};
1717
use traits::{self, Reveal};
1818
use ty::{self, Ty, TyCtxt, TypeFoldable};
19-
use ty::ParamEnv;
2019
use ty::fold::TypeVisitor;
2120
use ty::layout::{Layout, LayoutError};
2221
use ty::subst::{Subst, Kind};
@@ -148,7 +147,7 @@ pub enum Representability {
148147
SelfRecursive(Vec<Span>),
149148
}
150149

151-
impl<'tcx> ParamEnv<'tcx> {
150+
impl<'tcx> ty::ParamEnv<'tcx> {
152151
/// Construct a trait environment suitable for contexts where
153152
/// there are no where clauses in scope.
154153
pub fn empty() -> Self {
@@ -720,23 +719,23 @@ impl<'a, 'gcx, 'tcx, W> TypeVisitor<'tcx> for TypeIdHasher<'a, 'gcx, 'tcx, W>
720719
impl<'a, 'tcx> ty::TyS<'tcx> {
721720
pub fn moves_by_default(&'tcx self,
722721
tcx: TyCtxt<'a, 'tcx, 'tcx>,
723-
param_env: ParamEnv<'tcx>,
722+
param_env: ty::ParamEnv<'tcx>,
724723
span: Span)
725724
-> bool {
726725
!tcx.at(span).is_copy_raw(param_env.and(self))
727726
}
728727

729728
pub fn is_sized(&'tcx self,
730729
tcx: TyCtxt<'a, 'tcx, 'tcx>,
731-
param_env: ParamEnv<'tcx>,
730+
param_env: ty::ParamEnv<'tcx>,
732731
span: Span)-> bool
733732
{
734733
tcx.at(span).is_sized_raw(param_env.and(self))
735734
}
736735

737736
pub fn is_freeze(&'tcx self,
738737
tcx: TyCtxt<'a, 'tcx, 'tcx>,
739-
param_env: ParamEnv<'tcx>,
738+
param_env: ty::ParamEnv<'tcx>,
740739
span: Span)-> bool
741740
{
742741
tcx.at(span).is_freeze_raw(param_env.and(self))

0 commit comments

Comments
 (0)