Skip to content

Commit ccc417b

Browse files
committed
Update some outdated names and comments
1 parent a0d98ff commit ccc417b

File tree

2 files changed

+3
-14
lines changed
  • compiler

2 files changed

+3
-14
lines changed

compiler/rustc_hir_analysis/src/hir_ty_lowering/mod.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2032,13 +2032,6 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
20322032
}
20332033

20342034
/// Lower a type from the HIR to our internal notion of a type given some extra data for diagnostics.
2035-
///
2036-
/// Extra diagnostic data:
2037-
///
2038-
/// 1. `borrowed`: Whether trait object types are borrowed like in `&dyn Trait`.
2039-
/// Used to avoid emitting redundant errors.
2040-
/// 2. `in_path`: Whether the type appears inside of a path.
2041-
/// Used to provide correct diagnostics for bare trait object types.
20422035
#[instrument(level = "debug", skip(self), ret)]
20432036
pub fn lower_ty(&self, hir_ty: &hir::Ty<'tcx>) -> Ty<'tcx> {
20442037
let tcx = self.tcx();

compiler/rustc_middle/src/ty/consts.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ impl<'tcx> Const<'tcx> {
241241

242242
let ty = tcx.type_of(def).no_bound_vars().expect("const parameter types cannot be generic");
243243

244-
match Self::try_from_lit_or_param(tcx, ty, expr) {
244+
match Self::try_from_lit(tcx, ty, expr) {
245245
Some(v) => v,
246246
None => ty::Const::new_unevaluated(tcx, ty::UnevaluatedConst {
247247
def: def.to_def_id(),
@@ -279,11 +279,7 @@ impl<'tcx> Const<'tcx> {
279279
}
280280

281281
#[instrument(skip(tcx), level = "debug")]
282-
fn try_from_lit_or_param(
283-
tcx: TyCtxt<'tcx>,
284-
ty: Ty<'tcx>,
285-
expr: &'tcx hir::Expr<'tcx>,
286-
) -> Option<Self> {
282+
fn try_from_lit(tcx: TyCtxt<'tcx>, ty: Ty<'tcx>, expr: &'tcx hir::Expr<'tcx>) -> Option<Self> {
287283
// Unwrap a block, so that e.g. `{ P }` is recognised as a parameter. Const arguments
288284
// currently have to be wrapped in curly brackets, so it's necessary to special-case.
289285
let expr = match &expr.kind {
@@ -322,7 +318,7 @@ impl<'tcx> Const<'tcx> {
322318
Err(e) => {
323319
tcx.dcx().span_delayed_bug(
324320
expr.span,
325-
format!("Const::from_anon_const: couldn't lit_to_const {e:?}"),
321+
format!("Const::try_from_lit: couldn't lit_to_const {e:?}"),
326322
);
327323
}
328324
}

0 commit comments

Comments
 (0)