]> git.lizzy.rs Git - rust.git/log
rust.git
2 years agoModernize `alloc-no-oom-handling` test
Miguel Ojeda [Tue, 22 Mar 2022 20:44:58 +0000 (21:44 +0100)]
Modernize `alloc-no-oom-handling` test

  - The edition should be 2021 to avoid warnings.

  - The `external_crate` feature was removed in commit 45bf1ed1a112
    ("rustc: Allow changing the default allocator").

    Note that commit d620ae10709c ("Auto merge of #84266") removed
    the old test, but the new one introduced passed the `--cfg` like
    in the old one.

Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
2 years agoEliminate `TokenTreeOrTokenTreeSlice`.
Nicholas Nethercote [Sat, 19 Mar 2022 05:20:07 +0000 (16:20 +1100)]
Eliminate `TokenTreeOrTokenTreeSlice`.

As its name suggests, `TokenTreeOrTokenTreeSlice` is either a single
`TokenTree` or a slice of them. It has methods `len` and `get_tt` that
let it be treated much like an ordinary slice. The reason it isn't an
ordinary slice is that for `TokenTree::Delimited` the open and close
delimiters are represented implicitly, and when they are needed they are
constructed on the fly with `Delimited::{open,close}_tt`, rather than
being present in memory.

This commit changes `Delimited` so the open and close delimiters are
represented explicitly. As a result, `TokenTreeOrTokenTreeSlice` is no
longer needed and `MatcherPos` and `MatcherTtFrame` can just use an
ordinary slice. `TokenTree::{len,get_tt}` are also removed, because they
were only needed to support `TokenTreeOrTokenTreeSlice`.

The change makes the code shorter and a little bit faster on benchmarks
that use macro expansion heavily, partly because `MatcherPos` is a lot
smaller (less data to `memcpy`) and partly because ordinary slice
operations are faster than `TokenTreeOrTokenTreeSlice::{len,get_tt}`.

2 years agoAuto merge of #95215 - Dylan-DPC:rollup-l9f9t7l, r=Dylan-DPC
bors [Tue, 22 Mar 2022 19:06:04 +0000 (19:06 +0000)]
Auto merge of #95215 - Dylan-DPC:rollup-l9f9t7l, r=Dylan-DPC

Rollup of 5 pull requests

Successful merges:

 - #95188 ([`macro-metavar-expr`] Fix generated tokens hygiene)
 - #95196 (rename LocalState::Uninitialized to Unallocated)
 - #95197 (Suggest constraining param for unary ops when missing trait impl)
 - #95200 (Cancel a not emitted error after parsing const generic args)
 - #95207 (update Termination trait docs)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

2 years agoRollup merge of #95207 - ZHANGWENTAI:update_termination_doc, r=yaahc
Dylan DPC [Tue, 22 Mar 2022 18:07:37 +0000 (19:07 +0100)]
Rollup merge of #95207 - ZHANGWENTAI:update_termination_doc, r=yaahc

update Termination trait docs

this pr add some statement about intending to provide `Termination` trait only on standard library's runtime.

from #93448

r? `@Lokathor`

2 years agoRollup merge of #95200 - TaKO8Ki:cancel-not-emitted-error-when-parsing-generic-arg...
Dylan DPC [Tue, 22 Mar 2022 18:07:36 +0000 (19:07 +0100)]
Rollup merge of #95200 - TaKO8Ki:cancel-not-emitted-error-when-parsing-generic-arg, r=oli-obk

Cancel a not emitted error after parsing const generic args

closes #95163

2 years agoRollup merge of #95197 - frank-king:feat/unary_op_type_constrain, r=petrochenkov
Dylan DPC [Tue, 22 Mar 2022 18:07:35 +0000 (19:07 +0100)]
Rollup merge of #95197 - frank-king:feat/unary_op_type_constrain, r=petrochenkov

Suggest constraining param for unary ops when missing trait impl

This PR adds a suggestion of constraining param for unary ops `-` and `!` when the corresponding trait implementation
is missing.

Fixs #94543.

BTW, this is my first time to touch rustc, please correct me if I did anything wrong.

2 years agoRollup merge of #95196 - RalfJung:unalloc-not-uninit, r=oli-obk
Dylan DPC [Tue, 22 Mar 2022 18:07:34 +0000 (19:07 +0100)]
Rollup merge of #95196 - RalfJung:unalloc-not-uninit, r=oli-obk

rename LocalState::Uninitialized to Unallocated

This is to avoid confusion with `Uninit` as in `ScalarMaybeUninit`, which is very different.

r? `@oli-obk`

2 years agoRollup merge of #95188 - c410-f3r:aqui-vamos-nos, r=petrochenkov
Dylan DPC [Tue, 22 Mar 2022 18:07:33 +0000 (19:07 +0100)]
Rollup merge of #95188 - c410-f3r:aqui-vamos-nos, r=petrochenkov

[`macro-metavar-expr`] Fix generated tokens hygiene

Only uses `Marker` on generated tokens -> https://github.com/rust-lang/rust/issues/83527#issuecomment-1074439425)

I really don't know how to test this PR

r? `@petrochenkov`

2 years agoadd perf side effect docs to `Iterator::cloned()`
Andre Bogus [Sun, 16 Jan 2022 00:33:19 +0000 (01:33 +0100)]
add perf side effect docs to `Iterator::cloned()`

2 years agoMove std::sys::{mutex, condvar, rwlock} to std::sys::locks.
Mara Bos [Mon, 21 Mar 2022 14:45:51 +0000 (15:45 +0100)]
Move std::sys::{mutex, condvar, rwlock} to std::sys::locks.

2 years agoreplace `this.clone()` with `this.create_snapshot_for_diagnostic()`
Takayuki Maeda [Tue, 22 Mar 2022 16:26:34 +0000 (01:26 +0900)]
replace `this.clone()` with `this.create_snapshot_for_diagnostic()`

2 years agoAuto merge of #94693 - nnethercote:parser-inlining, r=petrochenkov
bors [Tue, 22 Mar 2022 16:24:50 +0000 (16:24 +0000)]
Auto merge of #94693 - nnethercote:parser-inlining, r=petrochenkov

Inline some parser functions

Some crates that do a lot of complex declarative macro expansion spend a lot of time parsing (and reparsing) tokens. These commits inline some functions for some minor speed wins.

r? `@ghost`

2 years agoadd some fix
ZHANGWENTAI [Tue, 22 Mar 2022 15:33:08 +0000 (23:33 +0800)]
add some fix

Signed-off-by: ZHANGWENTAI <2092913428@qq.com>
2 years agoerase region in ParamEnvAnd and make ConstUnifyCtxt private
b-naber [Tue, 22 Mar 2022 15:13:28 +0000 (16:13 +0100)]
erase region in ParamEnvAnd and make ConstUnifyCtxt private

2 years agofix the lint problem
ZHANGWENTAI [Tue, 22 Mar 2022 15:10:00 +0000 (23:10 +0800)]
fix the lint problem

Signed-off-by: ZHANGWENTAI <2092913428@qq.com>
2 years agoupdate Termination trait docs
ZHANGWENTAI [Tue, 22 Mar 2022 14:37:17 +0000 (22:37 +0800)]
update Termination trait docs

2 years agodont canonicalize in try_unify_abstract_consts and erase regions instead
b-naber [Tue, 22 Mar 2022 14:27:20 +0000 (15:27 +0100)]
dont canonicalize in try_unify_abstract_consts and erase regions instead

2 years agoimpl_header -> impl_subject
Santiago Pastorino [Tue, 22 Mar 2022 13:35:17 +0000 (10:35 -0300)]
impl_header -> impl_subject

2 years agofix previous failures and address review
b-naber [Tue, 22 Mar 2022 09:38:46 +0000 (10:38 +0100)]
fix previous failures and address review

