Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

[DO NOT MERGE] perf-test for #99212 #99897

Closed
wants to merge 2 commits into from

Conversation

rust-timer
Copy link
Collaborator

This is an automatically generated pull request (from here) to run perf tests for #99212 which merged in a rollup.

r? @ghost

Original message:
Rollup merge of rust-lang#99212 - davidtwco:partial-stability-implies, r=michaelwoerister

introduce `implied_by` in `#[unstable]` attribute

Requested by the library team [on Zulip](https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/better.20support.20for.20partial.20stabilizations/near/285581519).

If part of a feature is stabilized and a new feature is added for the remaining parts, then the `implied_by` meta-item can be added to `#[unstable]` to indicate which now-stable feature was used previously.

```diagnostic
error: the feature `foo` has been partially stabilized since 1.62.0 and is succeeded by the feature `foobar`
  --> $DIR/stability-attribute-implies-using-unstable.rs:3:12
   |
LL | #![feature(foo)]
   |            ^^^
   |
note: the lint level is defined here
  --> $DIR/stability-attribute-implies-using-stable.rs:2:9
   |
LL | #![deny(stable_features)]
   |         ^^^^^^^^^^^^^^^
help: if you are using features which are still unstable, change to using `foobar`
   |
LL | #![feature(foobar)]
   |            ~~~~~~
help: if you are using features which are now stable, remove this line
   |
LL - #![feature(foo)]
   |
```

When a `#![feature(..)]` attribute still exists for the now-stable attribute, then there this has two effects:

- There will not be an stability error for uses of items from the implied feature which are still unstable (until the `#![feature(..)]` is removed or updated to the new feature).
- There will be an improved diagnostic for the remaining use of the feature attribute for the now-stable feature.

```rust
        /// If part of a feature is stabilized and a new feature is added for the remaining parts,
        /// then the `implied_by` attribute is used to indicate which now-stable feature previously
        /// contained a item.
        ///
        /// ```pseudo-Rust
        /// #[unstable(feature = "foo", issue = "...")]
        /// fn foo() {}
        /// #[unstable(feature = "foo", issue = "...")]
        /// fn foobar() {}
        /// ```
        ///
        /// ...becomes...
        ///
        /// ```pseudo-Rust
        /// #[stable(feature = "foo", since = "1.XX.X")]
        /// fn foo() {}
        /// #[unstable(feature = "foobar", issue = "...", implied_by = "foo")]
        /// fn foobar() {}
        /// ```
```

In the Zulip discussion, this was envisioned as `implies` on `#[stable]` but I went with `implied_by` on `#[unstable]` because it means that only the unstable attribute needs to be changed in future, not the new stable attribute, which seems less error-prone. It also isn't particularly feasible for me to detect whether items from the implied feature are used and then only suggest updating _or_ removing the `#![feature(..)]` as appropriate, so I always do both.

There's some new information in the cross-crate metadata as a result of this change, that's a little unfortunate, but without requiring that the `#[unstable]` and `#[stable]` attributes both contain the implication information, it's necessary:

```rust
    /// This mapping is necessary unless both the `#[stable]` and `#[unstable]` attributes should
    /// specify their implications (both `implies` and `implied_by`). If only one of the two
    /// attributes do (as in the current implementation, `implied_by` in `#[unstable]`), then this
    /// mapping is necessary for diagnostics. When a "unnecessary feature attribute" error is
    /// reported, only the `#[stable]` attribute information is available, so the map is necessary
    /// to know that the feature implies another feature. If it were reversed, and the `#[stable]`
    /// attribute had an `implies` meta item, then a map would be necessary when avoiding a "use of
    /// unstable feature" error for a feature that was implied.
```

I also change some comments to documentation comments in the compiler, add a helper for going from a `Span` to a `Span` for the entire line, and fix a incorrect part of the pre-existing stability attribute diagnostics.

cc `@yaahc`
@rustbot rustbot added T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-infra Relevant to the infrastructure 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. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Jul 29, 2022
@rustbot
Copy link
Collaborator

rustbot commented Jul 29, 2022

Some changes occurred in diagnostic error codes

cc @GuillaumeGomez

A change occurred in the Ayu theme.

cc @Cldfire

Some changes occurred in compiler/rustc_codegen_cranelift

cc @bjorn3

Some changes occurred in src/librustdoc/clean/types.rs

cc @camelid

Some changes occurred in src/tools/clippy

cc @rust-lang/clippy

Some changes occurred in HTML/CSS/JS.

cc @GuillaumeGomez, @Folyd, @jsha

Some changes occurred in need_type_info.rs

cc @lcnr

Some changes occurred in HTML/CSS themes.

cc @GuillaumeGomez

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

Some changes occurred to the CTFE / Miri engine

cc @rust-lang/miri

Some changes occurred in const_evaluatable.rs

cc @lcnr

Hey! It looks like you've submitted a new PR for the library teams!

If this PR contains changes to any rust-lang/rust public library APIs then please comment with @rustbot label +T-libs-api -T-libs to tag it appropriately. If this PR contains changes to any unstable APIs please edit the PR description to add a link to the relevant API Change Proposal or create one if you haven't already. If you're unsure where your change falls no worries, just leave it as is and the reviewer will take a look and make a decision to forward on if necessary.

Examples of T-libs-api changes:

  • Stabilizing library features
  • Introducing insta-stable changes such as new implementations of existing stable traits on existing stable types
  • Introducing new or changing existing unstable library APIs (excluding permanently unstable features / features without a tracking issue)
  • Changing public documentation in ways that create new stability guarantees
  • Changing observable runtime behavior of library APIs

The Miri submodule was changed

cc @rust-lang/miri

Some changes occurred to the CTFE / Miri engine

cc @rust-lang/miri

Some changes occurred in compiler/rustc_codegen_gcc

cc @antoyo

Some changes occurred in src/tools/cargo

cc @ehuss

@rust-timer
Copy link
Collaborator Author

@bors try @rust-timer queue

The try commit's (master) parent should be ea6ab1b. If it isn't, then please:

  • Stop this try build (try-).
  • Run @rust-timer update-pr-for 857afc75e6ca69cc7dcae36a6fac8c093ee6fa31.
  • Rerun bors try.

You do not need to reinvoke the queue command as long as the perf build hasn't yet started.

@rust-timer
Copy link
Collaborator Author

Awaiting bors try build completion.

@rustbot label: +S-waiting-on-perf

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jul 29, 2022
@bors
Copy link
Contributor

bors commented Jul 29, 2022

⌛ Trying commit 54fff5c with merge 135eb0df1bb9ed2170cc2348a964dc1ef7ebbd2b...

@rylev
Copy link
Member

rylev commented Jul 29, 2022

Sorry for the pings everyone. I'm trying out the functionality outlined here for automatically unrolling a rollup and testing one of the PRs for perf regressions.

@rust-log-analyzer
Copy link
Collaborator

The job x86_64-gnu-tools failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
    
    --- stdout
    
    running 17 tests
    test /tmp/mdbook-nGoOus/macros-by-example.md - Macros_By_Example::Dollar_dollar_____ (line 233) ... ignored
    test /tmp/mdbook-nGoOus/macros-by-example.md - Macros_By_Example::Hygiene (line 417) ... ignored
    test /tmp/mdbook-nGoOus/macros-by-example.md - Macros_By_Example::Scoping__Exporting__and_Importing (line 258) ... ignored
    test /tmp/mdbook-nGoOus/macros-by-example.md - Macros_By_Example::Scoping__Exporting__and_Importing::Textual_Scope (line 280) ... ignored
    test /tmp/mdbook-nGoOus/macros-by-example.md - Macros_By_Example::Scoping__Exporting__and_Importing::The_ (line 371) ... ignored
    test /tmp/mdbook-nGoOus/macros-by-example.md - Macros_By_Example::Dollar_dollar_____ (line 219) ... FAILED
    test /tmp/mdbook-nGoOus/macros-by-example.md - Macros_By_Example::Dollar_dollar_____ (line 204) - compile fail ... ok
    test /tmp/mdbook-nGoOus/macros-by-example.md - Macros_By_Example::Transcribing (line 63) - compile fail ... ok
    test /tmp/mdbook-nGoOus/macros-by-example.md - Macros_By_Example::Transcribing (line 86) - compile fail ... ok
    test /tmp/mdbook-nGoOus/macros-by-example.md - Macros_By_Example::Hygiene (line 442) ... ok
    test /tmp/mdbook-nGoOus/macros-by-example.md - Macros_By_Example::Hygiene (line 482) ... ok
    test /tmp/mdbook-nGoOus/macros-by-example.md - Macros_By_Example::Scoping__Exporting__and_Importing::The_ (line 350) ... ok
    test /tmp/mdbook-nGoOus/macros-by-example.md - Macros_By_Example::Scoping__Exporting__and_Importing::Textual_Scope (line 303) ... ok
    test /tmp/mdbook-nGoOus/macros-by-example.md - Macros_By_Example::Hygiene (line 459) ... ok
    test /tmp/mdbook-nGoOus/macros-by-example.md - Macros_By_Example::Scoping__Exporting__and_Importing::Path_Based_Scope (line 388) ... ok
    test /tmp/mdbook-nGoOus/macros-by-example.md - Macros_By_Example::Scoping__Exporting__and_Importing::Textual_Scope (line 331) ... ok
    test /tmp/mdbook-nGoOus/macros-by-example.md - Macros_By_Example::Transcribing (line 102) ... ok
    failures:
    
    
    ---- /tmp/mdbook-nGoOus/macros-by-example.md - Macros_By_Example::Dollar_dollar_____ (line 219) stdout ----
    error[E0658]: meta-variable expressions are unstable
     --> /tmp/mdbook-nGoOus/macros-by-example.md:223:16
    6 |             ( $$( $any:tt )* ) => { $$( $any )* };
      |                ^
      |
      = note: see issue #83527 <https://github.com/rust-lang/rust/issues/83527> for more information
      = note: see issue #83527 <https://github.com/rust-lang/rust/issues/83527> for more information
      = help: add `#![feature(macro_metavar_expr)]` to the crate attributes to enable
    
    error[E0658]: meta-variable expressions are unstable
     --> /tmp/mdbook-nGoOus/macros-by-example.md:223:38
    6 |             ( $$( $any:tt )* ) => { $$( $any )* };
      |                                      ^
      |
      = note: see issue #83527 <https://github.com/rust-lang/rust/issues/83527> for more information
---
    For more information about this error, try `rustc --explain E0658`.
    Couldn't compile the test.
    
    failures:
        /tmp/mdbook-nGoOus/macros-by-example.md - Macros_By_Example::Dollar_dollar_____ (line 219)
    test result: FAILED. 11 passed; 1 failed; 5 ignored; 0 measured; 0 filtered out; finished in 0.23s
    
    
    --- stderr
---
This PR updated 'src/doc/reference', verifying if status is 'test-pass'...

We detected that this PR updated 'reference', but its tests failed.

If you do intend to update 'reference', please check the error messages above and
commit another update.

If you do NOT intend to update 'reference', please ensure you did not accidentally
change the submodule at 'src/doc/reference'. You may ask your reviewer for the
Build completed unsuccessfully in 0:00:00

@bors
Copy link
Contributor

bors commented Jul 29, 2022

☀️ Try build successful - checks-actions
Build commit: 135eb0df1bb9ed2170cc2348a964dc1ef7ebbd2b (135eb0df1bb9ed2170cc2348a964dc1ef7ebbd2b)

@RalfJung
Copy link
Member

RalfJung commented Jul 29, 2022 via email

@rylev
Copy link
Member

rylev commented Jul 29, 2022

@RalfJung the strategy employed by the automation is to first revert back to the master at the time the rollup was created and then to apply the single merge commit of the PR being tested for perf regressions. The strategy is not to just revert the rollup itself. That explains the large amount of changes. There have been over 2,900 files changed in master since the master at the time of the rollup.

@rylev
Copy link
Member

rylev commented Jul 29, 2022

Talking this over with @Mark-Simulacrum - it seems we're using the wrong master commit - we're using the sha in master at rollup creation rather than the sha at rollup merge. This may be the reason CI is failing but we're not sure. I'm going to close this for now.

We're going to experiment with a different approach that optimistically builds artifacts that are testable by perf.rlo for every commit in a rollup. We can then build a command that kicks off a perf run for that artifact (initiated by a human who is investigating a rollup issue).

@davidtwco
Copy link
Member

@rylev are you going to continue to test with #99212? If not I'll open a PR to do a perf-test of a revert, but if you are then I'm happy to just wait until you've successfully got results from your automation. :)

@rylev
Copy link
Member

rylev commented Jul 29, 2022

@davidtwco I wouldn't wait on me - I'm trying to find a general solution that will likely take a bit of time. It's probably more productive for #99212 to do the revert manually.

@rylev rylev closed this Jul 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-perf Status: Waiting on a perf run to be completed. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-infra Relevant to the infrastructure 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. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants