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

Do not evaluate unknown cfg to false in stdlib crates #7053

Merged
merged 1 commit into from Apr 5, 2021

Conversation

Undin
Copy link
Member

@Undin Undin commented Apr 5, 2021

When org.rust.cargo.fetch.actual.stdlib.metadata feature is enabled, we know that stdlib crates have build scripts.

Previously, we tried to evaluate unknown cfg options that led to unresolved references in some cases.
For example, panic! macro has two versions with cfg(bootstrap) and cfg(not(bootstrap)) on 1.51.0 and in combination with the current name resolution engine, it cannot be resolved.

Now the plugin doesn't evaluate unknown options (at least temporarily) in stdlib crates.

changelog: Fix name resolution of items in standard library with cfg attribute in some cases

When `org.rust.cargo.fetch.actual.stdlib.metadata` feature is enabled, we know that stdlib crates have build scripts.

Previously, we tried to evaluate unknown cfg options that led to unresolved references in some cases.
For example, `panic!` macro has two versions with `cfg(bootstrap)` and `cfg(not(bootstrap))` on 1.51.0 and in combination with the current name resolution engine, it cannot be resolved.

Now the plugin doesn't evaluate unknown options (at least temporarily) in stdlib crates.
@Undin Undin added the fix Pull requests that fix some bug(s) label Apr 5, 2021
@vlad20012
Copy link
Member

bors r+

bors bot added a commit that referenced this pull request Apr 5, 2021
7053: Do not evaluate unknown cfg to false in stdlib crates r=vlad20012 a=Undin

When `org.rust.cargo.fetch.actual.stdlib.metadata` feature is enabled, we know that stdlib crates have build scripts.

Previously, we tried to evaluate unknown cfg options that led to unresolved references in some cases.
For example, `panic!` macro has two versions with `cfg(bootstrap)` and `cfg(not(bootstrap))` on 1.51.0 and in combination with the current name resolution engine, it cannot be resolved.

Now the plugin doesn't evaluate unknown options (at least temporarily) in stdlib crates.

changelog: Fix name resolution of items in standard library with `cfg` attribute in some cases


Co-authored-by: Arseniy Pendryak <a.pendryak@yandex.ru>
@bors
Copy link
Contributor

bors bot commented Apr 5, 2021

Build failed:

@Undin
Copy link
Member Author

Undin commented Apr 5, 2021

bors retry

@bors
Copy link
Contributor

bors bot commented Apr 5, 2021

Build succeeded:

@bors bors bot merged commit 198d5be into master Apr 5, 2021
@github-actions github-actions bot added this to the v145 milestone Apr 5, 2021
@Undin Undin deleted the undin/cfg-options-in-stdlib branch June 13, 2021 19:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix Pull requests that fix some bug(s)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants