From 4508f5f8628c2869f153b59aba6d90411d831e33 Mon Sep 17 00:00:00 2001 From: Mu001999 Date: Sun, 2 Mar 2025 23:21:43 +0800 Subject: [PATCH] update outdated doc with new example --- compiler/rustc_hir_analysis/src/check/wfcheck.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/rustc_hir_analysis/src/check/wfcheck.rs b/compiler/rustc_hir_analysis/src/check/wfcheck.rs index d72cf00293f0c..e81d753f3e7d4 100644 --- a/compiler/rustc_hir_analysis/src/check/wfcheck.rs +++ b/compiler/rustc_hir_analysis/src/check/wfcheck.rs @@ -218,10 +218,10 @@ fn check_well_formed(tcx: TyCtxt<'_>, def_id: LocalDefId) -> Result<(), ErrorGua /// definition itself. For example, this definition would be illegal: /// /// ```rust -/// struct Ref<'a, T> { x: &'a T } +/// struct StaticRef { x: &'static T } /// ``` /// -/// because the type did not declare that `T:'a`. +/// because the type did not declare that `T: 'static`. /// /// We do this check as a pre-pass before checking fn bodies because if these constraints are /// not included it frequently leads to confusing errors in fn bodies. So it's better to check