Skip to content

[experiment] inject compiler builtins #136234

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

Closed
wants to merge 6 commits into from

Conversation

tgross35
Copy link
Contributor

r? @ghost

Introduce an enum that represents the different possible sources for
dependencies, and use them where possible. This will enable more fine
grained control and provides better context than passing the `dep_root`
tuple.
@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 Jan 29, 2025
@rust-log-analyzer

This comment has been minimized.

@tgross35
Copy link
Contributor Author

tgross35 commented Jan 29, 2025

I need to dig into what determines a crate was unstable. Looks like the test was added at 40aaa65, and the functionality was in 99f629a.

let dep_kind = if attr::contains_name(&item.attrs, sym::no_link) {
CrateDepKind::MacrosOnly
} else {
CrateDepKind::Explicit
};

if name == sym::compiler_builtins {
info!("BUILTINS DETECTED dep_kind {dep_kind:?}");
return None;
Copy link
Member

Choose a reason for hiding this comment

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

Why are you ignoring explicit extern crate compiler_builtins;? I think this is the reason of the CI failure as the implicitly injected compiler_builtins dependency isn't checked for stability, yet explicit mentions should be.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, that's dumb. I did this as a more minimal step than removing it from standard_library_imports for experimentation, but you're right that this would catch the explicit extern as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, that was it. I updated #136226 with the changes here, so will close this one.

The change between 0.1.143 and 0.1.144 includes refactoring that was in
compiler-builtins before, but had to be reverted before landing in
rust-lang/rust because the traits were leaking into diagnostics [1].
Recently a fix for this issue was merged [2] so the cleanup is reapplied
here.

This also acts as a regression test for [2].

[1]: rust-lang#128691 (comment)
[2]: rust-lang#135278
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.

4 participants