Commit Graph

165419 Commits

Author SHA1 Message Date
Nicholas Nethercote
754dc8e66f Move items into TtParser as Vecs.
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.
2022-03-21 10:09:24 +11:00
Nicholas Nethercote
cedb787f6e 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.
2022-03-21 10:08:29 +11:00
Max Baumann
765cce11b1
refactor: remove need for MethodCall matching 2022-03-21 00:04:37 +01:00
Dan Gohman
6c407d0592 Add a testcase. 2022-03-20 15:56:25 -07:00
Max Baumann
4580c8a9b7
refactor: use is_lang_ctor() 2022-03-20 23:54:04 +01:00
Max Baumann
0f83753934
feat: change error message 2022-03-20 23:43:17 +01:00
Dan Gohman
95e1702284 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.
2022-03-20 15:37:31 -07:00
bors
47b93ea5ef Auto merge of #8559 - pickfire:patch-1, r=xFrednet
Fix typo in bug report

repoduce -> reproduce

---

changelog: none
2022-03-20 22:32:12 +00:00
Audun Halland
cd762d8694 fix two comments referring to moved code (rustc_mir_transform::generator) 2022-03-20 23:31:04 +01:00
bors
51558ccb8e 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
2022-03-20 21:36:57 +00:00
bjorn3
56939ffe7d Don't declare test_variadic_fnptr with two conflicting signatures
It is UB for LLVM and results in a compile error for Cranelift
2022-03-20 21:09:35 +01:00
Matthias Krüger
e33a4819df
Rollup merge of #95145 - ChayimFriedman2:patch-1, r=Dylan-DPC
Fix typo interator->iterator
2022-03-20 20:42:46 +01:00
Matthias Krüger
63da51db93
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
2022-03-20 20:42:45 +01:00
Matthias Krüger
7557c08048
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](f2661cfe34/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
2022-03-20 20:42:44 +01:00
Matthias Krüger
3c02b5192e
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.
2022-03-20 20:42:43 +01:00
Camille GILLOT
0b49d05ea3 Filter OnceNote in diagnostic infra. 2022-03-20 20:36:26 +01:00
Camille GILLOT
056951d628 Take &mut Diagnostic in emit_diagnostic.
Taking a Diagnostic by move would break the usual pattern
`diag.label(..).emit()`.
2022-03-20 20:36:08 +01:00
bors
c84f39e6c0 Auto merge of #95144 - RalfJung:miri, r=RalfJung
update Miri
2022-03-20 19:10:06 +00:00
Chayim Refael Friedman
159961fb28
Fix typo interator->iterator 2022-03-20 20:52:22 +02:00
Ralf Jung
8ebc407bde update Miri 2022-03-20 14:30:40 -04:00
bors
4767ccec93 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
2022-03-20 16:29:16 +00:00
bjorn3
ce7f5ecad7 Add once_cell as allowed cg_clif dependency 2022-03-20 17:01:32 +01:00
bjorn3
ef4ce72919 Merge commit '370c397ec9169809e5ad270079712e0043514240' into sync_cg_clif-2022-03-20 2022-03-20 16:55:21 +01:00
bors
9bd53718e2 Auto merge of #95071 - RalfJung:arbitrary-self-dyn, r=oli-obk
Miri: implement arbitrary-self dyn receivers

Roughly follows the [codegen logic](851fcc7a54/compiler/rustc_codegen_ssa/src/mir/block.rs (L809)).

Fixes https://github.com/rust-lang/miri/issues/1038
r? `@oli-obk` Cc `@eddyb`
2022-03-20 13:48:23 +00:00
Takayuki Maeda
5c8aaedef6 fix a not emitted unmatched angle bracket error 2022-03-20 22:39:15 +09:00
bors
c7ce69faf2 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)`.
2022-03-20 11:20:26 +00:00
bjorn3
370c397ec9 Run part of the simd test suite 2022-03-20 12:14:24 +01:00
bjorn3
636fb020c4 Ignore rustc tests with needs-unwind directive 2022-03-20 12:14:24 +01:00
bjorn3
e7e5016207 Move test and clarify problem of some other tests 2022-03-20 12:14:24 +01:00
bjorn3
215905cdc8 Wrap write_mir_fn call in with_no_trimmed_paths!() 2022-03-20 12:14:05 +01:00
bors
3b84829750 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
2022-03-20 08:35:40 +00:00
Matthias Krüger
9725caf9e9
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.
2022-03-20 09:15:01 +01:00
Matthias Krüger
355d87807f
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
```
2022-03-20 09:15:00 +01:00
Matthias Krüger
24a7aad082
Rollup merge of #94989 - compiler-errors:stream-alias, r=Dylan-DPC
Add Stream alias for AsyncIterator

