about summary refs log tree commit diff
path: root/compiler/rustc_feature/src
AgeCommit message (Collapse)AuthorLines
2022-03-31Rollup merge of #94869 - jackh726:gats_extended, r=compiler-errorsDylan DPC-0/+2
Add the generic_associated_types_extended feature Right now, this only ignore obligations that reference new placeholders in `poly_project_and_unify_type`. In the future, this might do other things, like allowing object-safe GATs. **This feature is *incomplete* and quite likely unsound. This is mostly just for testing out potential future APIs using a "relaxed" set of rules until we figure out *proper* rules.** Also drive by cleanup of adding a `ProjectAndUnifyResult` enum instead of using a `Result<Result<Option>>`. r? `@nikomatsakis`
2022-03-30Add the generic_associated_types_extended featureJack Huey-0/+2
2022-03-30Stabilize native library modifier syntax and the `whole-archive` modifier ↵Vadim Petrochenkov-4/+4
specifically
2022-03-30rework implementation for inherent impls for builtin typeslcnr-0/+8
2022-03-21move `adt_const_params` to its own tracking issuelcnr-1/+1
2022-03-17Rollup merge of #94982 - skippy10110:deprecated_safe, r=Dylan-DPCDylan DPC-0/+7
Add deprecated_safe feature gate and attribute, cc #94978
2022-03-15Add deprecated_safe feature gate and attribute, cc #94978skippy10110-0/+7
2022-03-14Stabilize ADX target featureTony Arcieri-0/+2
This is a continuation of #60109, which noted that while the ADX intrinsics were stabilized, the corresponding target feature never was. This PR follows the same general structure and stabilizes the ADX target feature.
2022-03-14Rollup merge of #90621 - adamgemmell:dev/stabilise-target-feature, r=AmanieuMatthias Krüger-1/+3
Stabilise `aarch64_target_feature` This PR stabilises `aarch64_target_feature` - see https://github.com/rust-lang/rust/issues/90620
2022-03-14Stabilise `aarch64_target_feature`Adam Gemmell-1/+3
2022-03-10Rollup merge of #94368 - c410-f3r:metaaaaaaaaaaaaaaaaaaaaaaaaaaa, r=petrochenkovDylan DPC-0/+2
[1/2] Implement macro meta-variable expressions See https://github.com/rust-lang/rust/pull/93545#issuecomment-1050963295 The logic behind `length`, `index` and `count` was removed but the parsing code is still present, i.e., everything is simply ignored like `ignored`. r? ``@petrochenkov``
2022-03-10Rollup merge of #94274 - djkoloski:unknown_unstable_lints, r=tmandryDylan DPC-0/+2
Treat unstable lints as unknown This change causes unstable lints to be ignored if the `unknown_lints` lint is allowed. To achieve this, it also changes lints to apply as soon as they are processed. Previously, lints in the same set were processed as a batch and then all simultaneously applied. Implementation of https://github.com/rust-lang/compiler-team/issues/469
2022-03-10Rollup merge of #94635 - jhpratt:merge-deprecated-attrs, r=davidtwcoMatthias Krüger-1/+3
Merge `#[deprecated]` and `#[rustc_deprecated]` The first commit makes "reason" an alias for "note" in `#[rustc_deprecated]`, while still prohibiting it in `#[deprecated]`. The second commit changes "suggestion" to not just be a feature of `#[rustc_deprecated]`. This is placed behind the new `deprecated_suggestion` feature. This needs a tracking issue; let me know if this PR will be approved and I can create one. The third commit is what permits `#[deprecated]` to be used when `#![feature(staged_api)]` is enabled. This isn't yet used in stdlib (only tests), as it would require duplicating all deprecation attributes until a bootstrap occurs. I intend to submit a follow-up PR that replaces all uses and removes the remaining `#[rustc_deprecated]` code after the next bootstrap. `@rustbot` label +T-libs-api +C-feature-request +A-attributes +S-waiting-on-review
2022-03-09New `deprecated_suggestion` feature, use in testsJacob Pratt-0/+2
2022-03-09Implement macro meta-variable expressionsCaio-0/+2
2022-03-08Treat unstable lints as unknownDavid Koloski-0/+2
This change causes unstable lints to be ignored if the `unknown_lints` lint is allowed. To achieve this, it also changes lints to apply as soon as they are processed. Previously, lints in the same set were processed as a batch and then all simultaneously applied. Implementation of https://github.com/rust-lang/compiler-team/issues/469
2022-03-08Rollup merge of #94586 - sunfishcode:sunfishcode/io-lifetimes-tests, r=davidtwcoMatthias Krüger-3/+3
Generalize `get_nullable_type` to allow types where null is all-ones. Generalize get_nullable_type to accept types that have an all-ones bit pattern as their sentry "null" value. This will allow [`OwnedFd`], [`BorrowedFd`], [`OwnedSocket`], and [`BorrowedSocket`] to be marked with `#[rustc_nonnull_optimization_guaranteed]`, which will allow `Option<OwnedFd>`, `Option<BorrowedFd>`, `Option<OwnedSocket>`, and `Option<BorrowedSocket>` to be used in FFI declarations, as described in the [I/O safety RFC]. For example, it will allow a function like `open` on Unix and `WSASocketW` on Windows to be declared using `Option<OwnedFd>` and `Option<OwnedSocket>` return types, respectively. The actual change to add `#[rustc_nonnull_optimization_guaranteed]` to the abovementioned types will be a separate PR, as it'll depend on having this patch in the stage0 compiler. Also, update the diagnostics to mention that "niche optimizations" are used in libstd as well as libcore, as `rustc_layout_scalar_valid_range_start` and `rustc_layout_scalar_valid_range_end` are already in use in libstd. [`OwnedFd`]: https://github.com/rust-lang/rust/blob/c9dc44be24c58ff13ce46416c4b97ab5c1bd8429/library/std/src/os/fd/owned.rs#L49 [`BorrowedFd`]: https://github.com/rust-lang/rust/blob/c9dc44be24c58ff13ce46416c4b97ab5c1bd8429/library/std/src/os/fd/owned.rs#L29 [`OwnedSocket`]: https://github.com/rust-lang/rust/blob/c9dc44be24c58ff13ce46416c4b97ab5c1bd8429/library/std/src/os/windows/io/socket.rs#L51 [`BorrowedSocket`]: https://github.com/rust-lang/rust/blob/c9dc44be24c58ff13ce46416c4b97ab5c1bd8429/library/std/src/os/windows/io/socket.rs#L29 [I/O safety RFC]: https://github.com/rust-lang/rfcs/blob/master/text/3128-io-safety.md#ownedfd-and-borrowedfdfd-1
2022-03-07Bump stabilization version to 1.61.0Eric Holk-3/+3
2022-03-07Stabilize const_impl_trait as wellEric Holk-2/+2
2022-03-07Stabilize const_fn_fn_ptr_basics and const_fn_trait_boundEric Holk-4/+4
2022-03-04Change `rustc_deprecated` to use `note`Jacob Pratt-1/+1
This keeps `reason` around for the time being. This is necessary to avoid breakage during the bootstrap process. This change, as a whole, brings `#[rustc_deprecated]` more in line with `#[deprecated]`.
2022-03-04Auto merge of #94096 - cjgillot:ensure-stability, r=lcnrbors-0/+8
Ensure stability directives are checked in all cases Split off #93017 Stability and deprecation were not checked in all cases, for instance if a type error happened. This PR moves the check earlier in the pipeline to ensure the errors are emitted in all cases. r? `@lcnr`
2022-03-03Generalize `get_nullable_type` to allow types where null is all-ones.Dan Gohman-3/+3
Generalize get_nullable_type to accept types that have an all-ones bit pattern as their sentry "null" value. This will allow [`OwnedFd`], [`BorrowedFd`], [`OwnedSocket`], and [`BorrowedSocket`] to be marked with `#[rustc_nonnull_optimization_guaranteed]`, which will allow `Option<OwnedFd>`, `Option<BorrowedFd>`, `Option<OwnedSocket>`, and `Option<BorrowedSocket>` to be used in FFI declarations, as described in the [I/O safety RFC]. For example, it will allow a function like `open` on Unix and `WSASocketW` on Windows to be declared using `Option<OwnedFd>` and `Option<OwnedSocket>` return types, respectively. The actual change to add `#[rustc_nonnull_optimization_guaranteed]` to the abovementioned types will be a separate PR, as it'll depend on having this patch in the stage0 compiler. Also, update the diagnostics to mention that "niche optimizations" are used in libstd as well as libcore, as `rustc_layout_scalar_valid_range_start` and `rustc_layout_scalar_valid_range_end` are already in use in libstd. [`OwnedFd`]: https://github.com/rust-lang/rust/blob/c9dc44be24c58ff13ce46416c4b97ab5c1bd8429/library/std/src/os/fd/owned.rs#L49 [`BorrowedFd`]: https://github.com/rust-lang/rust/blob/c9dc44be24c58ff13ce46416c4b97ab5c1bd8429/library/std/src/os/fd/owned.rs#L29 [`OwnedSocket`]: https://github.com/rust-lang/rust/blob/c9dc44be24c58ff13ce46416c4b97ab5c1bd8429/library/std/src/os/windows/io/socket.rs#L51 [`BorrowedSocket`]: https://github.com/rust-lang/rust/blob/c9dc44be24c58ff13ce46416c4b97ab5c1bd8429/library/std/src/os/windows/io/socket.rs#L29 [I/O safety RFC]: https://github.com/rust-lang/rfcs/blob/master/text/3128-io-safety.md#ownedfd-and-borrowedfdfd-1
2022-03-03Move the set of features to the `features` query.Camille GILLOT-0/+8
2022-03-02Added `Expect` lint level and attribute (RFC-2383)xFrednet-0/+4
* Also added the `LintExpectationId` which will be used in future commits
2022-02-24Remove in-band lifetimesMichael Goulet-2/+3
2022-02-21fix names in feature(...) suggestionMario Carneiro-1/+1
2022-02-19Rollup merge of #93658 - cchiw:issue-77443-fix, r=joshtriplettMatthias Krüger-3/+2
Stabilize `#[cfg(panic = "...")]` [Stabilization PR](https://rustc-dev-guide.rust-lang.org/stabilization_guide.html#stabilization-pr) for #77443
2022-02-17Rollup merge of #93337 - Amanieu:asm_tracking, r=tmiaskoMatthias Krüger-4/+4
Update tracking issue numbers for inline assembly sub-features The main tracking issue for inline assembly is [closed](https://github.com/rust-lang/rust/issues/72016#issuecomment-1022332954), further tracking of the remaining sub-features has been moved to separate tracking issues.
2022-02-16Destabilize cfg(target_has_atomic_load_store = ...)Mark Rousskov-2/+3
This was not intended to be stabilized yet.
2022-02-14Update unsafe_pin_internals unstable version.Mara Bos-1/+1
2022-02-14Mark `unsafe_pin_internals` as `incomplete`.Daniel Henry-Mantilla-0/+3
This thus still makes it technically possible to enable the feature, and thus to trigger UB without `unsafe`, but this is fine since incomplete features are known to be potentially unsound (labelled "may not be safe"). This follows from the discussion at https://github.com/rust-lang/rust/pull/93176#discussion_r799413561
2022-02-10updating the feature-gate listing and do not require the feature-gate to use ↵Charisee-3/+2
the feature
2022-02-10Rollup merge of #93824 - Amanieu:stable_cfg_target_has_atomic, r=davidtwcoMatthias Krüger-6/+6
Stabilize cfg_target_has_atomic `target_has_atomic_equal_alignment` is now tracked separately in #93822. Closes #32976
2022-02-09Rollup merge of #93753 - jeremyBanks:main-conflict, r=petrochenkovMatthias Krüger-1/+0
Complete removal of #[main] attribute from compiler resolves #93786 --- The `#[main]` attribute was mostly removed from the language in #84217, but not completely. It is still recognized as a builtin attribute by the compiler, but it has no effect. However, this no-op attribute is no longer gated by `#[feature(main)]` (which no longer exists), so it's possible to include it in code *on stable* without any errors, which seems unintentional. For example, the following code is accepted ([playground link](https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&code=%23%5Bmain%5D%0Afn%20main()%20%7B%0A%20%20%20%20println!(%22hello%20world%22)%3B%0A%7D%0A)). ```rust #[main] fn main() { println!("hello world"); } ``` Aside from that oddity, the existence of this attribute causes code like the following to fail ([playground link](https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&code=use%20tokio%3A%3Amain%3B%0A%0A%23%5Bmain%5D%0Afn%20main()%20%7B%0A%20%20%20%20println!(%22hello%20world%22)%3B%0A%7D%0A)). According https://github.com/rust-lang/rust/pull/84062#issuecomment-825038275, the removal of `#[main]` was expected to eliminate this conflict (previously reported as #62127). ```rust use tokio::main; #[main] fn main() { println!("hello world"); } ``` ``` error[E0659]: `main` is ambiguous --> src/main.rs:3:3 | 3 | #[main] | ^^^^ ambiguous name | = note: ambiguous because of a name conflict with a builtin attribute = note: `main` could refer to a built-in attribute ``` [This error message can be confusing](https://stackoverflow.com/q/71024443/1114), as the mostly-removed `#[main]` attribute is not mentioned in any documentation. Since the current availability of `#[main]` on stable seems unintentional, and to needlessly block use of the `main` identifier in the attribute namespace, this PR finishes removing the `#[main]` attribute as described in https://github.com/rust-lang/rust/issues/29634#issuecomment-274951753 by deleting it from `builtin_attrs.rs`, and adds two test cases to ensure that the attribute is no longer accepted and no longer conflicts with other attributes imported as `main`.
2022-02-09Rollup merge of #91504 - cynecx:used_retain, r=nikicMatthias Krüger-1/+3
`#[used(linker)]` attribute See https://github.com/dtolnay/linkme/issues/41#issuecomment-927255631.
2022-02-09Stabilize cfg_target_has_atomicAmanieu d'Antras-6/+6
Closes #32976
2022-02-09Add tracking issueNikita Popov-1/+1
2022-02-08Remove obsolete no-op #[main] attribute from compiler.Jeremy Banks-1/+0
2022-02-07Rollup merge of #93682 - ↵Mara Bos-1/+1
PatchMixolydic:where-in-the-world-is-const_fn_trait_bound, r=oli-obk Update tracking issue for `const_fn_trait_bound` It previously pointed to #57563, the conglomerate issue for `const fn` (presumably under the feature gate `const_fn`). This tracking issue doesn't mention anything about `const_fn_trait_bound`(the only occurrence of "trait bound" is for the now-removed `?const Trait` syntax), which can be confusing to people who want to find out more about trait bounds on `const fn`s. This pull request changes the tracking issue to one meant specifically for `const_fn_trait_bound`, #93706, which can help collect information on this feature's stabilization and point users towards `const_trait_impl` if they're looking for const-in-const-contexts trait bounds. Fixes #93679. `````@rustbot````` modify labels +A-const-fn +F-const_trait_impl
2022-02-07Rollup merge of #93416 - name1e5s:chore/remove_allow_fail, r=m-ou-seMara Bos-3/+2
remove `allow_fail` test flag close #93345
2022-02-07add tests and fix commentscynecx-3/+3
2022-02-06`#[used(linker)]` attribute (https://github.com/dtolnay/linkme/issues/41)cynecx-1/+3
2022-02-06Fix tracking issue for `const_fn_trait_bound`Ruby Lazuli-1/+1
It previously pointed to #57563, the conglomerate issue for `const fn` (presumably under the feature gate `const_fn`). `const_fn_trait_bounds` weren't mentioned here, so this commit changes its tracking issue to a new one.
2022-02-01add a rustc::query_stability lintlcnr-0/+3
2022-01-31Move overlap_mode into trait level attribute + feature flagSantiago Pastorino-1/+3
2022-01-28remove allow_fail test flagyuhaixin.hx-3/+2
2022-01-27update pass_by_valuelcnr-1/+1
2022-01-26Update tracking issue numbers for inline assembly sub-featuresAmanieu d'Antras-4/+4
2022-01-25Rollup merge of #93175 - spastorino:negative-traits-coherence-new, ↵Matthias Krüger-0/+1
r=nikomatsakis Implement stable overlap check considering negative traits This PR implement the new disjointness rules for overlap check described in https://rust-lang.github.io/negative-impls-initiative/explainer/coherence-check.html#new-disjointness-rules r? ``@nikomatsakis``