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

regression: from_raw_parts is ambiguous #121606

Closed
Mark-Simulacrum opened this issue Feb 25, 2024 · 5 comments
Closed

regression: from_raw_parts is ambiguous #121606

Mark-Simulacrum opened this issue Feb 25, 2024 · 5 comments
Labels
regression-from-stable-to-beta Performance or correctness regression from stable to beta. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Milestone

Comments

@Mark-Simulacrum
Copy link
Member

https://crater-reports.s3.amazonaws.com/beta-1.77-3/beta-2024-02-18/reg/rsubox-0.2.1/log.txt

My guess is this will be closed as expected, but should be a conscious decision.

[INFO] [stdout] error[E0659]: `from_raw_parts` is ambiguous
[INFO] [stdout]     --> src/utils.rs:1255:65
[INFO] [stdout]      |
[INFO] [stdout] 1255 | ...   version: OsString::from(&OsStr::from_bytes(unsafe { from_raw_parts(libc_name.assume_init_ref().version.as_ptr() as *const u8, versi...
[INFO] [stdout]      |                                                           ^^^^^^^^^^^^^^ ambiguous name
[INFO] [stdout]      |
[INFO] [stdout]      = note: ambiguous because of multiple glob imports of a name in the same module
[INFO] [stdout] note: `from_raw_parts` could refer to the function imported here
[INFO] [stdout]     --> src/utils.rs:39:5
[INFO] [stdout]      |
[INFO] [stdout] 39   | use std::slice::*;
[INFO] [stdout]      |     ^^^^^^^^^^^^^
[INFO] [stdout]      = help: consider adding an explicit import of `from_raw_parts` to disambiguate
[INFO] [stdout] note: `from_raw_parts` could also refer to the function imported here
[INFO] [stdout]     --> src/utils.rs:40:5
[INFO] [stdout]      |
[INFO] [stdout] 40   | use std::str::*;
[INFO] [stdout]      |     ^^^^^^^^^^^
[INFO] [stdout]      = help: consider adding an explicit import of `from_raw_parts` to disambiguate
@Mark-Simulacrum Mark-Simulacrum added T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. regression-from-stable-to-beta Performance or correctness regression from stable to beta. labels Feb 25, 2024
@Mark-Simulacrum Mark-Simulacrum added this to the 1.77.0 milestone Feb 25, 2024
@rustbot rustbot added I-prioritize Issue: Indicates that prioritization has been requested for this issue. needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Feb 25, 2024
@Mark-Simulacrum Mark-Simulacrum changed the title regression: from_raw_parts is ambigous regression: from_raw_parts is ambiguous Feb 25, 2024
@asquared31415
Copy link
Contributor

#119466 added the str::from_raw_parts function. I suspect this is expected, std can't be expected to never add any functions ever because it might conflict with something else.

cc #119206 (tracking issue)

@dtolnay
Copy link
Member

dtolnay commented Feb 26, 2024

Relevant documentation: https://doc.rust-lang.org/1.76.0/cargo/reference/semver.html#item-new

"glob imports are a known forwards-compatibility hazard. Glob imports of items from external crates should be avoided."

Normally, unless the breakage is extraordinarily disruptive (affecting a foundational library that is unmaintained but still widely-used) we move on and remind the author not to use glob imports.

@apiraino
Copy link
Contributor

removing the I-prioritize as it looks like expected behaviour (Zulip discussion), so IIUC nothing to see here.

@rustbot label -I-prioritize

@rustbot rustbot removed the I-prioritize Issue: Indicates that prioritization has been requested for this issue. label Feb 26, 2024
@jieyouxu
Copy link
Member

Can this issue be closed then if it's intended breakage?

@jieyouxu jieyouxu removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Feb 26, 2024
@joshtriplett
Copy link
Member

We discussed this in today's @rust-lang/libs meeting. Confirming that this kind of ambiguity is expected behavior when doing multiple glob imports.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
regression-from-stable-to-beta Performance or correctness regression from stable to beta. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

7 participants