1
Fork 0

Fix compiler docs

This commit is contained in:
Guillaume Gomez 2022-10-09 16:15:23 +02:00 committed by Guillaume Gomez
parent 3416fa1882
commit adc24d1b5e
10 changed files with 32 additions and 16 deletions

View file

@ -707,10 +707,12 @@ pub(super) fn check_opaque_for_cycles<'tcx>(
/// check those cases in the `param_env` of that function, which may have
/// bounds not on this opaque type:
///
/// type X<T> = impl Clone
/// ```ignore (illustrative)
/// type X<T> = impl Clone;
/// fn f<T: Clone>(t: T) -> X<T> {
/// t
/// }
/// ```
///
/// Without this check the above code is incorrectly accepted: we would ICE if
/// some tried, for example, to clone an `Option<X<&mut ()>>`.