@@ -1034,9 +1034,11 @@ impl PlaceholderLike for PlaceholderConst {
1034
1034
}
1035
1035
}
1036
1036
1037
- /// When type checking, we use the `ParamEnv` to track
1038
- /// details about the set of where-clauses that are in scope at this
1039
- /// particular point.
1037
+ /// When interacting with the type system we must provide information about the
1038
+ /// environment. `ParamEnv` is the type that represents this information. See the
1039
+ /// [dev guide chapter](param_env_guide) for more information.
1040
+ ///
1041
+ /// [param_env_guide]: https://rustc-dev-guide.rust-lang.org/param_env/param_env_summary.html
1040
1042
#[ derive( Copy , Clone , Hash , PartialEq , Eq ) ]
1041
1043
pub struct ParamEnv < ' tcx > {
1042
1044
/// This packs both caller bounds and the reveal enum into one pointer.
@@ -1103,8 +1105,11 @@ impl<'tcx> TypeVisitable<TyCtxt<'tcx>> for ParamEnv<'tcx> {
1103
1105
impl < ' tcx > ParamEnv < ' tcx > {
1104
1106
/// Construct a trait environment suitable for contexts where
1105
1107
/// there are no where-clauses in scope. Hidden types (like `impl
1106
- /// Trait`) are left hidden, so this is suitable for ordinary
1107
- /// type-checking.
1108
+ /// Trait`) are left hidden. In majority of cases it is incorrect
1109
+ /// to use an empty environment. See the [dev guide section][param_env_guide]
1110
+ /// for information on what a `ParamEnv` is and how to acquire one.
1111
+ ///
1112
+ /// [param_env_guide]: https://rustc-dev-guide.rust-lang.org/param_env/param_env_summary.html
1108
1113
#[ inline]
1109
1114
pub fn empty ( ) -> Self {
1110
1115
Self :: new ( List :: empty ( ) , Reveal :: UserFacing )
0 commit comments