Commit Graph

210624 Commits

Author SHA1 Message Date
bors
36db030a7c Auto merge of #104205 - clubby789:grow-rc, r=thomcc
Attempt to reuse `Vec<T>` backing storage for `Rc/Arc<[T]>`

If a `Vec<T>` has sufficient capacity to store the inner `RcBox<[T]>`, we can just reuse the existing allocation and shift the elements up, instead of making a new allocation.
2022-11-17 10:48:22 +00:00
Ayush Singh
2436dff772
Use custom entry name in cranelift
This is a continuation of 9f0a8620bd for
cranelift.

Signed-off-by: Ayush Singh <ayushsingh1325@gmail.com>
2022-11-17 15:28:47 +05:30
Pietro Albini
00ec6797a3
fmt 2022-11-17 09:56:59 +01:00
Pietro Albini
6bfbd113e2
run tests on the remote device even when the default address is used
When running tests inside the Android emulator, bootstrap doesn't set
the TEST_DEVICE_ADDR environment variable, as the default address
(127.0.0.1:12345) is used.

Instead, REMOTE_TEST_CLIENT is set all the times when remote testing is
needed, and in no other cases. To ensure Android tests are executed in
the emulator, change the check.
2022-11-17 09:37:41 +01:00
Pietro Albini
6d8160261f
set correct default value for cc and cxx on android 2022-11-17 09:37:39 +01:00
Pietro Albini
09340e3c57
install the target g++ in armhf-gnu 2022-11-17 09:37:37 +01:00
Pietro Albini
c80af320bb
issue-36710 test can now run on cross-compiled targets 2022-11-17 09:37:34 +01:00
Pietro Albini
ecaa342702
Revert "test: run-make: skip when cross-compiling"
This reverts commit 0567fec8e4.
2022-11-17 09:37:32 +01:00
Pietro Albini
b2c74ab82b
add support for running binaries with remote-test-client on run-make 2022-11-17 09:37:30 +01:00
Ralf Jung
99f7e9494e try_normalize_after_erasing_regions: promote an assertion to always run 2022-11-17 09:06:15 +01:00
bors
7c75fe4c85 Auto merge of #104170 - cjgillot:hir-def-id, r=fee1-dead
Record `LocalDefId` in HIR nodes instead of a side table

