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

Add copy_sign() as doc alias for f32/f64::copysign() #83933

Closed
wants to merge 1 commit into from

Conversation

mqudsi
Copy link
Contributor

@mqudsi mqudsi commented Apr 6, 2021

This should help the compiler emit a more helpful error message when the
function is spelled the way it should have been.

cc #58046

This should help the compiler emit a more helpful error message when the
function is spelled the way it should have been.

cc rust-lang#58046
@rust-highfive
Copy link
Collaborator

r? @kennytm

(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 Apr 6, 2021
@mqudsi mqudsi changed the title Add copy_sign() as alias for f32/f64::copysign() Add copy_sign() as rustc/doc alias for f32/f64::copysign() Apr 6, 2021
@jyn514 jyn514 changed the title Add copy_sign() as rustc/doc alias for f32/f64::copysign() Add copy_sign() as doc alias for f32/f64::copysign() Apr 6, 2021
@jyn514
Copy link
Member

jyn514 commented Apr 6, 2021

doc(alias) doesn't affect compiler error messages (although maybe it should? cc @estebank) - was that your goal? If so you should add a UI test, that would show that it has no effect.

@estebank
Copy link
Contributor

estebank commented Apr 6, 2021

We don't currently use doc(alias) for diagnostics, it is only used (afaik) to add alternative names in generated docs.

@mqudsi
Copy link
Contributor Author

mqudsi commented Apr 7, 2021

My mistake. Is there some other attribute that does help the compiler? (I think the compiler being aware of doc(alias) and using it for error messages is a good idea.)

@estebank
Copy link
Contributor

estebank commented Apr 7, 2021

@mqudsi we don't have such an attribute today, but I would love to see it happen at some point, whether it is by overloading doc(alias) or adding something else. I can help with it, but do not have the bandwidth at this time to take that project on myself.

@kennytm
Copy link
Member

kennytm commented Apr 7, 2021

Currently searching copy_sign does give us {f32, f64}::copysign already. So I think we can close this PR.

@jyn514
Copy link
Member

jyn514 commented Apr 7, 2021

Closing this in favor of #83968.

@jyn514 jyn514 closed this Apr 7, 2021
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants