Skip to content

Conversation

@chenyukang
Copy link
Member

@chenyukang chenyukang commented Nov 29, 2025

Fixes #149402

@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 Nov 29, 2025
@rustbot
Copy link
Collaborator

rustbot commented Nov 29, 2025

r? @fee1-dead

rustbot has assigned @fee1-dead.
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

Copy link
Member

@fee1-dead fee1-dead left a comment

Choose a reason for hiding this comment

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

r=me after addressing nit

View changes since this review

@@ -0,0 +1,9 @@
//@ only-nightly
Copy link
Member

Choose a reason for hiding this comment

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

Is it possible to use revisions here to avoid duplicating the same file?

Copy link
Member Author

Choose a reason for hiding this comment

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

@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 Nov 30, 2025
@chenyukang
Copy link
Member Author

@bors r=fee1-dead

@bors
Copy link
Collaborator

bors commented Nov 30, 2025

📌 Commit 34c80e4 has been approved by fee1-dead

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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Nov 30, 2025
bors added a commit that referenced this pull request Nov 30, 2025
Remove suggestion from importing unstable items on stable channel

Fixes #149402
@bors
Copy link
Collaborator

bors commented Nov 30, 2025

⌛ Testing commit 34c80e4 with merge 2699798...

bors added a commit that referenced this pull request Nov 30, 2025
Remove suggestion from importing unstable items on stable channel

Fixes #149402
@bors
Copy link
Collaborator

bors commented Nov 30, 2025

⌛ Testing commit 34c80e4 with merge 8787ed6...

@rust-log-analyzer
Copy link
Collaborator

The job x86_64-gnu-stable failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
Saved the actual stderr to `/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/resolve/suggest-unresolve-149402.stable/suggest-unresolve-149402.stable.stderr`
diff of stderr:

3    |
4 LL |     x.push(Complete::Item { name: "hello" });
5    |            ^^^^^^^^ use of undeclared type `Complete`
+    |
+ help: there is an enum variant `std::ops::CoroutineState::Complete`; try using the variant's enum
+    |
+ LL -     x.push(Complete::Item { name: "hello" });
+ LL +     x.push(std::ops::CoroutineState::Item { name: "hello" });
+    |
6 
7 error: aborting due to 1 previous error
8 


The actual stderr differed from the expected stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args resolve/suggest-unresolve-149402.rs`

error in revision `stable`: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/resolve/suggest-unresolve-149402.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--cfg" "stable" "--check-cfg" "cfg(test,FALSE,stable,nightly)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/resolve/suggest-unresolve-149402.stable" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers"
stdout: none
--- stderr -------------------------------
error[E0433]: failed to resolve: use of undeclared type `Complete`
##[error]  --> /checkout/tests/ui/resolve/suggest-unresolve-149402.rs:7:12
   |
LL |     x.push(Complete::Item { name: "hello" });
   |            ^^^^^^^^ use of undeclared type `Complete`
   |
help: there is an enum variant `std::ops::CoroutineState::Complete`; try using the variant's enum
   |
LL -     x.push(Complete::Item { name: "hello" });
LL +     x.push(std::ops::CoroutineState::Item { name: "hello" });
   |

error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0433`.

@bors
Copy link
Collaborator

bors commented Nov 30, 2025

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Nov 30, 2025
@chenyukang
Copy link
Member Author

@jieyouxu
do you know how to add test case only for stable channel?

I build a stage2 on local machine, and found out the is_nightly_build() returns true, I think it's the same in CI testing.

https://github.com/chenyukang/rust/blob/34c80e46389304d906fcb50efe4cf32a0270fab7/compiler/rustc_resolve/src/diagnostics.rs#L1612

From the code, seems we will set CFG_DISABLE_UNSTABLE_FEATURES for stable channel.
https://github.com/chenyukang/rust/blob/34c80e46389304d906fcb50efe4cf32a0270fab7/compiler/rustc_feature/src/lib.rs#L84

@jieyouxu jieyouxu self-assigned this Dec 1, 2025
@jieyouxu

This comment was marked as outdated.

@jieyouxu
Copy link
Member

jieyouxu commented Dec 1, 2025

Ok, it looks like RUSTC_BOOTSTRAP overriding CFG_DISABLE_UNSTABLE_FEATURES is intentional (at least, that's what the original logic was also doing), as otherwise, you can't even bootstrap.

One option you may have is to write this as a run-make test, with two stderr tracked: a stable rustc, and an unstable rustc. Gate the run-make itself using //@ only-nightly, but have the nightly rustc "pretend" to be a stable rustc with RUSTC_BOOTSTRAP=-1. Have a look at

for an example. That should still allow you to compare the diffs generated by the same rustc as if it reached stable.

@jieyouxu jieyouxu removed their assignment Dec 1, 2025
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-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.

Don't suggest stuff (that doesn't really exist) from nightly when on stable

6 participants