| Age | Commit message (Collapse) | Author | Lines |
|
|
|
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
|
|
|
|
|
|
|
|
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`
|
|
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
|
|
Move #[doc(alias)] check in rustc
Part of #73721.
r? @ollie27
|
|
Only allow `repr(i128/u128)` on enum
Fixes #74082
|
|
|
|
|
|
|
|
replace more `DefId`s with `LocalDefId`
part of https://github.com/rust-lang/rust/issues/70853
|
|
|
|
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.
|
|
They're unused now.
|
|
|
|
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
|
|
|
|
UI tests are updated with additional error messages that were missing
before.
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|
Split lang_items to crates `rustc_hir` and `rustc_passes`.
As discussed in comment https://github.com/rust-lang/rust/pull/67688#discussion_r368289946
|
|
|
|
|
|
Hide niches under UnsafeCell
Hide any niche of T from type-construction context of `UnsafeCell<T>`.
Fix #68303
Fix #68206
|
|
|
|
|
|
Caller now passes in a `decorate` function, which is only run if the
lint is allowed.
|
|
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.
|
|
|
|
|
|
|
|
|