Commit Graph

171090 Commits

Author SHA1 Message Date
bors
2953edc7b7 Auto merge of #98475 - notriddle:notriddle/index-fn-signatures, r=GuillaumeGomez
rustdoc: reference function signature types from the `p` array

This reduces the size of the function signature index, because it's common to have many functions that operate on the same types.

    $ wc -c search-index-old.js search-index-new.js
    5224374 search-index-old.js
    3932314 search-index-new.js

By my math, this reduces the uncompressed size of the search index by 32%.
On compressed signatures, the wins are less drastic, a mere 8%:

    $ wc -c search-index-old.js.gz search-index-new.js.gz
    404532 search-index-old.js.gz
    371635 search-index-new.js.gz
2022-06-28 21:40:10 +00:00
bors
8308806403 Auto merge of #98632 - matthiaskrgr:rollup-peg868d, r=matthiaskrgr
Rollup of 11 pull requests

Successful merges:

 - #98548 (rustdoc-json: Allow Typedef to be different in sanity assert)
 - #98560 (Add regression test for #85907)
 - #98564 (Remove references to `./tmp` in-tree)
 - #98602 (Add regression test for #80074)
 - #98606 (⬆️ rust-analyzer)
 - #98609 (Fix ICE for associated constant generics)
 - #98611 (Fix glob import ICE in rustdoc JSON format)
 - #98617 (Remove feature `const_option` from std)
 - #98619 (Fix mir-opt wg name)
 - #98621 (llvm-wrapper: adapt for removal of the ASanGlobalsMetadataAnalysis LLVM API)
 - #98623 (fix typo in comment)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-06-28 18:36:42 +00:00
Matthias Krüger
164c98e447
Rollup merge of #98623 - pro465:patch-1, r=Dylan-DPC
fix typo in comment
2022-06-28 18:34:36 +02:00
Matthias Krüger
db872ee1b8
Rollup merge of #98621 - krasimirgg:llvm-15-wrapper, r=nikic
llvm-wrapper: adapt for removal of the ASanGlobalsMetadataAnalysis LLVM API

No functional changes intended.

This adapts llvm-wrapper for dacfa24f75, which removed `ASanGlobalsMetadataAnalysis`.

Found via our experimental rust + HEAD llvm bot: https://buildkite.com/llvm-project/rust-llvm-integrate-prototype/builds/11565#0181a72f-75bb-4378-88f0-4c0bca7d03fa/231-505.
2022-06-28 18:34:35 +02:00
Matthias Krüger
62a787c595
Rollup merge of #98619 - Mark-Simulacrum:fix-triagebot, r=Dylan-DPC
Fix mir-opt wg name

r? ``@ehuss``
2022-06-28 18:34:34 +02:00
Matthias Krüger
a3bdd46431
Rollup merge of #98617 - ChrisDenton:const-unwrap, r=Mark-Simulacrum
Remove feature `const_option` from std

This is part of the effort to reduce the number of unstable features used by std. This one is easy as it's only used in one place.
2022-06-28 18:34:33 +02:00
Matthias Krüger
956a9f55c0
Rollup merge of #98611 - GuillaumeGomez:rustdoc-json-glob-ice, r=notriddle
Fix glob import ICE in rustdoc JSON format

Fixes #98003.

r? `@notriddle`
2022-06-28 18:34:32 +02:00
Matthias Krüger
a1b06388ce
Rollup merge of #98609 - TaKO8Ki:fix-ice-for-associated-constant-generics, r=lcnr
Fix ICE for associated constant generics

Fixes #98432
2022-06-28 18:34:31 +02:00
Matthias Krüger
28d2c4bd69
Rollup merge of #98606 - lnicola:rust-analyzer-2022-06-28, r=lnicola
⬆️ rust-analyzer

r? ``@ghost``
2022-06-28 18:34:30 +02:00
Matthias Krüger
70b4e042d3
Rollup merge of #98602 - TaKO8Ki:add-regression-test-for-issue-80074, r=Mark-Simulacrum
Add regression test for #80074

