Repository navigation
Rollup of 5 pull requests - #164193
Rollup of 5 pull requests#164193
Conversation
The rust-analyzer impls of these methods will need to be removed on the next sync.
It's faster than `extend` to initialize these structures.
A lot of work can be skipped if the two values being related are equal. (There are various early-return equality checks like this further down the call chain, this just adds one earlier.)
The former has an early return check and a single call site, so the check can be moved before the call site. Also, in the `Err(NoSolution)` case we can skip the `CandidateHeadUsages::default()` stuff because that's just an empty list and `merge_usages` is a no-op.
Instead of getting it within `fast_reject_assumption`. `fast_reject_assumption` has three call sites. For two of them this change doesn't help perf, but the third call occurs in a loop, and this lets us get the goal lang item once per loop instead of once per loop element.
- Increase the number of preinterned type vars and anon bound types. - Preintern some root-universe placeholder types with anon bounds. - Adjust some comments. - Also rename a lot of the preinterning names for more consistency.
In unused macro lint, mention when its enclosing `mod` isn't annotated with `#[macro_use]`:
```
error: unused macro definition: `unused`
--> $DIR/unused-macros-decl.rs:17:11
|
LL | macro unused {
| ^^^^^^
|
note: the lint level is defined here
--> $DIR/unused-macros-decl.rs:16:12
|
LL | #[deny(unused_macros)]
| ^^^^^^^^^^^^^
help: consider annotating the enclosing module with `#[macro_use]`
|
LL + #[macro_use]
LL | mod bar {
|
```
On resolution error for unexported macro, point at macro of the same name and mention its enclosing scope could be marked with `#[macro_use]`:
```
error: cannot find macro `a_macro` in this scope
--> $DIR/unresolved-macro-missing-macro-use.rs:11:5
|
LL | a_macro!();
| ^^^^^^^
|
help: you might be missing a `#[macro_use]` attribute on a `mod` module or `use` import
--> $DIR/unresolved-macro-missing-macro-use.rs:5:5
|
LL | / mod has_a_macro {
LL | |
LL | | macro_rules! a_macro { () => {} }
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ a macro with the same name is defined here
... |
LL | | }
| |_- consider annotating this `mod` with `#[macro_use]`
```
On ambiguous macro use, suggest removing invalid import:
```
error[E0659]: `a_macro` is ambiguous
--> $DIR/unresolved-macro-missing-macro-use-3.rs:15:5
|
LL | a_macro!();
| ^^^^^^^ ambiguous name
|
= note: ambiguous because of a conflict between a `macro_rules` name and a non-`macro_rules` name from another module
note: `a_macro` could refer to the macro defined here
--> $DIR/unresolved-macro-missing-macro-use-3.rs:5:5
|
LL | macro_rules! a_macro { () => {} }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: `a_macro` could also refer to the unresolved item imported here
--> $DIR/unresolved-macro-missing-macro-use-3.rs:9:5
|
LL | use crate::has_a_macro::a_macro;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: consider removing this
```
…zelmann New solver opts for `diesel` A collection of small optimizations. Details in individual commits. Local measurements: ``` solver icounts (B) ------ ----------- old 37.9 new (orig) 56.4 (1.49x) new (this PR) 49.5 (1.31x) ``` Also some small improvements on a range of other benchmarks. r? @jdonszelmann
const-check: clarify when and how we can rely on non-UB assumptions
Turns out const-checking relies on `&x` being immutable. This is the "most obvious" property we get from the aliasing model, and we emit LLVM attributes and have MIR-opts that rely on it. I just didn't realize that taking away this UB would actually be a breaking change; there is code that runs on stable that we'd have to stop accepting if we took away this UB:
```rust
struct NotConstDestruct;
impl Drop for NotConstDestruct {
fn drop(&mut self) {
eprintln!("this is not const");
}
}
const _: () = {
let x = None::<NotConstDestruct>;
let ptr = std::ptr::from_ref(&x);
unsafe { ptr.cast_mut().write(Some(NotConstDestruct)) };
};
```
This means that I accidentally fixed a hole in const-checking when I added `&` immutability checking to const-eval.
r? @oli-obk
Cc @rust-lang/opsem @tmiasko
… r=mu001999 Remove unnecessary indirection around `hir::ConstArg` Probably doesn't have measurable perf effect because `ConstArg` is not that common of a type (yet), but it's nicer this way regardless imo :)
Tweak output on unused/unaccessible local macro
In unused macro lint, mention when its enclosing `mod` isn't annotated with `#[macro_use]`:
```
error: unused macro definition: `unused`
--> $DIR/unused-macros-decl.rs:17:11
|
LL | macro unused {
| ^^^^^^
|
note: the lint level is defined here
--> $DIR/unused-macros-decl.rs:16:12
|
LL | #[deny(unused_macros)]
| ^^^^^^^^^^^^^
help: consider annotating the enclosing module with `#[macro_use]`
|
LL + #[macro_use]
LL | mod bar {
|
```
On resolution error for unexported macro, point at macro of the same name and mention its enclosing scope could be marked with `#[macro_use]`:
```
error: cannot find macro `a_macro` in this scope
--> $DIR/unresolved-macro-missing-macro-use.rs:11:5
|
LL | a_macro!();
| ^^^^^^^
|
help: you might be missing a `#[macro_use]` attribute on a `mod` module or `use` import
--> $DIR/unresolved-macro-missing-macro-use.rs:5:5
|
LL | / mod has_a_macro {
LL | |
LL | | macro_rules! a_macro { () => {} }
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ a macro with the same name is defined here
... |
LL | | }
| |_- consider annotating this `mod` with `#[macro_use]`
```
On ambiguous macro use, suggest removing invalid import:
```
error[E0659]: `a_macro` is ambiguous
--> $DIR/unresolved-macro-missing-macro-use-3.rs:15:5
|
LL | a_macro!();
| ^^^^^^^ ambiguous name
|
= note: ambiguous because of a conflict between a `macro_rules` name and a non-`macro_rules` name from another module
note: `a_macro` could refer to the macro defined here
--> $DIR/unresolved-macro-missing-macro-use-3.rs:5:5
|
LL | macro_rules! a_macro { () => {} }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: `a_macro` could also refer to the unresolved item imported here
--> $DIR/unresolved-macro-missing-macro-use-3.rs:9:5
|
LL | use crate::has_a_macro::a_macro;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: consider removing this
```
Fix rust-lang#57966.
…ns, r=jieyouxu Update actions/upload-artifact action to v7.0.2 This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [actions/upload-artifact](https://redirect.github.com/actions/upload-artifact) | action | patch | `v7.0.1` → `v7.0.2` | --- ### Release Notes <details> <summary>actions/upload-artifact (actions/upload-artifact)</summary> ### [`v7.0.2`](https://redirect.github.com/actions/upload-artifact/releases/tag/v7.0.2) [Compare Source](https://redirect.github.com/actions/upload-artifact/compare/v7.0.1...v7.0.2) #### What's Changed - Improves artifact download retries when the service returns HTTP 429 (rate limiting), including honoring valid Retry-After headers. - Updates [@&rust-lang#8203;actions/artifact](https://redirect.github.com/actions/artifact) to v6.3.1. #### New Contributors - [@&rust-lang#8203;tunc-d](https://redirect.github.com/tunc-d) made their first contribution in [#&rust-lang#8203;821](https://redirect.github.com/actions/upload-artifact/pull/821) **Full Changelog**: <actions/upload-artifact@v7.0.1...v7.0.2> </details> --- ### Configuration 📅 **Schedule**: (UTC) - Branch creation - Between 12:00 AM and 03:59 AM, only on Monday (`* 0-3 * * 1`) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/rust-lang/rust). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC4xMzQuMSIsInVwZGF0ZWRJblZlciI6IjQ0LjEzNC4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->
|
@bors r+ p=5 force |
This comment has been minimized.
This comment has been minimized.
Rollup of 5 pull requests Successful merges: - #163981 (New solver opts for `diesel`) - #164088 (const-check: clarify when and how we can rely on non-UB assumptions) - #164105 (Remove unnecessary indirection around `hir::ConstArg`) - #164181 (Tweak output on unused/unaccessible local macro) - #164186 (Update actions/upload-artifact action to v7.0.2)
|
💔 Test for 5e21f07 failed: CI. Failed job:
|
|
spurious @bors retry |
This comment has been minimized.
This comment has been minimized.
|
The job Click to see the possible cause of the failure (guessed by this bot) |
What is this?This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.Comparing b542750 (parent) -> fb5f32b (this PR) Test differencesShow 65 test diffsStage 1
Stage 2
Additionally, 56 doctest diffs were found. These are ignored, as they are noisy. Job group index
Test dashboardRun cargo run --manifest-path src/ci/citool/Cargo.toml -- \
test-dashboard fb5f32bdbe75e9114c62589cb86ace65f14a5b78 --output-dir test-dashboardAnd then open Job duration changes
How to interpret the job duration changes?Job durations can vary a lot, based on the actual runner instance |
|
Finished benchmarking commit (fb5f32b): comparison URL. Overall result: ❌✅ regressions and improvements - please read:Our benchmarks found a performance regression caused by this PR. Next Steps:
@rustbot label: +perf-regression Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (primary -2.3%, secondary 0.0%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary 2.3%, secondary -3.4%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis perf run didn't have relevant results for this metric. Bootstrap: 490.336s -> 490.047s (-0.06%) |
|
📌 Perf builds for each rolled up PR:
parent commit: b5427502da In the case of a perf regression, run the following command with the SHAs of each PR you suspect might be the cause: |
|
@rust-timer triage all |
Running triage with 21 benchmarksTriage only executes the benchmarks on rollup members, that were changed significantly on the rollup.
#163981 bc8e72c New solver opts for
|
| mean | range | count | |
|---|---|---|---|
| Regressions ❌ (primary) |
0.3% | [0.2%, 0.6%] | 4 |
| Regressions ❌ (secondary) |
0.3% | [0.1%, 0.7%] | 7 |
| Improvements ✅ (primary) |
-0.2% | [-0.5%, -0.1%] | 7 |
| Improvements ✅ (secondary) |
-1.5% | [-11.1%, -0.1%] | 36 |
| All ❌✅ (primary) | -0.0% | [-0.5%, 0.6%] | 11 |
Max RSS (memory usage)
Results (secondary -2.3%)
A less reliable metric. May be of interest, but not used to determine the overall result above.
| mean | range | count | |
|---|---|---|---|
| Regressions ❌ (primary) |
- | - | 0 |
| Regressions ❌ (secondary) |
- | - | 0 |
| Improvements ✅ (primary) |
- | - | 0 |
| Improvements ✅ (secondary) |
-2.3% | [-2.3%, -2.3%] | 1 |
| All ❌✅ (primary) | - | - | 0 |
Cycles
Results (secondary -4.0%)
A less reliable metric. May be of interest, but not used to determine the overall result above.
| mean | range | count | |
|---|---|---|---|
| Regressions ❌ (primary) |
- | - | 0 |
| Regressions ❌ (secondary) |
3.7% | [3.7%, 3.7%] | 1 |
| Improvements ✅ (primary) |
- | - | 0 |
| Improvements ✅ (secondary) |
-6.6% | [-6.8%, -6.4%] | 3 |
| All ❌✅ (primary) | - | - | 0 |
Binary size
This perf run didn't have relevant results for this metric.
#164088 2419b82 const-check: clarify when and how we can rely on non-UB assumptions
This perf run didn't have relevant results for the `instruction count` metric.
Instruction count
This perf run didn't have relevant results for this metric.
Max RSS (memory usage)
This perf run didn't have relevant results for this metric.
Cycles
This perf run didn't have relevant results for this metric.
Binary size
This perf run didn't have relevant results for this metric.
#164105 bbcd44c Remove unnecessary indirection around hir::ConstArg
This perf run didn't have relevant results for the `instruction count` metric.
Instruction count
This perf run didn't have relevant results for this metric.
Max RSS (memory usage)
This perf run didn't have relevant results for this metric.
Cycles
This perf run didn't have relevant results for this metric.
Binary size
This perf run didn't have relevant results for this metric.
#164181 478b77d Tweak output on unused/unaccessible local macro
This perf run didn't have relevant results for the `instruction count` metric.
Instruction count
This perf run didn't have relevant results for this metric.
Max RSS (memory usage)
This perf run didn't have relevant results for this metric.
Cycles
This perf run didn't have relevant results for this metric.
Binary size
This perf run didn't have relevant results for this metric.
#164186 d7fb775 Update actions/upload-artifact action to v7.0.2
This perf run didn't have relevant results for the `instruction count` metric.
Instruction count
This perf run didn't have relevant results for this metric.
Max RSS (memory usage)
This perf run didn't have relevant results for this metric.
Cycles
This perf run didn't have relevant results for this metric.
Binary size
This perf run didn't have relevant results for this metric.
Successful merges:
diesel#163981 (New solver opts fordiesel)hir::ConstArg#164105 (Remove unnecessary indirection aroundhir::ConstArg)r? @ghost
Create a similar rollup