Skip to content

Rollup of 10 pull requests #124646

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 34 commits into from
May 3, 2024
Merged

Rollup of 10 pull requests #124646

merged 34 commits into from
May 3, 2024

Conversation

matthiaskrgr
Copy link
Member

Successful merges:

Failed merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

Nadrieril and others added 30 commits April 5, 2024 00:02
"is greater or equal to". Beside common sense.
library/backtrace also declares a feature called `gimli-symbolize` which
appear used, but the feature in std with the same name is unused, so
remove it.
`ConstKind::Value` is the only variant where control flow leaves the
first match on `impl_ct.kind()`, so there is no need for a second match
on the same expression later on.
Sort them, and remove the unused ones (`lint_reasons` and
`proc_macro_span`).
They each have a single call site.
Control flow never gets past the end of the `ExpandResult::Retry` match
arm, due to the `span_bug` and the `continue`. Therefore, the code after
the match can only be reached from the `ExpandResult::Ready` arm.

This commit moves that code after the match into the
`ExpandResult::Ready` arm, avoiding the need for the `continue` in the
`ExpandResult::Retry` arm.
Too clever by half, IMO.
Alongside the existing `Invocation::span`.
Because the type is not obvious, and this clarifies things.
It is currently an enum and the `tts` and `idx` fields are repeated
across the two variants.

This commit splits it into a struct `Frame` and an enum `FrameKind`, to
factor out the duplication. The commit also renames `Frame::new` as
`Frame::new_delimited` and adds `Frame::new_sequence`. I.e. both
variants now have a constructor.
…ompiler-errors

deref patterns: impl `DerefPure` for more std types

Context: [deref patterns](rust-lang#87121). The requirements of `DerefPure` aren't precise yet, but these types unambiguously satisfy them.

Interestingly, a hypothetical `impl DerefMut for Cow` that does a `Clone` would *not* be eligible for `DerefPure` if we allow mixing deref patterns with normal patterns. If the following is exhaustive then the `DerefMut` would cause UB:
```rust
match &mut Cow::Borrowed(&()) {
    Cow::Owned(_) => ..., // Doesn't match
    deref!(_x) if false => ..., // Causes the variant to switch to `Owned`
    Cow::Borrowed(_) => ..., // Doesn't match
    // We reach unreachable
}
```
io safety: update Unix explanation to use `Arc`

Fixes rust-lang#124384

Cc ```@jsgf```
…s, r=Amanieu

String.truncate comment microfix (greater or equal)

String.truncate calls Vec.truncate, in turn, and that states "is greater or equal to". Beside common sense.
run-make-support: preserve tooks.mk behavior for EXTRACXXFLAGS

In rust-lang#123149 when trying to add a command wrapper for `cc`, I didn't preserve the behavior of tools.mk completely: tools.mk had

```makefile
# Extra flags needed to compile a working executable with the standard library
ifdef IS_WINDOWS
ifdef IS_MSVC
	#EXTRACFLAGS := ws2_32.lib userenv.lib advapi32.lib bcrypt.lib ntdll.lib synchronization.lib
else
	#EXTRACFLAGS := -lws2_32 -luserenv -lbcrypt -lntdll -lsynchronization
	EXTRACXXFLAGS := -lstdc++
	#EXTRARSCXXFLAGS := -l static:-bundle=stdc++
endif
else
ifeq ($(UNAME),Darwin)
	#EXTRACFLAGS := -lresolv
	EXTRACXXFLAGS := -lc++
	#EXTRARSCXXFLAGS := -lc++
else
ifeq ($(UNAME),FreeBSD)
	#EXTRACFLAGS := -lm -lpthread -lgcc_s
else
ifeq ($(UNAME),SunOS)
	#EXTRACFLAGS := -lm -lpthread -lposix4 -lsocket -lresolv
else
ifeq ($(UNAME),OpenBSD)
	#EXTRACFLAGS := -lm -lpthread -lc++abi
	#RUSTC := $(RUSTC) -C linker="$(word 1,$(CC:ccache=))"
else
	#EXTRACFLAGS := -lm -lrt -ldl -lpthread
	EXTRACXXFLAGS := -lstdc++
	#EXTRARSCXXFLAGS := -lstdc++
endif
endif
endif
endif
endif
```

Note that for {`FreeBSD`, `SunOs`, `OpenBSD`} the `-lstdc++` flag is *not* passed, so `EXTRACXXFLAGS` for those platforms should be an empty `vec![]`.

r? ghost (testing this with PR CI)
…kingjubilee

library/std: Remove unused `gimli-symbolize` feature

library/backtrace also declares a feature called `gimli-symbolize` which appear used, but the feature in std with the same name is unused, so remove it.
… r=compiler-errors

`rustc_expand` cleanups

Some cleanups I made while looking through this code. Nothing that requires any real domain-specific knowledge about this crate.

r? ````@michaelwoerister````
variable-precision float operations can differ depending on optimization levels

Follow-up to rust-lang#121793 and rust-lang#118217 that accounts for optimizations changing the precision of these functions.

Fixes rust-lang#109118
Fixes rust-lang#71355
Tweak `consts_may_unify`

r? ````@lcnr````
…yn, r=compiler-errors

AST pretty: Use `builtin_syntax` for type ascription

Follow-up to rust-lang#122806.
CC #124619.
@rustbot rustbot added O-unix Operating system: Unix-like S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. rollup A PR which is a rollup labels May 3, 2024
@matthiaskrgr
Copy link
Member Author

@bors r+ rollup=never p=11

@bors
Copy link
Collaborator

bors commented May 3, 2024

📌 Commit e6c82d9 has been approved by matthiaskrgr

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 3, 2024
@bors
Copy link
Collaborator

bors commented May 3, 2024

⌛ Testing commit e6c82d9 with merge 561b5de...

@bors
Copy link
Collaborator

bors commented May 3, 2024

☀️ Test successful - checks-actions
Approved by: matthiaskrgr
Pushing 561b5de to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label May 3, 2024
@bors bors merged commit 561b5de into rust-lang:master May 3, 2024
7 checks passed
@rustbot rustbot added this to the 1.80.0 milestone May 3, 2024
@rust-timer
Copy link
Collaborator

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#123480 deref patterns: impl DerefPure for more std types 26b5bb35e5dfe68134da97877fb9db938fc03b0d (link)
#124412 io safety: update Unix explanation to use Arc 863333eb0cf8148a93ce65aeda5b7fe35a64aeb5 (link)
#124441 String.truncate comment microfix (greater or equal) 6770bad7d15c2a2f1e0fd5014b2c421ebbffb16a (link)
#124594 run-make-support: preserve tooks.mk behavior for EXTRACXXFL… 3384176426a170842f467b36bbe103d0584f2ab2 (link)
#124604 library/std: Remove unused gimli-symbolize feature 7cdb335770106a1933a44f2e13c8d6f5abbad9f6 (link)
#124607 rustc_expand cleanups 3499f2a270d0c499a7180f94e8f6206659981996 (link)
#124609 variable-precision float operations can differ depending on… 17a343418bbf77acbc46844870d2688402d6c188 (link)
#124610 Tweak consts_may_unify 98060dfd1bbc830a062e8421e62abe94fa0111f2 (link)
#124626 const_eval_select: add tracking issue 129b7668a6e1072b6c5135d9090177d6dac0eef6 (link)
#124637 AST pretty: Use builtin_syntax for type ascription 51be999138def9f9d3636fec47bfaef20f82a5ce (link)

previous master: 79734f1db8

In the case of a perf regression, run the following command for each PR you suspect might be the cause: @rust-timer build $SHA

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (561b5de): comparison URL.

Overall result: ✅ improvements - no action needed

@rustbot label: -perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-1.0% [-2.8%, -0.2%] 24
Improvements ✅
(secondary)
-0.9% [-1.6%, -0.3%] 9
All ❌✅ (primary) -1.0% [-2.8%, -0.2%] 24

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
1.9% [0.1%, 4.3%] 3
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 1.9% [0.1%, 4.3%] 3

Cycles

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
1.0% [1.0%, 1.0%] 1
Regressions ❌
(secondary)
2.4% [2.4%, 2.4%] 1
Improvements ✅
(primary)
-1.4% [-1.7%, -1.2%] 4
Improvements ✅
(secondary)
-1.7% [-2.1%, -1.3%] 4
All ❌✅ (primary) -0.9% [-1.7%, 1.0%] 5

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 676.146s -> 676.467s (0.05%)
Artifact size: 316.04 MiB -> 315.90 MiB (-0.04%)

@matthiaskrgr matthiaskrgr deleted the rollup-crlsvg5 branch September 1, 2024 17:35
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
merged-by-bors This PR was explicitly merged by bors. O-unix Operating system: Unix-like rollup A PR which is a rollup S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.