8000 Rollup of 19 pull requests by m-ou-se · Pull Request #81013 · rust-lang/rust · GitHub
[go: up one dir, main page]

Skip to content

Rollup of 19 pull requests #81013

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 68 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
64f11b9
Update tests of "unused_lifetimes" lint for async functions and corre…
Dec 4, 2020
3ea744e
Recommend panic::resume_unwind instead of panicking.
frewsxcv Dec 18, 2020
1f9a8a1
Add a `std::io::read_to_string` function
camelid Nov 5, 2020
4ee6d1b
Add description independent of `Read::read_to_string`
camelid Dec 30, 2020
588786a
Add error docs
camelid Dec 30, 2020
7ed824e
Add Iterator::intersperse_with
lukaslueg Dec 31, 2020
7a0ada0
Remove FIXME-notes
lukaslueg Jan 6, 2021
f7d261c
Get rid of `DepConstructor`
jyn514 Jan 8, 2021
ebe402d
Fix handling of malicious Readers in read_to_end
sfackler Jan 11, 2021
a9ef798
clean up control flow
sfackler Jan 11, 2021
5cb8303
make check a bit more clear
sfackler Jan 11, 2021
e6c07b0
clarify docs a bit
sfackler Jan 11, 2021
7463292
Add docs on performance
camelid Jan 12, 2021
16692ab
Suggest `_` and `..` if a pattern has too few fields
camelid 8000 Dec 13, 2020
5fe61a7
Simplify code
camelid Dec 19, 2020
f3d9df5
Suggest `Variant(..)` if all of the mentioned fields are `_`
camelid Dec 19, 2020
a5e8e6e
Pluralize 'parenthesis' correctly
camelid Dec 19, 2020
fe82cc3
Specialize `..` help message for all fields vs. the rest
camelid Dec 19, 2020
9959d6d
Only suggest `..` if more than one field is missing
camelid Dec 20, 2020
1bce775
Add a test case with lots of whitespace
camelid Jan 13, 2021
d7307a7
Always show suggestions in their own subwindows
camelid Jan 13, 2021
c3f7429
Use better ICE message when no MIR is available
camelid Jan 13, 2021
7e83fec
remove unstable deprecated Vec::remove_item
KodrAus Jan 13, 2021
6bfd987
Update books
ehuss Jan 13, 2021
e8c8793
Include `..` suggestion if fields are all wildcards
camelid Jan 13, 2021
d65cb6e
deprecate atomic::spin_loop_hint in favour of hint::spin_loop
KodrAus Jan 13, 2021
697b20f
Fixed incorrect doc comment
trevarj Jan 13, 2021
52adfdd
Use Option::map_or instead of `.map(..).unwrap_or(..)`
LingMan Jan 11, 2021
64c1b0d
Fix -Cpasses=list and llvm version print with -vV
bjorn3 Jan 13, 2021
5b1316f
unix ExitStatus: Do not treat WIFSTOPPED as WIFSIGNALED
ijackson Dec 12, 2020
12d62aa
unix ExitStatus: Clarify docs for .signal()
ijackson Dec 12, 2020
530270f
unix ExitStatus: Provide .into_raw()
ijackson Dec 12, 2020
3f05051
unix ExitStatus: Provide .core_dumped
ijackson Dec 12, 2020
f060b9e
unix ExitStatus: Provide .stopped_signal()
ijackson Dec 12, 2020
42ea8f6
unix ExitStatus: Provide .continued()
ijackson Dec 12, 2020
29c851a
Replace `Ie` with `In other words`
ijackson Dec 13, 2020
06a405c
Replace `Ie` with `In other words`
ijackson Dec 13, 2020
fa68567
unix ExitStatus: Add tracking issue to new methods
ijackson Jan 4, 2021
7012194
ExitStatusExt unix: Retrospectively seal this trait
ijackson Jan 4, 2021
f3e7199
ExitStatusExt windows: Retrospectively seal this trait
ijackson Jan 4, 2021
efddf59
Fix typo saeled -> sealed
dtolnay Jan 11, 2021
05a88aa
ExitStatusExt: Fix build on Fuchsia
ijackson Jan 13, 2021
b59fa3d
Fix stabilisation version of slice_strip
ijackson Jan 13, 2021
9528988
Add doc intralinks
lukaslueg Jan 13, 2021
0342fd1
Remove the unused context from CreateDebugLocation
cuviper Jan 13, 2021
391b4cc
Fix formatting specifiers doc link
calebsander Jan 13, 2021
9b2f085
Improve Iterator::intersperse_ docs
lukaslueg Jan 13, 2021
eb72dc5
Add as_ref and as_mut methods for Bound
glittershark Dec 28, 2020
a8d0161
Fix typos in Fuchsia unix_process_wait_more
dtolnay Jan 14, 2021
05f5db4
Rollup merge of #79689 - Vooblin:patch1, r=tmandry
m-ou-se Jan 14, 2021
aacb26d
Rollup merge of #79982 - ijackson:exit-status, r=dtolnay
m-ou-se Jan 14, 2021
b07415c
Rollup merge of #80017 - camelid:sugg-rest-pattern, r=estebank
m-ou-se Jan 14, 2021
473c292
Rollup merge of #80169 - frewsxcv:frewsxcv-docs-fix, r=jyn514
m-ou-se Jan 14, 2021
35833c2
Rollup merge of #80217 - camelid:io-read_to_string, r=m-ou-se
m-ou-se Jan 14, 2021
4ac831b
Rollup merge of #80444 - glittershark:bound-as-ref, r=dtolnay
m-ou-se Jan 14, 2021
7c4d34f
Rollup merge of #80567 - lukaslueg:intersperse_with, r=m-ou-se
m-ou-se Jan 14, 2021
4913b50
Rollup merge of #80829 - jyn514:dep-constructor, r=michaelwoerister
m-ou-se Jan 14, 2021
09276b0
Rollup merge of #80895 - sfackler:read-to-end-ub, r=m-ou-se
m-ou-se Jan 14, 2021
c0c379a
Rollup merge of #80944 - LingMan:map_or, r=nagisa
m-ou-se Jan 14, 2021
de47f47
Rollup merge of #80966 - KodrAus:deprecate/spin_loop_hint, r=m-ou-se
m-ou-se Jan 14, 2021
b480d2b
Rollup merge of #80969 - camelid:monomorph-ice-msg, r=nagisa
m-ou-se Jan 14, 2021
b18bbf5
Rollup merge of #80972 - KodrAus:deprecate/remove_item, r=nagisa
m-ou-se Jan 14, 2021
4e5eb81
Rollup merge of #80973 - ehuss:update-books, r=ehuss
m-ou-se Jan 14, 2021
e4f75cc
Rollup merge of #80980 - trevarj:patch-1, r=nagisa
m-ou-se Jan 14, 2021
459b274
Rollup merge of #80981 - bjorn3:bjorn3-patch-1, r=jonas-schievink
m-ou-se Jan 14, 2021
4dc3a44
Rollup merge of #80985 - ijackson:slice-strip-fix, r=jyn514
m-ou-se Jan 14, 2021
896757f
Rollup merge of #80990 - cuviper:unused-debug-context, r=nagisa
m-ou-se Jan 14, 2021
ce19d93
Rollup merge of #80991 - calebsander:fix/fmt-link, r=m-ou-se
m-ou-se Jan 14, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Pluralize 'parenthesis' correctly
It's 'parentheses', not 'parenthesis', when you have more than one.
  • Loading branch information
camelid committed Jan 13, 2021
commit a5e8e6ec2df58bd50963af57bbd08d0526f119db
10 changes: 5 additions & 5 deletions compiler/rustc_typeck/src/check/pat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1002,7 +1002,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
// More generally, the expected type wants a tuple variant with one field of an
// N-arity-tuple, e.g., `V_i((p_0, .., p_N))`. Meanwhile, the user supplied a pattern
// with the subpatterns directly in the tuple variant pattern, e.g., `V_i(p_0, .., p_N)`.
let missing_parenthesis = match (&expected.kind(), fields, had_err) {
let missing_parentheses = match (&expected.kind(), fields, had_err) {
// #67037: only do this if we could successfully type-check the expected type against
// the tuple struct pattern. Otherwise the substs could get out of range on e.g.,
// `let P() = U;` where `P != U` with `struct P<T>(T);`.
Expand All @@ -1015,13 +1015,13 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
}
_ => false,
};
if missing_parenthesis {
if missing_parentheses {
let (left, right) = match subpats {
// This is the zero case; we aim to get the "hi" part of the `QPath`'s
// span as the "lo" and then the "hi" part of the pattern's span as the "hi".
// This looks like:
//
// help: missing parenthesis
// help: missing parentheses
// |
// L | let A(()) = A(());
// | ^ ^
Expand All @@ -1030,14 +1030,14 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
// last sub-pattern. In the case of `A(x)` the first and last may coincide.
// This looks like:
//
// help: missing parenthesis
// help: missing parentheses
// |
// L | let A((x, y)) = A((1, 2));
// | ^ ^
[first, ..] => (first.span.shrink_to_lo(), subpats.last().unwrap().span),
};
err.multipart_suggestion(
"missing parenthesis",
"missing parentheses",
vec![(left, "(".to_string()), (right.shrink_to_hi(), ")".to_string())],
Applicability::MachineApplicable,
);
Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/error-codes/E0023.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ LL | Orange((String, String)),
LL | Fruit::Orange(a, b) => {},
| ^^^^^^^^^^^^^^^^^^^ expected 1 field, found 2
|
help: missing parenthesis
help: missing parentheses
|
LL | Fruit::Orange((a, b)) => {},
| ^ ^
Expand All @@ -57,7 +57,7 @@ LL | Banana(()),
LL | Fruit::Banana() => {},
| ^^^^^^^^^^^^^^^ expected 1 field, found 0
|
help: missing parenthesis
help: missing parentheses
|
LL | Fruit::Banana(()) => {},
| ^ ^
Expand Down
0