about summary refs log tree commit diff
path: root/src/librustc_feature
AgeCommit message (Collapse)AuthorLines
2020-05-03Implement RFC 2523, `#[cfg(version(..))]`mibac138-0/+4
2020-05-01Allow `#[target_feature]` on safe functionsLeSeulArtichaut-0/+3
2020-03-29#[link]: mention wasm_import_module instead of cfgJonas Schievink-1/+1
2020-03-29Auto merge of #70370 - petrochenkov:nosmatch, r=Centrilbors-5/+2
Remove attribute `#[structural_match]` and any references to it A small remaining part of https://github.com/rust-lang/rust/issues/63438.
2020-03-26bump negative impls version to 1.44.0Niko Matsakis-1/+1
2020-03-26create a tracking issue and link to itNiko Matsakis-3/+3
2020-03-26introduce `negative_impls` feature gate and documentNiko Matsakis-0/+3
They used to be covered by `optin_builtin_traits` but negative impls are now applicable to all traits, not just auto traits. This also adds docs in the unstable book for the current state of auto traits.
2020-03-24Remove attribute `#[structural_match]` and any references to itVadim Petrochenkov-5/+2
2020-03-22remove redundant closures (clippy::redundant_closure)Matthias Krüger-1/+1
2020-03-17Rollup merge of #69870 - petrochenkov:cfgacc, r=matthewjasperMazdak Farrokhzad-7/+1
expand: Implement something similar to `#[cfg(accessible(path))]` cc https://github.com/rust-lang/rust/issues/64797 The feature is implemented as a `#[cfg_accessible(path)]` attribute macro rather than as `#[cfg(accessible(path))]` because it needs to wait until `path` becomes resolvable, and `cfg` cannot wait, but macros can wait. Later we can think about desugaring or not desugaring `#[cfg(accessible(path))]` into `#[cfg_accessible(path)]`. This implementation is also incomplete in the sense that it never returns "false" from `cfg_accessible(path)`, it requires some tweaks to resolve, which is not quite ready to answer queries like this during early resolution. However, the most important part of this PR is not `cfg_accessible` itself, but expansion infrastructure for retrying expansions. Before this PR we could say "we cannot resolve this macro path, let's try it later", with this PR we can say "we cannot expand this macro, let's try it later" as well. This is a pre-requisite for - turning `#[derive(...)]` into a regular attribute macro, - properly supporting eager expansion for macros that cannot yet be resolved like ``` fn main() { println!(not_available_yet!()); } macro_rules! make_available { () => { #[macro_export] macro_rules! not_available_yet { () => { "Hello world!" } }} } make_available!(); ```
2020-03-15Add attributes to allow specializing on traitsMatthew Jasper-0/+8
2020-03-15Add `min_specialization` featureMatthew Jasper-0/+5
Currently the only difference between it and `specialization` is that it only allows specializing functions.
2020-03-10Rollup merge of #69514 - GuillaumeGomez:remove-spotlight, r=kinnisonMazdak Farrokhzad-3/+0
Remove spotlight I had a few comments saying that this feature was at best misunderstood or not even used so I decided to organize a poll about on [twitter](https://twitter.com/imperioworld_/status/1232769353503956994). After 87 votes, the result is very clear: it's not useful. Considering the amount of code we have just to run it, I think it's definitely worth it to remove it. r? @kinnison cc @ollie27
2020-03-09expand/builtin_macros: Minor cleanupVadim Petrochenkov-7/+1
2020-03-08Rollup merge of #69561 - JohnTitor:clean-up-unstable-book, r=Mark-SimulacrumMazdak Farrokhzad-3/+3
Clean up unstable book - #58402's feature was renamed to `tidy_test_never_used_anywhere_else` and it is now used for tidy only - `read_initializer` link is wrong and the doc should be auto-generated so removed - Add dummy doc for `link_cfg` - Stop generating `compiler_builtins_lib` doc in favor of b8ccc0f8a60ac16fdc00f4b2e36e1a5db8b78295 - Make `rustc_attrs` tracking issue "None"
2020-03-07Rollup merge of #69773 - matthiaskrgr:typos, r=petrochenkovMazdak Farrokhzad-2/+2
fix various typos
2020-03-07Rollup merge of #69667 - JohnTitor:no-debug, r=nikomatsakisMazdak Farrokhzad-13/+2
Remove the `no_debug` feature Context: https://github.com/rust-lang/rust/issues/29721#issuecomment-367642779 r? @nikomatsakis
2020-03-06fix various typosMatthias Krüger-2/+2
2020-03-05Bumped version number for const_eval_limit in active.rsChristoph Schmidler-3/+3
and renamed 'recursion_limit' in limits.rs to simple 'limit' because it does handle other limits too.
2020-03-05Add a new test to reach const_limit setting, although with wrong WARNINGs yetChristoph Schmidler-3/+3
rename feature to const_eval_limit
2020-03-05Prepare const_limit feature gate and attributeChristoph Schmidler-0/+7
2020-03-03Remove the `no_debug` featureYuki Okushi-13/+2
2020-03-01Make `rustc_attrs` tracking issue NoneYuki Okushi-3/+3
2020-02-27Remove "important traits" featureGuillaume Gomez-3/+0
2020-02-27Revert "Mark attributes consumed by `check_mod_attrs` as normal"Tomasz Miąsko-6/+6
This reverts commit d78b22f35ec367368643fe7d6f7e87d01762692b. Those changes were incompatible with incremental compilation since the effect `check_mod_attrs` has with respect to marking the attributes as used is neither persisted nor recomputed.
2020-02-23Mark attributes consumed by `check_mod_attrs` as normalTomasz Miąsko-6/+6
Take advantage of the fact that `check_mod_attrs` marks attributes as used and change their type to normal, so that any remaining uses will be warned about by the unused attribute lint.
2020-02-10Add `#[repr(no_niche)]`.Felix S. Klock II-0/+4
This repr-hint makes a struct/enum hide any niche within from its surrounding type-construction context. It is meant (at least initially) as an implementation detail for resolving issue 68303. We will not stabilize the repr-hint unless someone finds motivation for doing so. (So, declaration of `no_niche` feature lives in section of file where other internal implementation details are grouped, and deliberately leaves out the tracking issue number.) incorporated review feedback, and fixed post-rebase.
2020-02-09Auto merge of #68376 - Centril:move-ref-patterns, r=matthewjasperbors-0/+4
Initial implementation of `#![feature(move_ref_pattern)]` Following up on #45600, under the gate `#![feature(move_ref_pattern)]`, `(ref x, mut y)` is allowed subject to restrictions necessary for soundness. The match checking implementation and tests for `#![feature(bindings_after_at)]` is also adjusted as necessary. Closes #45600. Tracking issue: #68354. r? @matthewjasper
2020-02-05Selectively disable sanitizer instrumentationTomasz Miąsko-0/+8
Add `no_sanitize` attribute that allows to opt out from sanitizer instrumentation in an annotated function.
2020-02-04Remove the `overlapping_marker_traits` featureAaron Hill-4/+3
See #29864 This has been replaced by `#[feature(marker_trait_attr)]` A few notes: * Due to PR #68057 not yet being in the bootstrap compiler, it's necessary to continue using `#![feature(overlapping_marker_traits)]` under `#[cfg(bootstrap)]` to work around type inference issues. * I've updated tests that used `overlapping_marker_traits` to now use `marker_trait_attr` where applicable The test `src/test/ui/overlap-marker-trait.rs` doesn't make any sense now that `overlapping_marker_traits`, so I removed it. The test `src/test/ui/traits/overlap-permitted-for-marker-traits-neg.rs` now fails, since it's no longer possible to have multiple overlapping negative impls of `Send`. I believe that this is the behavior we want (assuming that `Send` is not going to become a `#[marker]` trait, so I renamed the test to `overlap-permitted-for-marker-traits-neg`
2020-02-02introduce `#![feature(move_ref_pattern)]`Mazdak Farrokhzad-0/+4
2020-02-01Remove or_patterns from INCOMPLETE_FEATURESMatthew Jasper-1/+0
2020-01-20stabilize transparent_enumsMazdak Farrokhzad-3/+2
2020-01-18stabilize slice_patternsMazdak Farrokhzad-3/+2
2020-01-16Fix issue number of `repr128`Yuki Okushi-1/+1
2020-01-16Fix issue number of `member_constraints`Yuki Okushi-1/+1
2020-01-13Fix crate paths in commentsYuki Okushi-1/+2
2020-01-10Auto merge of #65241 - tmiasko:no-std-san, r=alexcrichtonbors-8/+2
build-std compatible sanitizer support ### Motivation When using `-Z sanitizer=*` feature it is essential that both user code and standard library is instrumented. Otherwise the utility of sanitizer will be limited, or its use will be impractical like in the case of memory sanitizer. The recently introduced cargo feature build-std makes it possible to rebuild standard library with arbitrary rustc flags. Unfortunately, those changes alone do not make it easy to rebuild standard library with sanitizers, since runtimes are dependencies of std that have to be build in specific environment, generally not available outside rustbuild process. Additionally rebuilding them requires presence of llvm-config and compiler-rt sources. The goal of changes proposed here is to make it possible to avoid rebuilding sanitizer runtimes when rebuilding the std, thus making it possible to instrument standard library for use with sanitizer with simple, although verbose command: ``` env CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUSTFLAGS=-Zsanitizer=thread cargo test -Zbuild-std --target x86_64-unknown-linux-gnu ``` ### Implementation * Sanitizer runtimes are no long packed into crates. Instead, libraries build from compiler-rt are used as is, after renaming them into `librusc_rt.*`. * rustc obtains runtimes from target libdir for default sysroot, so that they are not required in custom build sysroots created with build-std. * The runtimes are only linked-in into executables to address issue #64629. (in previous design it was hard to avoid linking runtimes into static libraries produced by rustc as demonstrated by sanitizer-staticlib-link test, which still passes despite changes made in #64780). cc @kennytm, @japaric, @firstyear, @choller
2020-01-10Introduce `#![feature(half_open_range_patterns)]`.Mazdak Farrokhzad-0/+3
This feature adds `X..`, `..X`, and `..=X` patterns.
2020-01-09Add `const_trait_bound_opt_out` feature gateDylan MacKenzie-0/+4
2020-01-09Add `const_trait_impl` feature gateDylan MacKenzie-0/+4
2020-01-09Remove sanitizer_runtime attributeTomasz Miąsko-8/+2
2020-01-01Rename `syntax_pos` to `rustc_span` in source codeVadim Petrochenkov-8/+8
2019-12-30Make things build againVadim Petrochenkov-1/+1
2019-12-24Format librustc_featureMark Rousskov-30/+44
Use #[rustfmt::skip] on the tidy-parsed macro invocations
2019-12-23Remove `bindings_after_at` from `INCOMPLETE_FEATURES`.Mazdak Farrokhzad-1/+0
2019-12-23Introduce `#![feature(bindings_after_at)]`.Mazdak Farrokhzad-0/+5
Under the gate, `x @ Some(y)` is allowed. This is subject to various restrictions for soundness.
2019-12-15Auto merge of #67216 - ecstatic-morse:const-loop, r=oli-obkbors-0/+14
Enable `loop` and `while` in constants behind a feature flag This PR is an initial implementation of #52000. It adds a `const_loop` feature gate, which allows `while` and `loop` expressions through both HIR and MIR const-checkers if enabled. `for` expressions remain forbidden by the HIR const-checker, since they desugar to a call to `IntoIterator::into_iter`, which will be rejected anyways. `while` loops also require [`#![feature(const_if_match)]`](https://github.com/rust-lang/rust/pull/66507), since they have a conditional built into them. The diagnostics from the HIR const checker will suggest this to the user. r? @oli-obk cc @rust-lang/wg-const-eval
2019-12-14Auto merge of #67224 - nikomatsakis:revert-stabilization-of-never-type, ↵bors-2/+3
r=centril Revert stabilization of never type Fixes https://github.com/rust-lang/rust/issues/66757 I decided to keep the separate `never-type-fallback` feature gate, but tried to otherwise revert https://github.com/rust-lang/rust/pull/65355. Seemed pretty clean. ( cc @Centril, author of #65355, you may want to check this over briefly )
2019-12-14Revert "Stabilize the `never_type`, written `!`."Niko Matsakis-2/+3
This reverts commit 15c30ddd69d6cc3fffe6d304c6dc968a5ed046f1.