closes #80074
2022-06-28 18:34:29 +02:00
Matthias Krüger
6cb46ca382
Rollup merge of #98564 - jyn514:remove-tmp-dir, r=Mark-Simulacrum
Remove references to `./tmp` in-tree

These used to be used by codegen-units tests, but were switched from manually specifying directories
to just using `// incremental` in https://github.com/rust-lang/rust/pull/89101.
Remove the old references.

Fixes https://github.com/rust-lang/rust/issues/34586.
2022-06-28 18:34:28 +02:00
Matthias Krüger
5c7a04553d
Rollup merge of #98560 - TaKO8Ki:add-regression-test-for-85907, r=Mark-Simulacrum
Add regression test for #85907

closes #85907
2022-06-28 18:34:27 +02:00
Matthias Krüger
3991e739ba
Rollup merge of #98548 - Enselic:allow-typedef-diff-for-rustdoc-json, r=GuillaumeGomez
rustdoc-json: Allow Typedef to be different in sanity assert

Closes #98547

This fix is a natural extension of #98053.

r? `@notriddle`

(Since you reviewed the other PR.)

CC `@GuillaumeGomez`

`@rustbot` labels +A-rustdoc-json +T-rustdoc
2022-06-28 18:34:26 +02:00
bors
94e93749ab Auto merge of #98188 - mystor:fast_group_punct, r=eddyb
proc_macro/bridge: stop using a remote object handle for proc_macro Punct and Group

This is the third part of https://github.com/rust-lang/rust/pull/86822, split off as requested in https://github.com/rust-lang/rust/pull/86822#pullrequestreview-1008655452. This patch transforms the `Punct` and `Group` types into structs serialized over IPC rather than handles, making them more efficient to create and manipulate from within proc-macros.
2022-06-28 16:10:30 +00:00
Proloy Mishra
8c22b6bcac
fix typo in comment 2022-06-28 19:59:09 +05:30
Krasimir Georgiev
fe02ee8be9 llvm-wrapper: adapt for an LLVM API change
This adapts llvm-wrapper for
dacfa24f75,
which removed ASanGlobalsMetadataAnalysis.
2022-06-28 14:08:35 +00:00
Nika Layzell
64a7d57046 review changes
longer names for RPC generics and reduced dependency on macros in the server.
2022-06-28 09:54:29 -04:00
bors
00ebeb87ac Auto merge of #98612 - Dylan-DPC:rollup-7tasikc, r=Dylan-DPC
Rollup of 9 pull requests

Successful merges:

 - #97346 (Remove a back-compat hack on lazy TAIT)
 - #98261 (Remove `MAX_SUGGESTION_HIGHLIGHT_LINES`)
 - #98337 ([RFC 2011] Optimize non-consuming operators)
 - #98384 (Fix RSS reporting on macOS)
 - #98420 (translation: lint fix + more migration)
 - #98430 (Refactor iter adapters with less macros)
 - #98555 (Hermit: Fix initializing lazy locks)
 - #98595 (Implement `Send` and `Sync` for `ThinBox<T>`)
 - #98597 (Remove unstable CStr/CString change from 1.62 release note)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-06-28 13:46:43 +00:00
Mark Rousskov
d6b9c10e03 Fix mir-opt wg name 2022-06-28 08:14:42 -04:00
Chris Denton
720c430822
Add a fixme comment 2022-06-28 12:18:16 +01:00
Chris Denton
2ee92419dd
Remove feature const_option from std 2022-06-28 11:37:48 +01:00
Dylan DPC
66b806084e
Rollup merge of #98597 - wwylele:patch-1, r=Mark-Simulacrum
Remove unstable CStr/CString change from 1.62 release note

(Discovered in https://github.com/rust-lang/rust/pull/98571#discussion_r907469604)

The change to move CStr/CString to core/alloc is currently behind feature flags as stated in https://github.com/rust-lang/rust/issues/98314
2022-06-28 15:30:08 +05:30
Dylan DPC
e5b82de04c
Rollup merge of #98595 - cuviper:send-sync-thinbox, r=m-ou-se
Implement `Send` and `Sync` for `ThinBox<T>`

Just like `Box<T>`, `ThinBox<T>` owns its data on the heap, so it should
implement `Send` and `Sync` when `T` does.

This extends tracking issue #92791.
2022-06-28 15:30:07 +05:30
Dylan DPC
f181ae9946
Rollup merge of #98555 - mkroening:hermit-lock-init, r=m-ou-se
Hermit: Fix initializing lazy locks

Closes https://github.com/hermitcore/rusty-hermit/issues/322.

The initialization function of hermit's `Condvar` is not called since https://github.com/rust-lang/rust/pull/97647 and was erroneously removed in https://github.com/rust-lang/rust/pull/97879.

r? ``@m-ou-se``

CC: ``@stlankes``
2022-06-28 15:30:06 +05:30
Dylan DPC
ff223ff297
Rollup merge of #98430 - camsteffen:flatten-refactor, r=joshtriplett
Refactor iter adapters with less macros

Just some code cleanup. Introduced a util `and_then_or_clear` for each of chain, flatten and fuse iter adapter impls. This reduces code nicely for flatten, but admittedly the other modules are more of a lateral move replacing macros with a function. But I think consistency across the modules and avoiding macros when possible is good.
2022-06-28 15:30:05 +05:30
Dylan DPC
400f435c2d
Rollup merge of #98420 - davidtwco:translation-lint-fixes-and-more-migration, r=compiler-errors
translation: lint fix + more migration

- Unfortunately, the diagnostic lints are very broken and trigger much more often than they should. This PR corrects the conditional which checks if the function call being made is to a diagnostic function so that it returns in every intended case.
- The `rustc_lint_diagnostics` attribute is used by the diagnostic translation/struct migration lints to identify calls where non-translatable diagnostics or diagnostics outwith impls are being created. Any function used in creating a diagnostic should be annotated with this attribute so this PR adds the attribute to many more functions.
- Port the diagnostics from the `rustc_privacy` crate and enable the lints for that crate.

r? ``@compiler-errors``
2022-06-28 15:30:04 +05:30
Dylan DPC
56b7786914
Rollup merge of #98384 - rdzhaafar:fix-macos-rss-reporting, r=davidtwco,michaelwoerister
Fix RSS reporting on macOS

> NOTE: This is a duplicate of #98164, which I closed because I borked my rustc fork

Currently, `rustc_data_structures::profiling::get_resident_set_size()` always returns `None` on macOS. This is because
macOS does not implement procfs used in the unix version of the function:

```rust
...
else if #[cfg(unix)] {
        pub fn get_resident_set_size() -> Option<usize> {
            let field = 1;
            let contents = fs::read("/proc/self/statm").ok()?;
            let contents = String::from_utf8(contents).ok()?;
            let s = contents.split_whitespace().nth(field)?;
            let npages = s.parse::<usize>().ok()?;
            Some(npages * 4096)
        }
...
```

The proposed solution uses libproc, and more specifically `proc_pidinfo`, which has been available on macOS since 10.5 if the function signature inside libproc.h is to be believed:

```c
int proc_pidinfo(int pid, int flavor, uint64_t arg, void *buffer, int buffersize) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
```
2022-06-28 15:30:03 +05:30
Dylan DPC
ec8477fea1
Rollup merge of #98337 - c410-f3r:assert-compiler, r=oli-obk
[RFC 2011] Optimize non-consuming operators

Tracking issue: https://github.com/rust-lang/rust/issues/44838
Fifth step of https://github.com/rust-lang/rust/pull/96496

The most non-invasive approach that will probably have very little to no performance impact.

## Current behaviour

Captures are handled "on-the-fly", i.e., they are performed in the same place expressions are located.

```rust
// `let a = 1; let b = 2; assert!(a > 1 && b < 100);`

if !(
  { ***try capture `a` and then return `a`*** } > 1 && { ***try capture `b` and then return `b`*** } < 100
) {
  panic!( ... );
}
```

As such, some overhead is likely to occur (Specially with very large chains of conditions).

## New behaviour for non-consuming operators

When an operator is known to not take `self`, then it is possible to capture variables **AFTER** the condition.

```rust
// `let a = 1; let b = 2; assert!(a > 1 && b < 100);`

if !( a > 1 && b < 100 ) {
  { ***try capture `a`*** }
  { ***try capture `b`*** }
  panic!( ... );
}
```

So the possible impact on the runtime execution time will be diminished.

r? ````@oli-obk````
2022-06-28 15:30:02 +05:30
Dylan DPC
9b3dbb8200
Rollup merge of #98261 - WaffleLapkin:attempt_to_remove_max_suggestion_highlight_lines, r=flip1995
Remove `MAX_SUGGESTION_HIGHLIGHT_LINES`

After #97798 the `MAX_SUGGESTION_HIGHLIGHT_LINES` constant doesn't really make sense since we always show full suggestions. This PR removes last usages of the constant and the constant itself.

r? ``@flip1995`` (this mostly does changes in clippy)
2022-06-28 15:30:01 +05:30
Dylan DPC
c703d11dcc
Rollup merge of #97346 - JohnTitor:remove-back-compat-hacks, r=oli-obk
Remove a back-compat hack on lazy TAIT

This PR's motivation is here: https://github.com/rust-lang/rust/issues/72614#issuecomment-1134595446
~~But removing a hack doesn't seem to reject the code on the issue, there're some more hacks?~~
r? ``@oli-obk``
2022-06-28 15:30:00 +05:30
bors
baf382e63c Auto merge of #98396 - cjgillot:iwfchir, r=petrochenkov
Do not access HIR to check impl wf.

r? `@ghost`
2022-06-28 09:48:18 +00:00
Guillaume Gomez
c2221eff62 Add regression test for glob import ICE in rustdoc JSON 2022-06-28 11:46:24 +02:00
Guillaume Gomez
b7e62000dd Fix glob import ICE in rustdoc JSON format 2022-06-28 11:46:03 +02:00
Takayuki Maeda
8c7d9f6092 fix ice for associated constant generics 2022-06-28 18:29:07 +09:00
Martin Nordholts
2888e76d06 test/rustdoc-json/assoc_type.rs: Maximize chance of detecting future ICEs 2022-06-28 11:02:14 +02:00
Martin Nordholts
ae4b929c00 rustdoc-json: Add assoc type ICE regression test 2022-06-28 10:10:40 +02:00
Laurențiu Nicola
396342a1fb ⬆️ rust-analyzer 2022-06-28 09:54:21 +03:00
bors
64eb9ab869 Auto merge of #98324 - conradludgate:write-vectored-vec, r=Mark-Simulacrum
attempt to optimise vectored write

benchmarked:

old:
```
test io::cursor::tests::bench_write_vec                     ... bench:          68 ns/iter (+/- 2)
test io::cursor::tests::bench_write_vec_vectored            ... bench:         913 ns/iter (+/- 31)
```

new:
```
test io::cursor::tests::bench_write_vec                     ... bench:          64 ns/iter (+/- 0)
test io::cursor::tests::bench_write_vec_vectored            ... bench:         747 ns/iter (+/- 27)
```

More unsafe than I wanted (and less gains) in the end, but it still does the job
2022-06-28 06:25:19 +00:00
bors
5ffa8f67b7 Auto merge of #98222 - cjgillot:single-wf, r=michaelwoerister
Only keep a single query for well-formed checking

There are currently 3 queries to perform wf checks on different item-likes.  This complexity is not required.

This PR replaces the query by:
- one query per item;
- one query to invoke it for a whole module.

This allows to remove HIR `ParItemLikeVisitor`.
2022-06-28 03:44:33 +00:00
Takayuki Maeda
05263f05bd add regression test for #80074 2022-06-28 12:28:04 +09:00
Weiyi Wang
f5a38d1b30
Remove unstable CStr/CString change from 1.62 release note
(Discovered in https://github.com/rust-lang/rust/pull/98571#discussion_r907469604)

The change to move CStr/CString to core/alloc is currently behind feature flags as stated in https://github.com/rust-lang/rust/issues/98314
2022-06-27 19:35:33 -04:00
Josh Stone
6400736142 Implement Send and Sync for ThinBox<T>
Just like `Box<T>`, `ThinBox<T>` owns its data on the heap, so it should
implement `Send` and `Sync` when `T` does.
2022-06-27 15:49:59 -07:00
bors
7f08d04d60 Auto merge of #98591 - matthiaskrgr:rollup-7dok1wq, r=matthiaskrgr
Rollup of 9 pull requests

Successful merges:

 - #98331 (Fix rustdoc argument error)
 - #98506 (Fix span issues in object safety suggestions)
 - #98563 (interpret: refactor allocation info query)
 - #98576 (small regions refactoring)
 - #98577 (Fix "kind" for associated types in trait implementations in rustdoc JSON)
 - #98578 (Remove eddyb from miri failure pings)
 - #98579 (liballoc tests: avoid int2ptr cast)
 - #98581 (Add triagebot mentions.)
 - #98587 (libcore tests: avoid int2ptr casts)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-06-27 22:22:58 +00:00
Michael Howell
33cf9ea4a2 Add comments, fixes for 0 sentinel 2022-06-27 14:15:14 -07:00
Matthias Krüger
f266821d8f
Rollup merge of #98587 - RalfJung:core-tests, r=thomcc
libcore tests: avoid int2ptr casts

We don't need any of these pointers to actually be dereferenceable so using `ptr::invalid` should be fine. And then we can run Miri with strict provenance enforcement on the tests.
2022-06-27 22:35:14 +02:00
Matthias Krüger
19a05b56b1
Rollup merge of #98581 - ehuss:triagebot-mentions, r=Mark-Simulacrum
Add triagebot mentions.

This migrates the configuration of mentions from highfive to triagebot.

I also fixed a few broken paths (error_codes.rs src/librustdoc/html/static/themes src/librustdoc/html/static/themes/ayu.css).
2022-06-27 22:35:14 +02:00
Matthias Krüger
b52c362b8b
Rollup merge of #98579 - RalfJung:alloc-tests, r=thomcc
liballoc tests: avoid int2ptr cast

I think we don't need `ptr::from_exposed_addr` here; `ptr::invalid` should be enough for this test. (And this makes Miri less unhappy when running these tests.)
2022-06-27 22:35:13 +02:00
Matthias Krüger
9f667994fd
Rollup merge of #98578 - rust-lang:oli-obk-patch-1, r=eddyb
Remove eddyb from miri failure pings

r? `@eddyb`
2022-06-27 22:35:11 +02:00
Matthias Krüger
d0ae6ebe63
Rollup merge of #98577 - GuillaumeGomez:associated-items, r=notriddle
Fix "kind" for associated types in trait implementations in rustdoc JSON

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

Contrary to what is suggested in the issue, I really think we should distinguish between associated items and "normal" constants and types.

cc `@CraftSpider` `@SimonSapin`
r? `@notriddle`
2022-06-27 22:35:11 +02:00
Matthias Krüger
950934801e
Rollup merge of #98576 - lcnr:region-stuff-cool-beans, r=jackh726
small regions refactoring

these commits should be fairly self-contained

r? rust-lang/types
2022-06-27 22:35:09 +02:00