Skip to content

Add test cases for namespaced crates - #142437

Open
eholk wants to merge 1 commit into
rust-lang:mainfrom
eholk:namespace-tests
Open

eholk wants to merge 1 commit into
rust-lang:mainfrom
eholk:namespace-tests

Conversation

@eholk

@eholk eholk commented Jun 12, 2025 •

Copy link
Copy Markdown
Contributor

This is just to add a few test cases of agreed upon desired behavior for this feature so that future PRs can enable them as they start passing.

I pulled these tests out of #140271.

r? @petrochenkov

cc @b-naber

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jun 12, 2025
Comment thread tests/ui/resolve/open-ns-7.rs
Comment thread tests/ui/resolve/open-ns-1.rs
Comment thread tests/ui/resolve/open-ns-2.rs

use my_api::core::{core_fn, core_fn2};
use my_api::utils::*;
use my_api::*;

@petrochenkov petrochenkov Jun 19, 2025 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the 3-scope model this would import from both my_api(crate) and my_api(open_ns).
Therefore it will introduce names root_function, core and utils into this module.
Need to test this behavior.

Old comment (based on mixing open-ns-my_api.rs and open-ns-mod-my_api.rs):

Therefore it will introduce names utils(mod), root_function and core into this module, but not utils(crate) because it would be shadowed by utils(mod).

It would be good to actually add a test case with scenario like that.

@@ -0,0 +1,18 @@
// This test should fail with `utils` being defined multiple times, since open-ns-mod-my_api.rs

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm? There's no open-ns-mod-my_api.rs in this test.

Comment thread tests/ui/resolve/open-ns-4.rs
Comment thread tests/ui/resolve/open-ns-7.rs
@petrochenkov petrochenkov added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jun 19, 2025
@JohnCSimon

Copy link
Copy Markdown

@eholk
ping from triage:
Can you please address the comments from the reviewer?

FYI: when a PR is ready for review, send a message containing
@rustbot ready to switch to S-waiting-on-review so the PR is in the reviewer's backlog.

Thank you.

@b-naber

b-naber commented Jul 13, 2025

Copy link
Copy Markdown
Contributor

@JohnCSimon @eholk is still on vacation, so I address your comment.

This is still waiting on a review (see #142437 (comment)).

@b-naber b-naber 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 Jul 13, 2025
@petrochenkov

petrochenkov commented Jul 14, 2025 •

Copy link
Copy Markdown
Contributor

I did the re-review and marked this as waiting on author because some comments (#142437 (comment), #142437 (comment)) are still unaddressed.
@rustbot author

@rustbot

rustbot commented Jul 14, 2025

Copy link
Copy Markdown
Collaborator

Failed to set assignee to author: cannot assign: response: {"message":"Not Found","documentation_url":"https://docs.github.com/rest/issues/assignees#add-assignees-to-an-issue","status":"404"}

Note: Only org members with at least the repository "read" role, users with write permissions, or people who have commented on the PR may be assigned.

@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 Jul 14, 2025
@rustbot

rustbot commented Jul 14, 2025

Copy link
Copy Markdown
Collaborator

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@rust-bors

rust-bors Bot commented Mar 23, 2026

Copy link
Copy Markdown
Contributor

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

@JohnCSimon

Copy link
Copy Markdown

@eholk
Ping from triage: can you post your status on this PR? no progress in the last year

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler 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