Commit Graph

238672 Commits

Author SHA1 Message Date
Michael Goulet
24e14dd8b4 Only check predicates for late-bound non-lifetime vars in object candidate assembly 2023-11-06 23:25:32 +00:00
bors
189d6c71f3 Auto merge of #117641 - matthiaskrgr:rollup-f9c12td, r=matthiaskrgr
Rollup of 4 pull requests

Successful merges:

 - #117190 (add test for #113381)
 - #117516 (add test for #113375)
 - #117631 (Documentation cleanup for core::error::Request.)
 - #117637 (Check binders with bound vars for global bounds that don't hold)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-11-06 21:43:55 +00:00
Michael Goulet
c17d33f1df Extend builtin/auto trait args with error when they have >1 argument 2023-11-06 21:29:08 +00:00
Matthias Krüger
9efe60b1eb
Rollup merge of #117637 - lqd:trivial-bounds-with-binder-vars, r=compiler-errors
Check binders with bound vars for global bounds that don't hold

This fixes `soa_derive-0.13.0` from #117589's crater run.

r? `@compiler-errors`
2023-11-06 20:31:56 +01:00
Matthias Krüger
2a1f8bccee
Rollup merge of #117631 - smarnach:error-request-doc-fix, r=ChrisDenton
Documentation cleanup for core::error::Request.

This part of the documentation currently render like this:

![image](https://github.com/rust-lang/rust/assets/249196/b34cb907-4ce4-4e85-beca-510d8aa1fefb)

The new version renders like this:

![image](https://github.com/rust-lang/rust/assets/249196/fe18398a-15fb-42a7-82a4-f1856d48bd79)

Fixes:
* Add missing closing back tick.
* Remove spurious double back ticks.
* Add missing newline to render bullet point correctly.
* Fix grammar "there are methods calledrequest_ref and request_value are available" -> "there are methods calledrequest_ref and request_value".
* Change "methods" to "functions", which seems more appropriate for free functions.
2023-11-06 20:31:55 +01:00
Matthias Krüger
8a34fea835
Rollup merge of #117516 - matthiaskrgr:test_effects_113375_oob, r=fee1-dead
add test for #113375

Fixes #113375

r? `@fee1-dead`
2023-11-06 20:31:55 +01:00
Matthias Krüger
1683df7d3b
Rollup merge of #117190 - matthiaskrgr:test_effects_113381, r=fee1-dead
add test for #113381

Fixes #113381

r? fee1-dead
2023-11-06 20:31:54 +01:00
bors
fb61292105 Auto merge of #117292 - estebank:issue-80446, r=davidtwco
Detect misparsed binop caused by missing semi

When encountering

```rust
foo()
*bar = baz;
```

We currently emit potentially two errors, one for the return type of
`foo` not being multiplicative by the type of `bar`, and another for
`foo() * bar` not being assignable.

We now check for this case and suggest adding a semicolon in the right
place and emit only a single error.

Fix #80446.
2023-11-06 18:46:04 +00:00
Esteban Küber
4b7aacaa4f Silence redundant error on typo resulting on binop 2023-11-06 17:38:06 +00:00
rustbot
bf65e3bddb Update books 2023-11-06 12:00:35 -05:00
Matthew Jasper
868de8e76b Visit patterns in THIR let expressions
This fixes some THIR unsafety checking errors not being emitted for
let expressions in these situations.
2023-11-06 16:23:09 +00:00
Matthew Jasper
2b59992736 Add suggestion to THIR unsafe_op_in_unsafe_fn lint 2023-11-06 16:23:09 +00:00
Matthew Jasper
2b2c0f9886 Allow tests with rust-rustfix and revisions 2023-11-06 16:23:08 +00:00
Matthew Jasper
931692fa13 Recognise thread local statics in THIR unsafeck 2023-11-06 16:23:08 +00:00
bors
aea82b268a Auto merge of #117603 - HKalbasi:make-feature-additive, r=Nilstrieb
Make the randomize feature of rustc_abi additive

The goal here is to make rust-analyzer able to build with the `rustc_private` versions of the rustc crates it depends on. See #116847
2023-11-06 16:17:49 +00:00
Rémy Rakic
58351ae03f add test for trivial bound not holding in soa-derive 2023-11-06 15:50:35 +00:00
Rémy Rakic
2beca157c9 check binders with bound vars for global bounds that don't hold
(instead of just late bound vars)
2023-11-06 15:46:17 +00:00
Pietro Albini
580fa0c1a9
rename github_repository to git_repository 2023-11-06 15:53:32 +01:00
bors
b049093560 Auto merge of #116988 - RalfJung:null, r=WaffleLapkin
document that the null pointer has the 0 address

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

Will need t-lang FCP, but I think this is fairly uncontroversial -- there's probably already tons of code out there that relies on this.
2023-11-06 14:13:00 +00:00
Nilstrieb
ffffc2038f Update ICU4X
This updates all ICU4X crates and regenerates rustc_baked_icu_data.

Since the new unicode license under which they are licensed does not
have an SPDX identifier yet, we define some exceptions. The license has
to be reviewed to make sure it is still fine to use here, but I assume
that is the case.

I also added an exception for rustc_icu_data to the unexplained ignore
doctest tidy lint. This is a bit hacky but the whole style.rs in tidy is
a mess so I didn't want to touch it more than this small hack.
2023-11-06 13:42:20 +00:00
bors
e1fcecb1b9 Auto merge of #117630 - matthiaskrgr:rollup-v0d5p3f, r=matthiaskrgr
Rollup of 3 pull requests

Successful merges:

 - #117592 (Use the correct span when emitting the `env!` result)
 - #117613 (Remove from vacation and compiler review group)
 - #117615 (Couple of small changes)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-11-06 12:08:40 +00:00
Sven Marnach
3a096e96fa
Documentation cleanup for core::error::Request. 2023-11-06 11:38:27 +01:00
Matthias Krüger
b88d62e222
Rollup merge of #117615 - bjorn3:misc_changes, r=davidtwco
Couple of small changes

These are unrelated to each other, but they are each small enough that opening separate PR's doesn't make sense to me either.

* Remove a place where the parse driver query is stolen.
* Update an outdated doc comment
* Use correct crate name in `-Zprint-vtable-sizes` when using `#![crate_name = "..."]`.
2023-11-06 11:28:19 +01:00
Matthias Krüger
ec35c03143
Rollup merge of #117613 - jackh726:vacation, r=compiler-errors
Remove from vacation and compiler review group

Staying on the types review rotation, but staying off the general review queue is good for me right now.

Also move ``@compiler-errors`` since he's a full member now.
2023-11-06 11:28:18 +01:00
Matthias Krüger
60dca87cff
Rollup merge of #117592 - thomcc:env-span-wrong, r=davidtwco
Use the correct span when emitting the `env!` result

The span used for the `env!` resut changed in 1.73, due to 75df62d4a2 (from https://github.com/rust-lang/rust/pull/114014).

This prevents [a lint in `plrustc`](https://github.com/tcdi/plrust/blob/main/plrustc/plrustc/src/lints/builtin_macros.rs#L54-L60)[^1] from working well, because the resulting span is not inside the  region where the lint is `#[deny()]`ed.

[^1]: Perhaps worth noting that the `env_macro` diagnostic item comes from [the std fork used with PL/Rust](https://github.com/tcdi/postgrestd/blob/rust-1.73.0/library/core/src/macros/mod.rs#L944).

Unfortunately, I have no idea how to write a test for this since I don't think we can have a custom lint in a test. A suggestion was made to use a custom proc macro for it, but that seems pretty involved (frankly, I might not have time to do it).

r? ``@davidtwco`` (since they're the author of the PR with the regression)

P.S. We generally try to avoid bothering upstream about PL/Rust-specific stuff (we don't want to nag), but this seems like an actual bug, since the other similar macros, such as `option_env` use the other span (and are lintable as a result).
2023-11-06 11:28:18 +01:00
bors
6bf2fb3679 Auto merge of #117578 - compiler-errors:derive-encode-in-rustc_type_ir, r=davidtwco
Derive `TyEncodable`/`TyDecodable` in `rustc_type_ir`

when `derive(TyEncodable)` or `derive(TyDecodable)` sees an `I` type parameter on a struct that has no `'tcx`, then parameterize the `TyEncoder`/`TyDecoder`'s interner over that variable rather than `TyCtxt<'tcx>`.

Also, emit where clauses for fields rather than generics.
2023-11-06 10:10:52 +00:00
Ralf Jung
b85c6835d0 warn when using an unstable feature with -Ctarget-feature 2023-11-06 09:44:00 +01:00
bors
f9b644636f Auto merge of #117435 - SparrowLii:nightly_parallel, r=oli-obk,davidtwco
enable parallel rustc front end in nightly builds

Refers to the [MCP](https://github.com/rust-lang/compiler-team/issues/681), this pr does:
1. Enable the parallel front end in nightly builds, and keep the default number of threads as 1. Then users can use the parallel rustc front end via -Z threads=n option.

2. Set it up to serial front end for beta/stable builds via bootstrap.

3. Switch over the alt builders from parallel rustc to serial, so we have artifacts without parallel to test against the artifacts with parallel.

r? `@oli-obk`

cc `@cjgillot` `@nnethercote` `@bjorn3` `@Kobzol`
2023-11-06 07:41:22 +00:00
bors
fcca978aa0 Auto merge of #117607 - klensy:clang-17.0.4, r=Mark-Simulacrum
bump clang version for dist-x86_64-linux from 17.0.2 to 17.0.4

This fixes few miscompiles, so nice to have.

Release notes:
https://discourse.llvm.org/t/llvm-17-0-3-released/74172
https://discourse.llvm.org/t/llvm-17-0-4-released/74548

>The next release will be 17.0.5, in two weeks 14th of November.

Or maybe delay until 17.0.5?
2023-11-06 04:08:15 +00:00
bors
152a4e90d1 Auto merge of #117585 - dnbln:feat/move-kw-span, r=cjgillot
Add the `Span` of the `move` keyword to the HIR.

This is required to implement a lint like the one described here: https://github.com/rust-lang/rust-clippy/issues/11721
2023-11-06 02:07:34 +00:00
SparrowLii
f2a40e99ff use portable AtomicU64 for powerPC and MIPS 2023-11-06 09:58:51 +08:00
bors
7a892ab8d8 Auto merge of #117576 - the8472:fix-io-copy-vec, r=Mark-Simulacrum
Fix excessive initialization and reads beyond EOF in `io::copy(_, Vec<u8>)` specialization

fixes #117545 and https://github.com/bczhc/bzip3-rs/pull/8
2023-11-06 00:05:58 +00:00
bors
fee5518cdd Auto merge of #96979 - SabrinaJewson:waker-update, r=workingjubilee
Override `Waker::clone_from` to avoid cloning `Waker`s unnecessarily

This would be very useful for futures — I think it’s pretty much always what they want to do instead of `*waker = cx.waker().clone()`.

Tracking issue: https://github.com/rust-lang/rust/issues/98287

r? rust-lang/libs-api `@rustbot` label +T-libs-api -T-libs
2023-11-05 21:44:24 +00:00
bjorn3
438194980b Implement all avx2 intrinsics used by the image crate 2023-11-05 19:49:30 +00:00
bors
c1ccc29cd6 Auto merge of #117191 - Skgland:easy-beta-channels, r=Mark-Simulacrum
generate beta manifests as pre-requisit to rust-lang/rustup#1329

<https://github.com/rust-lang/rustup/issues/1329#issuecomment-1134946736> mentioned (a while ago) this would be the next step
2023-11-05 19:43:04 +00:00
bjorn3
6a53acefd8 Implement _mm256_permute2f128_ps and _mm256_permute2f128_pd intrinsics 2023-11-05 18:24:39 +00:00
hkalbasi
c8a25eddfe Make the randomize feature of rustc_abi additive 2023-11-05 21:51:47 +03:30
bors
5103173af1 Auto merge of #117179 - Voultapher:fix-useless-comp-in-partition-equal, r=Mark-Simulacrum
Avoid unnecessary comparison in partition_equal

The branchy Hoare partition `partition_equal` as part of `slice::sort_unstable` has a bug that makes it perform a comparison of the last element twice.

Measuring inputs with a Zipfian distribution with characterizing exponent s == 1.0, yields a ~0.05% reduction in the total number of comparisons performed.
2023-11-05 17:41:36 +00:00
Urgau
15719a8c1d libc: bump dependency to 0.2.150 2023-11-05 18:32:10 +01:00
bjorn3
ec29a02071 Update doc comment for CodegenBackend::link 2023-11-05 16:29:16 +00:00
bjorn3
ba82056a14 Use the actual computed crate name for -Zprint-vtable-sizes 2023-11-05 16:29:15 +00:00
bjorn3
1a1b10fa63 Don't steal the parse query when using --pretty
This is the only place aside from the global_ctxt query where it is
stolen.
2023-11-05 16:29:15 +00:00
bors
6c7de3181b Auto merge of #117574 - onur-ozkan:fix-compiler-crate-linking, r=Mark-Simulacrum
improve compiler&tool documenting and re-enable cranelift on CI

First commit addresses the linking issue with compiler crates. Second one ensures that compiler crates are linked correctly (with later commits we added this check for tools as well), allowing us to detect these hard-to-catch bugs on CI. Following three commits cherry-picked from #117328 to re-enable the Cranelift backend on CI.

More info: https://github.com/rust-lang/rust/issues/117430

cc `@bjorn3` `@RalfJung`
2023-11-05 15:41:35 +00:00
Jack Huey
6e33e89337 Remove from vacation and compiler review group 2023-11-05 10:09:51 -05:00
onur-ozkan
b0df8216ed bootstrap: improve linking of tool docs
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2023-11-05 17:01:53 +03:00
bors
c1c9e10f72 Auto merge of #15832 - Young-Flash:generate_mut_trait, r=lnicola
feat: add generate_mut_trait_impl assist

![generate_mut_trait_impl](https://github.com/rust-lang/rust-analyzer/assets/71162630/362a5a93-e109-4ffc-996e-9b6e4f54fcfa)

Generate proper `index_mut` method body refer to `index` method body may impossible due to the unpredicable case (#15581).

Here just leave the `index_mut` method body be same as `index` method body, user can modify it manually to meet their need.
2023-11-05 14:00:24 +00:00
bors
992943dbae Auto merge of #117537 - GKFX:offset-of-enum-feature, r=cjgillot
Feature gate enums in offset_of

As requested at https://github.com/rust-lang/rust/issues/106655#issuecomment-1790815262, put enums in offset_of behind their own feature gate.

`@rustbot` label F-offset_of
2023-11-05 13:44:59 +00:00
bors
04817ff00c Auto merge of #117608 - matthiaskrgr:rollup-g9fagmv, r=matthiaskrgr
Rollup of 4 pull requests

Successful merges:

 - #116017 (Don't pass `-stdlib=libc++` when building C files on macOS)
 - #117524 (bootstrap/setup: create hooks directory if non-existing)
 - #117588 (Remove unused LoadResult::DecodeIncrCache variant)
 - #117596 (Add diagnostic items for a few of core's builtin macros)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-11-05 11:47:38 +00:00
Matthias Krüger
a660516334
Rollup merge of #117596 - thomcc:core_macro_diag_items, r=Nilstrieb
Add diagnostic items for a few of core's builtin macros

Specifically, `env`, `option_env`, and `include`. There are a number of reasons why people might want to look at these in lints (For example, to ensure that things behave consistently, detect things that might make builds less reproducible, etc).

Concretely, in PL/Rust (well, `plrustc`) we have lints that forbid these (which I'd like to [add to clippy as restriction lints](https://rust-lang.zulipchat.com/#narrow/stream/257328-clippy/topic/Landing.20a.20flotilla.20of.20lints.3F) eventually), and `dylint` also has [lints that look for `env!`/`option_env!`](109a07e9f2/examples/general/env_cargo_path/src/lib.rs) (although perhaps not `include`), which would benefit from this.

My experience is that it's pretty annoying to (robustly) check uses of builtin macros without these IME, although that's perhaps just my own fault (e.g. I could be doing it wrong).

At `@Nilstrieb's` suggestion, I've added a comment that explains why these are here, even though they are not used in the compiler. This is mostly to discourage removal, although it's not a big deal if it happens (I'm certainly not suggesting the presence of these be in any way stable).

---

In theory this is a library PR (in that it's in library/core), but I'm going to roll compiler because the existence of this or not is much more likely something they care about rather than libs. Hopefully nobody objects to this.

r? compiler
2023-11-05 12:41:48 +01:00
Matthias Krüger
629ee74337
Rollup merge of #117588 - bjorn3:remove_unused_error_variant, r=cjgillot
Remove unused LoadResult::DecodeIncrCache variant
2023-11-05 12:41:47 +01:00