Skip to content

Commit

Permalink
Rollup merge of rust-lang#119487 - gurry:improve-freshner-comment, r=…
Browse files Browse the repository at this point in the history
…Nilstrieb

Minor improvements in comment on `freshen.rs`

- Removed a stray "if"
- Changed a numeric "2" to "two" because it reads better
  • Loading branch information
fmease committed Jan 3, 2024
2 parents 5968c00 + 884cb41 commit d1b0151
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions compiler/rustc_infer/src/infer/freshen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
//! Freshening is used primarily to get a good type for inserting into a cache. The result
//! summarizes what the type inferencer knows "so far". The primary place it is used right now is
//! in the trait matching algorithm, which needs to be able to cache whether an `impl` self type
//! matches some other type X -- *without* affecting `X`. That means if that if the type `X` is in
//! matches some other type X -- *without* affecting `X`. That means that if the type `X` is in
//! fact an unbound type variable, we want the match to be regarded as ambiguous, because depending
//! on what type that type variable is ultimately assigned, the match may or may not succeed.
//!
Expand All @@ -21,7 +21,7 @@
//! Because of the manipulation required to handle closures, doing arbitrary operations on
//! freshened types is not recommended. However, in addition to doing equality/hash
//! comparisons (for caching), it is possible to do a `ty::_match` operation between
//! 2 freshened types - this works even with the closure encoding.
//! two freshened types - this works even with the closure encoding.
//!
//! __An important detail concerning regions.__ The freshener also replaces *all* free regions with
//! 'erased. The reason behind this is that, in general, we do not take region relationships into
Expand Down

0 comments on commit d1b0151

Please sign in to comment.