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
You can give the name of specific crates (separated with spaces I think). Rustc will then only allow unstable features for those crates. This could be used as a roadblock to prevent depending on unstable features outside of libcore, liballoc and libkernel. Driver code shouldn't ever rely on unstable features IMO. It is much easier to update only a few core crates than update many drivers as unstable features change.
This is blocked on allocator_api (at least) becoming stable (or a way to e.g. enable some unstable features from the command line but not allowing any other in source code), but as soon as we can do it, it can be a very good idea, specially when we are in mainline where others will be writing Rust drivers independently of us.
@bjorn3 I edited the post above to add another possibility: having a way to enable unstable features from the command-line but at the same time disallow any further features to be enabled in the actual source code. This would allow us to e.g. enable allocator_api globally, but disallow kernel module writers any other feature.
There is -Zallow-features which can restrict the list of allowed features. (names separated by spaces) This still requires RUSTC_BOOTSTRAP and #![feature] though, but at least prevents drivers from using any features other than allocator_api.
Activity
[-]Give `RUSTC_BOOTSTRAP` with a list of crates[/-][+]Give `RUSTC_BOOTSTRAP` a list of crates[/+]ojeda commentedon Jun 30, 2021
@bjorn3 I edited the post above to add another possibility: having a way to enable unstable features from the command-line but at the same time disallow any further features to be enabled in the actual source code. This would allow us to e.g. enable
allocator_apiglobally, but disallow kernel module writers any other feature.bjorn3 commentedon Jun 30, 2021
There is
-Zallow-featureswhich can restrict the list of allowed features. (names separated by spaces) This still requiresRUSTC_BOOTSTRAPand#![feature]though, but at least prevents drivers from using any features other thanallocator_api.ojeda commentedon Jun 30, 2021
That is actually perfect for us -- thanks a lot, I will add it.
ojeda commentedon Jul 2, 2021
-Zallow-featuresdone in #416.LoongArch: BPF: Add struct ops support for trampoline
selftests/bpf: Enable timed may_goto tests for arm64
Merge branch 'bpf-arm64-support-for-timed-may_goto'