Commit Graph

165419 Commits

Author SHA1 Message Date
Santiago Pastorino
64df2ee1eb
impl_header -> impl_subject 2022-03-22 10:35:17 -03:00
b-naber
8ff1edbe5e fix previous failures and address review 2022-03-22 11:35:59 +01:00
bors
3ea44938e2 Auto merge of #95107 - r00ster91:fmt, r=joshtriplett
Improve formatting in macro

CC `@dtolnay`
2022-03-22 08:47:16 +00:00
Takayuki Maeda
62ded071d5 cancel a not emitted error after parsing const generic args 2022-03-22 16:06:56 +09:00
bors
b9c4067417 Auto merge of #95158 - sunfishcode:sunfishcode/windows-8, r=joshtriplett
Preserve the Windows `GetLastError` error in `HandleOrInvalid`.

In the `TryFrom<HandleOrInvalid> for OwnedHandle` and
`TryFrom<HandleOrNull> for OwnedHandle` implemenations, `forget` the
owned handle on the error path, to avoid calling `CloseHandle` on an
invalid handle. It's harmless, except that it may overwrite the
thread's `GetLastError` error.

r? `@joshtriplett`
2022-03-22 05:48:49 +00:00
Frank King
f28d8b13df suggest constraining param for unary ops when missing trait impl 2022-03-22 12:17:30 +08:00
bors
2d15732f6e Auto merge of #95127 - notriddle:notriddle/option-content-move-from-tuple-match, r=estebank
diagnostics: do not give Option::as_ref suggestion for complex match

Fixes #82528
2022-03-22 03:08:01 +00:00
ltdk
d5803678c1 Add u16::is_utf16_surrogate 2022-03-21 22:51:32 -04:00
Ralf Jung
b92a60586a rename LocalState::Uninitialized to Unallocated 2022-03-21 22:48:11 -04:00
bors
cf8531064e Auto merge of #95161 - JakobDegen:fix-early-otherwise-branch, r=wesleywiser
Disable almost certainly unsound early otherwise branch MIR opt

Originally thought this was just an MIR semantics issue, but it's not.

r? rust-lang/mir-opt
2022-03-22 00:26:06 +00:00
Nicholas Nethercote
f8f1d3f00b Split TokenCursor::{next,next_desugared} into inlined and non-inlined halves. 2022-03-22 11:05:54 +11:00
Nicholas Nethercote
4e700a023c Split Parser::bump_with into inlined and non-inlined halves.
The call site within `Parser::bump` is hot.

Also add an inline annotation to `Parser::next_tok`. It was already
being inlined by the compiler; this just makes sure that continues.
2022-03-22 11:01:53 +11:00
The 8472
7549cfa599 rename internal helper trait AsIntoIter to AsVecIntoIter 2022-03-22 00:02:54 +01:00
Caio
74e7313e0e Fix generated tokens hygiene 2022-03-21 19:45:55 -03:00
The8472
a1a602adde add module-level documentation for vec's in-place iteration 2022-03-21 22:29:38 +01:00
The8472
79b43b35be move AsIntoIter helper trait and mark it as unsafe 2022-03-21 22:29:38 +01:00
The8472
47a7a07a8b rename module to better reflect its purpose 2022-03-21 22:29:38 +01:00
bors
f07ee8a998 Auto merge of #8232 - Jarcho:match_same_arm_860, r=xFrednet
`match_same_arms` fix

fixes #860
fixes #1140

changelog: Don't lint `match_same_arms` when an interposing arm's pattern would overlap
2022-03-21 20:42:51 +00:00
bors
4a07662d94 Auto merge of #8561 - FoseFx:use_unwrap_or, r=xFrednet
add `or_then_unwrap`

Closes #8557

changelog: New lint [`or_then_unwrap`]
2022-03-21 20:08:29 +00:00
bors
ff0a3687d8 Auto merge of #8520 - J-ZhengLi:issue8506, r=xFrednet
fix suggestion on `[map_flatten]` being cropped causing possible information loss

fixes #8506

Multi-line suggestion given by the lint is missing its bottom part, which could potentially contains useful information about the fix.

---

changelog: [`map_flatten`]: Long suggestions will now be splitup into two help messages
2022-03-21 19:51:56 +00:00
bors
3c17c84a38 Auto merge of #95180 - matthiaskrgr:rollup-ai1ch2s, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - #95074 (Refactor: use `format-args-capture` and remove unnecessary nested if blocks in some parts of `rust_passes`)
 - #95085 (Return err instead of ICE)
 - #95116 (Add needs-* directives to many tests)
 - #95129 (Remove animation on source sidebar)
 - #95166 (Update the unstable book with the new `values()` form of check-cfg)
 - #95175 (move `adt_const_params`  to its own tracking issue)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-03-21 19:23:00 +00:00
Matthias Krüger
44200a91ba
Rollup merge of #95175 - lcnr:adt_const_params-tracking-issue, r=Dylan-DPC
move `adt_const_params`  to its own tracking issue

the new tracking issue is  #95174

r? ``@rust-lang/project-const-generics``
2022-03-21 19:48:35 +01:00
Matthias Krüger
aa9077e0c9
Rollup merge of #95166 - Urgau:check-cfg-values-unstable-book, r=petrochenkov
Update the unstable book with the new `values()` form of check-cfg

Forgot to update the unstable book in https://github.com/rust-lang/rust/pull/94362

