Commit Graph

249653 Commits

Author SHA1 Message Date
bors
a615cea333 Auto merge of #121885 - reitermarkus:generic-nonzero-inner, r=oli-obk,wesleywiser
Move generic `NonZero` `rustc_layout_scalar_valid_range_start` attribute to inner type.

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

r? `@dtolnay`
2024-03-17 02:27:52 +00:00
bors
c8813ddd6d Auto merge of #122607 - fmease:rollup-ozl1eeq, r=fmease
Rollup of 9 pull requests

Successful merges:

 - #117918 (Add `wasm_c_abi` `future-incompat` lint)
 - #121545 (fix attribute validation on associated items in traits)
 - #121720 (Split refining_impl_trait lint into _reachable, _internal variants)
 - #122270 (fix `long-linker-command-lines` failure caused by `rust.rpath=false`)
 - #122564 (Delegation: fix ICE on duplicated associative items)
 - #122577 (Remove obsolete parameter `speculative` from `instantiate_poly_trait_ref`)
 - #122601 (Optimize `ptr::replace`)
 - #122604 (Mention jieyouxu for changes to compiletest, run-make tests and the run-make-support library)
 - #122605 (rustc-metadata: Store crate name in self-profile of metadata_register_crate)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-03-17 00:22:29 +00:00
León Orell Valerian Liehr
caa6131ae5
Rollup merge of #122605 - osiewicz:metadata-register-crate-store-crate-name-in-profile, r=Nadrieril
rustc-metadata: Store crate name in self-profile of metadata_register_crate

When profiling a build of Zed, I found myself in need of names of crates that take the longest to register in downstream crates.
2024-03-16 23:28:50 +01:00
León Orell Valerian Liehr
53515f3faf
Rollup merge of #122604 - jieyouxu:triagebot-mention-compiletest-run-make, r=Nilstrieb
Mention jieyouxu for changes to compiletest, run-make tests and the run-make-support library
2024-03-16 23:28:50 +01:00
León Orell Valerian Liehr
de0c2a4723
Rollup merge of #122601 - joboet:ptr_replace, r=workingjubilee
Optimize `ptr::replace`

#83022 optimized `mem::replace` to reduce the number of `memcpy`s. `ptr::replace`, which is [documented to behave just like `mem::replace`](https://doc.rust-lang.org/nightly/std/ptr/fn.replace.html), was not optimized however, leading to [worse code](https://godbolt.org/z/T3hdEEdfe) and missed optimizations. This PR simply forwards `ptr::replace` to `mem::replace` to take advantage of the better implementation.
2024-03-16 23:28:49 +01:00
León Orell Valerian Liehr
4cbfa15a2d
Rollup merge of #122577 - fmease:speculative-say-what, r=compiler-errors
Remove obsolete parameter `speculative` from `instantiate_poly_trait_ref`

In #122527 I totally missed that `speculative` has become obsolete with the removal of `hir_trait_to_predicates` / due to #113671.

Fixes #114635.

r? `@compiler-errors`
2024-03-16 23:28:49 +01:00
León Orell Valerian Liehr
7b7a7fc891
Rollup merge of #122564 - Bryanskiy:delegation-fixes, r=compiler-errors
Delegation: fix ICE on duplicated associative items

Currently, functions delegation is only supported for delegation items with early resolved paths e.g. free functions and trait methods. During name resolution, information about function signatures is collected, including the number of parameters and whether there are self arguments. This information is then used when lowering from a delegation item into a regular function(`rustc_ast_lowering/src/delegation.rs`). The signature is usually inherited from path resolution id(`path_id`). However, in the case of trait impls `path_id` and `item_id` may be different:

```rust
trait Trait {
    fn foo(&self) -> u32 { 0 }
}

struct S;

mod to_reuse {
    use crate::S;

    pub fn foo(_: &S) -> u32 { 0 }
}

impl Trait for S {
    reuse to_reuse::foo { self }
    //~^ The signature should be inherited from item id instead of resolution id
}

```

Let's now consider an example from [issue](https://github.com/rust-lang/rust/issues/119920). Due to duplicated associative elements partial resolution for one of them will not be recorded:

