Skip to content

Commit 0152393

Browse files
committed
Auto merge of #99324 - reez12g:issue-99144, r=jyn514
Enable doctests in compiler/ crates Helps with #99144
2 parents 27579a2 + 488eb42 commit 0152393

File tree

36 files changed

+16
-40
lines changed

36 files changed

+16
-40
lines changed

compiler/rustc_ast/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ version = "0.0.0"
44
edition = "2021"
55

66
[lib]
7-
doctest = false
87

98
[dependencies]
109
bitflags = "1.2.1"

compiler/rustc_ast_lowering/src/expr.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1609,11 +1609,11 @@ impl<'hir> LoweringContext<'_, 'hir> {
16091609
}
16101610

16111611
/// Desugar `ExprKind::Yeet` from: `do yeet <expr>` into:
1612-
/// ```rust
1612+
/// ```ignore(illustrative)
16131613
/// // If there is an enclosing `try {...}`:
1614-
/// break 'catch_target FromResidual::from_residual(Yeet(residual)),
1614+
/// break 'catch_target FromResidual::from_residual(Yeet(residual));
16151615
/// // Otherwise:
1616-
/// return FromResidual::from_residual(Yeet(residual)),
1616+
/// return FromResidual::from_residual(Yeet(residual));
16171617
/// ```
16181618
/// But to simplify this, there's a `from_yeet` lang item function which
16191619
/// handles the combined `FromResidual::from_residual(Yeet(residual))`.

compiler/rustc_ast_pretty/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ version = "0.0.0"
44
edition = "2021"
55

66
[lib]
7-
doctest = false
87

98
[dependencies]
109
rustc_span = { path = "../rustc_span" }

compiler/rustc_attr/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ version = "0.0.0"
44
edition = "2021"
55

66
[lib]
7-
doctest = false
87

98
[dependencies]
109
rustc_ast_pretty = { path = "../rustc_ast_pretty" }

compiler/rustc_borrowck/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ version = "0.0.0"
44
edition = "2021"
55

66
[lib]
7-
doctest = false
87

98
[dependencies]
109
either = "1.5.0"

compiler/rustc_borrowck/src/diagnostics/region_errors.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
341341
/// Report an error because the universal region `fr` was required to outlive
342342
/// `outlived_fr` but it is not known to do so. For example:
343343
///
344-
/// ```compile_fail,E0312
344+
/// ```compile_fail
345345
/// fn foo<'a, 'b>(x: &'a u32) -> &'b u32 { x }
346346
/// ```
347347
///

compiler/rustc_borrowck/src/region_infer/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1398,7 +1398,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
13981398
/// whether any of the constraints were too strong. In particular,
13991399
/// we want to check for a case where a universally quantified
14001400
/// region exceeded its bounds. Consider:
1401-
/// ```compile_fail,E0312
1401+
/// ```compile_fail
14021402
/// fn foo<'a, 'b>(x: &'a u32) -> &'b u32 { x }
14031403
/// ```
14041404
/// In this case, returning `x` requires `&'a u32 <: &'b u32`
@@ -1451,7 +1451,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
14511451
/// <https://smallcultfollowing.com/babysteps/blog/2019/01/17/polonius-and-region-errors/>
14521452
///
14531453
/// In the canonical example
1454-
/// ```compile_fail,E0312
1454+
/// ```compile_fail
14551455
/// fn foo<'a, 'b>(x: &'a u32) -> &'b u32 { x }
14561456
/// ```
14571457
/// returning `x` requires `&'a u32 <: &'b u32` and hence we establish (transitively) a

compiler/rustc_builtin_macros/src/assert/context.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ impl<'cx, 'a> Context<'cx, 'a> {
5858
/// Builds the whole `assert!` expression. For example, `let elem = 1; assert!(elem == 1);` expands to:
5959
///
6060
/// ```rust
61+
/// #![feature(generic_assert_internals)]
6162
/// let elem = 1;
6263
/// {
6364
/// #[allow(unused_imports)]
@@ -70,7 +71,7 @@ impl<'cx, 'a> Context<'cx, 'a> {
7071
/// __local_bind0
7172
/// } == 1
7273
/// ) {
73-
/// panic!("Assertion failed: elem == 1\nWith captures:\n elem = {}", __capture0)
74+
/// panic!("Assertion failed: elem == 1\nWith captures:\n elem = {:?}", __capture0)
7475
/// }
7576
/// }
7677
/// ```

compiler/rustc_builtin_macros/src/deriving/generic/mod.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1114,6 +1114,11 @@ impl<'a> MethodDef<'a> {
11141114
/// ```
11151115
/// is equivalent to:
11161116
/// ```
1117+
/// #![feature(core_intrinsics)]
1118+
/// enum A {
1119+
/// A1,
1120+
/// A2(i32)
1121+
/// }
11171122
/// impl ::core::cmp::PartialEq for A {
11181123
/// #[inline]
11191124
/// fn eq(&self, other: &A) -> bool {

compiler/rustc_codegen_llvm/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ edition = "2021"
55

66
[lib]
77
test = false
8-
doctest = false
98

109
[dependencies]
1110
bitflags = "1.0"

0 commit comments

Comments
 (0)