summary refs log tree commit diff
path: root/compiler/rustc_passes/src/stability.rs
AgeCommit message (Collapse)AuthorLines
2022-09-14Also replace the placeholder for the stable_features lintest31-2/+11
2022-09-05Make `hir::PathSegment::res` non-optional.Nicholas Nethercote-1/+1
2022-08-13Rollup merge of #100431 - compiler-errors:enum-ctor-variant-stab, r=estebankMichael Goulet-1/+4
Enum variant ctor inherits the stability of the enum variant Fixes #100399 Fixes #100420 Context #71481 for why enum variants don't need stability
2022-08-12Check ctor for missing stabilityMichael Goulet-0/+3
2022-08-12enum variant ctor inherits stability of variantMichael Goulet-1/+1
2022-08-12Auto merge of #100328 - davidtwco:perf-implications, r=nnethercotebors-36/+91
passes: load `defined_lib_features` query less Hopefully addresses the perf regressions from #99212 (see #99905). Re-structure the stability checks for library features to avoid calling `defined_lib_features` for any more crates than necessary for each of the implications or local feature attributes that need validation. r? `@ghost` (just checking perf at first)
2022-08-11Rollup merge of #100392 - nnethercote:simplify-visitors, r=cjgillotMatthias Krüger-5/+5
Simplify visitors By removing some unused arguments. r? `@cjgillot`
2022-08-11Simplify `rustc_hir::intravisit::Visitor::visit_variant_data`.Nicholas Nethercote-5/+5
It has four arguments that are never used. This avoids lots of argument passing in functions that feed into `visit_variant_data`.
2022-08-09passes: load `defined_lib_features` query lessDavid Wood-36/+91
Re-structure the stability checks for library features to avoid calling `defined_lib_features` for any more crates than necessary for each of the implications or local feature attributes that need validation.
2022-07-31Don't track parent body stability (it wasn't used anyway)Maybe Waffle-18/+3
2022-07-26Implement `#[rustc_default_body_unstable]`Maybe Waffle-4/+32
This attribute allows to mark default body of a trait function as unstable. This means that implementing the trait without implementing the function will require enabling unstable feature. This is useful in conjunction with `#[rustc_must_implement_one_of]`, we may want to relax requirements for a trait, for example allowing implementing either of `PartialEq::{eq, ne}`, but do so in a safe way -- making implementation of only `PartialEq::ne` unstable.
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