Commit Graph

235386 Commits

Author SHA1 Message Date
bors
5ead7452e5 Auto merge of #116346 - matthiaskrgr:rollup-uwepk8j, r=matthiaskrgr
Rollup of 3 pull requests

Successful merges:

 - #116313 (Some small cleanups in `rustc_abi`)
 - #116326 (Correct misleading std::fmt::Binary example (#116165))
 - #116340 (`skip_binder` to `instantiate_identity`)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-10-02 15:56:33 +00:00
asquared31415
34ea540720 add must_use on pointer equality functions 2023-10-02 15:10:51 +00:00
Matthias Krüger
cfe9e13627
Rollup merge of #116340 - lcnr:early-binder-skip_binder, r=compiler-errors
`skip_binder` to `instantiate_identity`
2023-10-02 16:23:54 +02:00
Matthias Krüger
b3853ccc9d
Rollup merge of #116326 - Colonial-Dev:issue-116165-fix, r=joshtriplett
Correct misleading std::fmt::Binary example (#116165)

Nothing too crazy...

- Add two to the width specifier (so all 32 bits are correctly displayed)
- Pad out the compared string so the assert passes
- Add `// Note` comment highlighting the need for the extra width when using the `#` flag.

The exact contents (and placement?) of the note are, of course, highly bikesheddable.
2023-10-02 16:23:53 +02:00
Matthias Krüger
e51a2aaa4e
Rollup merge of #116313 - nnethercote:rustc_abi, r=the8472
Some small cleanups in `rustc_abi`

Minor things I found while looking at this crate's code.

r? `@the8472`
2023-10-02 16:23:53 +02:00
Chinedu Francis Nwafili
bf4df0617f
Tidy 2023-10-02 10:08:03 -04:00
Chinedu Francis Nwafili
9bb55a038f
Tidy 2023-10-02 09:54:45 -04:00
Chinedu Francis Nwafili
67379c4006
Address misc feedback 2023-10-02 08:59:31 -04:00
lcnr
dbc2cc8717 skip_binder to instantiate_identity 2023-10-02 13:19:37 +02:00
bors
b0889cb4ed Auto merge of #116276 - lqd:lld-sysroot, r=onur-ozkan
bootstrap: copy self-contained linking components to `stage0-sysroot`

I hit this issue while trying to bootstrap using a rustc where `rust-lld` is used by default: this was the cause of the failure to profile rustc-perf's bootstrap benchmark in https://github.com/rust-lang/rust/pull/113382.

`stage0-sysroot` currently only has libs and self-contained objects, not the other self-contained linking components yet. Most notably, it does not contain the linker and wrappers that we build, and that rustup distributes.

If you try to bootstrap using the bootstrap compiler's `rust-lld`, it will fail to link std at stage0 because `rust-lld` and the `gcc-ld` wrappers, will not be found in `stage0-sysroot/lib/rustlib/x86_64-unknown-linux-gnu/bin`.

This PR copies the `bin` directory next to the `lib` directory when `rust.lld` is enabled in the config (though maybe it could be done unconditionally, the fact that we need it to link does not necessarily mean that we'd want to build and provide it at stage1).

cc `@Kobzol` who also encountered this issue while using lld during bootstrap.
2023-10-02 09:41:42 +00:00
Nikita Popov
5bcf4f26ac Limit to LLVM 17.0.2 to work around WinEH codegen bug 2023-10-02 11:06:38 +02:00
Nikita Popov
ebbc68769d Update stack protector test
We no longer generate a protector for the strong case in this test,
which is actually the expected behavior per the test comment.
2023-10-02 10:37:56 +02:00
Nikita Popov
0608fca3ad Fix codegen tests on panic=abort targets 2023-10-02 10:37:56 +02:00
Erik Desjardins
31ee8b1818 Reapply: Mark drop calls in landing pads cold instead of noinline
Co-authored-by: Max Fan <git@max.fan>
Co-authored-by: Nikita Popov <npopov@redhat.com>
2023-10-02 10:37:53 +02:00
bors
781ebbec8a Auto merge of #115898 - onur-ozkan:config-change-tracking, r=Mark-Simulacrum
bootstrap major change detection implementation

The use of `changelog-seen` and `bootstrap/CHANGELOG.md` has not been functional in any way for many years. We often do major/breaking changes but never update the changelog file or the `changelog-seen`. This is an alternative method for tracking major or breaking changes and informing developers when such changes occur.

Example output when bootstrap detects a major change:
![image](https://github.com/rust-lang/rust/assets/39852038/ee802dfa-a02b-488b-a433-f853ce079b8a)
2023-10-02 07:41:52 +00:00
Rémy Rakic
dcfa64bc2d update jemalloc-sys to most recent release 2023-10-02 07:41:51 +00:00
Ralf Jung
bfc0f23acb MIRI -> Miri 2023-10-02 08:35:08 +02:00
Ralf Jung
ec2e00c404 update some comments around swap() 2023-10-02 08:34:10 +02:00
Nicholas Nethercote
57397de2c9 Fix a comment.
Compiling any part of the compiler will almost certainly require
Nightly.
2023-10-02 16:47:11 +11:00
Nicholas Nethercote
5f4177a786 Factor out common token generation in fluent_messages.
The failure and success cases are similar enough that they can share
code.
2023-10-02 16:47:10 +11:00
bors
15783292e5 Auto merge of #116325 - scottmcm:addr_eq, r=dtolnay
Add `ptr::addr_eq`

Seconded ACP: https://github.com/rust-lang/libs-team/issues/274#issuecomment-1741853598
Tracking issue: https://github.com/rust-lang/rust/issues/116324
cc `@dtolnay` https://github.com/rust-lang/rust/issues/106447
2023-10-02 04:17:01 +00:00
James Haywood
f2ecf7c511 Correct misleading std::fmt::Binary example 2023-10-01 23:58:54 -04:00
bors
30ec74728d Auto merge of #116317 - ravenclaw900:track-caller-unwrap-or-else, r=Mark-Simulacrum
Add track_caller attribute to Result::unwrap_or_else

Fixes issue where panics in unwrap_or_else callbacks marked with the `track_caller` attribute appear as errors in core.
2023-10-02 02:26:38 +00:00
Scott McMurray
18787914aa Add ptr::addr_eq 2023-10-01 18:56:38 -07:00
bors
79bfd93d5a Auto merge of #116207 - Ayush1325:uefi_stdio, r=Mark-Simulacrum
Stdio support for UEFI

- Uses Simple Text Output Protocol and Simple Text Input Protocol
- Reading is done one character at a time
- Writing is done with max 4096 characters

# Quirks
## Output Newline
- UEFI uses CRLF for newline. So when running the application in UEFI shell (qemu VGA), the output of `println` looks weird.
- However, since the UEFI shell supports piping output, I am unsure if doing any output post-processing is a good idea. UEFI shell `cat` command seems to work fine with just LF.

## Input Newline
- `Stdin.read_line()` method is broken in UEFI shell. Pressing enter seems to be read as CR, which means LF is never encountered.
- Works fine with input redirection from file.

CC `@dvdhrm`
2023-10-02 00:03:52 +00:00
Nicholas Nethercote
17e3793eb1 Name some local variables more consistently.
By making every `alt_foo` exactly match a `foo`.
2023-10-02 09:12:47 +11:00
bors
e0d7ed1f45 Auto merge of #116281 - Nadrieril:eager-const-eval, r=cjgillot
Cleanup number handling in match exhaustiveness

Doing a little bit of cleanup; handling number constants was somewhat messy. In particular, this:

- evals float consts once instead of repetitively
- reduces `Constructor` from 88 bytes to 56 (`mir::Const` is big!)

The `fast_try_eval_bits` function was mostly constructed from inlining existing code but I don't fully understand it; I don't follow how consts work and are evaluated very well.
2023-10-01 22:01:44 +00:00
bors
51ddc74679 Auto merge of #116304 - Zalathar:unreachable, r=cjgillot
coverage: Regression test for functions with unreachable bodies

This is a regression test for the coverage issue that was addressed temporarily by #116166, and is tracked by #116171.

---

If we instrument a function for coverage, but all of its counter-increment statements are removed by MIR optimizations, LLVM will think it isn't instrumented and it will disappear from coverage maps and coverage reports.

Most MIR opts won't cause this because they tend not to remove statements from bb0, but `UnreachablePropagation` can do so if it sees that bb0 ends with `TerminatorKind::Unreachable`.

Currently we have worked around this by turning off `UnreachablePropagation` when coverage instrumentation is enabled, which is why this test is able to pass.

---

`@rustbot` label +A-code-coverage
2023-10-01 20:14:42 +00:00
Nadrieril
eac7bcde5f Move eval_bits optimization upstream 2023-10-01 21:12:24 +02:00
Ayush Singh
3f4a289016
Stdio for UEFI
- Uses Simple Text Output Protocol and Simple Text Input Protocol
- Reading is done one character at a time
- Writing is done with max 4096 characters

Signed-off-by: Ayush Singh <ayushdevel1325@gmail.com>
2023-10-02 00:07:11 +05:30
Ayush Singh
b0a72173bb
Update UEFI docs
- Mention stdio support
- Update the example

Signed-off-by: Ayush Singh <ayushdevel1325@gmail.com>
2023-10-02 00:06:09 +05:30
bors
0e1dd179f1 Auto merge of #116259 - nnethercote:entry_point_type, r=cjgillot
Factor out duplicated `entry_point_type` functions

A small but nice cleanup.
2023-10-01 18:27:00 +00:00
bors
16b7b39fdd Auto merge of #116228 - bvanjoi:fix-116164, r=cjgillot
resolve: skip underscore character during candidate lookup

Fixes #116164

In use statement, an underscore is merely a placeholder symbol and does not bind to any name. Therefore, it can be safely ignored.
2023-10-01 16:41:03 +00:00
ravenclaw900
ba0b7f0f01
Add track_caller attribute to Result::unwrap_or_else 2023-10-01 09:42:37 -05:00
bors
6c29b45439 Auto merge of #116224 - nnethercote:rustc_arena-overhaul, r=cjgillot
`rustc_arena` overhaul

I find the `rustc_arena` a bit hard to read. These commits make it better.

r? `@cjgillot`
2023-10-01 14:38:51 +00:00
onur-ozkan
7d3dcd918e add triagebot notification for bootstrap config changes
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2023-10-01 16:55:46 +03:00
onur-ozkan
78eed2dfe1 add Changelog topic to bootstrap/README.md
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2023-10-01 16:55:27 +03:00
onur-ozkan
957de61594 implement major change tracking for the bootstrap configuration
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2023-10-01 16:54:52 +03:00
bors
871407a034 Auto merge of #115554 - Kobzol:single-cgu, r=Mark-Simulacrum
Build `rustc` with a single CGU on x64 Linux

This PR adds the `rust.codegen-units=1` setting when compiling the 64-bit Linux `rustc` artifact (the one used for try builds and Linux rustup distribution). This had mixed results in the past, however after the bump to LLVM 17, the results now seem pretty [incredible](https://github.com/rust-lang/rust/pull/115554#issuecomment-1706518199). Instruction counts, cycles, wall time, max RSS and even artifact sizes see large improvements.

The last [try build](https://github.com/rust-lang-ci/rust/actions/runs/6077686494/job/16487768049) with this setting took 1h 8m, which is basically the same duration for try builds that we have seen recently. So there shouldn't be any large hit to CI/build time.

I hope that this could potentially also reduce codegen noise of `rustc` a little bit, since small changes within a single `rustc` crate should no longer perturb optimizations because of CGU movement. We still do cross-crate LTO, so it won't eliminate it though.

r? `@Mark-Simulacrum`
2023-10-01 12:49:29 +00:00
bors
c16823d757 Auto merge of #116311 - matthiaskrgr:rollup-7r5zogb, r=matthiaskrgr
Rollup of 3 pull requests

Successful merges:

 - #116292 (warn if source is not either a git clone or a dist tarball)
 - #116295 (Fix `core::mem::drop` docs inaccuracy)
 - #116299 (Update location of `auxiliary/lint-plugin-test.rs`)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-10-01 11:06:38 +00:00
Nicholas Nethercote
2369adc5d8 Remove unnecessary pubs. 2023-10-01 21:57:09 +11:00
Nicholas Nethercote
ddb742225a Rename two parsing closures.
To match `parse_address_space` and `parse_bits` above.
2023-10-01 21:57:09 +11:00
Nicholas Nethercote
86ecfdd605 Minor comment and whitespace tweaks. 2023-10-01 21:57:06 +11:00
Rémy Rakic
82d23a6275 bootstrap: copy self-contained linking components to stage0-sysroot
otherwise bootstrap will fail to link the stdlib on a target using the
self-contained linker: rust-lld will not be found since it's currently
not in the stage0-sysroot.
2023-10-01 10:35:30 +00:00
Matthias Krüger
bcba369004
Rollup merge of #116299 - emmanuel-ferdman:wip, r=albertlarsan68
Update location of `auxiliary/lint-plugin-test.rs`

**PR Summary**:
PR updates the location of  `auxiliary/lint-plugin-test.rs` file which was moved in PR #110478.
2023-10-01 12:18:12 +02:00
Matthias Krüger
de7053133a
Rollup merge of #116295 - asquared31415:mem_drop_docs, r=WaffleLapkin
Fix `core::mem::drop` docs inaccuracy

r? `@Nilstrieb`
2023-10-01 12:18:12 +02:00
Matthias Krüger
cb4e2994c2
Rollup merge of #116292 - onur-ozkan:warn-wrong-sources, r=clubby789
warn if source is not either a git clone or a dist tarball

When the repository is downloaded directly via HTTP(as in #115041), builds may fail due to missing submodules.

This PR adds a check that warns people in such cases.
2023-10-01 12:18:11 +02:00
Nicholas Nethercote
7326cd98b9 Factor out the two entry_point_type functions.
They are very similar, and each one has a comment about the importance
of being kept in sync with the other. This commit removes the
duplication.
2023-10-01 20:45:09 +11:00
bors
7c3eeb92a5 Auto merge of #116307 - RalfJung:miri, r=RalfJung
Miri subtree update

r? `@ghost`
2023-10-01 07:43:21 +00:00
bors
8fa7bdf191 Auto merge of #115670 - Zoxc:outline-panic-macro-1, r=Mark-Simulacrum
Partially outline code inside the panic! macro

This outlines code inside the panic! macro in some cases. This is split out from https://github.com/rust-lang/rust/pull/115562 to exclude changes to rustc.
2023-10-01 05:56:47 +00:00