Commit Graph

152993 Commits

Author SHA1 Message Date
clubby789
b577b26249 Add stdio configuring to run-make Rustc 2024-10-07 16:30:00 +00:00
clubby789
ad7d41ce90 Test for issue 23600 2024-10-07 16:29:52 +00:00
bors
7caad69253 Auto merge of #131354 - matthiaskrgr:rollup-hprnng2, r=matthiaskrgr
Rollup of 4 pull requests

Successful merges:

 - #131331 (Revert "warn_old_master_branch" check)
 - #131344 (Avoid `&Lrc<T>` in various places)
 - #131346 (Restrict `ignore-mode-*` directives)
 - #131353 (Add documentation for `runtest::check_rustdoc_test_option` method)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-10-07 11:30:33 +00:00
Matthias Krüger
fd2278d017
Rollup merge of #131353 - GuillaumeGomez:check_rustdoc_test_option, r=jieyouxu
Add documentation for `runtest::check_rustdoc_test_option` method

r? `@jieyouxu`
2024-10-07 12:23:56 +02:00
Matthias Krüger
7d7b43c39a
Rollup merge of #131346 - jieyouxu:prune-invalid-directives, r=Zalathar
Restrict `ignore-mode-*` directives

This is only used by coverage test suites where the same sources get run under different coverage modes. Restrict `ignore-mode-<coverage_mode>` to only coverage modes.
2024-10-07 12:23:55 +02:00
Matthias Krüger
df61a0b1b2
Rollup merge of #131344 - nnethercote:ref-Lrc, r=compiler-errors
Avoid `&Lrc<T>` in various places

Seeing `&Lrc<T>` is a bit suspicious, and `&T` or `Lrc<T>` is often better.

r? `@oli-obk`
2024-10-07 12:23:54 +02:00
Matthias Krüger
3a5a816190
Rollup merge of #131331 - onur-ozkan:131296, r=Kobzol
Revert "warn_old_master_branch" check

See https://github.com/rust-lang/rust/issues/131296#issuecomment-2395486918.

Reverts https://github.com/rust-lang/rust/pull/130121 and https://github.com/rust-lang/rust/pull/129584.

Fixes https://github.com/rust-lang/rust/issues/131296 and https://github.com/rust-lang/rust/issues/131324.
2024-10-07 12:23:54 +02:00
Guillaume Gomez
dde78bd946 Add documentation for runtest::check_rustdoc_test_option method 2024-10-07 12:09:28 +02:00
bors
0b16baa570 Auto merge of #131235 - codemountains:rename-nestedmetaitem-to-metaitemlnner, r=nnethercote
Rename `NestedMetaItem` to `MetaItemInner`

Fixes #131087

r? `@nnethercote`
2024-10-07 08:59:55 +00:00
许杰友 Jieyou Xu (Joe)
f1e408a8de Remove valgrind test suite from opt-dist 2024-10-07 07:54:57 +00:00
许杰友 Jieyou Xu (Joe)
de588a6e60 Remove valgrind test suite support from bootstrap 2024-10-07 07:53:48 +00:00
许杰友 Jieyou Xu (Joe)
a961be9f13 Remove valgrind test suite and support from compiletest 2024-10-07 07:53:42 +00:00
codemountains
fc64ff7ec2 Rename nested_meta to meta_item_inner 2024-10-07 15:22:03 +09:00
许杰友 Jieyou Xu (Joe)
64efbe2b53 Prune invalid ignore-mode-* directives
These are only valid for coverage test modes.
2024-10-07 05:42:43 +00:00
Nicholas Nethercote
4547c0a990 Avoid another &Lrc<..> in a return value. 2024-10-07 13:59:50 +11:00
Nicholas Nethercote
731469fee5 Convert Option<&Lrc<T>> return types to Option<&T>.
It's simpler and more concise.
2024-10-07 13:56:29 +11:00
bors
1b3b8e7b02 Auto merge of #128651 - folkertdev:naked-asm-macro-v2, r=Amanieu
add `naked_asm!` macro for use in `#[naked]` functions

tracking issue: https://github.com/rust-lang/rust/issues/90957

Adds the `core::arch::naked_asm` macro, to be used in `#[naked]` functions, but providing better error messages and a place to explain the restrictions on assembly in naked functions.

This PR does not yet require that the `naked_asm!` macro is used inside of `#[naked]` functions:

- the `asm!` macro can still be used in `#[naked]` functions currently, with the same restrictions and error messages as before.
- the `naked_asm!` macro can be used outside of `#[naked]` functions. It has not yet been decided whether that should be allowed long-term.

In this PR, the parsing code of `naked_asm!` now enforces the restrictions on assembly in naked functions, with the exception of checking that the `noreturn` option is specified. It also has not currently been decided if `noreturn` should be implicit or not.

