Commit Graph

210535 Commits

Author SHA1 Message Date
Matthias Krüger
43fa2918d1
Rollup merge of #104508 - compiler-errors:dyn-return, r=oli-obk
Check `dyn*` return type correctly

In `check_fn`, if the declared return type is `dyn Trait`, then we check the return type separately to produce better diagnostics, because this is never valid -- however, when `dyn*` was introduced, this check was never adjusted to only account for *unsized* `dyn Trait` and not *sized* `dyn* Trait`.

Fixes #104501
2022-11-17 22:33:21 +01:00
Matthias Krüger
68a8109ddb
Rollup merge of #104503 - notriddle:notriddle/where, r=GuillaumeGomez
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-17 22:33:20 +01:00
Matthias Krüger
039cae73ad
Rollup merge of #104496 - djkoloski:dont_normalize_compiler_backtraces, r=jackh726
Don't attempt to normalize compiler backtraces

Backtraces can very significantly depending on environment and cause spurious test suite failures. Ensuring a proper failure-status should be sufficient to keep a crash properly documented.

This caused a failure in Fuchsia's test suite CI due to an extra newline between "stack" and "error" appearing after normalization.

cc ````@jackh726````
r? ````@tmandry````
2022-11-17 22:33:20 +01:00
Matthias Krüger
ed97f245f1
Rollup merge of #104483 - oli-obk:santa-clauses-make-goals, r=compiler-errors
Convert predicates into Predicate in the Obligation constructor

instead of having almost all callers do that.

This reduces a bit of boilerplate, and also paves the way for my work towards https://github.com/rust-lang/compiler-team/issues/531 (as it makes it easier to accept both goals and clauses where right now it only accepts predicates).
2022-11-17 22:33:19 +01:00
Matthias Krüger
1c52c247f9
Rollup merge of #104444 - chenyukang:yukang/fix-104390, r=compiler-errors
Fix ICE in in_operand for ty error

Fixes #104390

By the way, moving some test cases to proper directory for tidy bless.
2022-11-17 22:33:19 +01:00
Matthias Krüger
c9ccb0ba28
Rollup merge of #104433 - TaKO8Ki:fix-104392, r=estebank
Fix `emit_unused_delims_expr` ICE

Fixes #104392
2022-11-17 22:33:18 +01:00
Matthias Krüger
43dca249a2
Rollup merge of #104366 - GuillaumeGomez:simplify-settings-theme-choice, r=notriddle
Simplify settings theme choice

I removed the storage changes from https://github.com/rust-lang/rust/pull/98765 and only kept the UI changes.