This is part of an attempt to remove the `HirId -> LocalDefId` table from HIR.
This attempt is a prerequisite to creation of `LocalDefId` after HIR lowering (https://github.com/rust-lang/rust/pull/96840), by controlling how `def_id` information is accessed.

This first part adds the information to HIR nodes themselves instead of a table.
The second part is https://github.com/rust-lang/rust/pull/103902
The third part will be to make `hir::Visitor::visit_fn` take a `LocalDefId` as last parameter.
The fourth part will be to completely remove the side table.
2022-11-17 07:42:27 +00:00
Michael Howell
ebee589bc0 rustdoc: clean up sidebar width CSS
This commit takes advantage of the ability to set [flex-basis] to a specific
length instead of setting it to `auto` and changing min-/max-width, and
setting flex-grow/-shrink both to 0.

[flex-basis]: https://developer.mozilla.org/en-US/docs/Web/CSS/flex-basis
2022-11-16 22:57:08 -07:00
bors
9340e5c1b9 Auto merge of #103779 - the8472:simd-str-contains, r=thomcc
x86_64 SSE2 fast-path for str.contains(&str) and short needles

Based on Wojciech Muła's [SIMD-friendly algorithms for substring searching](http://0x80.pl/articles/simd-strfind.html#sse-avx2)

The two-way algorithm is Big-O efficient but it needs to preprocess the needle
to find a "critical factorization" of it. This additional work is significant
for short needles. Additionally it mostly advances needle.len() bytes at a time.

The SIMD-based approach used here on the other hand can advance based on its
vector width, which can exceed the needle length. Except for pathological cases,
but due to being limited to small needles the worst case blowup is also small.

benchmarks taken on a Zen2, compiled with `-Ccodegen-units=1`:

```
OLD:
test str::bench_contains_16b_in_long                     ... bench:         504 ns/iter (+/- 14) = 5061 MB/s
test str::bench_contains_2b_repeated_long                ... bench:         948 ns/iter (+/- 175) = 2690 MB/s
test str::bench_contains_32b_in_long                     ... bench:         445 ns/iter (+/- 6) = 5732 MB/s
test str::bench_contains_bad_naive                       ... bench:         130 ns/iter (+/- 1) = 569 MB/s
test str::bench_contains_bad_simd                        ... bench:          84 ns/iter (+/- 8) = 880 MB/s
test str::bench_contains_equal                           ... bench:         142 ns/iter (+/- 7) = 394 MB/s
test str::bench_contains_short_long                      ... bench:         677 ns/iter (+/- 25) = 3768 MB/s
test str::bench_contains_short_short                     ... bench:          27 ns/iter (+/- 2) = 2074 MB/s

NEW:
test str::bench_contains_16b_in_long                     ... bench:          82 ns/iter (+/- 0) = 31109 MB/s
test str::bench_contains_2b_repeated_long                ... bench:          73 ns/iter (+/- 0) = 34945 MB/s
test str::bench_contains_32b_in_long                     ... bench:          71 ns/iter (+/- 1) = 35929 MB/s
test str::bench_contains_bad_naive                       ... bench:           7 ns/iter (+/- 0) = 10571 MB/s
test str::bench_contains_bad_simd                        ... bench:          97 ns/iter (+/- 41) = 762 MB/s
test str::bench_contains_equal                           ... bench:           4 ns/iter (+/- 0) = 14000 MB/s
test str::bench_contains_short_long                      ... bench:          73 ns/iter (+/- 0) = 34945 MB/s
test str::bench_contains_short_short                     ... bench:          12 ns/iter (+/- 0) = 4666 MB/s
```
2022-11-17 04:47:11 +00:00
Nicholas Nethercote
67d5cc0462 Use ThinVec in ast::Path. 2022-11-17 13:56:38 +11:00
Nicholas Nethercote
6b7ca2fcf2 Box ExprKind::{Closure,MethodCall}, and QSelf in expressions, types, and patterns. 2022-11-17 13:45:59 +11:00
bors
251831ece9 Auto merge of #103138 - nnethercote:merge-BBs, r=bjorn3
Merge basic blocks where possible when generating LLVM IR.

r? `@ghost`
2022-11-17 01:56:24 +00:00
Scott McMurray
9d4b1f98e6 Ignore the unchecked-shifts codegen test in debug-assertions builds 2022-11-16 15:58:43 -08:00
bors
bebd57a960 Auto merge of #102944 - nnethercote:ast-Lit-third-time-lucky, r=petrochenkov
Use `token::Lit` in `ast::ExprKind::Lit`.

Instead of `ast::Lit`.

Literal lowering now happens at two different times. Expression literals are lowered when HIR is crated. Attribute literals are lowered during parsing.

r? `@petrochenkov`
2022-11-16 23:03:14 +00:00
Michael Goulet
75afb22331 Check dyn* return type correctly 2022-11-16 22:21:41 +00:00
Michael Howell
893bd781be rustdoc: remove redundant font-color CSS on .where
Before 7f6ce7dddd, light-theme where clauses
had color `#4E4C4C` while the main color was `#000`. One of that commit's
simplifications made it so that everything used the same black.
2022-11-16 13:28:51 -07:00
bors
e9493d63c2 Auto merge of #104456 - RalfJung:miri, r=RalfJung
update Miri

Not a huge sync, but there was a conflict and [josh](https://github.com/josh-project/josh/) seems to prefer those to be merged back ASAP.
2022-11-16 19:52:45 +00:00
Martin Nordholts
8b5bfaf662 rustdoc JSON: Use Function everywhere and remove Method 2022-11-16 20:24:03 +01:00
David Koloski
b44d808e4a Don't attempt to normalize compiler backtraces
Backtraces can very significantly depending on environment and cause
test suite failures spuriously. Ensuring a proper failure-status should
be sufficient to keep a crash properly documented.
2022-11-16 12:35:30 -05:00
bors
e69336efe0 Auto merge of #104492 - matthiaskrgr:rollup-3xyjynz, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - #103750 (Fix some misleading target feature aliases)
 - #104137 (Issue error when -C link-self-contained option is used on unsupported platforms)
 - #104317 (cleanup and dedupe CTFE and Miri error reporting)
 - #104335 (Only do parser recovery on retried macro matching)
 - #104394 (various cleanups to try to reduce the use of spans inside method resolution)
 - #104459 (rustdoc: remove unused JS IIFE from main.js)
 - #104462 (rustdoc: remove pointless CSS `.rightside { padding-right: 2px }`)
 - #104466 (rustdoc: remove no-op CSS `#crate-search-div { display: inline-block }`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-11-16 15:55:30 +00:00
Ralf Jung
157b2d5436 ensure rand has its default features enabled 2022-11-16 16:13:55 +01:00
Matthias Krüger
972ad00094
Rollup merge of #104466 - notriddle:notriddle/crate-search-div-display, r=GuillaumeGomez
rustdoc: remove no-op CSS `#crate-search-div { display: inline-block }`

`#crate-search-div` is nested directly below `.search-results-title`, which has `display: inline-flex`. This makes the crate-search-div a [flex item], which makes its display property irrelevant, because flex items have their display [blockified] in any case.

[flex item]: https://developer.mozilla.org/en-US/docs/Glossary/Flex_Item
[blockified]: https://www.w3.org/TR/css-flexbox-1/#flex-items
2022-11-16 15:39:48 +01:00
Matthias Krüger
938948ea80
Rollup merge of #104462 - notriddle:notriddle/rightside-padding-right, r=GuillaumeGomez
rustdoc: remove pointless CSS `.rightside { padding-right: 2px }`

This CSS was added in 34bd2b845b, as `.since { padding-right: 2px }`, to prevent it from uncomfortably touching the srclink, which were separate floated elements. It was carried forward with 962c0a4ee5 to the new `.rightside`, but its role was replaced with adding " &bull; " between them. All it does now is pushes the element 2px away from the page's right margin.

Removing this rule changes the page layout, but you have to look for it to notice it.
2022-11-16 15:39:47 +01:00
Matthias Krüger
baf1cbb70d
Rollup merge of #104459 - notriddle:notriddle/main-js-iife, r=GuillaumeGomez
rustdoc: remove unused JS IIFE from main.js

This [IIFE] made sense when it was added in f0683f98fa and there was a local variable scoped to it, but now it only sets two globals, so it does nothing.

[IIFE]: https://developer.mozilla.org/en-US/docs/Glossary/IIFE "immediately invoked function expression"
2022-11-16 15:39:47 +01:00
Matthias Krüger
163a7090b8
Rollup merge of #104394 - oli-obk:suggest_method_call, r=lcnr
various cleanups to try to reduce the use of spans inside method resolution

definitely review commit by commit.
2022-11-16 15:39:46 +01:00
Matthias Krüger
e033a389e1
Rollup merge of #104335 - Nilstrieb:macrowo, r=compiler-errors
Only do parser recovery on retried macro matching

Eager parser recovery can break macros, so we don't do it at first. But when we already know that the macro failed, we can retry it with recovery enabled to still emit useful diagnostics.

Helps with #103534
2022-11-16 15:39:46 +01:00
Matthias Krüger
353b915fec
Rollup merge of #104317 - RalfJung:ctfe-error-reporting, r=oli-obk
cleanup and dedupe CTFE and Miri error reporting

It looks like most of the time, this error raised from const_prop_lint is just redundant -- it duplicates the error reported when evaluating the const-eval query. This lets us make `ConstEvalErr` private to the const_eval module which I think is a good step.

The Miri change mostly replaces a `match` by `if let`, and dedupes the "this error is impossible in Miri" checks.

r? ``@oli-obk``
Fixes https://github.com/rust-lang/rust/issues/75461
2022-11-16 15:39:45 +01:00
Matthias Krüger
fbcd751ea1
Rollup merge of #104137 - StackDoubleFlow:err-lsc-unsupported, r=bjorn3
Issue error when -C link-self-contained option is used on unsupported platforms

The documentation was also updated to reflect this.

I'm assuming the supported platforms are the same as initially written in [RELEASES.md](https://github.com/rust-lang/rust/blob/master/RELEASES.md#compiler-17).

Fixes #103576
2022-11-16 15:39:45 +01:00
Matthias Krüger
56a28a65f5
Rollup merge of #103750 - calebzulawski:master, r=workingjubilee
Fix some misleading target feature aliases

This is the first half of a fix for #100752.  It looks like these aliases were added in #78361 and slipped under the radar, as these features are not AVX512.  These features _do_ add AVX512 instructions when used _in combination_ with AVX512F, but without AVX512F, these features still provide 128-bit and 256-bit vector instructions.  A user might be mislead into thinking these features imply AVX512F (which is true of the actual AVX512 features).  This PR allows using the names as defined by LLVM, which matches Intel documentation.

A future PR should change the `std::arch` intrinsics to use these names, and finally remove these aliases from rustc.

r? ```@workingjubilee```

cc ```@Amanieu```
2022-11-16 15:39:44 +01:00
klensy
658586c74a update ntapi dep to remove future-incompat warning 2022-11-16 14:49:54 +03:00
yukang
9c2d4dd529 fix #104510, Remove is_tainted_by_errors since we have ty_error for delay bug 2022-11-16 19:41:08 +08:00
bors
63c748ee23 Auto merge of #104481 - matthiaskrgr:rollup-hf8rev0, r=matthiaskrgr
Rollup of 10 pull requests

Successful merges:

 - #103484 (Add `rust` to `let_underscore_lock` example)
 - #103489 (Make `pointer::byte_offset_from` more generic)
 - #104193 (Shift no characters when using raw string literals)
 - #104348 (Respect visibility & stability of inherent associated types)
 - #104401 (avoid memory leak in mpsc test)
 - #104419 (Fix test/ui/issues/issue-30490.rs)
 - #104424 (rustdoc: remove no-op CSS `.popover { font-size: 1rem }`)
 - #104425 (rustdoc: remove no-op CSS `.main-header { justify-content }`)
 - #104450 (Fuchsia test suite script fix)
 - #104471 (Update PROBLEMATIC_CONSTS in style.rs)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-11-16 10:27:24 +00:00
yukang
20ea083d87 fix #104390, fix ICE in in_operand for ty error 2022-11-16 17:48:13 +08:00
Oli Scherer
4f11f3b257 Convert predicates into Predicate in the Obligation constructor 2022-11-16 09:25:19 +00:00
Oli Scherer
634df06fae Generalize the ToPredicate trait
Its name is now not accurate anymore, but we'll adjust that later
2022-11-16 09:20:28 +00:00
Ralf Jung
1115ec601a cleanup and dedupe CTFE and Miri error reporting 2022-11-16 10:13:29 +01:00
Pietro Albini
470423c3d2
normalize download-rustc's prefix when running compiletests 2022-11-16 10:07:42 +01:00
Pietro Albini
80d535966c
normalize source paths from sysroot in compiletest 2022-11-16 10:01:07 +01:00
Matthias Krüger
8bbecb9a42
Rollup merge of #104471 - scruss:patch-1, r=jyn514
Update PROBLEMATIC_CONSTS in style.rs

added 3735932941, since 3735927486 was already present.
2022-11-16 08:36:14 +01:00
Matthias Krüger
c32d79c983
Rollup merge of #104450 - andrewpollack:fix-fuchsia-compiler-docs, r=tmandry
Fuchsia test suite script fix

Fixing error from https://github.com/rust-lang/rust/pull/103842#discussion_r1022178201

r? ```@tmandry```
2022-11-16 08:36:14 +01:00
Matthias Krüger
25c3180d15
Rollup merge of #104425 - notriddle:notriddle/main-heading-justify-content, r=GuillaumeGomez
rustdoc: remove no-op CSS `.main-header { justify-content }`

This rule was added in 152e888905 to push the out-of-band content to the right while allowing it to line wrap when it got too big. The idea was that the justification rule would fill the space between the `<h1>` element and the `<div class="out-of-band">` element.

A later commit, 3cb03cb342, flattened the in-band element into the `<h1>`, copying the `flex-grow` rule. This means the `<h1>` element now grows to fill the space, so there's no need to justify-content any more.

This commit also adds a test case for this.
2022-11-16 08:36:13 +01:00
Matthias Krüger
b9d028ae99
Rollup merge of #104424 - notriddle:notriddle/popover-font-size, r=GuillaumeGomez
rustdoc: remove no-op CSS `.popover { font-size: 1rem }`

This rule was added in cc4f804829 because the help popover inherited the font-size from the help button "?" icon.

It doesn't inherit this any more, because it was moved from being nested inside the link to sharing a wrapper DIV with it.
2022-11-16 08:36:13 +01:00
Matthias Krüger
4ef422e2b9
Rollup merge of #104419 - Ayush1325:test-issue-30490, r=lcnr
Fix test/ui/issues/issue-30490.rs

Since the empty main is used for `not(unix)`, all the targets that will use this empty main will also need `allow(unused_imports)`.

Originally part of https://github.com/rust-lang/rust/pull/100316

Signed-off-by: Ayush Singh <ayushsingh1325@gmail.com>
2022-11-16 08:36:12 +01:00
Matthias Krüger
4864a04c33
Rollup merge of #104401 - RalfJung:mpsc-leak, r=Amanieu
avoid memory leak in mpsc test

r? ```@Amanieu```
2022-11-16 08:36:12 +01:00
Matthias Krüger
3a8cacd7fb
Rollup merge of #104348 - fmease:iat-vis-stab, r=cjgillot
Respect visibility & stability of inherent associated types

As discussed in #103621, this probably won't be the final location of the code that resolves inherent associated types. Still, I think it's valuable to push correctness fixes for this feature (in regards to visibility and stability).

Let me know if I should write a translatable diagnostic instead and if I should move the tests to `privacy/` and `stability-attribute/` respectively.

Fixes #104243.
````@rustbot```` label A-visibility F-inherent_associated_types
r? ````@cjgillot```` (since you reviewed #103621, feel free to reroll though)
2022-11-16 08:36:11 +01:00
Matthias Krüger
88a19197b9
Rollup merge of #104193 - TaKO8Ki:fix-104142, r=cjgillot
Shift no characters when using raw string literals

Fixes #104142

Given the following code:

```rust
fn main() {
    println!(r#"\'\'\'\'\'\'\'\'\'\'\'\'\'\'}"#);
}
```

The current output is:

```
error: invalid format string: unmatched `}` found
 --> src/main.rs:2:59
  |
2 |     println!(r#"\'\'\'\'\'\'\'\'\'\'\'\'\'\'}"#); //~ ERROR invalid format string: unmatched `}` found
  |                                                           ^ unmatched `}` in format string
  |
  = note: if you intended to print `}`, you can escape it using `}}`

error: could not compile `debug_playground` due to previous error
```

The output should look like:

```
error: invalid format string: unmatched `}` found
 --> src/main.rs:2:45
  |
2 |     println!(r#"\'\'\'\'\'\'\'\'\'\'\'\'\'\'}"#); //~ ERROR invalid format string: unmatched `}` found
  |                                             ^ unmatched `}` in format string
  |
  = note: if you intended to print `}`, you can escape it using `}}`

error: could not compile `debug_playground` due to previous error
```

This pull request fixes the wrong span for `invalid format string` error and also solves the ICE.
2022-11-16 08:36:11 +01:00