about summary refs log tree commit diff
path: root/compiler/rustc_attr
AgeCommit message (Collapse)AuthorLines
2021-10-03Move some HashStable impls.Camille GILLOT-3/+3
2021-09-20Migrate to 2021Mark Rousskov-1/+1
2021-08-21Remove `Session.used_attrs` and move logic to `CheckAttrVisitor`Aaron Hill-16/+9
Instead of updating global state to mark attributes as used, we now explicitly emit a warning when an attribute is used in an unsupported position. As a side effect, we are to emit more detailed warning messages (instead of just a generic "unused" message). `Session.check_name` is removed, since its only purpose was to mark the attribute as used. All of the callers are modified to use `Attribute.has_name` Additionally, `AttributeType::AssumedUsed` is removed - an 'assumed used' attribute is implemented by simply not performing any checks in `CheckAttrVisitor` for a particular attribute. We no longer emit unused attribute warnings for the `#[rustc_dummy]` attribute - it's an internal attribute used for tests, so it doesn't mark sense to treat it as 'unused'. With this commit, a large source of global untracked state is removed.
2021-08-03rustc: Fill out remaining parts of C-unwind ABIAlex Crichton-44/+0
This commit intends to fill out some of the remaining pieces of the C-unwind ABI. This has a number of other changes with it though to move this design space forward a bit. Notably contained within here is: * On `panic=unwind`, the `extern "C"` ABI is now considered as "may unwind". This fixes a longstanding soundness issue where if you `panic!()` in an `extern "C"` function defined in Rust that's actually UB because the LLVM representation for the function has the `nounwind` attribute, but then you unwind. * Whether or not a function unwinds now mainly considers the ABI of the function instead of first checking the panic strategy. This fixes a miscompile of `extern "C-unwind"` with `panic=abort` because that ABI can still unwind. * The aborting stub for non-unwinding ABIs with `panic=unwind` has been reimplemented. Previously this was done as a small tweak during MIR generation, but this has been moved to a separate and dedicated MIR pass. This new pass will, for appropriate functions and function calls, insert a `cleanup` landing pad for any function call that may unwind within a function that is itself not allowed to unwind. Note that this subtly changes some behavior from before where previously on an unwind which was caught-to-abort it would run active destructors in the function, and now it simply immediately aborts the process. * The `#[unwind]` attribute has been removed and all users in tests and such are now using `C-unwind` and `#![feature(c_unwind)]`. I think this is largely the last piece of the RFC to implement. Unfortunately I believe this is still not stabilizable as-is because activating the feature gate changes the behavior of the existing `extern "C"` ABI in a way that has no replacement. My thinking for how to enable this is that we add support for the `C-unwind` ABI on stable Rust first, and then after it hits stable we change the behavior of the `C` ABI. That way anyone straddling stable/beta/nightly can switch to `C-unwind` safely.
2021-07-29rfc3052: Remove authors field from Cargo manifestsJade-1/+0
Since RFC 3052 soft deprecated the authors field anyway, hiding it from crates.io, docs.rs, and making Cargo not add it by default, and it is not generally up to date/useful information, we should remove it from crates in this repo.
2021-07-09Enhance well-formedness checks for `#[repr(...)]` attributesFabian Wolff-8/+96
2021-05-24remove cfg(bootstrap)Pietro Albini-2/+0
2021-04-05Allow specifying alignment for functionsWesley Norris-36/+14
2021-03-19stabilize or_patternsmark-1/+1
2021-03-05Auto merge of #71481 - estebank:inherit-stability, r=nikomatsakisbors-11/+16
Inherit `#[stable(..)]` annotations in enum variants and fields from its item Lint changes for #65515. The stdlib will have to be updated once this lands in beta and that version is promoted in master.
2021-02-21remove redundant wrapping of return types of allow_internal_unstable() and ↵Matthias Krüger-4/+4
rustc_allow_const_fn_unstable()
2021-02-21remove unneccessary wrapping of return value of allow_unstable(), it would ↵Matthias Krüger-5/+5
always return Some(thing)
2021-02-10Tweak stability attribute diagnostic outputEsteban Küber-11/+16
2021-02-05Never MIR inline functions with a different instruction setTomasz Miąsko-1/+1
2021-01-30Rollup merge of #81468 - est31:cfg_version, r=petrochenkovYuki Okushi-4/+6
cfg(version): treat nightlies as complete This PR makes cfg(version) treat the nightlies for version 1.n.0 as 1.n.0, even though that nightly version might not have all stabilizations and features of the released 1.n.0. This is done for greater convenience for people who want to test a newly stabilized feature on nightly, or in other words, give newly stabilized features as many eyeballs as possible. For users who wish to pin nightlies, this commit adds a -Z assume-incomplete-release option that they can enable if they run into any issues due to this change. Implements the suggestion in https://github.com/rust-lang/rust/issues/64796#issuecomment-640851454
2021-01-29Treat nightlies for a version as completeest31-4/+6
This commit makes cfg(version) treat the nightlies for version 1.n.0 as 1.n.0, even though that nightly version might not have all stabilizations and features of the released 1.n.0. This is done for greater convenience for people who want to test a newly stabilized feature on nightly. For users who wish to pin nightlies, this commit adds a -Z assume-incomplete-release option that they can enable if there are any issues due to this change.
2021-01-26Auto merge of #80692 - Aaron1011:feature/query-result-debug, r=estebankbors-3/+3
Enforce that query results implement Debug Currently, we require that query keys implement `Debug`, but we do not do the same for query values. This can make incremental compilation bugs difficult to debug - there isn't a good place to print out the result loaded from disk. This PR adds `Debug` bounds to several query-related functions, allowing us to debug-print the query value when an 'unstable fingerprint' error occurs. This required adding `#[derive(Debug)]` to a fairly large number of types - hopefully, this doesn't have much of an impact on compiler bootstrapping times.
2021-01-24Replace version_check dependency with own version parsing codeest31-5/+28
This gives compiler maintainers a better degree of control over how the version gets parsed and is a good way to ensure that there are no changes of behaviour in the future. Also, issue a warning if the version is invalid instead of erroring so that we stay forwards compatible with possible future changes of the versioning scheme. Last, this improves the present test a little.
2021-01-16Enforce that query results implement DebugAaron Hill-3/+3
2020-12-14Get rid of `clean::Deprecation`Joshua Nelson-1/+1
This brings the size of `item.deprecation` from 56 to 16 bytes.
2020-12-01Created NestedMetaItem::name_value_literal_span methodGuillaume Gomez-1/+1
2020-11-20Never inline naked functionsTomasz Miąsko-1/+1
The `#[naked]` attribute disabled prologue / epilogue emission for the function and it is responsibility of a developer to provide them. The compiler is no position to inline such functions correctly. Disable inlining of naked functions at LLVM and MIR level.
2020-11-02Improve deprecation attribute diagnostic messages.Mara Bos-1/+2
(From the PR feedback.) Co-authored-by: Esteban Küber <esteban@kuber.com.ar>
2020-11-01Use the right span for errors about #[deprecated] attributes.Mara Bos-11/+9
2020-10-30Fix even more clippy warningsJoshua Nelson-30/+28
2020-10-21switch allow_internal_unstable const fns to rustc_allow_const_fn_unstableFlorian Warzecha-4/+21
2020-10-11Move `PartialOrd` impl out of rustcJoshua Nelson-14/+0
Rustdoc's ordering requirements are probably not relevant to the rest of the compiler.
2020-10-11Switch rustdoc from `clean::Stability` to `rustc_attr::Stability`Joshua Nelson-1/+15
This gives greater type safety and is less work to maintain on the rustdoc end.
2020-10-08Implement the instruction_set attributexd009642-0/+6
2020-09-27Remove `rustc_allow_const_fn_ptr`Dylan MacKenzie-24/+7
This was a hack to work around the lack of an escape hatch for the "min `const fn`" checks in const-stable functions. Now that we have co-opted `allow_internal_unstable` for this purpose, we no longer need the bespoke attribute.
2020-09-25Allow multiple allow_internal_unstable attributesDániel Buga-7/+14
Co-authored-by: varkor <github@varkor.com>
2020-09-23Don't use an if guard to check equality with a constantLingMan-1/+1
Match on it directly instead
2020-09-18use matches!() macro for simple if let conditionsMatthias Krüger-2/+2
2020-08-30mv compiler to compiler/mark-0/+1083