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

Use associated items of char instead of freestanding items in core::char #105671

Merged
merged 1 commit into from
Feb 12, 2023

Conversation

lukas-code
Copy link
Member

@lukas-code lukas-code commented Dec 13, 2022

The associated functions and constants on char have been stable since 1.52 and the freestanding items have soft-deprecated since 1.62 (#95566). This PR marks them as "deprecated in future", similar to the integer and floating point modules (core::{i32, f32} etc) replaces all uses of core::char::* with char::* to prepare for future deprecation of core::char::*.

@rustbot
Copy link
Collaborator

rustbot commented Dec 13, 2022

r? @scottmcm

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Dec 13, 2022
@rustbot
Copy link
Collaborator

rustbot commented Dec 13, 2022

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

@lukas-code lukas-code force-pushed the depreciate-char branch 2 times, most recently from 1415e0b to 9fd0fe1 Compare December 13, 2022 23:26
@lukas-code lukas-code changed the title Depreciate all functions and constants in core::char Deprecate all functions and constants in core::char Dec 13, 2022
@scottmcm
Copy link
Member

Is there a libs-api decision to do this? I think future-deprecated shows up in the docs, so it's probably up to them whether to do this.

Alternatively, if you wanted to split this into the changes to stop using those constants, in favour of the associated ones, and a separate one to actually do the deprecated, I'd be happy to sign of on no longer using these constants in other examples and such.

@rustbot author

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 14, 2023
@lukas-code lukas-code changed the title Deprecate all functions and constants in core::char Use associated items of char instead of freestanding items in core::char Jan 14, 2023
@lukas-code
Copy link
Member Author

Yeah, the idea was that the deprecation message shows up in the docs, because to me the current docs read like these are already deprecated.

But if the deprecation needs a libs-api decision we can land it separately. I've removed the deprecation from this PR for now, but kept the updates from core::char::* to char::*, including those in doc examples.

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jan 14, 2023
@scottmcm
Copy link
Member

Thanks! Updating the library and particularly the docs like this is a great improvement. (And, unlike deprecations, something I can sign off on 🙃)

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Feb 11, 2023

📌 Commit 76e216f has been approved by scottmcm

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 Feb 11, 2023
compiler-errors added a commit to compiler-errors/rust that referenced this pull request Feb 12, 2023
…tmcm

Use associated items of `char` instead of freestanding items in `core::char`

The associated functions and constants on `char` have been stable since 1.52 and the freestanding items have soft-deprecated since 1.62 (rust-lang#95566). This PR ~~marks them as "deprecated in future", similar to the integer and floating point modules (`core::{i32, f32}` etc)~~ replaces all uses of `core::char::*` with `char::*` to prepare for future deprecation of `core::char::*`.
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Feb 12, 2023
…tmcm

Use associated items of `char` instead of freestanding items in `core::char`

The associated functions and constants on `char` have been stable since 1.52 and the freestanding items have soft-deprecated since 1.62 (rust-lang#95566). This PR ~~marks them as "deprecated in future", similar to the integer and floating point modules (`core::{i32, f32}` etc)~~ replaces all uses of `core::char::*` with `char::*` to prepare for future deprecation of `core::char::*`.
@bors
Copy link
Contributor

bors commented Feb 12, 2023

⌛ Testing commit 76e216f with merge adb4bfd...

@bors
Copy link
Contributor

bors commented Feb 12, 2023

☀️ Test successful - checks-actions
Approved by: scottmcm
Pushing adb4bfd to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Feb 12, 2023
@bors bors merged commit adb4bfd into rust-lang:master Feb 12, 2023
@rustbot rustbot added this to the 1.69.0 milestone Feb 12, 2023
@lukas-code lukas-code deleted the depreciate-char branch February 12, 2023 14:29
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (adb4bfd): 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)
- - 0
Improvements ✅
(secondary)
-5.1% [-5.1%, -5.1%] 1
All ❌✅ (primary) - - 0

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)
2.9% [2.9%, 2.9%] 1
Regressions ❌
(secondary)
3.1% [3.1%, 3.1%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 2.9% [2.9%, 2.9%] 1

Cycles

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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.

5 participants