mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-16 17:03:35 +00:00
Auto merge of #99324 - reez12g:issue-99144, r=jyn514
Enable doctests in compiler/ crates Helps with https://github.com/rust-lang/rust/issues/99144
This commit is contained in:
commit
0152393048
@ -4,7 +4,6 @@ version = "0.0.0"
|
||||
edition = "2021"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
|
||||
[dependencies]
|
||||
bitflags = "1.2.1"
|
||||
|
@ -1609,11 +1609,11 @@ impl<'hir> LoweringContext<'_, 'hir> {
|
||||
}
|
||||
|
||||
/// Desugar `ExprKind::Yeet` from: `do yeet <expr>` into:
|
||||
/// ```rust
|
||||
/// ```ignore(illustrative)
|
||||
/// // If there is an enclosing `try {...}`:
|
||||
/// break 'catch_target FromResidual::from_residual(Yeet(residual)),
|
||||
/// break 'catch_target FromResidual::from_residual(Yeet(residual));
|
||||
/// // Otherwise:
|
||||
/// return FromResidual::from_residual(Yeet(residual)),
|
||||
/// return FromResidual::from_residual(Yeet(residual));
|
||||
/// ```
|
||||
/// But to simplify this, there's a `from_yeet` lang item function which
|
||||
/// handles the combined `FromResidual::from_residual(Yeet(residual))`.
|
||||
|
@ -4,7 +4,6 @@ version = "0.0.0"
|
||||
edition = "2021"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
|
||||
[dependencies]
|
||||
rustc_span = { path = "../rustc_span" }
|
||||
|
@ -4,7 +4,6 @@ version = "0.0.0"
|
||||
edition = "2021"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
|
||||
[dependencies]
|
||||
rustc_ast_pretty = { path = "../rustc_ast_pretty" }
|
||||
|
@ -4,7 +4,6 @@ version = "0.0.0"
|
||||
edition = "2021"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
|
||||
[dependencies]
|
||||
either = "1.5.0"
|
||||
|
@ -341,7 +341,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
|
||||
/// Report an error because the universal region `fr` was required to outlive
|
||||
/// `outlived_fr` but it is not known to do so. For example:
|
||||
///
|
||||
/// ```compile_fail,E0312
|
||||
/// ```compile_fail
|
||||
/// fn foo<'a, 'b>(x: &'a u32) -> &'b u32 { x }
|
||||
/// ```
|
||||
///
|
||||
|
@ -1398,7 +1398,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
|
||||
/// whether any of the constraints were too strong. In particular,
|
||||
/// we want to check for a case where a universally quantified
|
||||
/// region exceeded its bounds. Consider:
|
||||
/// ```compile_fail,E0312
|
||||
/// ```compile_fail
|
||||
/// fn foo<'a, 'b>(x: &'a u32) -> &'b u32 { x }
|
||||
/// ```
|
||||
/// In this case, returning `x` requires `&'a u32 <: &'b u32`
|
||||
@ -1451,7 +1451,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
|
||||
/// <https://smallcultfollowing.com/babysteps/blog/2019/01/17/polonius-and-region-errors/>
|
||||
///
|
||||
/// In the canonical example
|
||||
/// ```compile_fail,E0312
|
||||
/// ```compile_fail
|
||||
/// fn foo<'a, 'b>(x: &'a u32) -> &'b u32 { x }
|
||||
/// ```
|
||||
/// returning `x` requires `&'a u32 <: &'b u32` and hence we establish (transitively) a
|
||||
|
@ -58,6 +58,7 @@ impl<'cx, 'a> Context<'cx, 'a> {
|
||||
/// Builds the whole `assert!` expression. For example, `let elem = 1; assert!(elem == 1);` expands to:
|
||||
///
|
||||
/// ```rust
|
||||
/// #![feature(generic_assert_internals)]
|
||||
/// let elem = 1;
|
||||
/// {
|
||||
/// #[allow(unused_imports)]
|
||||
@ -70,7 +71,7 @@ impl<'cx, 'a> Context<'cx, 'a> {
|
||||
/// __local_bind0
|
||||
/// } == 1
|
||||
/// ) {
|
||||
/// panic!("Assertion failed: elem == 1\nWith captures:\n elem = {}", __capture0)
|
||||
/// panic!("Assertion failed: elem == 1\nWith captures:\n elem = {:?}", __capture0)
|
||||
/// }
|
||||
/// }
|
||||
/// ```
|
||||
|
@ -1114,6 +1114,11 @@ impl<'a> MethodDef<'a> {
|
||||
/// ```
|
||||
/// is equivalent to:
|
||||
/// ```
|
||||
/// #![feature(core_intrinsics)]
|
||||
/// enum A {
|
||||
/// A1,
|
||||
/// A2(i32)
|
||||
/// }
|
||||
/// impl ::core::cmp::PartialEq for A {
|
||||
/// #[inline]
|
||||
/// fn eq(&self, other: &A) -> bool {
|
||||
|
@ -5,7 +5,6 @@ edition = "2021"
|
||||
|
||||
[lib]
|
||||
test = false
|
||||
doctest = false
|
||||
|
||||
[dependencies]
|
||||
bitflags = "1.0"
|
||||
|
@ -4,7 +4,6 @@ version = "0.0.0"
|
||||
edition = "2021"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
|
||||
[dependencies]
|
||||
tracing = "0.1"
|
||||
|
@ -56,7 +56,7 @@ macro_rules! throw_validation_failure {
|
||||
/// This lets you use the patterns as a kind of validation list, asserting which errors
|
||||
/// can possibly happen:
|
||||
///
|
||||
/// ```
|
||||
/// ```ignore(illustrative)
|
||||
/// let v = try_validation!(some_fn(), some_path, {
|
||||
/// Foo | Bar | Baz => { "some failure" },
|
||||
/// });
|
||||
@ -65,7 +65,7 @@ macro_rules! throw_validation_failure {
|
||||
/// The patterns must be of type `UndefinedBehaviorInfo`.
|
||||
/// An additional expected parameter can also be added to the failure message:
|
||||
///
|
||||
/// ```
|
||||
/// ```ignore(illustrative)
|
||||
/// let v = try_validation!(some_fn(), some_path, {
|
||||
/// Foo | Bar | Baz => { "some failure" } expected { "something that wasn't a failure" },
|
||||
/// });
|
||||
@ -74,7 +74,7 @@ macro_rules! throw_validation_failure {
|
||||
/// An additional nicety is that both parameters actually take format args, so you can just write
|
||||
/// the format string in directly:
|
||||
///
|
||||
/// ```
|
||||
/// ```ignore(illustrative)
|
||||
/// let v = try_validation!(some_fn(), some_path, {
|
||||
/// Foo | Bar | Baz => { "{:?}", some_failure } expected { "{}", expected_value },
|
||||
/// });
|
||||
|
@ -4,7 +4,6 @@ version = "0.0.0"
|
||||
edition = "2021"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
|
||||
[dependencies]
|
||||
arrayvec = { version = "0.7", default-features = false }
|
||||
|
@ -4,7 +4,6 @@ version = "0.0.0"
|
||||
edition = "2021"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
|
||||
[dependencies]
|
||||
fluent-bundle = "0.15.2"
|
||||
|
@ -4,7 +4,6 @@ version = "0.0.0"
|
||||
edition = "2021"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
|
||||
[dependencies]
|
||||
tracing = "0.1"
|
||||
|
@ -4,7 +4,6 @@ version = "0.0.0"
|
||||
edition = "2021"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
|
||||
[dependencies]
|
||||
rustc_data_structures = { path = "../rustc_data_structures" }
|
||||
|
@ -4,7 +4,6 @@ version = "0.0.0"
|
||||
edition = "2021"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
|
||||
[dependencies]
|
||||
rustc_arena = { path = "../rustc_arena" }
|
||||
|
@ -4,7 +4,6 @@ version = "0.0.0"
|
||||
edition = "2021"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
|
||||
[dependencies]
|
||||
rustc_ast_pretty = { path = "../rustc_ast_pretty" }
|
||||
|
@ -4,7 +4,6 @@ version = "0.0.0"
|
||||
edition = "2021"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
|
||||
[dependencies]
|
||||
rustc_graphviz = { path = "../rustc_graphviz" }
|
||||
|
@ -4,7 +4,6 @@ version = "0.0.0"
|
||||
edition = "2021"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
|
||||
[dependencies]
|
||||
arrayvec = { version = "0.7", default-features = false }
|
||||
|
@ -4,7 +4,6 @@ version = "0.0.0"
|
||||
edition = "2021"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
|
||||
[dependencies]
|
||||
libloading = "0.7.1"
|
||||
|
@ -12,7 +12,6 @@ Rust lexer used by rustc. No stability guarantees are provided.
|
||||
# Note: do not remove this blank `[lib]` section.
|
||||
# This will be used when publishing this crate as `rustc-ap-rustc_lexer`.
|
||||
[lib]
|
||||
doctest = false
|
||||
|
||||
# Note that this crate purposefully does not depend on other rustc crates
|
||||
[dependencies]
|
||||
|
@ -4,7 +4,6 @@ version = "0.0.0"
|
||||
edition = "2021"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
|
||||
[dependencies]
|
||||
libloading = "0.7.1"
|
||||
|
@ -4,7 +4,6 @@ version = "0.0.0"
|
||||
edition = "2021"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
|
||||
[dependencies]
|
||||
rustc_arena = { path = "../rustc_arena" }
|
||||
|
@ -4,7 +4,6 @@ version = "0.0.0"
|
||||
edition = "2021"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
|
||||
[dependencies]
|
||||
polonius-engine = "0.13.0"
|
||||
|
@ -4,7 +4,6 @@ version = "0.0.0"
|
||||
edition = "2021"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
|
||||
[dependencies]
|
||||
itertools = "0.10.1"
|
||||
|
@ -5,4 +5,3 @@ edition = "2021"
|
||||
|
||||
[lib]
|
||||
proc-macro = true
|
||||
doctest = false
|
||||
|
@ -4,7 +4,6 @@ version = "0.0.0"
|
||||
edition = "2021"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
|
||||
[dependencies]
|
||||
smallvec = { version = "1.8.1", features = [ "union", "may_dangle" ] }
|
||||
|
@ -4,7 +4,6 @@ version = "0.0.0"
|
||||
edition = "2021"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
|
||||
[dependencies]
|
||||
bitflags = "1.0"
|
||||
|
@ -5,7 +5,6 @@ build = false
|
||||
edition = "2021"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
|
||||
[dependencies]
|
||||
libloading = "0.7.1"
|
||||
|
@ -4,7 +4,6 @@ version = "0.0.0"
|
||||
edition = "2021"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
|
||||
[dependencies]
|
||||
parking_lot = "0.11"
|
||||
|
@ -4,7 +4,6 @@ version = "0.0.0"
|
||||
edition = "2021"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
|
||||
[dependencies]
|
||||
bitflags = "1.2.1"
|
||||
|
@ -4,7 +4,6 @@ version = "0.0.0"
|
||||
edition = "2021"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
|
||||
[dependencies]
|
||||
rustc_serialize = { path = "../rustc_serialize" }
|
||||
|
@ -4,7 +4,6 @@ version = "0.0.0"
|
||||
edition = "2021"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
|
||||
[dependencies]
|
||||
bitflags = "1.2.1"
|
||||
|
@ -4,7 +4,6 @@ version = "0.0.0"
|
||||
edition = "2021"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
|
||||
[dependencies]
|
||||
rustc_parse_format = { path = "../rustc_parse_format" }
|
||||
|
@ -4,7 +4,6 @@ version = "0.0.0"
|
||||
edition = "2021"
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
|
||||
[dependencies]
|
||||
bitflags = "1.2.1"
|
||||
|
Loading…
Reference in New Issue
Block a user