2 years agoAuto merge of #95107 - r00ster91:fmt, r=joshtriplett
bors [Tue, 22 Mar 2022 08:47:16 +0000 (08:47 +0000)]
Auto merge of #95107 - r00ster91:fmt, r=joshtriplett

Improve formatting in macro

CC `@dtolnay`

2 years agocancel a not emitted error after parsing const generic args
Takayuki Maeda [Tue, 22 Mar 2022 07:06:56 +0000 (16:06 +0900)]
cancel a not emitted error after parsing const generic args

2 years agoAuto merge of #95158 - sunfishcode:sunfishcode/windows-8, r=joshtriplett
bors [Tue, 22 Mar 2022 05:48:49 +0000 (05:48 +0000)]
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`

2 years agosuggest constraining param for unary ops when missing trait impl
Frank King [Tue, 22 Mar 2022 04:17:30 +0000 (12:17 +0800)]
suggest constraining param for unary ops when missing trait impl

2 years agoAuto merge of #95127 - notriddle:notriddle/option-content-move-from-tuple-match,...
bors [Tue, 22 Mar 2022 03:08:01 +0000 (03:08 +0000)]
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

2 years agoAdd u16::is_utf16_surrogate
ltdk [Mon, 7 Mar 2022 21:36:13 +0000 (16:36 -0500)]
Add u16::is_utf16_surrogate

2 years agorename LocalState::Uninitialized to Unallocated
Ralf Jung [Tue, 22 Mar 2022 02:33:23 +0000 (22:33 -0400)]
rename LocalState::Uninitialized to Unallocated

2 years agoAuto merge of #95161 - JakobDegen:fix-early-otherwise-branch, r=wesleywiser
bors [Tue, 22 Mar 2022 00:26:06 +0000 (00:26 +0000)]
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

2 years agoSplit `TokenCursor::{next,next_desugared}` into inlined and non-inlined halves.
Nicholas Nethercote [Mon, 7 Mar 2022 04:55:39 +0000 (15:55 +1100)]
Split `TokenCursor::{next,next_desugared}` into inlined and non-inlined halves.

2 years agoSplit `Parser::bump_with` into inlined and non-inlined halves.
Nicholas Nethercote [Mon, 7 Mar 2022 04:17:38 +0000 (15:17 +1100)]
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.

2 years agorename internal helper trait AsIntoIter to AsVecIntoIter
The 8472 [Mon, 21 Mar 2022 23:02:54 +0000 (00:02 +0100)]
rename internal helper trait AsIntoIter to AsVecIntoIter

2 years agoFix generated tokens hygiene
Caio [Mon, 21 Mar 2022 22:45:55 +0000 (19:45 -0300)]
Fix generated tokens hygiene

2 years agoadd module-level documentation for vec's in-place iteration
The8472 [Sat, 31 Jul 2021 15:39:35 +0000 (17:39 +0200)]
add module-level documentation for vec's in-place iteration

2 years agomove AsIntoIter helper trait and mark it as unsafe
The8472 [Tue, 24 Aug 2021 21:54:14 +0000 (23:54 +0200)]
move AsIntoIter helper trait and mark it as unsafe

2 years agorename module to better reflect its purpose
The8472 [Tue, 24 Aug 2021 21:30:05 +0000 (23:30 +0200)]
rename module to better reflect its purpose

2 years agoAuto merge of #8232 - Jarcho:match_same_arm_860, r=xFrednet
bors [Mon, 21 Mar 2022 20:42:51 +0000 (20:42 +0000)]
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

2 years agoAuto merge of #8561 - FoseFx:use_unwrap_or, r=xFrednet
bors [Mon, 21 Mar 2022 20:08:29 +0000 (20:08 +0000)]
Auto merge of #8561 - FoseFx:use_unwrap_or, r=xFrednet

add `or_then_unwrap`

Closes #8557

changelog: New lint [`or_then_unwrap`]

2 years agoAuto merge of #8520 - J-ZhengLi:issue8506, r=xFrednet
bors [Mon, 21 Mar 2022 19:51:56 +0000 (19:51 +0000)]
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

2 years agoAuto merge of #95180 - matthiaskrgr:rollup-ai1ch2s, r=matthiaskrgr
bors [Mon, 21 Mar 2022 19:23:00 +0000 (19:23 +0000)]
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

2 years agoRollup merge of #95175 - lcnr:adt_const_params-tracking-issue, r=Dylan-DPC
Matthias Krüger [Mon, 21 Mar 2022 18:48:35 +0000 (19:48 +0100)]
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``

2 years agoRollup merge of #95166 - Urgau:check-cfg-values-unstable-book, r=petrochenkov
Matthias Krüger [Mon, 21 Mar 2022 18:48:34 +0000 (19:48 +0100)]
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``

2 years agoRollup merge of #95129 - GuillaumeGomez:rm-source-sidebar-animation, r=jsha
Matthias Krüger [Mon, 21 Mar 2022 18:48:33 +0000 (19:48 +0100)]
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``

2 years agoRollup merge of #95116 - bjorn3:cg_clif_test_fixes, r=Dylan-DPC
Matthias Krüger [Mon, 21 Mar 2022 18:48:32 +0000 (19:48 +0100)]
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.

2 years agoRollup merge of #95085 - ouz-a:master5, r=jackh726
Matthias Krüger [Mon, 21 Mar 2022 18:48:31 +0000 (19:48 +0100)]
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

2 years agoRollup merge of #95074 - TaKO8Ki:use-format-args-capture-and-remove-unnecessary-nesti...
Matthias Krüger [Mon, 21 Mar 2022 18:48:30 +0000 (19:48 +0100)]
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`

