forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of rust-lang#87068 - JohnTitor:rollup-2xuisfx, r=JohnTitor
Rollup of 8 pull requests Successful merges: - rust-lang#73936 (Rustdoc: Change all 'optflag' arguments to 'optflagmulti') - rust-lang#86926 (Update regex crates) - rust-lang#86951 ([docs] Clarify behaviour of f64 and f32::sqrt when argument is negative zero) - rust-lang#87031 (Update reference.md) - rust-lang#87037 (cleanup(rustdoc): remove unused function getObjectNameById) - rust-lang#87045 (Fix tracking issue for `bool_to_option`) - rust-lang#87049 (Account for `submodules = false` in config.toml when updating LLVM submodule) - rust-lang#87061 (Do not suggest adding a semicolon after `?`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
- Loading branch information
Showing
12 changed files
with
118 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
% The Rust Reference has moved | ||
|
||
We've split up the reference into chapters. Please find it at its new | ||
home [here](reference/index.html). | ||
home [here](https://doc.rust-lang.org/stable/reference/introduction.html). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
// compile-flags: --document-private-items --document-private-items | ||
|
||
// @has duplicate_flags/struct.Private.html | ||
struct Private; |
27 changes: 27 additions & 0 deletions
27
src/test/ui/suggestions/try-operator-dont-suggest-semicolon.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Regression test for #87051, where a double semicolon was erroneously | ||
// suggested after a `?` operator. | ||
|
||
fn main() -> Result<(), ()> { | ||
a(|| { | ||
b() | ||
//~^ ERROR: mismatched types [E0308] | ||
//~| NOTE: expected `()`, found `i32` | ||
//~| HELP: consider using a semicolon here | ||
})?; | ||
|
||
// Here, we do want to suggest a semicolon: | ||
let x = Ok(42); | ||
if true { | ||
//~^ NOTE: expected this to be `()` | ||
x? | ||
//~^ ERROR: mismatched types [E0308] | ||
//~| NOTE: expected `()`, found integer | ||
//~| HELP: consider using a semicolon here | ||
} | ||
//~^ HELP: consider using a semicolon here | ||
|
||
Ok(()) | ||
} | ||
|
||
fn a<F>(f: F) -> Result<(), ()> where F: FnMut() { Ok(()) } | ||
fn b() -> i32 { 42 } |
33 changes: 33 additions & 0 deletions
33
src/test/ui/suggestions/try-operator-dont-suggest-semicolon.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
error[E0308]: mismatched types | ||
--> $DIR/try-operator-dont-suggest-semicolon.rs:6:9 | ||
| | ||
LL | b() | ||
| ^^^- help: consider using a semicolon here: `;` | ||
| | | ||
| expected `()`, found `i32` | ||
|
||
error[E0308]: mismatched types | ||
--> $DIR/try-operator-dont-suggest-semicolon.rs:16:9 | ||
| | ||
LL | / if true { | ||
LL | | | ||
LL | | x? | ||
| | ^^ expected `()`, found integer | ||
LL | | | ||
LL | | | ||
LL | | | ||
LL | | } | ||
| |_____- expected this to be `()` | ||
| | ||
help: consider using a semicolon here | ||
| | ||
LL | x?; | ||
| ^ | ||
help: consider using a semicolon here | ||
| | ||
LL | }; | ||
| ^ | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0308`. |