Skip to content

Commit dca26ac

Browse files
authored
Unrolled build for #153172
Rollup merge of #153172 - jdonszelmann:placeholder-comment, r=lcnr Fix comment about placeholders r? @lcnr When this was introduced, briefly returned an `Option`, which is what the comment refers to. a9f1e1c#diff-8d11697c196da9f44774488ae0bf353283e5c6466a6dd570d7818431b73d4a44R511 Before that this code would just panic, and in the commit right after fixing review comments it does so again: cf001dc#diff-8d11697c196da9f44774488ae0bf353283e5c6466a6dd570d7818431b73d4a44R560 That comment has been copied around for 5 years now despite not reflecting the behavior hehe Second commit has some general typos I found
2 parents 1d113d2 + ea2a15f commit dca26ac

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

compiler/rustc_next_trait_solver/src/placeholder.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,10 @@ where
3232
Infcx: InferCtxtLike<Interner = I>,
3333
I: Interner,
3434
{
35-
/// Returns `Some` if we *were* able to replace bound vars. If there are any bound vars that
36-
/// use a binding level above `universe_indices.len()`, we fail.
35+
/// Returns a type with all bound vars replaced by placeholders,
36+
/// together with mappings from the new placeholders back to the original variable.
37+
///
38+
/// Panics if there are any bound vars that use a binding level above `universe_indices.len()`.
3739
pub fn replace_bound_vars<T: TypeFoldable<I>>(
3840
infcx: &'a Infcx,
3941
universe_indices: &'a mut Vec<Option<ty::UniverseIndex>>,

compiler/rustc_next_trait_solver/src/solve/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ use crate::solve::assembly::Candidate;
3939
///
4040
/// We previously used `cx.recursion_limit().0.checked_ilog2().unwrap_or(0)` for this.
4141
/// However, it feels unlikely that uncreasing the recursion limit by a power of two
42-
/// to get one more iteration is every useful or desirable. We now instead used a constant
42+
/// to get one more iteration is ever useful or desirable. We now instead used a constant
4343
/// here. If there ever ends up some use-cases where a bigger number of fixpoint iterations
44-
/// is required, we can add a new attribute for that or revert this to be dependant on the
44+
/// is required, we can add a new attribute for that or revert this to be dependent on the
4545
/// recursion limit again. However, this feels very unlikely.
4646
const FIXPOINT_STEP_LIMIT: usize = 8;
4747

0 commit comments

Comments
 (0)