2 years agoAdd needs-asm-support directive to tests where necessary
bjorn3 [Sat, 19 Mar 2022 15:50:24 +0000 (16:50 +0100)]
Add needs-asm-support directive to tests where necessary

2 years agoadd/update tests
b-naber [Mon, 21 Mar 2022 17:46:20 +0000 (18:46 +0100)]
add/update tests

2 years agodont try to unify unevaluated constants that contain infer vars
b-naber [Mon, 21 Mar 2022 17:26:53 +0000 (18:26 +0100)]
dont try to unify unevaluated constants that contain infer vars

2 years agostall on on constants that contain infer vars in const_eval_resolve
b-naber [Mon, 21 Mar 2022 17:26:02 +0000 (18:26 +0100)]
stall on on constants that contain infer vars in const_eval_resolve

2 years agotry to evaluate in try_unify
b-naber [Thu, 17 Mar 2022 10:44:57 +0000 (11:44 +0100)]
try to evaluate in try_unify

2 years agoReturn err instead of ICE
ouz-a [Fri, 18 Mar 2022 19:04:01 +0000 (22:04 +0300)]
Return err instead of ICE

2 years agomove `adt_const_params` to its own tracking issue
lcnr [Mon, 21 Mar 2022 15:33:15 +0000 (16:33 +0100)]
move `adt_const_params`  to its own tracking issue

