| Age | Commit message (Collapse) | Author | Lines |
|
|
|
By avoiding formatting and allocations in the no-ident case, and by making the span mandatory if the ident exists.
Use the optimized `opt_item_ident` to cleanup `fn each_child_of_item`
|
|
Rename `CStore::item_attrs` -> `CStore::item_attrs_untracked` top follow conventions
|
|
Import `SimplifiedType` more
|
|
Remove effect of `#[no_link]` attribute on name resolution
Previously it hid all non-macro names from other crates.
This has no relation to linking and can change name resolution behavior in some cases (e.g. glob conflicts), in addition to just producing the "unresolved name" errors.
I can kind of understand the possible reasoning behind the current behavior - if you can use names from a `no_link` crates then you can use, for example, functions too, but whether it will actually work or produce link-time errors will depend on random factors like inliner behavior.
(^^^ This is not the actual reason why the current behavior exist, I've looked through git history and it's mostly accidental.)
I think this risk is ok for such an obscure attribute, and we don't need to specifically prevent use of non-macro items from such crates.
(I'm not actually sure why would anyone use `#[no_link]` on a crate, even if it's macro only, if you aware of any use cases, please share. IIRC, at some point it was used for crates implementing custom derives - the now removed legacy ones, not the current proc macros.)
Extracted from https://github.com/rust-lang/rust/pull/91795.
|
|
|
|
rustc_metadata: Encode list of all crate's traits into metadata
While working on https://github.com/rust-lang/rust/pull/88679 I noticed that rustdoc is casually doing something quite expensive, something that is used only for error reporting in rustc - collecting all traits from all crates in the dependency tree.
This PR trades some minor extra time spent by metadata encoder in rustc for major gains for rustdoc (and for rustc runs with errors, which execute the `all_traits` query for better diagnostics).
|
|
|
|
during metadata encoding rather than during metadata decoding
|
|
Also avoid decoding the whole `ty::AssocItem` to get a `has_self` flag
|
|
Previously it hid all non-macro names from other crates.
This has no relation to linking and can change name resolution behavior in some cases (e.g. glob conflicts), in addition to just producing the "unresolved name" errors
|
|
|
|
|
|
This avoids having to decode 2 `Lazy`s when decoding a modules exports.
|
|
- Always use the ExpnId serialized to `tables`
- Use the Id for traits and enums from other crates in resolution.
|
|
This performs a substitution of code following the pattern:
let <id> = if let <pat> = ... { identity } else { ... : ! };
To simplify it to:
let <pat> = ... { identity } else { ... : ! };
By adopting the let_else feature.
|
|
Correct decoding of foreign expansions during incr. comp.
Fixes https://github.com/rust-lang/rust/issues/74946
The original issue was due to a wrong assertion in `expn_hash_to_expn_id`.
The secondary issue was due to a mismatch between the encoding and decoding paths for expansions that are created after the TyCtxt is created.
|
|
The metadata encoder does not necessarily encode all expansions, only
those which are referenced in other metadata fields.
|
|
|
|
|
|
|
|
directly instead.
|
|
DefPathHashMap in rustc_hir.
|
|
We only use this mapping for cases where we know that it must succeed.
Letting it panic otherwise makes it harder to use the API in unsupported
ways.
|
|
This encoding allows for random access without an expensive upfront decoding
state which in turn allows simplifying the DefPathIndex lookup logic without
regressing performance.
|
|
|
|
generic_const_exprs: use thir for abstract consts instead of mir
Changes `AbstractConst` building to use `thir` instead of `mir` so that there's less chance of consts unifying when they shouldn't because lowering to mir dropped information (see `abstract-consts-as-cast-5.rs` test)
r? `@lcnr`
|
|
rustc: Remove local variable IDs from `Export`s
Local variables can never be exported.
|
|
Local variables can never be exported.
|
|
|
|
|
|
|
|
same search
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The two paths will be modified independently in the next few commits.
|
|
Cache expansion hash globally
... instead of computing it multiple times.
Split from #86676
r? `@petrochenkov`
|
|
|
|
Add #[default_method_body_is_const]
`@rustbot` label F-const_trait_impl
|
|
This information is already available from `ExpnData`
|
|
|
|
This reverts commit 8176ab8bc18fdd7d3c2cf7f720c51166364c33a3.
|
|
Useful for debugging crate hash and resolution issues.
|
|
|
|
This reverts commit d0ec85d3fb6d322496cb8f4bc1c21e19f23284ad.
|
|
exported symbols for each crate
Restored underlying num_def_ids_method
Update compiler/rustc_metadata/src/rmeta/decoder/cstore_impl.rs
Changed name to fit with naming convention
Co-authored-by: bjorn3 <bjorn3@users.noreply.github.com>
Update compiler/rustc_metadata/src/rmeta/decoder/cstore_impl.rs
Replace regular doc with Rustdoc comment
Co-authored-by: Joshua Nelson <jyn514@gmail.com>
Clarifies third-party use of num_def_ids_untracked
|