This PR looks large because it touches a bunch of tests. The code changes are mostly straightforward I think: we now have 3 flavors of assembly macro, and that information must be propagated through the parsing code and error messages.

cc `@Lokathor`

r? `@Amanieu`
2024-10-06 21:51:18 +00:00
Chayim Refael Friedman
0e96fd02f0 Use external stack in borrowck DFS
Because damnit, it can crash r-a. Why do people make this stupid DFSes anyway (I get it, it's easier until it blows).
2024-10-06 23:48:16 +03:00
Folkert de Vries
5fc60d1e52 various fixes for naked_asm! implementation
- fix for divergence
- fix error message
- fix another cranelift test
- fix some cranelift things
- don't set the NORETURN option for naked asm
- fix use of naked_asm! in doc comment
- fix use of naked_asm! in run-make test
- use `span_bug` in unreachable branch
2024-10-06 19:00:09 +02:00
Folkert de Vries
562ec5a6fb disallow asm! in #[naked] functions
also disallow the `noreturn` option, and infer `naked_asm!` as `!`
2024-10-06 18:12:25 +02:00
Folkert
aa5bbf05f4 implement naked_asm macro 2024-10-06 18:12:25 +02:00
onur-ozkan
1e5c4cb0a2 Revert "Rollup merge of #129584 - lolbinarycat:old-upstream-warning, r=albertlarsan68"
This reverts commit 776187d2c9, reversing
changes made to 7d015575ad.
2024-10-06 19:04:35 +03:00
onur-ozkan
dd0bcf5185 Revert "Auto merge of #130121 - lolbinarycat:bootstrap-warn-old-upstream-worktree, r=albertlarsan68"
This reverts commit 507c05bead, reversing
changes made to 0609062a91.
2024-10-06 18:59:40 +03:00
codemountains
6dfc4a0473 Rename NestedMetaItem to MetaItemInner 2024-10-06 23:28:30 +09:00
bors
373971abe4 Auto merge of #131259 - ismailarilik:handle-potential-query-instability-lint-for-librustdoc, r=notriddle
Handle `librustdoc` cases of `rustc::potential_query_instability` lint

This PR removes `#![allow(rustc::potential_query_instability)]` line from [`src/librustdoc/lib.rs`](https://github.com/rust-lang/rust/blob/master/src/librustdoc/lib.rs#L23) and converts `FxHash{Map,Set}` types into `FxIndex{Map,Set}` to suppress lint errors.

A somewhat tracking issue: https://github.com/rust-lang/rust/issues/84447

r? `@compiler-errors`
2024-10-06 14:04:21 +00:00
bors
96d9d8aa7d Auto merge of #131320 - matthiaskrgr:rollup-tom15b3, r=matthiaskrgr
Rollup of 5 pull requests

Successful merges:

 - #129392 (Do not consider match/let/ref of place that evaluates to `!` to diverge, disallow coercions from them too)
 - #131279 (update "build/host" symlink comment)
 - #131312 (On function and method calls in patterns, link to the book)
 - #131315 (bootstrap: add `std_features` config)
 - #131316 (Fix typo in primitive_docs.rs)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-10-06 11:43:07 +00:00
Matthias Krüger
3c4bc7d763
Rollup merge of #131315 - shrirambalaji:issue-129599-fix-shrirambalaji, r=onur-ozkan
bootstrap: add `std_features` config

Adding support for a std-features config under the rust section in config.toml during bootstrap. This allows rustc devs to build with specific feature flags for local development.
2024-10-06 11:06:58 +02:00
Matthias Krüger
aa546f9a73
Rollup merge of #131279 - onur-ozkan:remove-host-symlink, r=Noratrieb
update "build/host" symlink comment

It's needed and can't be removed, so make it clear where it's needed.
2024-10-06 11:06:57 +02:00
Matthias Krüger
9aaebd481a
Rollup merge of #129392 - compiler-errors:raw-ref-op-doesnt-diverge-but-more, r=lcnr
Do not consider match/let/ref of place that evaluates to `!` to diverge, disallow coercions from them too

Fixes #117288.

This PR implements a heuristic which disables two things that are currently being performed on the HIR when we have **expressions that involve place-like expressions that point to `!`**. Specifically, it will (in certain cases explained below):

### (1.) Disable the `NeverToAny` coercion we implicitly insert for `!`.

Which fixes this inadvertent, sneaky unsoundness:

```
unsafe {
    let x: *const ! = &0 as *const u8 as *const !;
    let _: () = *x;
}
```

which is UB because currently rust emits an *implicit* NeverToAny coercion even though we really shouldn't be, since there's no read of the value pointed by `x`.

### (2.) Disable the logic which considers expression which evaluate to `!` to diverge, which affects the type returned by the containing block.

Which fixes this unsoundness:

```
fn make_up_a_value<T>() -> T {
    unsafe {
        let x: *const ! = &0 as *const u8 as *const !;
        let _ = *x;
    }
}
```

We disable these two operations **if** the expression is a place-like expression (locals, statics, field projections, index operations, and deref operations), and if the parent expression is either:
(1.) the LHS of an assignment
(2.) AddrOf
(3.) A match or let **unless** all of the *patterns consitute a read*, which is explained below:

And finally, a pattern currently is considered to constitute a read **unless** it is a wildcard, or an OR pattern. An OR pattern is considered to constitute a read if all of its subpatterns constitute a read, to remain as conservative as possible in cases like `_ | subpat` or `subpat | _`.

All other patterns are considered currently to constitute a read. Specifically, because `NeverToAny` is a coercion performed on a *value* and not a *place*, `Struct { .. }` on a `!` type must be a coercion currently, and we currently rely on this behavior to allow us to perform coercions like `let _: i32 = x;` where `x: !`.

This is already considered UB by [miri](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=daf3a2246433fe43fdc07d1389c276c9), but also means it does not affect the preexisting UB in this case:

```
let Struct { .. } = *never_ptr;
```

Even though it's likely up for debate since we're not actually reading any data out of the struct, it almost certainly causes inference changes which I do *NOT* want to fix in this PR.
2024-10-06 11:06:57 +02:00
bors
68301a6a96 Auto merge of #131075 - mrkajetanp:bootstrap-editors, r=Kobzol
bootstrap: Consolidate editor setup into ./x setup editor & add support for vim, emacs & helix

Add support for automatically setting up the recommended
LSP config for Vim (coc-nvim), Emacs (eglot) and Helix.

Additionally, refactor setup.rs to make it easier to add support
for more editors in the future.

As suggested,
r? `@jieyouxu`
2024-10-06 07:43:53 +00:00
ismailarilik
e0a20b484d Handle librustdoc cases of rustc::potential_query_instability lint 2024-10-06 10:39:03 +03:00
Shriram Balaji
8b968764f1 bootstrap: add std_features config
bootstrap: add std_features  to config.example

fix: use BTreeSet for std-features; add unit tests

* fix formatting of string in front of std_features
* rename `std_features` to `std-features` in config.toml

fix: remove space before std-features in config.toml

fix: remove explicit .into_iter conversion

bootstrap: add details for rust.std-features in config.example.toml

Co-authored-by: Onur Özkan <onurozkan.dev@outlook.com>

fix: remove `Option<T>` from `rust_std_features`

fix: move default rust_std_features to config

fix: make std_features CI rustc incompatible
2024-10-06 09:59:10 +05:30
bors
daebce4247 Auto merge of #130540 - veera-sivarajan:fix-87525, r=estebank
Add a Lint for Pointer to Integer Transmutes in Consts

Fixes #87525

This PR adds a MirLint for pointer to integer transmutes in const functions and associated consts. The implementation closely follows this comment: https://github.com/rust-lang/rust/pull/85769#issuecomment-880969112. More details about the implementation can be found in the comments.

Note: This could break some sound code as mentioned by RalfJung in https://github.com/rust-lang/rust/pull/85769#issuecomment-886491680:

> ... technically const-code could transmute/cast an int to a ptr and then transmute it back and that would be correct -- so the lint will deny some sound code. Does not seem terribly likely though.

References:
1. https://doc.rust-lang.org/std/mem/fn.transmute.html
2. https://doc.rust-lang.org/reference/items/associated-items.html#associated-constants
2024-10-06 02:39:23 +00:00
bors
85e2f55d82 Auto merge of #131293 - DianQK:llvm-19.1.1, r=nikic
Update to LLVM 19.1.1

No known issues are fixed this time.

r? `@rust-lang/wg-llvm`
2024-10-05 22:42:04 +00:00
Michael Goulet
73d49f8c69 Fix up tests 2024-10-05 18:36:47 -04:00
onur-ozkan
4f50efd132 update "build/host" symlink comment
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-10-05 22:48:55 +03:00
Matthias Krüger
8e31e98ff9
Rollup merge of #130555 - hegza:rv32e, r=workingjubilee
Initial support for riscv32{e|em|emc}_unknown_none_elf

We have a research prototype of an RV32EMC target and have been successfully running the e, em, emc programs on it. I'm hoping upstreaming this configuration would make the target maintenance slightly easier.

Configuration is based on the respective {i, im, imc} variants. As defined in RISC-V Unprivileged Spec. 20191213, the only change in RVE wrt. RVI is to reduce the number of integer registers to 16 (x0-x15), which also implies

- 2 callee saved registers instead of 12
- 32-bit / 4-byte stack alignment instead of 128 bits / 16 bytes

My initial presumption is that this will not impact how the target is defined for the compiler but only becomes relevant at the runtime level. I am willing to investigate, though.

EDIT: LLVM is now told about the presumed 32-bit stack alignment.

`@Disasm` `@romancardenas`
2024-10-05 19:07:53 +02:00
bors
e561499e90 Auto merge of #131188 - Kobzol:remove-libstd-so-from-sysroot, r=onur-ozkan
Do not copy libstd dynamic library to sysroot

Since https://github.com/rust-lang/rust/pull/122362, rustc links statically to libstd.[so|dll]. Which means that the libstd.[so|dll] file no longer has to be in the rustc sysroot. However, we are currently still shipping this file, in every new release of Rust, for no reason, it's just wasted bytes.

This PR removes the dynamic library file from the built sysroot.

However, it is not yet performed on Windows, because stage0 incremental tests start failing there (see description of the issue [here](https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/Failing.20incr.20tests.20on.20Windows.20when.20std.2Edll.20is.20missing/near/474507064)).

This is an extended version of https://github.com/rust-lang/rust/pull/128986.
CC `@Zoxc`
2024-10-05 14:05:05 +00:00
DianQK
70260dbeca
Update to LLVM 19.1.1 2024-10-05 21:10:04 +08:00
Veera
ab8673501c Add a Lint for Pointer to Integer Transmutes in Consts 2024-10-05 12:48:02 +00:00
Matthias Krüger
72acacf60f
Rollup merge of #131286 - RalfJung:miri-sync, r=RalfJung
Miri subtree update

r? `@ghost`
2024-10-05 13:15:59 +02:00
Matthias Krüger
1bd61bbeac
Rollup merge of #131278 - onur-ozkan:update-outdated-doc, r=Kobzol
remove outdated contribution direction
2024-10-05 13:15:59 +02:00
Matthias Krüger
cb5bb13ea9
Rollup merge of #131256 - RalfJung:f16-f128-const, r=ibraheemdev
move f16/f128 const fn under f16/f128 feature gate

The `*_const` features were added to work around https://github.com/rust-lang/rust/issues/129656, which should not be needed any more.
2024-10-05 13:15:58 +02:00
bors
3b418b1485 Auto merge of #3940 - rust-lang:refutable_slice, r=RalfJung
Prefer refutable slice patterns over len check + index op

Just something I noticed while reviewing other PRs

We do it for shim arguments almost everywhere, but when the size is not statically known, we didn't use the helpers as they rely on array ops. But we can avoid a len check followed by several index ops by just using a refutable slice pattern with `let else`.

The pattern is so common, it seems almost worth a dedicated macro
2024-10-05 09:39:25 +00:00
Henri Lunnikivi
6edd0b356f Add platform support doc for rv32e 2024-10-05 12:19:21 +03:00
Henri Lunnikivi
66b3d0b36a Work around the stage0 sanity check
Add rv32e-targets to 'stage0 missing targets'. This prevents the error
"no such target exists in the target list".
2024-10-05 12:14:35 +03:00
Henri Lunnikivi
f3037823de doc: platform-support.md: Document port 2024-10-05 12:14:35 +03:00
bors
eb97047cc6 Auto merge of #3943 - RalfJung:pthread-mutex-reentrant, r=RalfJung
pthread mutex: better error in reentrant-locking-UB

Also test reentrant locking of PTHREAD_MUTEX_INITIALIZER
2024-10-05 08:49:15 +00:00
Ralf Jung
155380523c pthread mutex: better error in reentrant-locking-UB, also test PTHREAD_MUTEX_INITIALIZER 2024-10-05 10:46:14 +02:00
Ralf Jung
0cd0f7ceef move f16/f128 const fn under f16/f128 feature gate 2024-10-05 10:13:18 +02:00
bors
5a4ee43c38 Auto merge of #129244 - cjgillot:opaque-hir, r=compiler-errors
Make opaque types regular HIR nodes

Having opaque types as HIR owner introduces all sorts of complications. This PR proposes to make them regular HIR nodes instead.

I haven't gone through all the test changes yet, so there may be a few surprises.

Many thanks to `@camelid` for the first draft.
Fixes https://github.com/rust-lang/rust/issues/129023

Fixes #129099
Fixes #125843
Fixes #119716
Fixes #121422
2024-10-05 06:19:35 +00:00
onur-ozkan
05f7b092a4 remove outdated contribution direction
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-10-05 08:07:26 +03:00
bors
d30c3924a4 Auto merge of #131275 - workingjubilee:rollup-4yxqio3, r=workingjubilee
Rollup of 9 pull requests

Successful merges:

 - #129517 (Compute array length from type for unconditional panic lint. )
 - #130367 (Check elaborated projections from dyn don't mention unconstrained late bound lifetimes)
 - #130403 (Stabilize `const_slice_from_raw_parts_mut`)
 - #130633 (Add support for reborrowing pinned method receivers)
 - #131105 (update `Literal`'s intro)
 - #131194 (Fix needless_lifetimes in stable_mir)
 - #131260 (rustdoc: cleaner errors on disambiguator/namespace mismatches)
 - #131267 (Stabilize `BufRead::skip_until`)
 - #131273 (Account for `impl Trait {` when `impl Trait for Type {` was intended)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-10-05 03:41:42 +00:00
Jubilee
f66aa600d9
Rollup merge of #131260 - notriddle:notriddle/disambiguator-error, r=GuillaumeGomez
rustdoc: cleaner errors on disambiguator/namespace mismatches

Resolves https://github.com/rust-lang/rust/pull/131224#pullrequestreview-2348407077

r? `@jyn514`
2024-10-04 19:19:25 -07:00
Jubilee
f09e5a785b
Rollup merge of #129517 - cjgillot:known-panic-array, r=pnkfelix
Compute array length from type for unconditional panic lint.

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

The cases that involve slicing are harder, so https://github.com/rust-lang/rust/issues/38035 remains open.
2024-10-04 19:19:22 -07:00
bors
495f75aa46 Auto merge of #131124 - weihanglo:update-cargo, r=weihanglo
Update cargo

17 commits in 80d82ca22abbee5fb7b51fa1abeb1ae34e99e88a..ad074abe3a18ce8444c06f962ceecfd056acfc73
2024-09-27 17:56:01 +0000 to 2024-10-04 18:18:15 +0000
- test: Remove the last of our custom json assertions (rust-lang/cargo#14576)
- docs(ref): Expand on MSRV (rust-lang/cargo#14636)
- docs: Minor re-grouping of pages (rust-lang/cargo#14620)
- docs(ref): Highleft whats left for msrv-policy (rust-lang/cargo#14638)
- Fix `cargo:version_number` - has only one `:` (rust-lang/cargo#14637)
- docs: Declare support level for each crate in our Charter / docs (rust-lang/cargo#14600)
- chore(deps): update tar to 0.4.42 (rust-lang/cargo#14632)
- docs(charter): Declare new Intentional Artifacts as 'small' changes (rust-lang/cargo#14599)
- fix: Remove implicit feature removal (rust-lang/cargo#14630)
- docs(config): make `--config &lt;PATH&gt;` more prominent (rust-lang/cargo#14631)
- chore(deps): update rust crate unicode-width to 0.2.0 (rust-lang/cargo#14624)
- chore(deps): update embarkstudios/cargo-deny-action action to v2 (rust-lang/cargo#14628)
- docs(ref): Clean up language for `package.rust-version` (rust-lang/cargo#14619)
- docs: clarify `target.'cfg(...)'`  doesnt respect cfg from build script (rust-lang/cargo#14312)
- test: relax compiler panic assertions (rust-lang/cargo#14618)
- refactor(compiler): zero-copy deserialization when possible (rust-lang/cargo#14608)
- test: add support for features in the sat resolver (rust-lang/cargo#14583)
2024-10-05 00:52:29 +00:00
Camille GILLOT
479779d6a9 Bless clippy. 2024-10-05 00:19:43 +00:00
Camille GILLOT
ef17eb79bb Adapt clippy. 2024-10-04 23:50:02 +00:00
Noah Lev
d6f247f3d5 rm ItemKind::OpaqueTy
This introduce an additional collection of opaques on HIR, as they can no
longer be listed using the free item list.
2024-10-04 23:28:22 +00:00
Jubilee
869b8eb7ee
Rollup merge of #131257 - GuillaumeGomez:fix-list-margins, r=notriddle
[rustdoc] Fix list margins

Fixes https://github.com/rust-lang/rust/issues/131106.
Fixes #131223.

Follow-up of  #130933.

This PR changes the display as follow: the margin between list items is reduced by half to ensure that they visually still seem part of the same list, while also being bigger than previously which improves display for list items with more than one paragragh. Paragraphs also get they bottom margin reduced to a little bit less than the list items bottom margin for two reasons:
1. The list items keep having the biggest bottom margin which makes it better for coherency.
2. The paragraphs are still visually separated but they don't "overcome" the list.

| before | after |
|-|-|
| ![Screenshot from 2024-10-04 17-58-51](https://github.com/user-attachments/assets/3fdc1472-781e-435d-a0d7-012f43aa8fb8) | ![image](https://github.com/user-attachments/assets/0366313d-416f-4f04-b905-bb16c54f4528) |

Can be tested [here](https://rustdoc.crud.net/imperio/fix-list-margins/doc/test_docs/long_list/index.html).

r? ``@notriddle``
2024-10-04 14:11:38 -07:00
Jubilee
a17df378e2
Rollup merge of #131240 - taiki-e:typo, r=jieyouxu
Fix typo in csky-unknown-linux-gnuabiv2.md
2024-10-04 14:11:38 -07:00
Jubilee
5a8fcab713
Rollup merge of #130518 - scottmcm:stabilize-controlflow-extra, r=dtolnay
Stabilize the `map`/`value` methods on `ControlFlow`

And fix the stability attribute on the `pub use` in `core::ops`.

libs-api in https://github.com/rust-lang/rust/issues/75744#issuecomment-2231214910 seemed reasonably happy with naming for these, so let's try for an FCP.

Summary:
```rust
impl<B, C> ControlFlow<B, C> {
    pub fn break_value(self) -> Option<B>;
    pub fn map_break<T>(self, f: impl FnOnce(B) -> T) -> ControlFlow<T, C>;
    pub fn continue_value(self) -> Option<C>;
    pub fn map_continue<T>(self, f: impl FnOnce(C) -> T) -> ControlFlow<B, T>;
}
```

Resolves #75744

``@rustbot`` label +needs-fcp +t-libs-api -t-libs

---

Aside, in case it keeps someone else from going down the same dead end: I looked at the `{break,continue}_value` methods and tried to make them `const` as part of this, but that's disallowed because of not having `const Drop`, so put it back to not even unstably-const.
2024-10-04 14:11:34 -07:00
Jubilee
b88f56f862
Rollup merge of #130453 - randomPoison:trusty-x86, r=pnkfelix
Add x86_64-unknown-trusty as tier 3 target

This PR adds a third target for the Trusty platform, `x86_64-unknown-trusty`.

Please let me know if an MCP is required. https://github.com/rust-lang/compiler-team/issues/582 was made when adding the first two targets, I can make another one for the new target as well if needed.

# Target Tier Policy Acknowledgements

> A tier 3 target must have a designated developer or developers (the "target maintainers") on record to be CCed when issues arise regarding the target. (The mechanism to track and CC such developers may evolve over time.)

- Nicole LeGare (```@randomPoison)```
- Andrei Homescu (```@ahomescu)```
- Chris Wailes (chriswailes@google.com)
- As a fallback trusty-dev-team@google.com can be contacted

Note that this does not reflect the maintainers currently listed in [`trusty.md`](c52c23b6f4/src/doc/rustc/src/platform-support/trusty.md). #130452 is currently open to update the list of maintainers in the documentation.

> Targets must use naming consistent with any existing targets; for instance, a target for the same CPU or OS as an existing Rust target should use the same name for that CPU or OS. Targets should normally use the same names and naming conventions as used elsewhere in the broader ecosystem beyond Rust (such as in other toolchains), unless they have a very good reason to diverge. Changing the name of a target can be highly disruptive, especially once the target reaches a higher tier, so getting the name right is important even for a tier 3 target.

The new target `x86_64-unknown-trusty` follows the existing naming convention for similar targets.

> Target names should not introduce undue confusion or ambiguity unless absolutely necessary to maintain ecosystem compatibility. For example, if the name of the target makes people extremely likely to form incorrect beliefs about what it targets, the name should be changed or augmented to disambiguate it.

👍

> Tier 3 targets may have unusual requirements to build or use, but must not create legal issues or impose onerous legal terms for the Rust project or for Rust developers or users.

There are no known legal issues or license incompatibilities.

> Neither this policy nor any decisions made regarding targets shall create any binding agreement or estoppel by any party. If any member of an approving Rust team serves as one of the maintainers of a target, or has any legal or employment requirement (explicit or implicit) that might affect their decisions regarding a target, they must recuse themselves from any approval decisions regarding the target's tier status, though they may otherwise participate in discussions.

👍

> Tier 3 targets should attempt to implement as much of the standard libraries as possible and appropriate (core for most targets, alloc for targets that can support dynamic memory allocation, std for targets with an operating system or equivalent layer of system-provided functionality), but may leave some code unimplemented (either unavailable or stubbed out as appropriate), whether because the target makes it impossible to implement or challenging to implement. The authors of pull requests are not obligated to avoid calling any portions of the standard library on the basis of a tier 3 target not implementing those portions.

This PR only adds the target. `std` support is being worked on and will be added in a future PR.

> The target must provide documentation for the Rust community explaining how to build for the target, using cross-compilation if possible. If the target supports running binaries, or running tests (even if they do not pass), the documentation must explain how to run such binaries or tests for the target, using emulation if possible or dedicated hardware if necessary.

👍

> Tier 3 targets must not impose burden on the authors of pull requests, or other developers in the community, to maintain the target. In particular, do not post comments (automated or manual) on a PR that derail or suggest a block on the PR based on a tier 3 target. Do not send automated messages or notifications (via any medium, including via ```@)``` to a PR author or others involved with a PR regarding a tier 3 target, unless they have opted into such messages.

👍

> Patches adding or updating tier 3 targets must not break any existing tier 2 or tier 1 target, and must not knowingly break another tier 3 target without approval of either the compiler team or the maintainers of the other tier 3 target.

👍

> Tier 3 targets must be able to produce assembly using at least one of rustc's supported backends from any host target. (Having support in a fork of the backend is not sufficient, it must be upstream.)

👍
2024-10-04 14:11:34 -07:00
Weihang Lo
d0a467a89f
Update cargo 2024-10-04 16:37:09 -04:00
Oli Scherer
f46e1624cb Prefer refutable slice patterns over len check + index op 2024-10-04 20:23:59 +02:00
bors
fe2b453c97 Auto merge of #18227 - davidbarsky:davidbarsky/push-lmntvwvznyyx, r=davidbarsky
internal: add json `tracing` Layer for profiling startup

On `buck2/integrations/rust-project`, this results in the following being printed:

```json
{"name":"discover_command","elapsed_ms":18703}
{"name":"parallel_prime_caches","elapsed_ms":0}
{"name":"vfs_load","elapsed_ms":5895}
{"name":"vfs_load","elapsed_ms":547}
{"name":"parallel_prime_caches","elapsed_ms":23}
{"name":"parallel_prime_caches","elapsed_ms":84}
{"name":"parallel_prime_caches","elapsed_ms":5819}
```
2024-10-04 17:59:02 +00:00
Michael Howell
3686e59913 rustdoc: cleaner errors on disambiguator/namespace mismatches 2024-10-04 09:56:53 -07:00
Guillaume Gomez
cc36e0d983 Fix list margins 2024-10-04 18:01:38 +02:00
David Barsky
a5a4d1a95b internal: add JSON formatting for hprof 2024-10-04 11:26:15 -04:00
Tobias Decking
d00b754721
Implement LLVM x86 gfni intrinsics 2024-10-04 16:40:09 +02:00
Taiki Endo
c6774f19e7 Fix typo in csky-unknown-linux-gnuabiv2.md 2024-10-04 23:33:30 +09:00
Guillaume Gomez
11b1b4faa4
Rollup merge of #131230 - GuillaumeGomez:no-sandbox, r=notriddle
Enable `--no-sandbox` option by default for rustdoc GUI tests

It's apparently common enough for people to have issues with the `sandbox` mode in chromium, so better disable it by default.

r? `@notriddle`
2024-10-04 15:42:55 +02:00
Guillaume Gomez
2ceeeb159d
Rollup merge of #131034 - Urgau:cfg-true-false, r=nnethercote
Implement RFC3695 Allow boolean literals as cfg predicates

This PR implements https://github.com/rust-lang/rfcs/pull/3695: allow boolean literals as cfg predicates, i.e. `cfg(true)` and `cfg(false)`.

r? `@nnethercote` *(or anyone with parser knowledge)*
cc `@clubby789`
2024-10-04 15:42:53 +02:00
Jakub Beránek
f59c8fffe3 Avoid dynamic linking to libstd in command-current-dir test 2024-10-04 15:34:31 +02:00
bors
fae34e062e Auto merge of #18234 - Veykril:veykril/push-vzynqtlxmrnl, r=Veykril
internal: Filter out opaque tokens in some IDE feature macro descensions
2024-10-04 10:26:04 +00:00
bjorn3
68034f837a
Disable -Zdual-proc-macros if the target doesn't support proc-macros 2024-10-04 12:25:48 +02:00
Guillaume Gomez
32099dbc1e Enable --no-sandbox option by default for rustdoc GUI tests 2024-10-04 12:11:23 +02:00
Lukas Wirth
03013688ec internal: Filter out opaque tokens in some of IDE feature macro descensions 2024-10-04 11:53:12 +02:00
Ralf Jung
dc88a6a788 clippy 2024-10-04 10:12:05 +02:00
Urgau
781f1840cd Adjust rustdoc for literal boolean support 2024-10-04 09:09:20 +02:00
Urgau
62ef411631 Feature gate boolean lit support in cfg predicates 2024-10-04 09:09:20 +02:00
The Miri Cronjob Bot
7014ae87df Merge from rustc 2024-10-04 05:07:56 +00:00
The Miri Cronjob Bot
d19bd66a4e Preparing for merge from rustc 2024-10-04 05:00:12 +00:00
Matthias Krüger
da81f64d84
Rollup merge of #131183 - compiler-errors:opaque-ty-origin, r=estebank
Refactoring to `OpaqueTyOrigin`

Pulled out of a larger PR that uses these changes to do cross-crate encoding of opaque origin, so we can use them for edition 2024 migrations. These changes should be self-explanatory on their own, tho 😄
2024-10-03 21:52:46 +02:00
bors
56e35a5dbb Auto merge of #131205 - flip1995:clippy-subtree-update, r=Manishearth
Clippy subtree update

r? `@Manishearth`
2024-10-03 16:44:39 +00:00
Philipp Krones
b823547eb1
Merge commit 'aa0d551351a9c15d8a95fdb3e2946b505893dda8' into clippy-subtree-update 2024-10-03 16:32:51 +02:00
Kajetan Puchalski
456be106b7
bootstrap: Consolidate editor LSP setup
Consolidate LSP setup for different editors into one `./x setup editor`.
2024-10-03 15:22:44 +01:00
Matthias Krüger
c9b907a567
Rollup merge of #130419 - nnethercote:streamline-HirCollector, r=GuillaumeGomez
Streamline `HirCollector`

r? `@GuillaumeGomez`
2024-10-03 13:47:59 +02:00
Jakub Beránek
2cf155924f
Do not include libstd.so in sysroot when we statically link to libstd 2024-10-03 09:43:55 +02:00
Ralf Jung
9b35886adf make sure we also detect mixed-size races that begin at different addresses 2024-10-03 08:19:07 +02:00
bors
8885239786 Auto merge of #131185 - workingjubilee:rollup-wkcqe2j, r=workingjubilee
Rollup of 3 pull requests

Successful merges:

 - #126930 (Add unstable support for outputting file checksums for use in cargo)
 - #130725 (Parser: better error messages for ``@`` in struct patterns)
 - #131166 (Fix `target_vendor` for `aarch64-nintendo-switch-freestanding`)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-10-03 06:02:19 +00:00
Ralf Jung
32d49680d6 fmt 2024-10-03 07:59:28 +02:00
Ralf Jung
6280e267f0 Merge from rustc 2024-10-03 07:58:48 +02:00
Ralf Jung
be819d4159 Preparing for merge from rustc 2024-10-03 07:47:41 +02:00
Jubilee
44f6275e14
Rollup merge of #126930 - Xaeroxe:file-checksum-hint, r=chenyukang
Add unstable support for outputting file checksums for use in cargo

Adds an unstable option that appends file checksums and expected lengths to the end of the dep-info file such that `cargo` can read and use these values as an alternative to file mtimes.

This PR powers the changes made in this cargo PR https://github.com/rust-lang/cargo/pull/14137

Here's the tracking issue for the cargo feature https://github.com/rust-lang/cargo/issues/14136.
2024-10-02 21:26:58 -07:00
bors
fd1f8aa05d Auto merge of #127912 - joboet:tls_dtor_thread_current, r=cuviper
std: make `thread::current` available in all `thread_local!` destructors

... and thereby allow the panic runtime to always print the right thread name.

This works by modifying the TLS destructor system to schedule a runtime cleanup function after all other TLS destructors registered by `std` have run. Unfortunately, this doesn't affect foreign TLS destructors, `thread::current` will still panic there.

Additionally, the thread ID returned by `current_id` will now always be available, even inside the global allocator, and will not change during the lifetime of one thread (this was previously the case with key-based TLS).

The mechanisms I added for this (`local_pointer` and `thread_cleanup`) will also allow finally fixing #111272 by moving the signal stack to a similar runtime-cleanup TLS variable.
2024-10-03 03:31:47 +00:00
Michael Goulet
cb7e3695e8 Use named fields for OpaqueTyOrigin 2024-10-02 22:04:18 -04:00
Michael Goulet
f95bdf453e Remove redundant in_trait from hir::TyKind::OpaqueDef 2024-10-02 21:59:55 -04:00
Frank Rehwinkel
81202c8b13 epoll: remove extraneous clone of ready_list
A simplification that doesn't impact the epoll implementation's logic.

It is not necessary to clone the ready_list before reading its
`is_empty` state.

This avoids the clone step but more importantly avoids the invisible
drop step of the clone.
2024-10-02 20:08:46 +02:00
Frank Rehwinkel
86bb1373aa epoll: add vector clock to the epoll ready_list
This adds a VClock to the epoll implementation's ready_list
and has this VClock synced from the thread that updates
an event in the ready_list and then has the VClocks of any
threads being made runnable again, out of the calls to
epoll_wait, synced from it.
2024-10-02 20:08:46 +02:00