8000 Rollup of 10 pull requests by matthiaskrgr · Pull Request #105525 · rust-lang/rust · GitHub
[go: up one dir, main page]

Skip to content

Rollup of 10 pull requests #105525

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

Merged
merged 29 commits into from
Dec 10, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
9678cec
std: rewrite SGX thread parker
joboet Jun 22, 2022
633d46d
std: reimplement SGX thread joining to use `Parker`
joboet Jun 22, 2022
a40d300
std: clarify semantics of SGX parker
joboet Sep 5, 2022
ac67262
Set `download-ci-llvm = "if-available"` by default when `channel = "d…
jyn514 Nov 17, 2022
7700595
Implement masking in FileType comparison on Unix
krtab Nov 25, 2022
6259028
Add test for regression for FileType equality
krtab Nov 30, 2022
4198d29
Implement masking in FileType hashing on Unix
krtab Dec 6, 2022
b45b948
Compute generator sizes with -Zprint_type_sizes
compiler-errors Nov 5, 2022
b0dcadf
Move closure/generator type info methods to TyCtxt
compiler-errors Dec 7, 2022
57b7226
Properly print generator interior type sizes
compiler-errors Dec 7, 2022
7d23e29
Pull out logic into distinct functions
compiler-errors Dec 7, 2022
ecf8127
Fix Async Generator ABI
Swatinem Nov 29, 2022
65698ae
Add LLVM KCFI support to the Rust compiler
rcvalle Nov 22, 2022
e1741ba
Add documentation for LLVM KCFI support
rcvalle Dec 1, 2022
24cd863
Replace hand-made masking by call to masked() method in FileType
krtab Dec 9, 2022
84a4635
Don't warn about unused parens when they are used by yeet expr
WaffleLapkin Dec 9, 2022
b9da55a
Introduce `Span::is_visible`
estebank Dec 9, 2022
ac90c9b
Update cargo
weihanglo Dec 10, 2022
f069e71
Correct wrong note for short circuiting operators
est31 Dec 10, 2022
ae8794c
Rollup merge of #98391 - joboet:sgx_parker, r=m-ou-se
matthiaskrgr Dec 10, 2022
0f5d3ba
Rollup merge of #104019 - compiler-errors:print-generator-sizes, r=we…
matthiaskrgr Dec 10, 2022
1ce18d2
Rollup merge of #104512 - jyn514:download-ci-llvm-default, r=Mark-Sim…
matthiaskrgr Dec 10, 2022
eb1159c
Rollup merge of #104901 - krtab:filetype_compare, r=the8472
matthiaskrgr Dec 10, 2022
020d7af
Rollup merge of #105082 - Swatinem:async-abi, r=compiler-errors
matthiaskrgr Dec 10, 2022
947fe7e
Rollup merge of #105109 - rcvalle:rust-kcfi, r=bjorn3
matthiaskrgr Dec 10, 2022
9e87dd9
Rollup merge of #105505 - WaffleLapkin:yeet_unused_parens_lint, r=fee…
matthiaskrgr Dec 10, 2022
cf84006
Rollup merge of #105514 - estebank:is_visible, r=oli-obk
matthiaskrgr Dec 10, 2022
6d7e3df
Rollup merge of #105516 - weihanglo:update-cargo, r=weihanglo
matthiaskrgr Dec 10, 2022
f6c2add
Rollup merge of #105522 - est31:remove_or_and_note, r=scottmcm
matthiaskrgr Dec 10, 2022
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
8000
Diff view
Prev Previous commit
Next Next commit
Don't warn about unused parens when they are used by yeet expr
  • Loading branch information
WaffleLapkin committed Dec 9, 2022
commit 84a46352ac541d93efaf142c163ebcf4c9a8b1fd
5 changes: 4 additions & 1 deletion compiler/rustc_lint/src/unused.rs
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,10 @@ trait UnusedDelimLint {
lhs_needs_parens
|| (followed_by_block
&& match &inner.kind {
ExprKind::Ret(_) | ExprKind::Break(..) | ExprKind::Yield(..) => true,
ExprKind::Ret(_)
| ExprKind::Break(..)
| ExprKind::Yield(..)
| ExprKind::Yeet(..) => true,
ExprKind::Range(_lhs, Some(rhs), _limits) => {
matches!(rhs.kind, ExprKind::Block(..))
}
Expand Down
9 changes: 8 additions & 1 deletion src/test/ui/lint/unused/issue-54538-unused-parens-lint.fixed
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// run-rustfix

#![feature(box_patterns, stmt_expr_attributes)]
#![feature(box_patterns, stmt_expr_attributes, yeet_expr)]

#![allow(
dead_code,
Expand All @@ -25,6 +25,13 @@ fn _no_lint_attr() {
let _x = #[allow(dead_code)] (1 + 2);
}

fn _no_lint_yeet() -> Result<(), ()> {
#[allow(unreachable_code)]
if (do yeet) {}

Ok(())
}

// Don't lint in these cases (#64106).
fn or_patterns_no_lint() {
match Box::new(0) {
Expand Down
9 changes: 8 additions & 1 deletion src/test/ui/lint/unused/issue-54538-unused-parens-lint.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// run-rustfix

#![feature(box_patterns, stmt_expr_attributes)]
#![feature(box_patterns, stmt_expr_attributes, yeet_expr)]

#![allow(
dead_code,
Expand All @@ -25,6 +25,13 @@ fn _no_lint_attr() {
let _x = #[allow(dead_code)] (1 + 2);
}

fn _no_lint_yeet() -> Result<(), ()> {
#[allow(unreachable_code)]
if (do yeet) {}

Ok(())
}

// Don't lint in these cases (#64106).
fn or_patterns_no_lint() {
match Box::new(0) {
Expand Down
36 changes: 18 additions & 18 deletions src/test/ui/lint/unused/issue-54538-unused-parens-lint.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ LL + let _ = |a: u8| 0;
|

error: unnecessary parentheses around pattern
--> $DIR/issue-54538-unused-parens-lint.rs:49:12
--> $DIR/issue-54538-unused-parens-lint.rs:56:12
|
LL | if let (0 | 1) = 0 {}
| ^ ^
Expand All @@ -88,7 +88,7 @@ LL + if let 0 | 1 = 0 {}
|

error: unnecessary parentheses around pattern
--> $DIR/issue-54538-unused-parens-lint.rs:50:13
--> $DIR/issue-54538-unused-parens-lint.rs:57:13
|
LL | if let ((0 | 1),) = (0,) {}
| ^ ^
Expand All @@ -100,7 +100,7 @@ LL + if let (0 | 1,) = (0,) {}
|

error: unnecessary parentheses around pattern
--> $DIR/issue-54538-unused-parens-lint.rs:51:13
--> $DIR/issue-54538-unused-parens-lint.rs:58:13
|
LL | if let [(0 | 1)] = [0] {}
| ^ ^
Expand All @@ -112,7 +112,7 @@ LL + if let [0 | 1] = [0] {}
|

error: unnecessary parentheses around pattern
--> $DIR/issue-54538-unused-parens-lint.rs:52:16
--> $DIR/issue-54538-unused-parens-lint.rs:59:16
|
LL | if let 0 | (1 | 2) = 0 {}
| ^ ^
Expand All @@ -124,7 +124,7 @@ LL + if let 0 | 1 | 2 = 0 {}
|

error: unnecessary parentheses around pattern
--> $DIR/issue-54538-unused-parens-lint.rs:54:15
--> $DIR/issue-54538-unused-parens-lint.rs:61:15
|
LL | if let TS((0 | 1)) = TS(0) {}
| ^ ^
Expand All @@ -136,7 +136,7 @@ LL + if let TS(0 | 1) = TS(0) {}
|

error: unnecessary parentheses around pattern
--> $DIR/issue-54538-unused-parens-lint.rs:56:20
--> $DIR/issue-54538-unused-parens-lint.rs:63:20
|
LL | if let NS { f: (0 | 1) } = (NS { f: 0 }) {}
| ^ ^
Expand All @@ -148,7 +148,7 @@ LL + if let NS { f: 0 | 1 } = (NS { f: 0 }) {}
|

error: unnecessary parentheses around pattern
--> $DIR/issue-54538-unused-parens-lint.rs:66:9
--> $DIR/issue-54538-unused-parens-lint.rs:73:9
|
LL | (_) => {}
| ^ ^
Expand All @@ -160,7 +160,7 @@ LL + _ => {}
|

error: unnecessary parentheses around pattern
--> $DIR/issue-54538-unused-parens-lint.rs:67:9
--> $DIR/issue-54538-unused-parens-lint.rs:74:9
|
LL | (y) => {}
| ^ ^
Expand All @@ -172,7 +172,7 @@ LL + y => {}
|

error: unnecessary parentheses around pattern
--> $DIR/issue-54538-unused-parens-lint.rs:68:9
--> $DIR/issue-54538-unused-parens-lint.rs:75:9
|
LL | (ref r) => {}
| ^ ^
Expand All @@ -184,7 +184,7 @@ LL + ref r => {}
|

error: unnecessary parentheses around pattern
--> $DIR/issue-54538-unused-parens-lint.rs:69:9
--> $DIR/issue-54538-unused-parens-lint.rs:76:9
|
LL | (e @ 1...2) => {}
| ^ ^
Expand All @@ -196,7 +196,7 @@ LL + e @ 1...2 => {}
|

error: unnecessary parentheses around pattern
--> $DIR/issue-54538-unused-parens-lint.rs:75:9
--> $DIR/issue-54538-unused-parens-lint.rs:82:9
|
LL | (e @ &(1...2)) => {}
| ^ ^
Expand All @@ -208,7 +208,7 @@ LL + e @ &(1...2) => {}
|

error: unnecessary parentheses around pattern
--> $DIR/issue-54538-unused-parens-lint.rs:76:10
--> $DIR/issue-54538-unused-parens-lint.rs:83:10
|
LL | &(_) => {}
| ^ ^
Expand All @@ -220,7 +220,7 @@ LL + &_ => {}
|

error: unnecessary parentheses around pattern
--> $DIR/issue-54538-unused-parens-lint.rs:87:9
--> $DIR/issue-54538-unused-parens-lint.rs:94:9
|
LL | (_) => {}
| ^ ^
Expand All @@ -232,7 +232,7 @@ LL + _ => {}
|

error: unnecessary parentheses around pattern
--> $DIR/issue-54538-unused-parens-lint.rs:88:9
--> $DIR/issue-54538-unused-parens-lint.rs:95:9
|
LL | (y) => {}
| ^ ^
Expand All @@ -244,7 +244,7 @@ LL + y => {}
|

error: unnecessary parentheses around pattern
--> $DIR/issue-54538-unused-parens-lint.rs:89:9
--> $DIR/issue-54538-unused-parens-lint.rs:96:9
|
LL | (ref r) => {}
| ^ ^
Expand All @@ -256,7 +256,7 @@ LL + ref r => {}
|

error: unnecessary parentheses around pattern
--> $DIR/issue-54538-unused-parens-lint.rs:90:9
--> $DIR/issue-54538-unused-parens-lint.rs:97:9
|
LL | (e @ 1..=2) => {}
| ^ ^
Expand All @@ -268,7 +268,7 @@ LL + e @ 1..=2 => {}
|

error: unnecessary parentheses around pattern
--> $DIR/issue-54538-unused-parens-lint.rs:96:9
--> $DIR/issue-54538-unused-parens-lint.rs:103:9
|
LL | (e @ &(1..=2)) => {}
| ^ ^
Expand All @@ -280,7 +280,7 @@ LL + e @ &(1..=2) => {}
|

error: unnecessary parentheses around pattern
--> $DIR/issue-54538-unused-parens-lint.rs:97:10
--> $DIR/issue-54538-unused-parens-lint.rs:104:10
|
LL | &(_) => {}
| ^ ^
Expand Down
0