about summary refs log tree commit diff
path: root/compiler/rustc_feature
AgeCommit message (Collapse)AuthorLines
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``
2022-01-21Implement stable with negative coherence modeSantiago Pastorino-0/+1
2022-01-18Formally implement let chainsCaio-1/+1
2022-01-18Auto merge of #87648 - JulianKnodt:const_eq_constrain, r=oli-obkbors-0/+2
allow eq constraints on associated constants Updates #70256 (cc `@varkor,` `@Centril)`
2022-01-18Rollup merge of #92701 - ehuss:even-more-attr-validation, r=matthewjasperMatthias Krüger-2/+2
Add some more attribute validation This adds some more validation for the position of attributes: * `link` is only valid on an `extern` block * `windows_subsystem` and `no_builtins` are only valid at the crate level
2022-01-17Add term to ExistentialProjectionkadmin-0/+2
Also prevent ICE when adding a const in associated const equality.
2022-01-17Rollup merge of #92164 - WaffleLapkin:rustc_must_implement_one_of_attr, ↵Matthias Krüger-0/+6
r=Aaron1011 Implement `#[rustc_must_implement_one_of]` attribute This PR adds a new attribute — `#[rustc_must_implement_one_of]` that allows changing the "minimal complete definition" of a trait. It's similar to GHC's minimal `{-# MINIMAL #-}` pragma, though `#[rustc_must_implement_one_of]` is weaker atm. Such attribute was long wanted. It can be, for example, used in `Read` trait to make transitions to recently added `read_buf` easier: ```rust #[rustc_must_implement_one_of(read, read_buf)] pub trait Read { fn read(&mut self, buf: &mut [u8]) -> Result<usize> { let mut buf = ReadBuf::new(buf); self.read_buf(&mut buf)?; Ok(buf.filled_len()) } fn read_buf(&mut self, buf: &mut ReadBuf<'_>) -> Result<()> { default_read_buf(|b| self.read(b), buf) } } impl Read for Ty0 {} //^ This will fail to compile even though all `Read` methods have default implementations // Both of these will compile just fine impl Read for Ty1 { fn read(&mut self, buf: &mut [u8]) -> Result<usize> { /* ... */ } } impl Read for Ty2 { fn read_buf(&mut self, buf: &mut ReadBuf<'_>) -> Result<()> { /* ... */ } } ``` For now, this is implemented as an internal attribute to start experimenting on the design of this feature. In the future we may want to extend it: - Allow arbitrary requirements like `a | (b & c)` - Allow multiple requirements like - ```rust #[rustc_must_implement_one_of(a, b)] #[rustc_must_implement_one_of(c, d)] ``` - Make it appear in rustdoc documentation - Change the syntax? - Etc Eventually, we should make an RFC and make this (or rather similar) attribute public. --- I'm fairly new to compiler development and not at all sure if the implementation makes sense, but at least it passes tests :)
2022-01-11rustc_pass_by_value: allow types with no parameters on selfMahdi Dibaiee-1/+1
includes minor refactorings
2022-01-09Mark windows_subsytem and no_builtins as crate-only attributes.Eric Huss-2/+2
These attributes are only checked at the crate root, so they should have a warning if they are used anywhere else.
2022-01-09feat: pass_by_value lint attributeMahdi Dibaiee-0/+5
Useful for thin wrapper attributes that are best passed as value instead of reference.
2022-01-09Apply suggestions from code reviewWaffle Maybe-1/+1
Use "(associated) function" terminology instead of "method". Co-authored-by: Daniel Henry-Mantilla <daniel.henry.mantilla@gmail.com>
2022-01-09Implement `#[rustc_must_implement_one_of]` attributeMaybe Waffle-0/+6
2021-12-14Stabilize `destructuring_assignment`Jacob Pratt-2/+2
2021-12-11update accepted feature gateEllen-2/+2
2021-12-10remove feature gate and cleanup codeEllen-6/+2
2021-12-03add `unwind_asm` feature gate for `may_unwind` optioncynecx-0/+2
2021-11-24Rollup merge of #90420 - GuillaumeGomez:rustdoc-internals-feature, r=camelidGuillaume Gomez-4/+8
Create rustdoc_internals feature gate As suggested by ``@camelid`` [here](https://github.com/rust-lang/rust/pull/90398#issuecomment-955093851), since `doc_keyword` and `doc_primitive` aren't meant to be stabilized, we could put them behind a same feature flag. This is pretty much what it would look like (needs to update the tests too). The tracking issue is https://github.com/rust-lang/rust/issues/90418. What do you think ``@rust-lang/rustdoc`` ?
2021-11-24Create rustdoc_internals feature gateGuillaume Gomez-4/+8
2021-11-23Rollup merge of #91140 - nbdd0121:const_typeck, r=oli-obkMatthias Krüger-1/+3
Split inline const to two feature gates and mark expression position inline const complete This PR splits inline const in pattern position into its own `#![feature(inline_const_pat)]` feature gate, and make the usage in expression position complete. I think I have resolved most outstanding issues related to `inline_const` with #89561 and other PRs. The only thing left that I am aware of is #90150 and the lack of lifetime checks when inline const is used in pattern position (FIXME in #89561). Implementation-wise when used in pattern position it has to be lowered during MIR building while in expression position it's evaluated only when monomorphizing (just like normal consts), so it makes some sense to separate it into two feature gates so one can progress without being blocked by another. ``@rustbot`` label: T-compiler F-inline_const
2021-11-22`#![feature(inline_const)]` is no longer incompleteGary Guo-1/+1
2021-11-22Split inline const to two feature gatesGary Guo-0/+2
2021-11-18Check for duplicate attributes.Eric Huss-155/+274
2021-11-18rustc: Remove `#[rustc_synthetic]`Vadim Petrochenkov-1/+0
This function parameter attribute was introduced in https://github.com/rust-lang/rust/pull/44866 as an intermediate step in implementing `impl Trait`, it's not necessary or used anywhere by itself.
2021-11-15Alphabetize language featuresJacob Pratt-795/+644
This should significantly reduce the frequency of merge conflicts.
2021-11-15Stabilize format_args_captureJosh Triplett-3/+2
Works as expected, and there are widespread reports of success with it, as well as interest in it.
2021-11-13Auto merge of #89551 - jhpratt:stabilize-const_raw_ptr_deref, r=oli-obkbors-3/+2
Stabilize `const_raw_ptr_deref` for `*const T` This stabilizes dereferencing immutable raw pointers in const contexts. It does not stabilize `*mut T` dereferencing. This is behind the same feature gate as mutable references. closes https://github.com/rust-lang/rust/issues/51911