You can test it [here](https://rustdoc.crud.net/imperio/simplify-settings-theme-choice/foo/index.html).

Discussion about this still in progress [on zulip](https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/Last.20part.20of.20settings.20simplification).

r? ````@notriddle````
2022-11-17 22:33:18 +01:00
Matthias Krüger
1521795a7d
Rollup merge of #103852 - compiler-errors:rpitit-early-from-impl, r=lcnr
Don't remap early-bound regions for return-position `impl Trait` in trait originating from `impl`

long title 😓

We don't want to remap early-bound regions that originate from the `impl`s themselves, since they have no corresponding region in the trait. Not sure if there's a better condition than checking if the EBR's def-id's parent is the impl -- maybe we should be checking if the region comes from the method or RPITIT... 🤷

r? types

Fixes #103850
2022-11-17 22:33:17 +01:00
Max Willsey
26b23f4a37 Improve accuracy of asinh and acosh 2022-11-17 12:50:33 -08:00
Ralf Jung
ff38c2891d fix a typo 2022-11-17 21:13:23 +01:00
Guillaume Gomez
23e5fa164e Migrate GUI test to use functions 2022-11-17 20:21:54 +01:00
Philipp Krones
4e65f5ea82
Add variant_name function to LangItem
Clippy has an internal lint that checks for the usage of hardcoded def
paths and suggests to replace them with a lang or diagnostic item, if
possible. This was implemented with a hack, by getting all the variants
of the `LangItem` enum and then index into it with the position of the
`LangItem` in the `items` list. This is no longer possible, because the
`items` list can't be accessed anymore.
2022-11-17 20:06:25 +01:00
Philipp Krones
34a14349b7
Readd the matches_macro diag item
This is now used by Clippy
2022-11-17 19:32:28 +01:00
bors
83356b78c4 Auto merge of #104361 - vladimir-ea:watchos_fix_linking, r=oli-obk
[watchos] Dynamic linking is not allowed for watchos targets

Dynamic linking of all apple targets was (re-) enabled in PR #100636. However, dynamic linking is not allowed on WatchOS so this broke the build of standard library for WatchOS.

This change disables dynamic linking for WatchOS non-simulator targets.
2022-11-17 17:15:31 +00:00
Yiming Lei
867582eb97 detect () to avoid redundant <> suggestion for type
fix #104379
2022-11-17 09:01:27 -08:00
bors
cf4da2d8aa Auto merge of #2677 - RalfJung:badge, r=RalfJung
remove CI badge

We don't actually run CI on the `master` branch (because bors checks things before they can even be on master), so this doesn't really show anything. rustc doesn't have a badge either. I think we can live without it. :D
2022-11-17 15:51:00 +00:00
Ralf Jung
8ec2149070 remove CI badge 2022-11-17 16:49:14 +01:00
Guillaume Gomez
11d0c97de9 Extend codeblock GUI test to include tooltips 2022-11-17 16:35:04 +01:00
Guillaume Gomez
16b55903ee Migrate tooltip style to CSS variables 2022-11-17 16:35:04 +01:00
bors
db0a48cc4d Auto merge of #2676 - RalfJung:empty, r=RalfJung
empty commit to go through bors

Go through bors once to clean up after the force push, have CI run, all the usual.
2022-11-17 15:18:23 +00:00
Ralf Jung
a00a094af2 empty commit to go through bors 2022-11-17 16:17:26 +01:00
bors
b6097f2e1b Auto merge of #104219 - bryangarza:async-track-caller-dup, r=eholk
Support `#[track_caller]` on async fns

Adds `#[track_caller]` to the generator that is created when we desugar the async fn.

Fixes #78840

Open questions:
- What is the performance impact of adding `#[track_caller]` to every `GenFuture`'s `poll(...)` function, even if it's unused (i.e., the parent span does not set `#[track_caller]`)? We might need to set it only conditionally, if the indirection causes overhead we don't want.
2022-11-17 13:47:03 +00:00
Deadbeef
d1c6b797de Move a ui test to make space for new folder 2022-11-17 12:46:43 +00:00
Deadbeef
0537d301c5 Add feature gate 2022-11-17 12:46:43 +00:00
Deadbeef
b2cb42d6a7 Minimal implementation of implicit deref patterns 2022-11-17 12:46:43 +00:00
Ralf Jung
955439508f update rust-version 2022-11-17 12:12:39 +01:00
Ralf Jung
da4eb351bd update josh scripts
- support pulling specific commit
- make rust-version update a separate commit to avoid confusing josh
- after pushing, check that we have a clear round-trip
2022-11-17 12:12:39 +01:00
Maybe Waffle
57e726108a Properly link {Once,Lazy}{Cell,Lock} in docs 2022-11-17 11:05:56 +00:00
Ralf Jung
3de7c2834f Auto merge of #2671 - klensy:shell_escape, r=RalfJung
recreated by hand
2022-11-17 11:59:07 +01:00
klensy
d0a7ae1a7a remove unused shell_escape dep 2022-11-17 11:59:02 +01:00
Ralf Jung
331b93a00b Auto merge of #2670 - RalfJung:retag, r=RalfJung
recreated by hand
2022-11-17 11:58:24 +01:00
Ralf Jung
f1a8701482 clean up retagging recursive traversal a bit 2022-11-17 11:58:14 +01:00
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