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/param_env/param_env_acquisition.md
+3-2
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@
4
4
When needing a [`ParamEnv`][pe] in the compiler there are a few options for obtaining one:
5
5
- The correct env is already in scope simply use it (or pass it down the call stack to where you are).
6
6
- The [`tcx.param_env(def_id)` query][param_env_query]
7
-
- Use [`ParamEnv::new`][param_env_new] to construct an env with an arbitrary set of where clauses. Then call `traits::normalize_param_env_or_error` which will handle normalizing and elaborating all the where clauses in the env for you.
7
+
- Use [`ParamEnv::new`][param_env_new] to construct an env with an arbitrary set of where clauses. Then call [`traits::normalize_param_env_or_error`][normalize_env_or_error] which will handle normalizing and elaborating all the where clauses in the env for you.
8
8
- Creating an empty environment via [`ParamEnv::reveal_all`][env_reveal_all] or [`ParamEnv::empty`][env_empty]
9
9
10
10
In the large majority of cases a `ParamEnv` when required already exists somewhere in scope or above in the call stack and should be passed down. A non exhaustive list of places where you might find an existing `ParamEnv`:
@@ -40,4 +40,5 @@ The `ParamEnv` type has a method [`ParamEnv::with_reveal_all_normalized`][with_r
Copy file name to clipboardExpand all lines: src/param_env/param_env_construction_internals.md
+2-1
Original file line number
Diff line number
Diff line change
@@ -79,4 +79,5 @@ This workaround does not work in all cases as normalizing associated types requi
79
79
In the next-gen trait solver the requirement for all where clauses in the `ParamEnv` to be fully normalized is not present and so we do not normalize when constructing `ParamEnv`s.
0 commit comments