Commit Graph

166674 Commits

Author SHA1 Message Date
Guillaume Gomez
ab9cf32131 Add tests for paths 2022-04-18 20:59:09 +02:00
Guillaume Gomez
51b4005003 Update the eBNF to allow generics bracket to not be closed if it's EOF 2022-04-18 20:59:09 +02:00
Guillaume Gomez
e03a950747 Handle separators in their own functions and fix missing handling of tabs 2022-04-18 20:59:09 +02:00
Guillaume Gomez
da829d8d9d Improve the BNF description a bit and fix some issues 2022-04-18 20:59:09 +02:00
Guillaume Gomez
1f5c4c2b30 Forbid rustdoc search query to end with -> 2022-04-18 20:59:09 +02:00
Guillaume Gomez
8e29ed43d9 Add isIdentCharacter function to ensure that unexpected characters are handled correctly 2022-04-18 20:59:09 +02:00
Guillaume Gomez
f9251eef68 Replace unneeded use of regex with a simple if 2022-04-18 20:59:09 +02:00
Guillaume Gomez
699ae365df Apply suggestions:
* Forbid generics without a path (so "<p>" is forbidden).
 * Change `handleSingleArg` so that it takes `results_others`, `results_in_args` and `results_returned` as arguments instead of using the "global" variables.
 * Change `createQueryElement` so that it returns the newly created element instead of taking `elems` as argument.
 * Improve documentation
2022-04-18 20:59:09 +02:00
Guillaume Gomez
c7de1a16f8 Improve documentation and add some explanations in the code 2022-04-18 20:59:09 +02:00
Guillaume Gomez
49297337b4 Simplify parser syntax 2022-04-18 20:59:08 +02:00
Guillaume Gomez
99d552092c Make query parser more strict and improve display of errors 2022-04-18 20:59:08 +02:00
Guillaume Gomez
264064df36 * Greatly improve the rustdoc search parser source code
* Move all functions outside parseQuery
2022-04-18 20:59:08 +02:00
Guillaume Gomez
99c5394ecc Add query syntax for the parser 2022-04-18 20:59:08 +02:00
Guillaume Gomez
51de26cfd9 * If type filter is in quotes, throw an error.
* If there are generics, don't allow to have quotes.
2022-04-18 20:59:08 +02:00
Guillaume Gomez
bbcf1762dd Improve naming of "val" field 2022-04-18 20:59:08 +02:00
Guillaume Gomez
f5833e759e Add parser tests 2022-04-18 20:59:08 +02:00
Guillaume Gomez
7cefee027a Add possibility to check parsed query 2022-04-18 20:59:08 +02:00
Guillaume Gomez
0f51652ad3 Update tests 2022-04-18 20:59:08 +02:00
Guillaume Gomez
3aeef67037 Update search engine and parser to error when quotes are used on queries with more than one element. 2022-04-18 20:59:08 +02:00
Guillaume Gomez
be41750a10 Greatly improve rustdoc search 2022-04-18 20:59:08 +02:00
bors
6fd7e9010d Auto merge of #96042 - m-ou-se:one-reentrant-mutex, r=Amanieu
Use a single ReentrantMutex implementation on all platforms.

This replaces all platform specific ReentrantMutex implementations by the one I added in #95727 for Linux, since that one does not depend on any platform specific details.

r? `@Amanieu`
2022-04-18 12:15:39 +00:00
Mara Bos
94f00e396a Remove forgotten reexport of ReentrantMutex in sys::unsupported. 2022-04-18 13:10:36 +02:00
bors
491f619f56 Auto merge of #96080 - nikic:ranlib, r=Mark-Simulacrum
Respect ranlib specified for target during LLVM build

The ranlib specified for the target was never actually transferred
into the builder configuration. In the dist-x86_64-linux build we
ended up using ranlib instead of llvm-ranlib.

Found this investigating a build failure in #94214.
2022-04-18 09:58:22 +00:00
bors
faecdc05ab Auto merge of #96113 - mixi:libressl-3.4.x, r=Mark-Simulacrum
Add support for LibreSSL 3.4.x

This updates the `openssl` and `openssl-sys` crates to support building
the toolchain with system libraries up to LibreSSL 3.4.x.

LibreSSL 3.4.0 has been supported since `openssl-sys` version 0.9.67,
LibreSSL 3.4.x since `openssl-sys` 0.9.72.
2022-04-18 07:24:55 +00:00
bors
74582acd3b Auto merge of #96000 - jyn514:faster-doctests, r=Mark-Simulacrum
Make `x test --stage 2 compiler/rustc_XXX` faster to run

Previously, bootstrap unconditionally rebuilt the stage 2 compiler,
even if it had previously built stage 1. This changes it to reuse stage 1 if possible.
In particular, it no longer runs the following step:
```
Building stage1 compiler artifacts (x86_64-unknown-linux-gnu(x86_64-unknown-linux-gnu) -> x86_64-unknown-linux-gnu(x86_64-unknown-linux-gnu))
```
2022-04-18 04:15:26 +00:00
bors
7b5408d3fb Auto merge of #95695 - the8472:vec-codegen-tests, r=Mark-Simulacrum
Add codegen tests for additional cases where noop iterators get optimized away

Optimizations have improved over time and now LLVM manages to optimize more in-place-collect noop-iterators to O(1) functions. This updates the codegen test to match.

Many but not all cases reported in #79308 work now.
2022-04-18 02:04:12 +00:00
bors
e27d9df431 Auto merge of #93530 - anonion0:pthread_sigmask_fix, r=JohnTitor
fix error handling for pthread_sigmask(3)

Errors from `pthread_sigmask(3)` were handled using `cvt()`, which expects a return value of `-1` on error and uses `errno`.
However, `pthread_sigmask(3)` returns `0` on success and an error number otherwise.

Fix it by replacing `cvt()` with `cvt_nz()`.
2022-04-17 22:54:55 +00:00
bors
ec77f25243 Auto merge of #96139 - erikdesjardins:revertinl2, r=Mark-Simulacrum
Revert: Make TLS __getit #[inline(always)] on non-Windows

re #96132

r? `@Mark-Simulacrum`
2022-04-17 20:32:08 +00:00
bors
ad4e98ed7d Auto merge of #96091 - GuillaumeGomez:duplicated-blanket-impls, r=notriddle
Fix rustdoc duplicated blanket impls

Fixes #96036.

I think it'll not be great performance-wise but I couldn't find another way to prevent that unfortunately...

r? `@notriddle`
2022-04-17 18:14:16 +00:00
Guillaume Gomez
6d10fd0b5b Add regression test for rustdoc duplicated blanket impls 2022-04-17 18:04:10 +02:00
Guillaume Gomez
caa770aee1 Fix rustdoc duplicated blanket impls issue 2022-04-17 18:04:10 +02:00
bors
1ec2c136b3 Auto merge of #95779 - cjgillot:ast-lifetimes-undeclared, r=petrochenkov
Report undeclared lifetimes during late resolution.

First step in https://github.com/rust-lang/rust/pull/91557

We reuse the rib design of the current resolution framework. Specific `LifetimeRib` and `LifetimeRibKind` types are introduced. The most important variant is `LifetimeRibKind::Generics`, which happens each time we encounter something which may introduce generic lifetime parameters. It can be an item or a `for<...>` binder. The `LifetimeBinderKind` specifies how this rib behaves with respect to in-band lifetimes.

r? `@petrochenkov`
2022-04-17 12:56:19 +00:00
Camille GILLOT
e628df9b0b Bless nll test. 2022-04-17 12:41:49 +02:00
bors
af68f7182e Auto merge of #96016 - Aaron1011:hash-name-cleanup, r=cjgillot
Remove last vestiges of skippng ident span hashing

This removes a comment that no longer applies, and properly hashes
the full ident for path segments.
2022-04-17 10:31:52 +00:00
Camille GILLOT
35eac359c9 Bless clippy. 2022-04-17 11:03:34 +02:00
Camille GILLOT
a9e13fa553 Lint elided lifetimes in path on the AST. 2022-04-17 11:03:34 +02:00
Camille GILLOT
ca57bada05 Bless tests. 2022-04-17 11:03:34 +02:00
Camille GILLOT
fc9f25531a Report undeclared lifetimes on AST. 2022-04-17 11:03:34 +02:00
Camille GILLOT
4cfceeabdc Remove is_in_fn_syntax. 2022-04-17 11:03:33 +02:00
Camille GILLOT
e47f66dc0d Visit generics inside visit_fn. 2022-04-17 11:03:33 +02:00
Camille GILLOT
aa2b5ef635 Count number of lifetime parameters in a separate pass. 2022-04-17 11:03:33 +02:00
bors
edba282770 Auto merge of #95655 - kckeiks:create-hir-crate-items-query, r=cjgillot
Refactor HIR item-like traversal (part 1)