9023f908cf/compiler/rustc_resolve/src/late.rs (L3153-L3162)

Which leads to an incorrect `is_in_trait_impl`

9023f908cf/compiler/rustc_ast_lowering/src/item.rs (L981-L986)

Which leads to an incorrect id for signature inheritance

9023f908cf/compiler/rustc_ast_lowering/src/delegation.rs (L99-L105)

Which lead to an ICE from original issue.

This patch fixes wrong `is_in_trait_impl`  calculation.

fixes https://github.com/rust-lang/rust/issues/119920
2024-03-16 23:28:48 +01:00
León Orell Valerian Liehr
c2b7d77d95
Rollup merge of #122270 - onur-ozkan:fix-rmake-test-with-rpath-false, r=Mark-Simulacrum
fix `long-linker-command-lines` failure caused by `rust.rpath=false`

Fixes `long-linker-command-lines` test failure (which happens when `rust.rpath` is set to `false`) by adjusting `LD_LIBRARY_PATH`.

Fixes https://github.com/rust-lang/rust/issues/90921
2024-03-16 23:28:48 +01:00
León Orell Valerian Liehr
0995508562
Rollup merge of #121720 - tmandry:split-refining, r=compiler-errors
Split refining_impl_trait lint into _reachable, _internal variants

As discussed in https://github.com/rust-lang/rust/issues/119535#issuecomment-1909352040:

> We discussed this today in triage and developed a consensus to:
>
> * Add a separate lint against impls that refine a return type defined with RPITIT even when the trait is not crate public.
> * Place that in a lint group along with the analogous crate public lint.
> * Create an issue to solicit feedback on these lints (or perhaps two separate ones).
> * Have the warnings displayed with each lint reference this issue in a similar manner to how we do that today with the required `Self: '0'` bound on GATs.
> * Make a note to review this feedback on 2-3 release cycles.

This points users to https://github.com/rust-lang/rust/issues/121718 to leave feedback.
2024-03-16 23:28:47 +01:00
León Orell Valerian Liehr
79c1e58801
Rollup merge of #121545 - gvozdvmozgu:fix-attribute-validation-associated-items, r=fmease
fix attribute validation on associated items in traits

#121537, fixed attribute validation on associated items in traits
2024-03-16 23:28:47 +01:00
León Orell Valerian Liehr
c00c5fec2a
Rollup merge of #117918 - daxpedda:wasm-c-abi-warning, r=workingjubilee
Add `wasm_c_abi` `future-incompat` lint

This is a warning that will tell users to update to `wasm-bindgen` v0.2.88, which supports spec-compliant C ABI.

The idea is to prepare for a future where Rust will switch to the spec-compliant C ABI by default; so not to break everyone's world, this warning is introduced.

Addresses #71871.
2024-03-16 23:28:46 +01:00
bors
4c1b9c3e2f Auto merge of #122594 - Mark-Simulacrum:bump-version, r=Mark-Simulacrum
Bump to 1.79.0

r? `@Mark-Simulacrum`
2024-03-16 22:18:06 +00:00
Piotr Osiewicz
ad84934e6f rustc-metadata: Store crate name in self-profile of metadata_register_crate
When profiling a build of Zed, I found myself in need of names of crates that take the longest to register in downstream crates.
2024-03-16 21:35:10 +01:00
bors
766bdce744 Auto merge of #122602 - ChrisDenton:rollup-f0vumtg, r=ChrisDenton
Rollup of 7 pull requests

Successful merges:

 - #122323 (configure.py: add flag for loongarch64 musl-root)
 - #122372 (prevent notifying the same changes more than once)
 - #122390 (Bump windows-bindgen to 0.55.0)
 - #122401 (Check library crates for all tier 1 targets in PR CI)
 - #122489 (Bump `cargo update` PR more often)
 - #122583 (Use `UnsafeCell` for fast constant thread locals)
 - #122590 (bootstrap: Don't name things copy that are not copies)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-03-16 20:14:20 +00:00
许杰友 Jieyou Xu (Joe)
fc42f3bfe3
Mention @jieyouxu for changes to compiletest, run-make tests and the run-make-support library 2024-03-16 19:15:45 +00:00
Chris Denton
d3ad841781
Rollup merge of #122590 - Nilstrieb:bootstrap-do-you-know-what-the-word-copy-means, r=Mark-Simulacrum
bootstrap: Don't name things copy that are not copies