Fixes #94965
2022-03-20 09:15:00 +01:00
Matthias Krüger
db374bd440
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.
2022-03-20 09:14:59 +01:00
Matthias Krüger
acb7ed141b
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...
2022-03-20 09:14:58 +01:00
bors
499d4a5684 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
2022-03-20 04:31:23 +00:00
Eric Huss
9da3c355c8 Fix docs for default rmeta filename. 2022-03-19 21:05:31 -07:00
Santiago Pastorino
0cd03c917c
Extract ImplSubject information 2022-03-20 00:12:18 -03:00
bors
183090f775 Auto merge of #94976 - jclulow:solaris-festival, r=Mark-Simulacrum
solaris build environment should include libsendfile/liblgrp

As of version 0.2.120 of the libc crate, the solaris target now requires
some additional libraries to be present in the sysroot.  Note that the
solaris target doesn't really build against files from Solaris, but
rather against some files from DilOS (a platform similar to both Solaris
and illumos).  Pull in the extra libraries and their compilation links
from that apt repository.

This aims to assist with rust-lang/rust#94052.
2022-03-20 01:50:36 +00:00
Maximilian Köhl
1fec0fbb2c apply rustfmt 2022-03-19 23:54:42 +01:00
Michael Howell
306dcd6efa diagnostics: do not give Option::as_ref suggestion for complex match
Fixes #82528
2022-03-19 15:54:30 -07:00
Maximilian Köhl
43e4bbdaaa rustdoc: add 🔒 to indicate restricted visibility 2022-03-19 23:51:33 +01:00
bors
f2661cfe34 Auto merge of #94372 - erikdesjardins:asrefinl, r=dtolnay
Add #[inline] to trivial AsRef/AsMut impls

These appeared uninlined in some perf runs, but they're trivial.

r? `@ghost`
2022-03-19 22:32:28 +00:00
bors
8d60bf427a Auto merge of #95103 - ehuss:update-cargo, r=ehuss
Update cargo

9 commits in 65c82664263feddc5fe2d424be0993c28d46377a..109bfbd055325ef87a6e7f63d67da7e838f8300b
2022-03-09 02:32:56 +0000 to 2022-03-17 21:43:09 +0000
- Refactor RegistryData::load to handle management of the index cache (rust-lang/cargo#10482)
- Separate VCS command paths with "--" (rust-lang/cargo#10483)
- Fix panic when artifact target is used for `[target.'cfg(&lt;target&gt;)'.dependencies` (rust-lang/cargo#10433)
- Bump git2@0.14.2 and libgit2-sys@0.13.2 (rust-lang/cargo#10479)
- vendor: Don't allow multiple values for --sync (rust-lang/cargo#10448)
- Use types to make clere (credential process || token) (rust-lang/cargo#10471)
- Warning on conflicting keys (rust-lang/cargo#10316)
- Registry functions return Poll to enable parallel fetching of index data (rust-lang/cargo#10064)
- Refine the contributor guide (rust-lang/cargo#10468)
2022-03-19 19:41:10 +00:00
Max Baumann
20c352a4f6
test: add method chain test 2022-03-19 18:17:43 +01:00
bors
9c7f6d60b1 Auto merge of #95112 - Dylan-DPC:rollup-0jo0loj, r=Dylan-DPC
Rollup of 5 pull requests

Successful merges:

 - #93858 (Add a `process_group` method to UNIX `CommandExt`)
 - #94650 (Relax tests for Windows dos device names)
 - #94991 (Make Weak::new const)
 - #95072 (Re-enable parallel debuginfo tests)
 - #95109 (Extend --check-cfg tests to all predicate inside all/any)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-03-19 17:00:15 +00:00
antoyo
44c0204af3
Merge pull request #141 from rust-lang/fix/unsigned-by-signed-shift
Fix shift of unsigned integer by signed integer
2022-03-19 12:47:46 -04:00
Antoni Boucher
0fb350f37c Fix shift of unsigned integer by signed integer 2022-03-19 12:15:26 -04:00
Guillaume Gomez
237d62588d Remove animation on source sidebar 2022-03-19 16:59:56 +01:00