Conversation
Fixes redundant language and bad grammar.
Contract variables can be declared in the `requires` clause and can be referenced both in `requires` and `ensures`, subject to usual borrow checking rules. This allows any setup common to both the `requires` and `ensures` clauses to only be done once.
In general, the rationale for `--open` is to only open HTML files if they were "explicitly" invoked from the CLI (e.g. `x doc --open library/core`). The existing logic did not do that. Instead it opened the docs unconditionally when a subset of the crates was requested. This is unfortunate for other Steps in bootstrap, which may wish to `ensure()` the standard library docs without opening them. Change `Std` to check if it was explicitly invoked, rather than assuming it's the case.
(cherry picked from commit 8130721)
When a MIR argument is spread at ABI level, deduced attributes are potentially misapplied, since a spread argument can correspond to zero or more arguments at ABI level. Disable deduction for MIR using spread argument for the time being.
…ng-rebased, r=jackh726 Contract variable declarations This change adds contract variables that can be declared in the `requires` clause and can be referenced both in `requires` and `ensures`, subject to usual borrow checking rules. This allows any setup common to both the `requires` and `ensures` clauses to only be done once. In particular, one future use case would be for [Fulminate](https://dl.acm.org/doi/10.1145/3704879)-like ownership assertions in contracts, that are essentially side-effects, and executing them twice would alter the semantics of the contract. As of this change, `requires` can now be an arbitrary sequence of statements, with the final expression being of type `bool`. They are executed in sequence as expected, before checking if the final `bool` expression holds. This PR depends on rust-lang#144438 (which has now been merged). Contracts tracking issue: rust-lang#128044 **Other changes introduced**: - Contract macros now wrap the content in braces to produce blocks, meaning there's no need to wrap the content in `{}` when using multiple statements. The change is backwards compatible, in that wrapping the content in `{}` still works as before. The macros also now treat `requires` and `ensures` uniformally, meaning the `requires` closure is built inside the parser, as opposed to in the macro. **Known limiatations**: - Contracts with variable declarations are subject to the regular borrow checking rules, and the way contracts are currently lowered limits the usefulness of contract variable declarations. Consider the below example: ```rust #[requires(let init_x = *x; true)] #[ensures(move |_| *x == 2 * init_x)] fn double_in_place(x: &mut i32) { *x *= 2; } ``` We have used the new variable declarations feature to remember the initial value pointed to by `x`, however, moving `x` into the `ensures` does not pass the borrow checker, meaning the above function contract is illegal. Ideally, something like the above should be expressable in contracts.
…ag, r=jackh726 Make diagnostics clearer for binop-related errors in foreign crates Fixes redundant language and bad grammar.
…ywiser Skip parameter attribute deduction for MIR with `spread_arg` When a MIR argument is spread at ABI level, deduced attributes are potentially misapplied, since a spread argument can correspond to zero or more arguments at ABI level. Disable deduction for MIR using spread argument for the time being.
bootstrap: `ensure(doc::Std)` no longer opens a browser In general, the rationale for `--open` is to only open HTML files if they were "explicitly" invoked from the CLI (e.g. `x doc --open library/core`). The existing logic did not do that. Instead it opened the docs unconditionally when a subset of the crates was requested. This is unfortunate for other Steps in bootstrap, which may wish to `ensure()` the standard library docs without opening them. Change `Std` to check if it was explicitly invoked, rather than assuming it's the case.
…imulacrum Bootstrap update - Update CURRENT_RUSTC_VERSION post-bump - Bump stage0 to 1.92.0-beta.1 - Update `#[cfg(bootstrap)]`
|
@bors r+ rollup=never p=5 |
|
☀️ Test successful - checks-actions |
|
📌 Perf builds for each rolled up PR:
previous master: 4146079cee In the case of a perf regression, run the following command for each PR you suspect might be the cause: |
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 4146079 (parent) -> c6d42d7 (this PR) Test differencesShow 672 test diffsStage 1
Stage 2
Additionally, 658 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 c6d42d774d1edfb270b8faaefacc67c213b0260b --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 (c6d42d7): comparison URL. Overall result: ❌ regressions - please read the text belowOur 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 -3.3%, secondary -3.7%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary 2.7%, secondary 1.4%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeResults (primary 1.1%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Bootstrap: 480.976s -> 475.179s (-1.21%) |
|
clap_derive is noise, and has since returned to its previous value @rustbot label: +perf-regression-triaged |
Successful merges:
spread_arg#148131 (Skip parameter attribute deduction for MIR withspread_arg)ensure(doc::Std)no longer opens a browser #148224 (bootstrap:ensure(doc::Std)no longer opens a browser)r? @ghost
@rustbot modify labels: rollup
Create a similar rollup