-
Notifications
You must be signed in to change notification settings - Fork 13.8k
99144 enable doctests #106574
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
99144 enable doctests #106574
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,8 +14,8 @@ use rustc_middle::ty::{self, Region, TyCtxt}; | |
/// br - the bound region corresponding to the above region which is of type `BrAnon(_)` | ||
/// | ||
/// # Example | ||
/// ```compile_fail,E0623 | ||
/// fn foo(x: &mut Vec<&u8>, y: &u8) | ||
/// ``` | ||
|
||
/// fn foo<'a>(x: &mut Vec<&'a u8>, y: &'a u8) | ||
/// { x.push(y); } | ||
/// ``` | ||
/// The function returns the nested type corresponding to the anonymous region | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,9 +13,11 @@ use crate::infer::region_constraints::VerifyIfEq; | |
|
||
/// Given a "verify-if-eq" type test like: | ||
/// | ||
/// ```ignore (not valid syntax) | ||
|
||
/// exists<'a...> { | ||
/// verify_if_eq(some_type, bound_region) | ||
/// } | ||
/// ``` | ||
/// | ||
/// and the type `test_ty` that the type test is being tested against, | ||
/// returns: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -272,7 +272,7 @@ impl<'cx, 'tcx> VerifyBoundCx<'cx, 'tcx> { | |
/// | ||
/// It will not, however, work for higher-ranked bounds like: | ||
/// | ||
/// ```compile_fail,E0311 | ||
/// ``` | ||
|
||
/// trait Foo<'a, 'b> | ||
/// where for<'x> <Self as Foo<'x, 'b>>::Bar: 'x | ||
/// { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -238,9 +238,15 @@ pub enum VerifyBound<'tcx> { | |
/// like this: | ||
/// | ||
/// ```rust | ||
/// fn foo<'a, 'b, T: SomeTrait<'a>> | ||
/// # trait SomeTrait<'a> { | ||
/// # type Item; | ||
/// # } | ||
/// fn foo<'a, 'b, T: SomeTrait<'a>>() | ||
/// where | ||
/// <T as SomeTrait<'a>>::Item: 'b | ||
/// { | ||
/// | ||
/// } | ||
/// ``` | ||
/// | ||
/// If we have an obligation like `<T as SomeTrait<'?x>>::Item: 'c`, then | ||
|
@@ -253,7 +259,15 @@ pub enum VerifyBound<'tcx> { | |
/// for cases like | ||
/// | ||
/// ```rust | ||
/// where for<'a> <T as SomeTrait<'a>::Item: 'a | ||
/// # trait SomeTrait<'a> { | ||
/// # type Item; | ||
/// # } | ||
/// fn foo<'a, 'b, T: SomeTrait<'a>>() | ||
/// where | ||
/// <T as SomeTrait<'a>>::Item: 'a | ||
/// { | ||
/// | ||
/// } | ||
|
||
/// ``` | ||
/// | ||
/// The idea is that we have to find some instantiation of `'a` that can | ||
|
Uh oh!
There was an error while loading. Please reload this page.