2 years agoAuto merge of #95169 - Smittyvb:union-test-ub, r=bjorn3
bors [Mon, 21 Mar 2022 15:17:08 +0000 (15:17 +0000)]
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`

2 years agouse `format-args-capture` and remove unnecessary nested if blocks in some parts of...
Takayuki Maeda [Fri, 18 Mar 2022 13:48:21 +0000 (22:48 +0900)]
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>
2 years agoMove pthread locks to own module.
Mara Bos [Thu, 17 Mar 2022 11:28:31 +0000 (12:28 +0100)]
Move pthread locks to own module.

2 years agoDon't run UB in test suite
Smitty [Mon, 21 Mar 2022 13:32:26 +0000 (09:32 -0400)]
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.

2 years agoUpdate unstable book with the new `values()` form for check-cfg
Loïc BRANSTETT [Mon, 21 Mar 2022 11:59:46 +0000 (12:59 +0100)]
Update unstable book with the new `values()` form for check-cfg

2 years agoallowing [`map_flatten`] to split long suggestions
J-ZhengLi [Mon, 21 Mar 2022 06:11:22 +0000 (14:11 +0800)]
allowing [`map_flatten`] to split long suggestions
add new function `span_lint_and_sugg_` for edges in `clippy_utils::diagnostics`

2 years agoTidy up
Deadbeef [Mon, 21 Mar 2022 06:07:09 +0000 (17:07 +1100)]
Tidy up

2 years agoRename `~const Drop` to `~const Destruct`
Deadbeef [Mon, 21 Mar 2022 05:52:41 +0000 (16:52 +1100)]
Rename `~const Drop` to `~const Destruct`

2 years agoAdd `Destructible` for replacing `~const Drop`
Deadbeef [Sun, 13 Mar 2022 04:04:01 +0000 (15:04 +1100)]
Add `Destructible` for replacing `~const Drop`

2 years agoDisable early otherwise branch MIR opt
Jakob Degen [Mon, 21 Mar 2022 02:43:31 +0000 (22:43 -0400)]
Disable early otherwise branch MIR opt

2 years agoAuto merge of #95104 - compiler-errors:remove-ascription, r=davidtwco
bors [Mon, 21 Mar 2022 02:29:55 +0000 (02:29 +0000)]
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

2 years agoAuto merge of #95156 - audunhalland:fix-rustc_const_eval_transform-comments, r=Dylan-DPC
bors [Mon, 21 Mar 2022 00:14:29 +0000 (00:14 +0000)]
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.

2 years agoMove items into `TtParser` as `Vec`s.
Nicholas Nethercote [Fri, 18 Mar 2022 22:53:41 +0000 (09:53 +1100)]
Move items into `TtParser` as `Vec`s.

By putting them in `TtParser`, we can reuse them for every rule in a
macro. With that done, they can be `SmallVec` instead of `Vec`, and this
is a performance win because these vectors are hot and `SmallVec`
operations are a bit slower due to always needing an "inline or heap?"
check.

2 years agoRemove `MatcherPosHandle`.
Nicholas Nethercote [Fri, 18 Mar 2022 21:56:24 +0000 (08:56 +1100)]
Remove `MatcherPosHandle`.

This type was a small performance win for `html5ever`, which uses a
macro with hundreds of very simple rules that don't contain any
metavariables. But this type is complicated (extra lifetimes) and
perf-neutral for macros that do have metavariables.

This commit removes `MatcherPosHandle`, simplifying things a lot. This
increases the allocation rate for `html5ever` and similar cases a bit,
but makes things easier for follow-up changes that will improve
performance more than what we lost here.

2 years agorefactor: remove need for MethodCall matching
Max Baumann [Sun, 20 Mar 2022 23:04:37 +0000 (00:04 +0100)]
refactor: remove need for MethodCall matching

2 years agoAdd a testcase.
Dan Gohman [Sun, 20 Mar 2022 22:54:03 +0000 (15:54 -0700)]
Add a testcase.

2 years agorefactor: use is_lang_ctor()
Max Baumann [Sun, 20 Mar 2022 22:54:04 +0000 (23:54 +0100)]
refactor: use is_lang_ctor()

2 years agofeat: change error message
Max Baumann [Sun, 20 Mar 2022 22:43:17 +0000 (23:43 +0100)]
feat: change error message

2 years agoPreserve the Windows `GetLastError` error in `HandleOrInvalid`.
Dan Gohman [Sun, 20 Mar 2022 22:37:31 +0000 (15:37 -0700)]
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.

2 years agoAuto merge of #8559 - pickfire:patch-1, r=xFrednet
bors [Sun, 20 Mar 2022 22:32:12 +0000 (22:32 +0000)]
Auto merge of #8559 - pickfire:patch-1, r=xFrednet

Fix typo in bug report

repoduce -> reproduce

---

changelog: none

2 years agofix two comments referring to moved code (rustc_mir_transform::generator)
Audun Halland [Sun, 20 Mar 2022 22:31:04 +0000 (23:31 +0100)]
fix two comments referring to moved code (rustc_mir_transform::generator)

2 years agoAuto merge of #95148 - matthiaskrgr:rollup-jsb1ld9, r=matthiaskrgr
bors [Sun, 20 Mar 2022 21:36:57 +0000 (21:36 +0000)]
Auto merge of #95148 - matthiaskrgr:rollup-jsb1ld9, r=matthiaskrgr

Rollup of 4 pull requests

Successful merges:

 - #95114 (Skip a test if symlink creation is not possible)
 - #95131 (Fix docs for default rmeta filename.)
 - #95135 (Fix a not emitted unmatched angle bracket error)
 - #95145 (Fix typo interator->iterator)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

2 years agoDon't declare test_variadic_fnptr with two conflicting signatures
bjorn3 [Fri, 18 Mar 2022 19:34:27 +0000 (20:34 +0100)]
Don't declare test_variadic_fnptr with two conflicting signatures

It is UB for LLVM and results in a compile error for Cranelift

2 years agoRollup merge of #95145 - ChayimFriedman2:patch-1, r=Dylan-DPC
Matthias Krüger [Sun, 20 Mar 2022 19:42:46 +0000 (20:42 +0100)]
Rollup merge of #95145 - ChayimFriedman2:patch-1, r=Dylan-DPC

Fix typo interator->iterator

2 years agoRollup merge of #95135 - TaKO8Ki:fix-not-emitted-unmatched-angle-bracket-error, r...
Matthias Krüger [Sun, 20 Mar 2022 19:42:45 +0000 (20:42 +0100)]
Rollup merge of #95135 - TaKO8Ki:fix-not-emitted-unmatched-angle-bracket-error, r=Dylan-DPC

Fix a not emitted unmatched angle bracket error

closes #95128

2 years agoRollup merge of #95131 - ehuss:fix-metadata-filename, r=bjorn3
Matthias Krüger [Sun, 20 Mar 2022 19:42:44 +0000 (20:42 +0100)]
Rollup merge of #95131 - ehuss:fix-metadata-filename, r=bjorn3

Fix docs for default rmeta filename.

The docs for the default filename for `--emit=metadata` was wrong, it was missing the `lib` prefix.  The current implementation for that default is [here](https://github.com/rust-lang/rust/blob/f2661cfe341f88bea919daf52a07015dceaf7a6a/compiler/rustc_session/src/output.rs#L140).  Perhaps somewhat confusing, but `lib` is used for all crate types.

cc https://github.com/rust-lang/rust/issues/68839#issuecomment-1073118716

2 years agoRollup merge of #95114 - ChrisDenton:symlink-test, r=the8472
Matthias Krüger [Sun, 20 Mar 2022 19:42:43 +0000 (20:42 +0100)]
Rollup merge of #95114 - ChrisDenton:symlink-test, r=the8472

Skip a test if symlink creation is not possible

If someone running tests on Windows does not have Developer Mode enabled then creating symlinks will fail which in turn would cause this test to fail. This can be a stumbling block for contributors.

2 years agoAuto merge of #95144 - RalfJung:miri, r=RalfJung
bors [Sun, 20 Mar 2022 19:10:06 +0000 (19:10 +0000)]
Auto merge of #95144 - RalfJung:miri, r=RalfJung

update Miri

2 years agoFix typo interator->iterator
Chayim Refael Friedman [Sun, 20 Mar 2022 18:52:22 +0000 (20:52 +0200)]
Fix typo interator->iterator

2 years agoupdate Miri
Ralf Jung [Sun, 20 Mar 2022 18:30:40 +0000 (14:30 -0400)]
update Miri

2 years agoAuto merge of #95142 - bjorn3:sync_cg_clif-2022-03-20, r=bjorn3
bors [Sun, 20 Mar 2022 16:29:16 +0000 (16:29 +0000)]
Auto merge of #95142 - bjorn3:sync_cg_clif-2022-03-20, r=bjorn3

Sync rustc_codegen_cranelift

r? `@ghost`

`@rustbot` label +A-codegen +A-cranelift +T-compiler

2 years agoAdd once_cell as allowed cg_clif dependency
bjorn3 [Sun, 20 Mar 2022 16:01:32 +0000 (17:01 +0100)]
Add once_cell as allowed cg_clif dependency

2 years agoMerge commit '370c397ec9169809e5ad270079712e0043514240' into sync_cg_clif-2022-03-20
bjorn3 [Sun, 20 Mar 2022 15:55:21 +0000 (16:55 +0100)]
Merge commit '370c397ec9169809e5ad270079712e0043514240' into sync_cg_clif-2022-03-20

2 years agoAuto merge of #95071 - RalfJung:arbitrary-self-dyn, r=oli-obk
bors [Sun, 20 Mar 2022 13:48:23 +0000 (13:48 +0000)]
Auto merge of #95071 - RalfJung:arbitrary-self-dyn, r=oli-obk

Miri: implement arbitrary-self dyn receivers

Roughly follows the [codegen logic](https://github.com/rust-lang/rust/blob/851fcc7a54262748b1aa9e16de91453998d896f3/compiler/rustc_codegen_ssa/src/mir/block.rs#L809).

Fixes https://github.com/rust-lang/miri/issues/1038
r? `@oli-obk` Cc `@eddyb`

2 years agofix a not emitted unmatched angle bracket error
Takayuki Maeda [Sun, 20 Mar 2022 13:39:15 +0000 (22:39 +0900)]
fix a not emitted unmatched angle bracket error

2 years agoAuto merge of #92962 - frank-king:btree_entry_no_insert, r=Amanieu
bors [Sun, 20 Mar 2022 11:20:26 +0000 (11:20 +0000)]
Auto merge of #92962 - frank-king:btree_entry_no_insert, r=Amanieu

BTreeMap::entry: Avoid allocating if no insertion

This PR allows the `VacantEntry` to borrow from an empty tree with no root, and to lazily allocate a new root node when the user calls `.insert(value)`.

2 years agoRun part of the simd test suite
bjorn3 [Sat, 19 Mar 2022 15:32:07 +0000 (16:32 +0100)]
Run part of the simd test suite

2 years agoIgnore rustc tests with needs-unwind directive
bjorn3 [Sat, 19 Mar 2022 15:11:53 +0000 (16:11 +0100)]
Ignore rustc tests with needs-unwind directive

2 years agoMove test and clarify problem of some other tests
bjorn3 [Sat, 19 Mar 2022 14:48:19 +0000 (15:48 +0100)]
Move test and clarify problem of some other tests

2 years agoWrap write_mir_fn call in with_no_trimmed_paths!()
bjorn3 [Sat, 19 Mar 2022 15:54:51 +0000 (16:54 +0100)]
Wrap write_mir_fn call in with_no_trimmed_paths!()

2 years agoAuto merge of #95133 - matthiaskrgr:rollup-4q0u804, r=matthiaskrgr
bors [Sun, 20 Mar 2022 08:35:40 +0000 (08:35 +0000)]
Auto merge of #95133 - matthiaskrgr:rollup-4q0u804, r=matthiaskrgr

Rollup of 5 pull requests

Successful merges:

 - #94749 (remove_dir_all: use fallback implementation on Miri)
 - #94948 (Fix diagnostics for `#![feature(deprecated_suggestion)]`)
 - #94989 (Add Stream alias for AsyncIterator)
 - #95108 (Give more details in `Display` for `hir::Target`)
 - #95110 (Provide more useful documentation of conversion methods)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

2 years agoRollup merge of #95110 - wmstack:patch-1, r=Dylan-DPC
Matthias Krüger [Sun, 20 Mar 2022 08:15:01 +0000 (09:15 +0100)]
Rollup merge of #95110 - wmstack:patch-1, r=Dylan-DPC

Provide more useful documentation of conversion methods

I thought that the documentation for these methods needed to be a bit more explanatory for new users. For advanced users, the comments are relatively unnecessary. I think it would be useful to explain precisely what the method does. As a new user, when you see the `into` method, where the type is inferred, if you are new you don't even know what you convert to, because it is implicit. I believe this can help new users understand.

2 years agoRollup merge of #95108 - scottmcm:more-in-target-display, r=Dylan-DPC
Matthias Krüger [Sun, 20 Mar 2022 08:15:00 +0000 (09:15 +0100)]
Rollup merge of #95108 - scottmcm:more-in-target-display, r=Dylan-DPC

Give more details in `Display` for `hir::Target`

Made because I was making a code change and got a very confusing "should be applied to a method, not a method" error.

```
error[E0718]: `into_try_type` language item must be applied to a method
   --> library\core\src\ops\try_trait.rs:352:32
    |
352 |     #[cfg_attr(not(bootstrap), lang = "into_try_type")]
    |                                ^^^^^^^^^^^^^^^^^^^^^^ attribute should be applied to a method, not a method
```

With this change the error is more actionable

```
error[E0718]: `into_try_type` language item must be applied to a required trait method
   --> library\core\src\ops\try_trait.rs:352:32
    |
352 |     #[cfg_attr(not(bootstrap), lang = "into_try_type")]
    |                                ^^^^^^^^^^^^^^^^^^^^^^ attribute should be applied to a required trait method, not a provided trait method
```

2 years agoRollup merge of #94989 - compiler-errors:stream-alias, r=Dylan-DPC
Matthias Krüger [Sun, 20 Mar 2022 08:15:00 +0000 (09:15 +0100)]
Rollup merge of #94989 - compiler-errors:stream-alias, r=Dylan-DPC

Add Stream alias for AsyncIterator

Fixes #94965

2 years agoRollup merge of #94948 - jhpratt:rustc_deprecated, r=Dylan-DPC
Matthias Krüger [Sun, 20 Mar 2022 08:14:59 +0000 (09:14 +0100)]
Rollup merge of #94948 - jhpratt:rustc_deprecated, r=Dylan-DPC

Fix diagnostics for `#![feature(deprecated_suggestion)]`

Follow up from #94635, where I missed a couple things.

2 years agoRollup merge of #94749 - RalfJung:remove-dir-all-miri, r=cuviper
Matthias Krüger [Sun, 20 Mar 2022 08:14:58 +0000 (09:14 +0100)]
Rollup merge of #94749 - RalfJung:remove-dir-all-miri, r=cuviper

remove_dir_all: use fallback implementation on Miri

Fixes https://github.com/rust-lang/miri/issues/1966

The new implementation requires `openat`, `unlinkat`, and `fdopendir`. These cannot easily be shimmed in Miri since libstd does not expose APIs corresponding to them. So for now it is probably easiest to just use the fallback code in Miri. Nobody should run Miri as root anyway...

2 years agoAuto merge of #95063 - tromey:fix-94458-gdb-char, r=Mark-Simulacrum
bors [Sun, 20 Mar 2022 04:31:23 +0000 (04:31 +0000)]
Auto merge of #95063 - tromey:fix-94458-gdb-char, r=Mark-Simulacrum

Fix debuginfo tests with GDB 11.2

GDB 11.2 added support for DW_ATE_UTF, which caused some test
failures.  This fixes these tests by changing the format that is used,
and adds a new test to verify that characters are emitted as something
that GDB can print in a char-like way.

Fixes #94458

2 years agoFix docs for default rmeta filename.
Eric Huss [Sun, 20 Mar 2022 04:05:31 +0000 (21:05 -0700)]
Fix docs for default rmeta filename.

2 years agoExtract ImplSubject information
Santiago Pastorino [Sun, 20 Mar 2022 03:12:03 +0000 (00:12 -0300)]
Extract ImplSubject information