Skip to content

Commit 705b613

Browse files
Rollup merge of rust-lang#34014 - GuillaumeGomez:fix-E0165, r=jonathandturner
Fix E0165 code examples r? @steveklabnik
2 parents 82d9103 + d211cd6 commit 705b613

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/librustc_const_eval/diagnostics.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -384,18 +384,19 @@ let irr = Irrefutable(0);
384384
385385
// This fails to compile because the match is irrefutable.
386386
while let Irrefutable(x) = irr {
387-
...
387+
// ...
388388
}
389+
```
389390
390391
Try this instead:
391392
392-
```
393+
```no_run
393394
struct Irrefutable(i32);
394395
let irr = Irrefutable(0);
395396
396397
loop {
397398
let Irrefutable(x) = irr;
398-
...
399+
// ...
399400
}
400401
```
401402
"##,

src/librustc_typeck/diagnostics.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2040,6 +2040,7 @@ impl Foo for Bar {
20402040
// the trait
20412041
fn foo(&self) {}
20422042
}
2043+
```
20432044
"##,
20442045

20452046
E0186: r##"

0 commit comments

Comments
 (0)