Skip to content

Commit 85f2eca

Browse files
committed
Add a fn main() {} to a doctest to prevent the test from being wrapped in a fn main() {} body
1 parent 0bc2001 commit 85f2eca

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

compiler/rustc_error_codes/src/error_codes/E0792.md

+4
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ type Foo<T> = impl std::fmt::Debug;
3939
fn foo<U>() -> Foo<U> {
4040
5u32
4141
}
42+
43+
fn main() {}
4244
```
4345

4446
This means that no matter the generic parameter to `foo`,
@@ -57,4 +59,6 @@ type Foo<T: Debug> = impl Debug;
5759
fn foo<U: Debug>() -> Foo<U> {
5860
Vec::<U>::new()
5961
}
62+
63+
fn main() {}
6064
```

compiler/rustc_lint/src/opaque_hidden_inferred_bound.rs

+2
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ declare_lint! {
4646
/// fn test() -> impl Trait<Assoc = Tait> {
4747
/// 42
4848
/// }
49+
///
50+
/// fn main() {}
4951
/// ```
5052
///
5153
/// {{produces}}

0 commit comments

Comments
 (0)