The bootstrap copy methods don't actually copy, they just hard link. Simply lying about it being "copying" can be very confusing! (ask me how I know!).

I'm not sure whether the name I chose is the ideal name, but it's definitely better than before.
2024-03-16 18:27:35 +00:00
Chris Denton
a9f8f8b070
Rollup merge of #122583 - Zoxc:tls-non-mut, r=joboet
Use `UnsafeCell` for fast constant thread locals

This uses `UnsafeCell` instead of `static mut` for fast constant thread locals. This changes the type of the TLS shims to return `&UnsafeCell<T>` instead of `*mut T` which means they are always non-null so LLVM can optimize away the check for `Some` in `LocalKey::with` if `T` has no destructor.

LLVM is currently unable to do this optimization as we lose the fact that `__getit` always returns `Some` as it gets optimized to just returning the value of the TLS shim.
2024-03-16 18:27:34 +00:00
Chris Denton
42e03fc158
Rollup merge of #122489 - clubby789:more-cargo-update, r=Mark-Simulacrum
Bump `cargo update` PR more often

r? `@Mark-Simulacrum`

(https://github.com/rust-lang/rust/pull/121923#issuecomment-1986879572)
2024-03-16 18:27:34 +00:00
Chris Denton
1fbe1390ca
Rollup merge of #122401 - ChrisDenton:check-tier1, r=Mark-Simulacrum
Check library crates for all tier 1 targets in PR CI

Let's try checking all tier 1 targets. Shouldn't take much time.

Not sure if this is the right place to put it or not but let's see if it works first.
2024-03-16 18:27:33 +00:00
Chris Denton
ceef59fa2b
Rollup merge of #122390 - ChrisDenton:bindgen, r=Mark-Simulacrum
Bump windows-bindgen to 0.55.0

windows-bindgen is the crate used to generate std's Windows API bindings.

Not many changes for us, it's mostly just simplifying the generate code (e.g. no more `-> ()`). The one substantial change is some structs now use `i8` byte arrays instead of `u8`. However, this only impacts one test.
2024-03-16 18:27:33 +00:00
Chris Denton
491acfa08d
Rollup merge of #122372 - onur-ozkan:change-id-improvement, r=Mark-Simulacrum
prevent notifying the same changes more than once

Prevents re-reporting of previously notified changes by using the .last-warned-change-id value for change detection.

Resolves #122344
2024-03-16 18:27:32 +00:00
Chris Denton
9870116309
Rollup merge of #122323 - heiher:loongarch64-musl-root, r=Mark-Simulacrum
configure.py: add flag for loongarch64 musl-root
2024-03-16 18:27:32 +00:00
bors
2ffa3c89fc Auto merge of #122599 - bjorn3:sync_cg_clif-2024-03-16, r=bjorn3
Subtree sync for rustc_codegen_cranelift

The main highlight this time is a fix for a recently introduced ICE.

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

r? `@ghost`

`@rustbot` label +A-codegen +A-cranelift +T-compiler
2024-03-16 18:08:42 +00:00
Bryanskiy
b2ed9d0911 Delegation: fix ICE on duplicated associative items 2024-03-16 21:03:36 +03:00
bjorn3
6697186f59 Merge commit '4cf4ffc6ba514f171b3f52d1c731063e4fc45be3' into sync_cg_clif-2024-03-16 2024-03-16 17:23:11 +00:00
joboet
f2721338f6
core: optimize ptr::replace 2024-03-16 17:51:00 +01:00
bjorn3
4cf4ffc6ba Fix rustc test suite 2024-03-16 16:30:08 +00:00
bjorn3
e775fdc9e9 Don't try to get a ty for a nested allocation
Fixes rust-lang/rustc_codegen_cranelift#1464
2024-03-16 16:17:58 +00:00
bjorn3
9f162c49cb Rustup to rustc 1.78.0-nightly (c67326b06 2024-03-15) 2024-03-16 16:17:16 +00:00
Mark Rousskov
1572896652 Bump to 1.79.0 2024-03-16 09:56:09 -04:00
bors
22e241e32e Auto merge of #122593 - ChrisDenton:windows-support-1, r=Nilstrieb
Remove Windows support note

The note is redundant now that Windows 10 is the minimum supported in tier 1.
2024-03-16 13:53:54 +00:00
bjorn3
0000db58c6 Sync from rust c67326b063 2024-03-16 13:25:40 +00:00
Chris Denton
d5f92fc585
Remove Windows support note 2024-03-16 12:54:32 +00:00
Nilstrieb
52f84fa7c2 Remove double remove_file 2024-03-16 12:57:36 +01:00
Nilstrieb
0ec5d374fe bootstrap: Don't name things copy that are not copies
The bootstrap copy methods don't actually copy, they just hard link.
Simply lying about it being "copying" can be very confusing! (ask me how
I know!).
2024-03-16 12:54:10 +01:00
John Kåre Alsaker
b0b249399a Use UnsafeCell for fast constant thread locals 2024-03-16 12:34:52 +01:00
bors
9023f908cf Auto merge of #119418 - aaupov:master, r=Kobzol
[BOLT] Use CDSort and CDSplit

CDSort and CDSplit are the most recent versions of function ordering and function splitting algorithms with some improvements over the previous baseline (ext-tsp and two-way splitting).
2024-03-16 11:18:39 +00:00
bors
774ae599ab Auto merge of #122309 - g-yziquel:issue-122262, r=saethlin
Use `MAP_PRIVATE` (not unsound-prone `MAP_SHARED`)

Solves https://github.com/rust-lang/rust/issues/122262
2024-03-16 09:19:08 +00:00
daxpedda
873a0f264e
Add wasm_c_abi future-incompat lint 2024-03-16 09:57:15 +01:00
bors
7aa1de7ed8 Auto merge of #122559 - ForsakenHarmony:hrmny/update-llvm, r=nikic
Update LLVM submodule

LLVM version `18.1.1` + additional fixes.

Fixes https://github.com/Amanieu/corosensei/issues/23.
Fixes https://github.com/rust-lang/rust/issues/122252.
Fixes https://github.com/rust-lang/rust/issues/121996.
Fixes https://github.com/rust-lang/rust/issues/121960.
2024-03-16 06:35:05 +00:00
bors
c563f2ee79 Auto merge of #122371 - oli-obk:visit_nested_body, r=tmiasko
Stop walking the bodies of statics for reachability, and evaluate them instead

cc `@saethlin` `@RalfJung`

cc #119214

This reuses the `DefIdVisitor` from `rustc_privacy`, because they basically try to do the same thing.

This PR's changes can probably be extended to constants, too, but let's tackle that separately, it's likely more involved.
2024-03-16 04:35:02 +00:00
bors
c03ea3dfd9 Auto merge of #121926 - tgross35:f16-f128-step3-feature-gate, r=compiler-errors,petrochenkov
`f16` and `f128` step 3: compiler support & feature gate

Continuation of https://github.com/rust-lang/rust/pull/121841, another portion of https://github.com/rust-lang/rust/pull/114607

This PR exposes the new types to the world and adds a feature gate. Marking this as a draft because I need some feedback on where I did the feature gate check. It also does not yet catch type via suffixed literals (so the feature gate test will fail, probably some others too because I haven't belssed).

If there is a better place to check all types after resolution, I can do that. If not, I figure maybe I can add a second gate location in AST when it checks numeric suffixes.

Unfortunately I still don't think there is much testing to be done for correctness (codegen tests or parsed value checks) until we have basic library support. I think that will be the next step.

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

r? `@compiler-errors`
cc `@Nilstrieb`
`@rustbot` label +F-f16_and_f128
2024-03-16 02:02:00 +00:00
León Orell Valerian Liehr
a37fe00ea1
Remove obsolete parameter speculative from instantiate_poly_trait_ref 2024-03-16 02:33:21 +01:00
bors
05a2be3def Auto merge of #122575 - weihanglo:update-cargo, r=weihanglo
Update cargo

6 commits in 7065f0ef4aa267a7455e1c478b5ccacb7baea59c..2fe739fcf16c5bf8c2064ab9d357f4a0e6c8539b
2024-03-12 13:25:15 +0000 to 2024-03-15 21:39:18 +0000
- feat: Add 'open-namespaces' feature (rust-lang/cargo#13591)
- refactor: Expose source/spans to Manifest for emitting lints (rust-lang/cargo#13593)
- feat(tree): Control `--charset` via auto-detecting config value (rust-lang/cargo#13337)
- refactor(toml): Flatten manifest parsing (rust-lang/cargo#13589)
- fix: strip feature dep when dep is dev dep (rust-lang/cargo#13518)
- fix(ci): bump check error when PR is behind master (rust-lang/cargo#13581)

r? ghost
2024-03-16 00:03:52 +00:00
Weihang Lo
20b4b19369
Update cargo 2024-03-15 19:26:58 -04:00
Guillaume Yziquel
3fc5ed8067 Issue 122262: MAP_PRIVATE for more reliability on virtualised filesystems.
Adding support of quirky filesystems occuring in virtualised settings not
having full POSIX support for memory mapped files. Example: current virtiofs
with cache disabled, occuring in Incus/LXD or Kata Containers. Has been
hitting various virtualised filesystems since 2016, depending on their levels
of maturity at the time. The situation will perhaps improve when virtiofs DAX
support patches will have made it into the qemu mainline.

On a reliability level, using the MAP_PRIVATE sycall flag instead of the
MAP_SHARED syscall flag for the mmap() system call does have some undefined
behaviour when the caller update the memory mapping of the mmap()ed file, but
MAP_SHARED does allow not only the calling process but other processes to
modify the memory mapping. Thus, in the current context, using MAP_PRIVATE
copy-on-write is marginally more reliable than MAP_SHARED.

This discussion of reliability is orthogonal to the type system enforced safety
policy of rust, which does not claim to handle memory modification of memory
mapped files triggered through the operating system and not the running rust
process.
2024-03-15 18:31:07 -04:00
bors
c67326b063 Auto merge of #122571 - matthiaskrgr:rollup-36wwovk, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - #122254 (Detect calls to .clone() on T: !Clone types on borrowck errors)
 - #122495 (Visually mark 👻hidden👻 items with document-hidden-items)
 - #122543 (Add `#![rustc_never_type_mode = "..."]` crate-level attribute to allow experimenting)
 - #122560 (Safe Transmute: Use 'not yet supported', not 'unspecified' in errors)
 - #122562 (Mention labelled blocks in `break` docs)
 - #122563 (CI: cache PR CI Docker builds)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-03-15 21:18:36 +00:00
Matthias Krüger
948e03150b
Rollup merge of #122563 - Kobzol:ci-pr-caching, r=Mark-Simulacrum
CI: cache PR CI Docker builds

An attempt to restore Docker caching for PR CI workflows that share the Docker image with an auto/try workflow.

This was broken by my previous [PR](https://github.com/rust-lang/rust/pull/119290) that changed how we cache the Docker builds.

[Before](https://github.com/rust-lang/rust/pull/122545):
![image](https://github.com/rust-lang/rust/assets/4539057/05e0d347-af64-4e85-bc99-0e4ac07192ec)

After:
![image](https://github.com/rust-lang/rust/assets/4539057/2f657d60-b242-45eb-ac61-d8f71787edda)

r? ``@ghost``
2024-03-15 21:51:58 +01:00
Matthias Krüger
1745f3d405
Rollup merge of #122562 - Wilfred:break_keyword_docs, r=workingjubilee
Mention labelled blocks in `break` docs

`break` doesn't require a loop, so note this in the docs. This is covered in the linked sections of the rust reference, but this page implied that `break` is only for loops.
2024-03-15 21:51:58 +01:00
Matthias Krüger
b482523607
Rollup merge of #122560 - jswrenn:not-yet-supported, r=compiler-errors
Safe Transmute: Use 'not yet supported', not 'unspecified' in errors

We can (and will) support analyzing the transmutability of types whose layouts aren't completely specified by its repr. This change ensures that the error messages remain sensible after this support lands.

r? ``@compiler-errors``
2024-03-15 21:51:57 +01:00