Issue  #95004

- Create hir_crate_items query which traverses tcx.hir_crate(()).owners to return a hir::ModuleItems
- use tcx.hir_crate_items in tcx.hir().items() to return an iterator of hir::ItemId
- use tcx.hir_crate_items to introduce a tcx.hir().par_items(impl Fn(hir::ItemId)) to traverse all items in parallel;

Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>

cc `@cjgillot`
2022-04-17 08:06:53 +00:00
Ralf Sager
e6aafbc707 move import to fix warning with emscripten target 2022-04-17 09:42:15 +02:00
Erik Desjardins
b0d9c42c46 Revert "Auto merge of #94373 - erikdesjardins:getitinl, r=Mark-Simulacrum"
This reverts commit 035a717ee8, reversing
changes made to 761e888485.
2022-04-17 02:15:45 -04:00
bors
ac8b11810f Auto merge of #96010 - eduardosm:Unique-on-top-of-NonNull, r=m-ou-se,tmiasko
Implement `core::ptr::Unique` on top of `NonNull`

Removes the use `rustc_layout_scalar_valid_range_start` and some `unsafe` blocks.
2022-04-17 05:26:08 +00:00
bors
43a71dc732 Auto merge of #96002 - nnethercote:speed-up-Vec-clear-2, r=m-ou-se
Speed up Vec::clear().

Currently it just calls `truncate(0)`. `truncate()` is (a) not marked as
`#[inline]`, and (b) more general than needed for `clear()`.

This commit changes `clear()` to do the work itself. This modest change
was first proposed in rust-lang#74172, where the reviewer rejected it because
there was insufficient evidence that `Vec::clear()`'s performance
mattered enough to justify the change. Recent changes within rustc have
made `Vec::clear()` hot within `macro_parser.rs`, so the change is now
clearly worthwhile.

Although it doesn't show wins on CI perf runs, this seems to be because they
use PGO. But not all platforms currently use PGO. Also, local builds don't use
PGO, and `truncate` sometimes shows up in an over-represented fashion in local
profiles. So local profiling will be made easier by this change.

Note that this will also benefit `String::clear()`, because it just
calls `Vec::clear()`.

Finally, the commit removes the `vec-clear.rs` codegen test. It was
added in #52908. From before then until now, `Vec::clear()` just called
`Vec::truncate()` with a zero length. The body of Vec::truncate() has
changed a lot since then. Now that `Vec::clear()` is doing actual work
itself, and not just calling `Vec::truncate()`, it's not surprising that
its generated code includes a load and an icmp. I think it's reasonable
to remove this test.

r? `@m-ou-se`
2022-04-17 03:08:45 +00:00
bors
2c28b0eaf9 Auto merge of #96134 - Dylan-DPC:rollup-ejug3yq, r=Dylan-DPC
Rollup of 6 pull requests

Successful merges:

 - #95346 (Stablize `const_extern_fn` for "Rust" and "C")
 - #95933 (htmldocck: Compare HTML tree instead of plain text html)
 - #96105 (Make the debug output for `TargetSelection` less verbose)
 - #96112 (Strict provenance lint diagnostics improvements)
 - #96119 (update Miri)
 - #96124 (to_digit tweak)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-04-17 00:44:53 +00:00
Dylan DPC
b47265e658
Rollup merge of #96124 - gilescope:to_digit_speedup4, r=thomcc
to_digit tweak

No need to check the assert all the time.

(Checked the TODO and it's not time to get rid of it yet)
2022-04-17 00:07:28 +02:00
Dylan DPC
13d3d0e856
Rollup merge of #96119 - RalfJung:miri, r=RalfJung
update Miri

Fixes https://github.com/rust-lang/rust/issues/96115
r? ``@rust-lang/miri``
2022-04-17 00:07:27 +02:00
Dylan DPC
99437b303a
Rollup merge of #96112 - niluxv:strict-provenance-lint-improvements, r=nagisa
Strict provenance lint diagnostics improvements

Use `multipart_suggestion` instead of `span_suggestion` and getting a snippet for the expression. Also don't suggest unnecessary parenthesis in `lossy_provenance_casts`.
cc ``@estebank``
``@rustbot`` label A-diagnostics
2022-04-17 00:07:26 +02:00