-
Notifications
You must be signed in to change notification settings - Fork 13.4k
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) | ||
/// ``` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we remove the |
||
/// 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) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It looks like it would be better to align the description with other parts of the document and make it ignore(illustrative). |
||
/// 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 | ||
/// ``` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If this compiles now then the previous comment is wrong as well (and we should find out why) |
||
/// 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 | ||
/// { | ||
/// | ||
/// } | ||
Comment on lines
+262
to
+270
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a lot more verbose and makes it harder to understand that the where clause is what's relevant here. I think it makes sense to |
||
/// ``` | ||
/// | ||
/// 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.