Skip to content

remove deprecated from core::ffi::c_str #143326

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

hkBst
Copy link
Member

@hkBst hkBst commented Jul 2, 2025

No description provided.

@rustbot
Copy link
Collaborator

rustbot commented Jul 2, 2025

r? @jhpratt

rustbot has assigned @jhpratt.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@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 Jul 2, 2025
@jhpratt
Copy link
Member

jhpratt commented Jul 2, 2025

cc @rust-lang/libs — I'm 99% sure this is acceptable but I'd like to be positive. r=me if that is the case.

@cuviper
Copy link
Member

cuviper commented Jul 2, 2025

Consolidating the Display impl is a positive change.

I have mixed feelings about dropping any existing Error::description though -- it doesn't hurt anything to leave its current static text in place.

@jhpratt
Copy link
Member

jhpratt commented Jul 2, 2025

Hm, I naïvely assumed that description delegated to the Display impl, but that's not the case. I guess because it returns a &str, which is borrowed rather than owned?

@cuviper
Copy link
Member

cuviper commented Jul 2, 2025

Right, Display is more powerful for that reason.

@hkBst
Copy link
Member Author

hkBst commented Jul 3, 2025

I also assumed description would call into Display, but it is actually:

    #[deprecated(since = "1.42.0", note = "use the Display impl or to_string()")]
    fn description(&self) -> &str {
        "description() is deprecated; use Display"
    }

Deprecation happened 46 stable versions ago, or almost 6 years ago.

@cuviper
Copy link
Member

cuviper commented Jul 4, 2025

Deprecation happened 46 stable versions ago, or almost 6 years ago.

Sure, but AFAIK we haven't removed any of the existing overrides. If we're going to do that, I think it should be intentional and en masse.

@hkBst
Copy link
Member Author

hkBst commented Jul 4, 2025

Sure, but AFAIK we haven't removed any of the existing overrides. If we're going to do that, I think it should be intentional and en masse.

Should I open an issue to gauge opinions on that, or do you want to do it? Or do you have a better idea?

@cuviper
Copy link
Member

cuviper commented Jul 5, 2025

Sure, if you're interested/motivated to make that happen, go ahead with an issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants