You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When implementing #52644, where we emit errors when using unknown features, I had to special case two features: libc and test, because they weren't being picked up (and there were time constraints).
I didn't manage to figure out what makes test special.
Ideally these should both not be special-cased. The relevant code for feature collection is in src/librustc/middle/lib_features.rs, so that's a good place to start looking.
The text was updated successfully, but these errors were encountered:
cfg_attr shouldn't make libc special. when we build it in-tree, we set feature = "stdbuild" (which is not set when using it from crates.io).
All you need to do is make sure you're not touching feature-gates in libsyntax{,_ext}, only later on, in librustc.
All you need to do is make sure you're not touching feature-gates in libsyntax{,_ext}
As in: just ignore any warnings for these? Though that means we would avoid the special-casing, it could lead to a build up of unnecessary feature attributes in the compiler.
When implementing #52644, where we emit errors when using unknown features, I had to special case two features:
libc
andtest
, because they weren't being picked up (and there were time constraints).The special-casing is here:
rust/src/librustc/middle/stability.rs
Lines 840 to 847 in 0aa8d03
libc
is declared unlike any other feature:https://github.com/rust-lang/libc/blob/6bdbf5dc937459bd10e6bc4dc52b0adbd8cf4358/src/lib.rs#L92-L94
so it's not entirely surprising that the detection overlooks it, but I didn't find the root cause.
test
special.Ideally these should both not be special-cased. The relevant code for feature collection is in
src/librustc/middle/lib_features.rs
, so that's a good place to start looking.The text was updated successfully, but these errors were encountered: