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

Allow since="TBD" for rustc_deprecated #79877

Merged
merged 1 commit into from
Dec 17, 2020
Merged

Conversation

bstrie
Copy link
Contributor

@bstrie bstrie commented Dec 10, 2020

Closes #78381.

This PR only affects #[rustc_deprecated], not #[deprecated], so there is no effect on any stable language feature.

Likewise this PR only implements since="TBD", it does not actually tag any library functions with it, so there is no effect on any stable API.

Overview of changes:

  • rustc_middle/stability.rs:
    • change deprecation_in_effect function to return false when since="TBD"
    • tidy up the compiler output when a deprecated item has since="TBD"
  • rustc_passes/stability.rs:
    • allow since="TBD" to pass the sanity check for stable_version < deprecated_version
    • refactor the "invalid stability version" and "invalid deprecation version" error into separate errors
  • rustdoc: make since="TBD" message on a deprecated item's page match the command-line deprecation output
  • tests:
    • test rustdoc output
    • test that the deprecated_in_future lint fires when since="TBD"
    • test the new "invalid deprecation version" error message

@rust-highfive
Copy link
Collaborator

r? @oli-obk

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Dec 10, 2020
@camelid

This comment has been minimized.

@bstrie

This comment has been minimized.

@bors
Copy link
Contributor

bors commented Dec 16, 2020

☔ The latest upstream changes (presumably #80041) made this pull request unmergeable. Please resolve the merge conflicts.

Note that reviewers usually do not review pull requests until merge conflicts are resolved! Once you resolve the conflicts, you should change the labels applied by bors to indicate that your PR is ready for review. Post this as a comment to change the labels:

@rustbot modify labels: +S-waiting-on-review -S-waiting-on-author

@oli-obk
Copy link
Contributor

oli-obk commented Dec 16, 2020

r=me (needs rebase)

@bstrie
Copy link
Contributor Author

bstrie commented Dec 16, 2020

Er, one moment, something went weird with the rebase...

@bstrie bstrie force-pushed the depinfut branch 2 times, most recently from 3e6a3e7 to b1abeea Compare December 16, 2020 17:15
@rust-log-analyzer
Copy link
Collaborator

The job mingw-check of your PR failed (pretty log, raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
[command]/usr/bin/git submodule foreach --recursive git config --local --name-only --get-regexp 'http\.https\:\/\/github\.com\/\.extraheader' && git config --local --unset-all 'http.https://github.com/.extraheader' || :
[command]/usr/bin/git config --local http.https://github.com/.extraheader AUTHORIZATION: basic ***
##[endgroup]
##[group]Fetching the repository
[command]/usr/bin/git -c protocol.version=2 fetch --no-tags --prune --progress --no-recurse-submodules --depth=2 origin +d72038a0b80906e8951ec23265d0e3c0860dbcf9:refs/remotes/pull/79877/merge
---
    Checking rustc-rayon v0.3.0
    Checking tempfile v3.1.0
    Checking regex v1.3.9
    Checking rustdoc v0.0.0 (/checkout/src/librustdoc)
error[E0277]: the trait bound `str: __Deref` is not satisfied
    --> src/librustdoc/html/render/mod.rs:2282:26
     |
2282 |                 if since == "TBD" {
     |                          ^^ the trait `__Deref` is not implemented for `str`
     |
     = note: required because of the requirements on the impl of `std::cmp::PartialEq<str>` for `SymbolStr`
     = note: required because of the requirements on the impl of `std::cmp::PartialEq<&str>` for `&SymbolStr`

error[E0277]: the size for values of type `str` cannot be known at compilation time
    --> src/librustdoc/html/render/mod.rs:2282:26
     |
2282 |                 if since == "TBD" {
     |                          ^^ doesn't have a size known at compile-time
     |
     = help: the trait `std::marker::Sized` is not implemented for `str`
     = note: required because of the requirements on the impl of `std::cmp::PartialEq<str>` for `SymbolStr`
     = note: required because of the requirements on the impl of `std::cmp::PartialEq<&str>` for `&SymbolStr`
error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0277`.
error: could not compile `rustdoc`

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @rust-lang/infra. (Feature Requests)

@jyn514
Copy link
Member

jyn514 commented Dec 16, 2020

@bors r=oli-obk

@bors
Copy link
Contributor

bors commented Dec 16, 2020

📌 Commit 1e1ca28 has been approved by oli-obk

@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 Dec 16, 2020
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Dec 16, 2020
Allow `since="TBD"` for rustc_deprecated

Closes rust-lang#78381.

This PR only affects `#[rustc_deprecated]`, not `#[deprecated]`, so there is no effect on any stable language feature.

Likewise this PR only implements `since="TBD"`, it does not actually tag any library functions with it, so there is no effect on any stable API.

Overview of changes:

* `rustc_middle/stability.rs`:
    * change `deprecation_in_effect` function to return `false` when `since="TBD"`
    * tidy up the compiler output when a deprecated item has `since="TBD"`
* `rustc_passes/stability.rs`:
    * allow `since="TBD"` to pass the sanity check for stable_version < deprecated_version
    * refactor the "invalid stability version" and "invalid deprecation version" error into separate errors
* rustdoc: make `since="TBD"` message on a deprecated item's page match the command-line deprecation output
* tests:
    * test rustdoc output
    * test that the `deprecated_in_future` lint fires when `since="TBD"`
    * test the new "invalid deprecation version" error message
bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 17, 2020
Rollup of 11 pull requests

Successful merges:

 - rust-lang#79051 (Implement if-let match guards)
 - rust-lang#79877 (Allow `since="TBD"` for rustc_deprecated)
 - rust-lang#79882 (Fix issue rust-lang#78496)
 - rust-lang#80026 (expand-yaml-anchors: Make the output directory separator-insensitive)
 - rust-lang#80039 (Remove unused `TyEncoder::tcx` required method)
 - rust-lang#80069 (Test that `core::assert!` is valid)
 - rust-lang#80072 (Fixed conflict with drop elaboration and coverage)
 - rust-lang#80073 (Add support for target aliases)
 - rust-lang#80082 (Revert rust-lang#78790 - rust-src vendoring)
 - rust-lang#80097 (Add `popcount` and `popcnt` as doc aliases for `count_ones` methods.)
 - rust-lang#80103 (Remove docs for non-existent parameters in `rustc_expand`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 3d42c00 into rust-lang:master Dec 17, 2020
@rustbot rustbot added this to the 1.50.0 milestone Dec 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow deprecated_in_future lint to specify an indeterminate future deprecation date
8 participants