about summary refs log tree commit diff
path: root/src/librustc_passes/check_attr.rs
AgeCommit message (Collapse)AuthorLines
2020-08-30mv compiler to compiler/mark-527/+0
2020-08-19Auto merge of #74098 - GuillaumeGomez:doc-alias-checks, r=ollie27bors-2/+24
Doc alias checks: ensure only items appearing in search index can use it Following the discussion in #73721, I added checks to ensure that only items appearing in the search are allowed to have doc alias. r? @ollie27
2020-08-17rust_ast::ast => rustc_astUjjwal Sharma-1/+1
2020-08-12Allow #[doc(alias)] on impl const itemsGuillaume Gomez-6/+2
2020-08-11Move #[doc(alias)] attribute checks in rustcGuillaume Gomez-2/+28
2020-08-08Eliminate the `SessionGlobals` from `librustc_ast`.Nicholas Nethercote-14/+13
By moving `{known,used}_attrs` from `SessionGlobals` to `Session`. This means they are accessed via the `Session`, rather than via TLS. A few `Attr` methods and `librustc_ast` functions are now methods of `Session`. All of this required passing a `Session` to lots of functions that didn't already have one. Some of these functions also had arguments removed, because those arguments could be accessed directly via the `Session` argument. `contains_feature_attr()` was dead, and is removed. Some functions were moved from `librustc_ast` elsewhere because they now need to access `Session`, which isn't available in that crate. - `entry_point_type()` --> `librustc_builtin_macros` - `global_allocator_spans()` --> `librustc_metadata` - `is_proc_macro_attr()` --> `Session`
2020-08-04rustc_ast: `(Nested)MetaItem::check_name` -> `has_name`Vadim Petrochenkov-1/+1
For consistency with `Attribute::has_name` which doesn't mark the attribute as used either. Replace all uses of `check_name` with `has_name` outside of rustc
2020-07-16Rollup merge of #74148 - GuillaumeGomez:doc-alias-check, r=ManishearthManish Goregaokar-0/+30
Move #[doc(alias)] check in rustc Part of #73721. r? @ollie27
2020-07-10Rollup merge of #74109 - nbdd0121:issue-74082, r=petrochenkovManish Goregaokar-0/+2
Only allow `repr(i128/u128)` on enum Fixes #74082
2020-07-08Move #[doc(alias)] check in rustcGuillaume Gomez-0/+30
2020-07-06Only allow `repr(i128/u128)` on enumGary Guo-0/+2
2020-07-05Use for<'tcx> fn pointers in Providers, instead of having Providers<'tcx>.Eduard-Mihai Burtescu-1/+1
2020-06-27Rollup merge of #73796 - lcnr:LocalDefId, r=matthewjasperManish Goregaokar-2/+2
replace more `DefId`s with `LocalDefId` part of https://github.com/rust-lang/rust/issues/70853
2020-06-27use LocalDefId in module checkingBastian Kauschke-2/+2
2020-06-24Implement associated lang itemsAaron Hill-1/+4
Fixes #70718 This commit allows making associated items (e.g. associated functions and types) into lang items via the `#[lang]` attribute. This allows such items to be accessed directly, rather than by iterating over the parent item's associated items. I've added `FnOnce::Output` as a lang item, and updated one old usage to use the new lang item. The remaining uses can be updated separately.
2020-06-11Remove associated opaque typesMatthew Jasper-1/+1
They're unused now.
2020-05-01Mark query function as must_use.Camille GILLOT-2/+2
2020-04-30Rollup merge of #71205 - NeoRaider:check_attr, r=jonas-schievinkDylan DPC-1/+4
rustc: fix check_attr() for methods, closures and foreign functions This fixes an issue that previously turned up for methods in https://github.com/rust-lang/rust/pull/69274, but also exists for closures and foreign function: `check_attr` does not call `codegen_fn_attrs()` for these types when it should, meaning that incorrectly used function attributes are not diagnosed without codegen. The issue affects our UI tests, as they run with `--emit=metadata` by default, but as it turns out, this is not the only case: Function attributes are not checked on any dead code without this fix! This makes the fix a **breaking change**. The following very silly Rust programs compiles fine on stable Rust when it should not, which is fixed by this PR. ```rust fn main() { #[target_feature(enable = "sse2")] || {}; } ``` I assume any real-world program which may trigger this issue would at least emit a dead code warning, but of course that is no guarantee that such code does not exist... Fixes #70307
2020-04-19Dogfood more or_patterns in the compilerJosh Stone-4/+2
2020-04-16rustc: fix check_attr() for methods, closures and foreign functionsMatthias Schiffer-1/+4
UI tests are updated with additional error messages that were missing before.
2020-04-12Remove usage of `DUMMY_HIR_ID` in `CheckAttrVisitor::check_inline`marmeladema-3/+2
2020-04-09track_caller: support on FFI importsMazdak Farrokhzad-11/+1
2020-04-08track_caller: harden naked interactionsMazdak Farrokhzad-1/+1
2020-03-30rustc -> rustc_middle part 2Mazdak Farrokhzad-3/+3
2020-03-22Allow #[track_caller] in traits.Adam Perry-3/+3
The codegen implementation already works for this, so we're: * propagating track_caller attr from trait def to impl * relaxing errors * adding tests Approved in a recent lang team meeting: https://github.com/rust-lang/lang-team/blob/master/minutes/2020-01-09.md
2020-03-15More Method->Fn renamingMark Mansi-1/+1
2020-03-14Index HIR after creating TyCtxtJohn Kåre Alsaker-2/+2
2020-03-12remove lifetimes that can be elided (clippy::needless_lifetimes)Matthias Krüger-1/+1
2020-02-29Rename `syntax` to `rustc_ast` in source codeVadim Petrochenkov-2/+2
2020-02-12Rollup merge of #68554 - cjgillot:lang_items, r=ZoxcYuki Okushi-1/+1
Split lang_items to crates `rustc_hir` and `rustc_passes`. As discussed in comment https://github.com/rust-lang/rust/pull/67688#discussion_r368289946
2020-02-11Move it all into rustc_hir.Camille GILLOT-1/+1
2020-02-11Move hir::check_attr::Target to librustc_lang_items.Camille GILLOT-1/+1
2020-02-11Auto merge of #68491 - pnkfelix:hide-niches-under-unsafe-cell, r=olibors-3/+21
Hide niches under UnsafeCell Hide any niche of T from type-construction context of `UnsafeCell<T>`. Fix #68303 Fix #68206
2020-02-11Run RustFmtjumbatm-15/+10
2020-02-11Run RustFmtjumbatm-18/+13
2020-02-11Invert control in struct_lint_level.jumbatm-19/+21
Caller now passes in a `decorate` function, which is only run if the lint is allowed.
2020-02-10Add `#[repr(no_niche)]`.Felix S. Klock II-3/+21
This repr-hint makes a struct/enum hide any niche within from its surrounding type-construction context. It is meant (at least initially) as an implementation detail for resolving issue 68303. We will not stabilize the repr-hint unless someone finds motivation for doing so. (So, declaration of `no_niche` feature lives in section of file where other internal implementation details are grouped, and deliberately leaves out the tracking issue number.) incorporated review feedback, and fixed post-rebase.
2020-02-09Make issue references consistentMatthias Prechtl-2/+2
2020-01-29Make Target::from_impl_item a free function.Camille GILLOT-22/+16
2020-01-29Move check_mod_attr query in librustc_passes.Camille GILLOT-118/+8
2020-01-29Move check_attr.rs to librustc_passes.Camille GILLOT-0/+587