You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/typing_parameter_envs.md
+3-3
Original file line number
Diff line number
Diff line change
@@ -83,7 +83,7 @@ In the large majority of cases, when a `ParamEnv` is required it either already
83
83
- In the next-gen trait solver all `Goal`s have a [`param_env` field][goal_param_env] specifying what environment to prove the goal in
84
84
- When editing an existing [`TypeRelation`][typerelation] if it implements [`PredicateEmittingRelation`][predicate_emitting_relation] then a [`param_env` method][typerelation_param_env] will be available.
85
85
86
-
If you aren't sure if there's a `ParamEnv` in scope somewhere that can be used it can be worth opening a thread in the [`#t-compiler/help`](compiler_help) zulip stream where someone may be able to point out where a `ParamEnv` can be acquired from.
86
+
If you aren't sure if there's a `ParamEnv` in scope somewhere that can be used it can be worth opening a thread in the [`#t-compiler/help`][compiler_help] zulip stream where someone may be able to point out where a `ParamEnv` can be acquired from.
87
87
88
88
Manually constructing a `ParamEnv` is typically only needed at the start of some kind of top level analysis (e.g. hir typeck or borrow checking). In such cases there are three ways it can be done:
89
89
- Calling the [`tcx.param_env(def_id)` query][param_env_query] which returns the environment associated with a given definition.
@@ -92,7 +92,7 @@ Manually constructing a `ParamEnv` is typically only needed at the start of some
92
92
93
93
Using the `param_env` query is by far the most common way to construct a `ParamEnv` as most of the time the compiler is performing an analysis as part of some specific definition.
94
94
95
-
Creating an empty environment with `ParamEnv::empty` is typically only done either in codegen (indirectly via [`TypingEnv::fully_monomorphized`](tenv_mono)), or as part of some analysis that do not expect to ever encounter generic parameters (e.g. various parts of coherence/orphan check).
95
+
Creating an empty environment with `ParamEnv::empty` is typically only done either in codegen (indirectly via [`TypingEnv::fully_monomorphized`][tenv_mono]), or as part of some analysis that do not expect to ever encounter generic parameters (e.g. various parts of coherence/orphan check).
96
96
97
97
Creating an env from an arbitrary set of where clauses is usually unnecessary and should only be done if the environment you need does not correspond to an actual item in the source code (e.g. [`compare_method_predicate_entailment`][method_pred_entailment]).
98
98
@@ -153,7 +153,7 @@ fn foo<T: Trait + Trait>() {}
153
153
The [next-gen trait solver][next-gen-solver] also requires this elaboration to take place.
0 commit comments