summary refs log tree commit diff
path: root/compiler/rustc_passes/src/stability.rs
AgeCommit message (Collapse)AuthorLines
2022-07-21avoid embedding StabilityLevel::Unstable reason string into metadata ↵klensy-5/+2
multiple times
2022-07-20passes: check implied feature existsDavid Wood-19/+31
Add a check confirming that features referenced in `implied_by` meta items actually exist. Signed-off-by: David Wood <david.wood@huawei.com>
2022-07-20passes: improved partial stabilization diagnosticDavid Wood-8/+50
Improves the diagnostic when a feature attribute is specified unnecessarily but the feature implies another (i.e. it was partially stabilized) to refer to the implied feature. Signed-off-by: David Wood <david.wood@huawei.com>
2022-07-20middle: add `implies_by` to `#[unstable]`David Wood-0/+1
If part of a feature is stabilized and a new feature is added for the remaining parts, then the `implied_by` attribute can be used to indicate which now-stable feature previously contained a item. If the now-stable feature is still active (if the user has only just updated rustc, for example) then there will not be an stability error for uses of the item from the implied feature. Signed-off-by: David Wood <david.wood@huawei.com>
2022-07-20attr/passes: comment -> doc commentDavid Wood-8/+8
Change some regular comments into documentation comments. Signed-off-by: David Wood <david.wood@huawei.com>
2022-07-14Auto merge of #95956 - yaahc:stable-in-unstable, r=cjgillotbors-3/+48
Support unstable moves via stable in unstable items part of https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/moving.20items.20to.20core.20unstably and a blocker of https://github.com/rust-lang/rust/pull/90328. The libs-api team needs the ability to move an already stable item to a new location unstably, in this case for Error in core. Otherwise these changes are insta-stable making them much harder to merge. This PR attempts to solve the problem by checking the stability of path segments as well as the last item in the path itself, which is currently the only thing checked.
2022-07-14Auto merge of #98975 - jyn514:unstable_opts, r=wesleywiserbors-2/+2
Rename `debugging_opts` to `unstable_opts` This is no longer used only for debugging options (e.g. `-Zoutput-width`, `-Zallow-features`). Rename it to be more clear. cc https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/Codegen.20options.20.2F.20debugging.20options r? `@Amanieu` cc `@nikic` `@joshtriplett`
2022-07-13Rename `debugging_opts` to `unstable_opts`Joshua Nelson-2/+2
This is no longer used only for debugging options (e.g. `-Zoutput-width`, `-Zallow-features`). Rename it to be more clear.
2022-07-13remove untagged_union feature gateRalf Jung-66/+2
2022-07-13also allow arrays of allowed typesRalf Jung-0/+5
2022-07-13allow unions with mutable references and tuples of allowed typesRalf Jung-5/+22
2022-07-13factor 'is this type allowed as union field on stable' into separate functionRalf Jung-3/+11
2022-07-08fixes post rebaseJane Losare-Lusby-1/+1
2022-07-08add opt in attribute for stable-in-unstable itemsJane Lusby-2/+19
2022-07-08clarify commentJane Lusby-2/+2
2022-07-08update commentJane Lusby-1/+4
2022-07-08Support unstable moves via stable in unstable itemsJane Lusby-2/+27
2022-07-07Reword comments and rename HIR visiting methods.Camille GILLOT-2/+2
2022-06-13remove unnecessary `to_string` and `String::new`Takayuki Maeda-1/+1
2022-06-04Allow unstable items to be re-exported unstably without requiring the ↵cole-3/+37
feature be enabled
2022-05-19Rebase falloutOli Scherer-1/+1
2022-05-19Move check to existing passJacob Pratt-56/+26
This alters the diagnostics a bit, as the trait method is still stable. The only thing this check does is ensure that compilation fails if a trait implementation is declared const-stable.
2022-05-19Proper const stability check, default to unstableJacob Pratt-1/+52
Rather than deferring to const eval for checking if a trait is const, we now check up-front. This allows the error to be emitted earlier, notably at the same time as other stability checks. Also included in this commit is a change of the default const stability level to UNstable. Previously, an item that was `const` but did not explicitly state it was unstable was implicitly stable.
2022-05-19Add and use stability helper methodsJacob Pratt-5/+3
This avoids an ambiguity (when reading) where `.level.is_stable()` is not immediately clear whether it is general stability or const stability.
2022-05-13rename visit item-like methodsMiguel Guarniz-2/+2
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
2022-05-13remove ItemLikeVisitor and DeepVisitorMiguel Guarniz-2/+2
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
2022-05-10only_local: always check for misuselcnr-1/+1
2022-04-30Box HIR Generics and Impl.Camille GILLOT-1/+1
2022-04-17Stop using CRATE_DEF_INDEX.Camille GILLOT-2/+2
`CRATE_DEF_ID` and `CrateNum::as_def_id` are almost always what we want.
2022-04-13couple of clippy::complexity fixesMatthias Krüger-2/+2
2022-04-08check_doc_keyword: don't alloc string for emptiness checkklensy-1/+1
check_doc_alias_value: get argument as Symbol to prevent needless string convertions check_doc_attrs: don't alloc vec, iterate over slice. Vec introduced in #83149, but no perf run posted on merge replace as_str() check with symbol check get_single_str_from_tts: don't prealloc string trivial string to str replace LifetimeScopeForPath::NonElided use Vec<Symbol> instead of Vec<String> AssertModuleSource use BTreeSet<Symbol> instead of BTreeSet<String> CrateInfo.crate_name replace FxHashMap<CrateNum, String> with FxHashMap<CrateNum, Symbol>
2022-03-30Addressed comments by @compiler-errors and @bjorn3Yuri Astrakhan-1/+1
2022-03-30Spellchecking compiler commentsYuri Astrakhan-3/+3
This PR cleans up the rest of the spelling mistakes in the compiler comments. This PR does not change any literal or code spelling issues.
2022-03-16rustc_error: make ErrorReported impossible to constructmark-3/+3
There are a few places were we have to construct it, though, and a few places that are more invasive to change. To do this, we create a constructor with a long obvious name.
2022-03-09Permit `#[deprecated]` in stdlibJacob Pratt-1/+1
2022-03-03Make unknown feature error deterministic.Camille GILLOT-3/+3
2022-03-03Gate stability attrs with other attributes.Camille GILLOT-56/+9
2022-03-03Move query providers.Camille GILLOT-1/+10
2022-03-03Remove useless map.Camille GILLOT-9/+5
2022-03-03Move the set of features to the `features` query.Camille GILLOT-11/+0
2022-02-24Auto merge of #94129 - cjgillot:rmeta-table, r=petrochenkovbors-10/+8
Back more metadata using per-query tables r? `@ghost`
2022-02-19Adopt let else in more placesest31-7/+3
2022-02-19Stop interning stability.Camille GILLOT-10/+8
2022-02-03Require const stability on all stable const itemsJacob Pratt-18/+18
This was supposed to be the case previously, but a missed method call meant that trait impls were not checked.
2022-01-16Replace NestedVisitorMap with NestedFilterCameron Steffen-17/+11
2022-01-15Return a LocalDefId in get_parent_item.Camille GILLOT-1/+1
2022-01-07Add `trait_item_def_id` to `AssocItem`Matthew Jasper-13/+6
This allows avoiding some lookups by name
2021-12-15Remove `in_band_lifetimes` for `rustc_passes`Peter Jaszkowiak-3/+3
2021-11-28Remove eval_always for lib_features.Camille GILLOT-1/+1
2021-09-29Avoid more invocations of hir_crate query.Camille GILLOT-2/+1