r? ``@petrochenkov``
2022-03-21 19:48:34 +01:00
Matthias Krüger
7154fa5193
Rollup merge of #95129 - GuillaumeGomez:rm-source-sidebar-animation, r=jsha
Remove animation on source sidebar

Fixes https://github.com/rust-lang/rust/issues/95043.

Didn't upload a demo considering how simple it is to test in a browser. :)

r? ``@jsha``
2022-03-21 19:48:33 +01:00
Matthias Krüger
08995e11f5
Rollup merge of #95116 - bjorn3:cg_clif_test_fixes, r=Dylan-DPC
Add needs-* directives to many tests

These are necessary to ignore tests that need features unsupported by cg_clif.
2022-03-21 19:48:32 +01:00
Matthias Krüger
e41e510c7f
Rollup merge of #95085 - ouz-a:master5, r=jackh726
Return err instead of ICE

Having `escaping_bound_vars` results in ICE when trying to create `ty::Binder::dummy`, to avoid it we return err like the line above. I think this requires a more sophisticated fix, I would love to investigate if mentorship is available 🤓

Fixes #95023 and #85350
2022-03-21 19:48:31 +01:00
Matthias Krüger
e3557e244e
Rollup merge of #95074 - TaKO8Ki:use-format-args-capture-and-remove-unnecessary-nesting-in-rustc-passes, r=lcnr
Refactor: use `format-args-capture` and remove unnecessary nested if blocks in some parts of `rust_passes`
2022-03-21 19:48:30 +01:00
Camille GILLOT
c544f108fd Deduplicate ui-fulldeps. 2022-03-21 19:43:53 +01:00
bjorn3
c542cd7740 Add needs-asm-support directive to tests where necessary 2022-03-21 18:48:24 +01:00
b-naber
6cf3409e16 add/update tests 2022-03-21 18:47:38 +01:00
b-naber
3b9de6b087 dont try to unify unevaluated constants that contain infer vars 2022-03-21 18:47:38 +01:00
b-naber
ac0458a597 stall on on constants that contain infer vars in const_eval_resolve 2022-03-21 18:47:37 +01:00
b-naber
47f78a2487 try to evaluate in try_unify 2022-03-21 18:47:23 +01:00
ouz-a
be566f1185 Return err instead of ICE 2022-03-21 19:56:23 +03:00
lcnr
e8890aad62 move adt_const_params to its own tracking issue 2022-03-21 16:33:42 +01:00
bors
44628f7273 Auto merge of #95169 - Smittyvb:union-test-ub, r=bjorn3
Don't run UB in test suite

This splits `ui/unsafe/union.rs` to make it so only the non-UB parts are run. It also means we can do more testing of the location of error messages (which are a bit different with the THIR unsafety checker). `union-modification.rs` has no UB (according to Miri), and `union.rs` has errors (but would have UB if not for those errors).

Closes #95075.
r? `@bjorn3`
2022-03-21 15:17:08 +00:00
Takayuki Maeda
726206696e use format-args-capture and remove unnecessary nested if blocks in some parts of rustc_passes
break before the `&&`

Update compiler/rustc_passes/src/check_const.rs

Co-authored-by: bjorn3 <bjorn3@users.noreply.github.com>
2022-03-22 00:02:18 +09:00
Mara Bos
ac6996345d Move pthread locks to own module. 2022-03-21 15:51:25 +01:00
Smitty
9477febc49 Don't run UB in test suite
This splits ui/unsafe/union.rs to make it so only the non-UB parts are
run. It also means we can do more testing of the location of error
messages.
2022-03-21 09:32:26 -04:00
Loïc BRANSTETT
c6c14a040d Update unstable book with the new values() form for check-cfg 2022-03-21 12:59:46 +01:00
Maximilian Köhl
1c523ba772 add tests for 🔒 2022-03-21 11:40:25 +01:00
Maximilian Köhl
4df867c4a3 fix: add a space only in front of 🔒 2022-03-21 11:25:05 +01:00
Maximilian Köhl
03ddfa3087 move the 🔒 after the name 2022-03-21 11:03:02 +01:00
J-ZhengLi
5b6295d663 allowing [map_flatten] to split long suggestions
add new function `span_lint_and_sugg_` for edges in `clippy_utils::diagnostics`
2022-03-21 14:11:22 +08:00
Deadbeef
fe5b81348f
Tidy up 2022-03-21 17:07:09 +11:00
Deadbeef
1f3ee7f32e
Rename ~const Drop to ~const Destruct 2022-03-21 17:04:03 +11:00
Deadbeef
4df2a28aee
Add Destructible for replacing ~const Drop 2022-03-21 17:04:02 +11:00
Jakob Degen
a2f3a17362 Disable early otherwise branch MIR opt 2022-03-20 23:25:59 -04:00
bors
051d1176b7 Auto merge of #95104 - compiler-errors:remove-ascription, r=davidtwco
suggest removing type ascription in bad parsing position

Not sure how to test this with the non-nightly suggestion. Didn't add a new UI test because it already manifests in an existing UI test.

Fixes #95014
2022-03-21 02:29:55 +00:00
bors
eded76b6f1 Auto merge of #95156 - audunhalland:fix-rustc_const_eval_transform-comments, r=Dylan-DPC
fix two comments referring to moved code (now rustc_mir_transform::generator)

This caused me some confusion when trying to find the related code.
2022-03-21 00:14:29 +00:00