//! is always the "expected" output from the POV of diagnostics.
//!
//! Examples:
-//!
+//! ```ignore (fragment)
//! infcx.at(cause, param_env).sub(a, b)
//! // requires that `a <: b`, with `a` considered the "expected" type
//!
//!
//! infcx.at(cause, param_env).eq(a, b)
//! // requires that `a == b`, with `a` considered the "expected" type
-//!
+//! ```
//! For finer-grained control, you can also do use `trace`:
-//!
+//! ```ignore (fragment)
//! infcx.at(...).trace(a, b).sub(&c, &d)
-//!
+//! ```
//! This will set `a` and `b` as the "root" values for
//! error-reporting, but actually operate on `c` and `d`. This is
//! sometimes useful when the types of `c` and `d` are not traceable
/// common state. Used in coherence.
pub fn fork(&self) -> Self {
Self {
- tcx: self.tcx.clone(),
- defining_use_anchor: self.defining_use_anchor.clone(),
- in_progress_typeck_results: self.in_progress_typeck_results.clone(),
+ tcx: self.tcx,
+ defining_use_anchor: self.defining_use_anchor,
+ in_progress_typeck_results: self.in_progress_typeck_results,
inner: self.inner.clone(),
skip_leak_check: self.skip_leak_check.clone(),
lexical_region_resolutions: self.lexical_region_resolutions.clone(),