Commit Graph

235178 Commits

Author SHA1 Message Date
bors
9998f4add0 Auto merge of #116372 - matthiaskrgr:rollup-ee9oxxa, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - #113053 (add notes about non-compliant FP behavior on 32bit x86 targets)
 - #115726 (For a single impl candidate, try to unify it with error trait ref)
 - #116158 (Don't suggest nonsense suggestions for unconstrained type vars in `note_source_of_type_mismatch_constraint`)
 - #116351 (Add `must_use` on pointer equality functions)
 - #116355 (Clarify float rounding direction for signed zero)
 - #116361 (Bump stdarch submodule)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-10-03 07:10:07 +00:00
Matthias Krüger
c3daf77132
Rollup merge of #116361 - eduardosm:bump-stdarch, r=Amanieu
Bump stdarch submodule

r? `@Amanieu`
2023-10-03 08:58:50 +02:00
Matthias Krüger
043fcc487a
Rollup merge of #116355 - orlp:signed-zero-rounding-mode, r=thomcc
Clarify float rounding direction for signed zero

Closes https://github.com/rust-lang/rust/issues/116339.
2023-10-03 08:58:50 +02:00
Matthias Krüger
cebe393a4a
Rollup merge of #116351 - asquared31415:ptr_eq_must_use, r=workingjubilee
Add `must_use` on pointer equality functions

`ptr == ptr` (like all use of `==`) has a similar warning, and these functions are simple convenience wrappers over that.
2023-10-03 08:58:49 +02:00
Matthias Krüger
634e5c9ba2
Rollup merge of #116158 - compiler-errors:unconstrained-type-var-sugg, r=wesleywiser
Don't suggest nonsense suggestions for unconstrained type vars in `note_source_of_type_mismatch_constraint`

The way we do type inference for suggestions in `note_source_of_type_mismatch_constraint` is a bit strange. We compute the "ideal" method signature, which takes the receiver that we *want* and uses it to compute the types of the arguments that would have given us that receiver via type inference, and use *that* to suggest how to change an argument to make sure our receiver type is inferred correctly.

