1
Fork 0
Commit graph

277097 commits

Author SHA1 Message Date
Michael Goulet
54e33bbdec Account for C string literals in HiddenUnicodeCodepoints lint 2024-12-31 04:53:00 +00:00
ericlehong
e34465f852 Fix typos
Signed-off-by: ericlehong <193237094+ericlehong@users.noreply.github.com>
2024-12-31 12:33:36 +08:00
Stuart Cook
2491edab30
Rollup merge of #134949 - compiler-errors:froms, r=jieyouxu
Convert some `Into` impls into `From` impls

From the [`From`](https://doc.rust-lang.org/std/convert/trait.From.html) docs:

> One should always prefer implementing `From` over [`Into`](https://doc.rust-lang.org/std/convert/trait.Into.html) because implementing `From` automatically provides one with an implementation of [`Into`](https://doc.rust-lang.org/std/convert/trait.Into.html) thanks to the blanket implementation in the standard library.
>
> Only implement [`Into`](https://doc.rust-lang.org/std/convert/trait.Into.html) when targeting a version prior to Rust 1.41 and converting to a type outside the current crate. `From` was not able to do these types of conversions in earlier versions because of Rust’s orphaning rules. See [Into](https://doc.rust-lang.org/std/convert/trait.Into.html) for more details.

Some of these impls are likely from before 1.41, and then some others were probably just mistakes. Building nightly rust is definitely not supported on 1.41, so let's modernize these impls :D
2024-12-31 14:12:49 +11:00
Stuart Cook
7da22aa6c3
Rollup merge of #134941 - workingjubilee:rustc-abi-normal, r=Noratrieb
compiler: Add a statement-of-intent to `rustc_abi`

This just documents the most basic idea of what the crate is even for in my view, rather than leaving that strewn about GitHub issues, PR reviews, and Zulip streams. In particular, I hope to make it clearer what code should go in `rustc_abi` and what should not, which is of immediate relevance to contributors.

I considered going even further and explaining ideas like "ABI compatibility", prologues, and so on. However, because of the cross-cutting nature of ABI, I think such explanations should probably live in the place for cross-cutting documents: the rustc dev guide. This is only meant to be a quick "by the way".
2024-12-31 14:12:48 +11:00
Stuart Cook
f3748c4fe0
Rollup merge of #134934 - Noname-Official:patch-1, r=saethlin
Fix typos
2024-12-31 14:12:48 +11:00
Stuart Cook
a93bef6161
Rollup merge of #134933 - compiler-errors:async-fn-future-sized, r=lqd
Make sure we check the future type is `Sized` in `AsyncFn*`

Fixes #134817
2024-12-31 14:12:47 +11:00
Stuart Cook
e49929e44d
Rollup merge of #134932 - RalfJung:arm-float-abi, r=workingjubilee
explicitly set float ABI for all ARM targets

We currently always set the `FloatABIType` field in the LLVM target machine to `Default`, which means LLVM infers the ARM float ABI (hard vs soft) from the LLVM target triple. This causes problems such as having to set the LLVM triple to `*-gnueabi` for our `musleabi` targets to ensure they get correctly inferred as soft-float targets. It also means rustc doesn't really know which float ABI ends up being used, which is a blocker for https://github.com/rust-lang/rust/pull/134794. So I think we should stop doing that and instead explicitly control that value. That's what this PR implements.

See [Zulip](https://rust-lang.zulipchat.com/#narrow/channel/187780-t-compiler.2Fwg-llvm/topic/Softfloat.20ABI.2C.20hardfloat.20instructions) for more context.

Best reviewed commit-by-commit. I hope I got all those `llvm_floatabi` values right...
2024-12-31 14:12:47 +11:00
Stuart Cook
fa6990c16e
Rollup merge of #134930 - RalfJung:ptr-docs-valid-access, r=jhpratt
ptr docs: make it clear that we are talking only about memory accesses

This should make it harder to take this sentence out of context and misunderstand it.
2024-12-31 14:12:46 +11:00
Stuart Cook
1200d3d733
Rollup merge of #134927 - DaniPopes:const-as_flattened_mut, r=scottmcm
Make slice::as_flattened_mut unstably const

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

Unblocked by const_mut_refs being stabilized: https://github.com/rust-lang/rust/pull/129195
2024-12-31 14:12:46 +11:00
Stuart Cook
a777f4a793
Rollup merge of #134919 - Zalathar:x-test-compiler, r=jieyouxu
bootstrap: Make `./x test compiler` actually run the compiler unit tests

Fixes #134916.
2024-12-31 14:12:45 +11:00
bors
80f5a81df9 Auto merge of #134929 - compiler-errors:style-edition-2024, r=ytmimi
Stabilize `style_edition = "2024"` in-tree

This PR stabilizes the `style_edition` flag in rustfmt.

**Why am I doing this in-tree?** The beta release cut is imminent (according to forge, on January 3) and this is the most lightweight approach to getting this flag stable on nightly. It's imperative (as far as I can tell -- `@traviscross` can verify or disagree) that we stabilize the `style_edition` flag so that users can control their style edition separately from the edition.

I'm happy to move this PR to the rustfmt repo and subsequently prepare a subtree sync if someone on `@rust-lang/rustfmt` believes that we should get this landed on the rustfmt side then synced. If this is the right recourse, I'd like to note that this is still quite time-sensitive. However, I'm happy to dedicate time to get this done if necessary, since I'd really like to un-jeopardize the style edition.

Tracking:

- https://github.com/rust-lang/rust/issues/123799
2024-12-31 03:05:49 +00:00
LemonJ
d9ef419c90 fix doc for read write unaligned in zst operation 2024-12-31 10:59:13 +08:00
Chris Denton
dc1f2be449
Add comments to -Zlink-* tests 2024-12-31 02:25:35 +00:00
Michael Goulet
f28e13b055 Fix span for IndexMut method call on HashMap/BTreeMap 2024-12-31 02:21:17 +00:00
Michael Goulet
6a3474e653 Use if-let in structured suggestion instead of Option::map 2024-12-31 02:21:17 +00:00
Michael Goulet
aea2a6f836 Convert some Into impls into From impls 2024-12-31 01:56:33 +00:00
Michael Goulet
b994124778 Explain how to mutate a HashMap/BTreeMap with more nuance 2024-12-31 01:20:53 +00:00
Michael Goulet
aac741a465 Unsafe binder support in rustdoc 2024-12-31 01:08:43 +00:00
Michael Goulet
f694db1e28 Stabilize style_edition 2024 in-tree 2024-12-31 00:50:21 +00:00
Michael Goulet
ed9a4cfdeb Make sure we check the future type is Sized in AsyncFn* 2024-12-31 00:46:46 +00:00
Zalathar
796835f376 Make ./x test compiler actually run the compiler unit tests 2024-12-31 10:52:33 +11:00
bors
4e5fec2f1e Auto merge of #134757 - RalfJung:const_swap, r=scottmcm
stabilize const_swap

libs-api FCP passed in https://github.com/rust-lang/rust/issues/83163.

However, I only just realized that this actually involves an intrinsic. The intrinsic could be implemented entirely with existing stable const functionality, but we choose to make it a primitive to be able to detect more UB. So nominating for `@rust-lang/lang`  to make sure they are aware; I leave it up to them whether they want to FCP this.

While at it I also renamed the intrinsic to make the "nonoverlapping" constraint more clear.

Fixes #83163
2024-12-30 23:46:42 +00:00
Jubilee Young
c0d3634af8 compiler: Add a statement-of-intent to rustc_abi 2024-12-30 15:21:27 -08:00
Chris Denton
7d5ff8b8bd
Windows: Enable issue 70093 link tests 2024-12-30 22:52:23 +00:00
bors
7f75bfa1ad Auto merge of #134931 - matthiaskrgr:rollup-b47ly73, r=matthiaskrgr
Rollup of 5 pull requests

Successful merges:

 - #132477 (Add illumos target documentation)
 - #134871 (Add codegen test for issue 63646)
 - #134911 (chore: fix typos)
 - #134922 (Fix typos)
 - #134924 (ci: Cleanup docker build logs in CI)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-12-30 21:06:28 +00:00
Ralf Jung
c3189c585f musleabi* targets: we no longer need to set gnueabi* for LLVM now that we set the float ABI explicitly 2024-12-30 21:59:05 +01:00
Ralf Jung
a51fefcaab explicitly set float ABI for all ARM targets 2024-12-30 21:59:05 +01:00
Ralf Jung
a0dbb37ebd add llvm_floatabi field to target spec that controls FloatABIType 2024-12-30 21:59:05 +01:00
NoName
0a0f5d3310
Fix typos 2024-12-30 19:58:55 +01:00
Matthias Krüger
05c0cd31e7
Rollup merge of #134924 - ranger-ross:cleanup-ci-output, r=Kobzol
ci: Cleanup docker build logs in CI

Cleaning up the CI logs to make reviewing CI failures easier. This PR adds a `::group` around the docker tag hash input which is pretty large (250+ lines) and is probably not relevant for most people.

Related to #134910 , see this [comment](https://github.com/rust-lang/rust/issues/134910#issuecomment-2565612463)
2024-12-30 19:34:57 +01:00
Matthias Krüger
b31c9d5036
Rollup merge of #134922 - ericlehong:fix/typos, r=lqd
Fix typos

This PR fixes typos errors in comments, docs and logs.

Thank you very much.
2024-12-30 19:34:57 +01:00
Matthias Krüger
4b9e3daa0b
Rollup merge of #134911 - HigherOrderLogic:master, r=onur-ozkan
chore: fix typos

This PR fixes typos errors in docstring only, so functionality wise, it should stay the same.
2024-12-30 19:34:56 +01:00
Matthias Krüger
6c12546dc0
Rollup merge of #134871 - clubby789:test-63646, r=compiler-errors
Add codegen test for issue 63646

Closes #63646
2024-12-30 19:34:55 +01:00
Matthias Krüger
953418c957
Rollup merge of #132477 - Noratrieb:illumos-oxide, r=workingjubilee
Add illumos target documentation

Fixes https://github.com/rust-lang/rust/pull/130132#issuecomment-2339055221

`@jclulow` `@pfmooney` I'm adding you as requested.

The page is very barebones (as I do not know illumos well) and could use some improvements (for example in the "Cross-compilation toolchains and C code" section).
Feel free to suggest improvements (or rewrite it from scratch) if you find something.
2024-12-30 19:34:54 +01:00
Ralf Jung
3c0c138687
fmt
Co-authored-by: scottmcm <scottmcm@users.noreply.github.com>
2024-12-30 19:30:08 +01:00
Ralf Jung
e36b4c95f4 ptr docs: make it clear that we are talking only about memory accesses 2024-12-30 19:28:03 +01:00
bors
2061630860 Auto merge of #134914 - lqd:polonius-next-episode-5, r=jackh726
A couple datalog/borrowck cleanups

As discussed on zulip, here's a chill one in between slightly more interesting PRs:
- I hadn't noticed there still were a couple of datalog-related modules outside of their dedicated `polonius` module (go to horn-clause jail, bonk!).
- there somehow was both a `diags` module and a `diagnostics` module.
- a couple other tiny things being renamed -- let me know what you think.

As requested I've tried to have somewhat granular commits to ease review, but the last two or three could be squashed together, since they're all related to the `diags` module (but moving its contents is less tedious to check in its own commit).

r? `@jackh726`
2024-12-30 18:24:37 +00:00
DaniPopes
26f523edfc
Make slice::as_flattened_mut unstably const
Tracking issue: https://github.com/rust-lang/rust/issues/95629

Unblocked by const_mut_refs being stabilized: https://github.com/rust-lang/rust/pull/129195
2024-12-30 18:16:49 +01:00
Ralf Jung
fff026c8e5 rustc_llvm: expose FloatABIType target machine parameter 2024-12-30 18:10:59 +01:00
rustbot
b560f5af11 Update books 2024-12-30 12:01:17 -05:00
bors
93722f7ed5 Auto merge of #134906 - jieyouxu:multi-crate-type, r=lqd,fmease
tests: add basic test coverage for stable `--crate-type` flag

I experimented locally with making the compiler panic if multiple crate types are passed to a single `--crate-type` flag, and it turns out not only does the compiler successfully bootstrap, only two ui tests failed:

```
failures:
    [ui] tests/ui/sepcomp/sepcomp-lib.rs
    [ui] tests/ui/sepcomp/sepcomp-lib-lto.rs

test result: FAILED. 4 passed; 2 failed; 18181 ignored; 0 measured; 0 filtered out; finished in 364.55ms
```

These are not specific tests for the `--crate-type` flag, only their auxiliary *happens* to use a `--crate-type` with two crate types:

```rs
//@ compile-flags: -C codegen-units=3 --crate-type=rlib,dylib -g
```

I was not able to find a specific test in run-make test suite either.

So this PR tries to add some basic test coverage for the stable `--crate-type` flag's interface (including to check that `--crate-type` accepts multiple crate types), since I imagine it might be slightly awkward if we accidentally regressed this.

r? compiler
2024-12-30 15:44:03 +00:00
ranger-ross
b4d14ceae7
ci: Cleanup docker build logs in CI 2024-12-31 00:28:58 +09:00
Noratrieb
ac3ffccf37 Add illumos target documentation 2024-12-30 16:25:25 +01:00
Davis Muro
62c3c9a5ae
add suggestion for wrongly ordered format parameters 2024-12-30 06:14:26 -08:00
ericlehong
a0b3452fb5 Fix typos
Signed-off-by: ericlehong <193237094+ericlehong@users.noreply.github.com>
2024-12-30 21:43:22 +08:00
bors
f95c996750 Auto merge of #134885 - RalfJung:arm-soft-float, r=workingjubilee
make -Csoft-float have an effect on all ARM targets

See the discussion [on Zulip](https://rust-lang.zulipchat.com/#narrow/channel/187780-t-compiler.2Fwg-llvm/topic/Softfloat.20ABI.2C.20hardfloat.20instructions): apparently `-float-abi=soft` is how one can force "use soffloat ABI but hardware FP instructions" on ARM-32. Our version of that is `-Csoft-float` but I made that one a NOP on all targets except for ARM eabihf (see https://github.com/rust-lang/rust/pull/129897)... which now make experimentation on what we actually want to do here a lot harder. So, let's unlock the flag on all ARM targets while we are still figuring out our long-term plans here.

Cc `@workingjubilee`
2024-12-30 12:41:55 +00:00
许杰友 Jieyou Xu (Joe)
92e8e84e7d tests: add basic test coverage for cli flag --crate-type 2024-12-30 19:10:43 +08:00
Noah Lev
cc9a6fa552 Opt into, rather than out of, linkcheck (#2180)
This makes it less of a hassle to render the book locally.
2024-12-30 17:22:22 +08:00
Horu
4c279fb7af chore: fix typos 2024-12-30 14:56:21 +07:00
bors
c1566141b6 Auto merge of #134865 - clubby789:proc-macro-tls, r=onur-ozkan
bootstrap: Don't apply -Ztls-model=initial-exec to deps of proc-macros

Fixes #134863

1. Checks if a crate name is in a static list before applying the flag
2. Adds a tidy check that gathers transitive deps of proc macros and ensures the list is up to date

cc `@bjorn3` - the issue specifies `rustc_fluent_macro` but I assume this applies to all proc macro crates.
2024-12-30 07:26:13 +00:00