Skip to content

Commit 253e14d

Browse files
authored
Unrolled build for rust-lang#137889
Rollup merge of rust-lang#137889 - mu001999-contrib:update-doc, r=wesleywiser update outdated doc with new example update the illegal definition example because we can compile `struct Ref<'a, T> { x: &'a T }` ([play](https://play.rust-lang.org/?version=stable&mode=debug&edition=2024&gist=2eb2f8800d423c316b545c864623ae16))
2 parents 2a06022 + 4508f5f commit 253e14d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

compiler/rustc_hir_analysis/src/check/wfcheck.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -188,10 +188,10 @@ fn check_well_formed(tcx: TyCtxt<'_>, def_id: LocalDefId) -> Result<(), ErrorGua
188188
/// definition itself. For example, this definition would be illegal:
189189
///
190190
/// ```rust
191-
/// struct Ref<'a, T> { x: &'a T }
191+
/// struct StaticRef<T> { x: &'static T }
192192
/// ```
193193
///
194-
/// because the type did not declare that `T:'a`.
194+
/// because the type did not declare that `T: 'static`.
195195
///
196196
/// We do this check as a pre-pass before checking fn bodies because if these constraints are
197197
/// not included it frequently leads to confusing errors in fn bodies. So it's better to check

0 commit comments

Comments
 (0)