The problem is that sometimes we have totally unconstrained arguments (well, they're constrained by things outside of the type checker per se, like associated types), and therefore type suggestions are happy to coerce anything to that unconstrained argument. This leads to bogus suggestions, like #116155. This is partly due to above, and partly due to the fact that `emit_type_mismatch_suggestions` doesn't double check that its suggestions are actually compatible with the program other than trying to satisfy the type mismatch.

This adds a hack to make sure that at least the types are fully constrained, but I guess I could also rip out this logic altogether. There would be some sad diagnostics regressions though, such as `tests/ui/type/type-check/point-at-inference-4.rs`.

Fixes #116155
2023-10-03 08:58:48 +02:00
Matthias Krüger
ff3b15e2bf
Rollup merge of #115726 - compiler-errors:better-error-ref, r=estebank
For a single impl candidate, try to unify it with error trait ref

This allows us to point out an exact type mismatch when there's only one applicable impl.

cc `@asquared31415`
r? `@estebank`
2023-10-03 08:58:48 +02:00
Matthias Krüger
9eb87c39a0
Rollup merge of #113053 - RalfJung:x86_32-float, r=workingjubilee
add notes about non-compliant FP behavior on 32bit x86 targets

Based on ton of prior discussion (see all the issues linked from https://github.com/rust-lang/unsafe-code-guidelines/issues/237), the consensus seems to be that these targets are simply cursed and we cannot implement the desired semantics for them. I hope I properly understood what exactly the extent of the curse is here, let's make sure people with more in-depth FP knowledge take a close look!

In particular for the tier 3 targets I have no clue which target is affected by which particular variant of the x86_32 FP curse. I assumed that `i686` meant SSE is used so the "floating point return value" is the only problem, while everything lower (`i586`, `i386`) meant x87 is used.

I opened https://github.com/rust-lang/rust/issues/114479 to concisely describe and track the issue.

Cc `@workingjubilee` `@thomcc` `@chorman0773`  `@rust-lang/opsem`
Fixes https://github.com/rust-lang/rust/issues/73288
Fixes https://github.com/rust-lang/rust/issues/72327
2023-10-03 08:58:47 +02:00
Ralf Jung
df911dfdd6 add notes about non-compliant FP behavior on 32bit x86 targets 2023-10-03 07:52:40 +02:00
bors
4f75af9e19 Auto merge of #116083 - cuviper:relnotes-1.73.0, r=Mark-Simulacrum
Add release notes for 1.73.0

r? `@Mark-Simulacrum`
cc `@rust-lang/release`
2023-10-03 04:37:43 +00:00
Mark Rousskov
9501ff00b9
Fix a few typos
Co-authored-by: Josh Triplett <josh@joshtriplett.org>
2023-10-02 22:49:16 -04:00
Michael Goulet
07851679cd Point out the actual mismatch error 2023-10-02 23:14:29 +00:00
Michael Goulet
8be12f4ed7 For a single impl candidate, try to unify it with error trait ref 2023-10-02 23:14:29 +00:00
bors
2e5a9dd6c9 Auto merge of #102099 - InnovativeInventor:re-cold-land, r=nikic
Rebased: Mark drop calls in landing pads cold instead of noinline

I noticed that certain inlining optimizations were missing while staring at some compiled code output. I'd like to see this relanded, so I rebased the PR from `@erikdesjardins` (PR #94823).

This PR reapplies https://github.com/rust-lang/rust/pull/92419, which was reverted in https://github.com/rust-lang/rust/pull/94402 due to https://github.com/rust-lang/rust/issues/94390.

Fixes https://github.com/rust-lang/rust/issues/46515, fixes https://github.com/rust-lang/rust/issues/87055.

Update: fixes #97217.
2023-10-02 22:02:12 +00:00
Eduardo Sánchez Muñoz
f2918b4a3d Bump stdarch submodule 2023-10-02 23:43:35 +02:00
Josh Stone
0eb8973fa9 Shuffle around some 1.73.0 relnotes 2023-10-02 14:41:10 -07:00
Josh Stone
c6bb73101e
Apply suggestions for 1.73.0 relnotes
Co-authored-by: Mark Rousskov <mark.simulacrum@gmail.com>
Co-authored-by: Urgau <3616612+Urgau@users.noreply.github.com>
2023-10-02 14:37:34 -07:00
Michael Goulet
ac5aa8c1a4 Don't suggest nonsense suggestions for unconstrained type vars in note_source_of_type_mismatch_constraint 2023-10-02 21:13:46 +00:00
bors
5333b878c8 Auto merge of #116356 - tmandry:rollup-trfidc8, r=tmandry
Rollup of 5 pull requests

Successful merges:

 - #114453 (Print GHA log groups to stdout instead of stderr)
 - #114454 (Replace `HashMap` with `IndexMap` in pattern binding resolve )
 - #116289 (Add missing #[inline] on AsFd impl for sys::unix::fs::File)
 - #116349 (ensure the parent path's existence on `x install`)
 - #116350 (Improve wording of `hint::black_box` docs)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-10-02 20:11:28 +00:00
Tyler Mandry
132e38366f
Rollup merge of #116350 - Nilstrieb:in-situ, r=Dylan-DPC
Improve wording of `hint::black_box` docs

The wording is a bit confusing.

squash of #109634
2023-10-02 16:09:43 -04:00
Tyler Mandry
d7621cdb19
Rollup merge of #116349 - onur-ozkan:hfix, r=tmandry
ensure the parent path's existence on `x install`

fixes https://github.com/rust-lang/rust/pull/116127#issuecomment-1743454109

cc `@tmandry`
2023-10-02 16:09:43 -04:00
Tyler Mandry
1edf7233fa
Rollup merge of #116289 - linkmauve:patch-1, r=the8472
Add missing #[inline] on AsFd impl for sys::unix::fs::File

This operation should be extremely cheap, at most the `mov` of the underlying file descriptor, but due to this missing `#[inline]` it is currently a function call.
2023-10-02 16:09:42 -04:00
Tyler Mandry
af77806bee
Rollup merge of #114454 - Nilstrieb:no-evil-sorting, r=cjgillot
Replace `HashMap` with `IndexMap` in pattern binding resolve

fixes https://github.com/rust-lang/rust/pull/114332#discussion_r1284189179
2023-10-02 16:09:42 -04:00
Tyler Mandry
14f6249018
Rollup merge of #114453 - Kobzol:ci-group-stdout, r=onur-ozkan
Print GHA log groups to stdout instead of stderr

In all other places (e.g. `bootstrap.py`, `opt-dist`), we use stdout instead of stderr. I think that using stderr might be causing some discrepancies in the log, where sometimes the contents of a group "leak" outside the group. Let's see what happens if we use stdout instead. It's possible that it will be worse, since we print most stuff to stderr (?).

r? `@ghost`
2023-10-02 16:09:41 -04:00
Orson Peters
07e96314ec Clarify float rounding direction for signed zero 2023-10-02 22:05:17 +02:00
4gboframram
44c9818993 Improve wording of hint::black_box docs
The wording is a bit confusing.

Co-authored-by: Chris Denton <christophersdenton@gmail.com>
2023-10-02 20:07:14 +02:00
onur-ozkan
2c8759ef8a ensure the parent path's existence on x install
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2023-10-02 20:48:53 +03:00
bors
8e47113d71 Auto merge of #116331 - lqd:jemalloc-update, r=nnethercote
update jemalloc-sys to most recent release

I wouldn't expect this to show perf improvements: IIUC this release should only contain a bugfix.

cc `@nnethercote`

r? `@ghost`
2023-10-02 17:48:05 +00:00
Nilstrieb
6ca07235a6 Replace HashMap with IndexMap in pattern binding resolve
It will be iterated over, so we should avoid using `HashMap`.
2023-10-02 19:12:42 +02:00
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
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
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