Skip to content

Commit ebf9bfc

Browse files
committed
Update some outdated names and comments
1 parent 373971a commit ebf9bfc

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

-7
Original file line numberDiff line numberDiff line change
@@ -2016,13 +2016,6 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
20162016
}
20172017

20182018
/// Lower a type from the HIR to our internal notion of a type given some extra data for diagnostics.
2019-
///
2020-
/// Extra diagnostic data:
2021-
///
2022-
/// 1. `borrowed`: Whether trait object types are borrowed like in `&dyn Trait`.
2023-
/// Used to avoid emitting redundant errors.
2024-
/// 2. `in_path`: Whether the type appears inside of a path.
2025-
/// Used to provide correct diagnostics for bare trait object types.
20262019
#[instrument(level = "debug", skip(self), ret)]
20272020
pub fn lower_ty(&self, hir_ty: &hir::Ty<'tcx>) -> Ty<'tcx> {
20282021
let tcx = self.tcx();

compiler/rustc_middle/src/ty/consts.rs

+3-7
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ impl<'tcx> Const<'tcx> {
240240

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

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

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

0 commit comments

Comments
 (0)