| Age | Commit message (Collapse) | Author | Lines |
|
|
|
|
|
If hir_owner is Owner(_), the LocalDefId is pointing to an owner, so the ItemLocalId is 0.
If the HIR node does not exist, we store Phantom.
Otherwise, we store the HirId associated to the LocalDefId.
|
|
The data structure previously used here required Ord.
As part of #90317, we do not want DefId to implement Ord.
|
|
This eliminates one more late use of resolver
|
|
|
|
Use let_else in even more places
Followup of #89933, #91018, #91481.
|
|
|
|
|
|
|
|
Also remove unnecessary `is_proc_macro_crate` checks from decoder
|
|
|
|
|
|
Link impl items to corresponding trait items in late resolver.
Hygienically linking trait impl items to declarations in the trait can be done directly by the late resolver. In fact, it is already done to diagnose unknown items.
This PR uses this resolution work and stores the `DefId` of the trait item in the HIR. This avoids having to do this resolution manually later.
r? `@matthewjasper`
Related to #90639. The added `trait_item_id` field can be moved to `ImplItemRef` to be used directly by your PR.
|
|
The `record_used` parameter changes the result, so we must pass the same
value for initial and module resolution.
|
|
Mak DefId to AccessLevel map in resolve for export
hir_id to accesslevel in resolve and applied in privacy
using local def id
removing tracing probes
making function not recursive and adding comments
Move most of Exported/Public res to rustc_resolve
moving public/export res to resolve
fix missing stability attributes in core, std and alloc
move code to access_levels.rs
return for some kinds instead of going through them
Export correctness, macro changes, comments
add comment for import binding
add comment for import binding
renmae to access level visitor, remove comments, move fn as closure, remove new_key
fmt
fix rebase
fix rebase
fmt
fmt
fix: move macro def to rustc_resolve
fix: reachable AccessLevel for enum variants
fmt
fix: missing stability attributes for other architectures
allow unreachable pub in rustfmt
fix: missing impl access level + renaming export to reexport
Missing impl access level was found thanks to a test in clippy
|
|
Rollup of 8 pull requests
Successful merges:
- #92055 (Add release notes for 1.58)
- #92490 (Move crate drop-down to search results page)
- #92510 (Don't resolve blocks in foreign functions)
- #92573 (expand: Refactor InvocationCollector visitor for better code reuse)
- #92608 (rustdoc: Introduce a resolver cache for sharing data between early doc link resolution and later passes)
- #92657 (Implemented const casts of raw pointers)
- #92671 (Make `Atomic*::from_mut` return `&mut Atomic*`)
- #92673 (Remove useless collapse toggle on "all items" page)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
Don't resolve blocks in foreign functions
Although it is an error for a foreign function to have a block, it is still possible at the level of the AST. #74204 made AST lowering skip over blocks belonging to foreign functions, since they're invalid. However, resolve still treated these blocks normally, resulting in a mismatch between the HIR and resolve, which could cause an ICE under certain circumstances. This PR changes resolve to skip over blocks belonging to foreign functions, as AST lowering does.
Fixes #91370.
r? ``@cjgillot``
|
|
Also rename `module_exports`/`export_map` to `module_reexports`/`reexport_map` for clarity.
|
|
`module_children(_untracked)`
And `each_child_of_item` to `for_each_module_child`
|
|
|
|
|
|
Rename `CStore::item_attrs` -> `CStore::item_attrs_untracked` top follow conventions
|
|
|
|
This makes it more uniform with other expanded nodes
|
|
Suggest while let x = y when encountering while x = y
Extends #75931 to also detect where the `let` might be missing from `while let` expressions.
|
|
Extends #75931 to also detect where the `let` might be missing from `while let` expressions.
|
|
Visit expressions in-order when resolving pattern bindings
[edited:] Visit the pattern's sub-expressions before defining any bindings.
Otherwise, we might get into a case where a Lit/Range expression in a pattern has a qpath pointing to a Ident pattern that is defined after it, causing an ICE when lowering to HIR. I have a more detailed explanation in the issue linked.
Fixes #92100
|
|
Tighten span when suggesting lifetime on path
This is kind of a hack.
Really the issue here is that we want to suggest the segment's span if the path resolves to something defined outside of the macro, and the macro's span if it resolves to something defined within.. I'll look into seeing if we can do something like that.
Fixes #92324
r? `@cjgillot`
|
|
|
|
resolve: Minor miscellaneous cleanups from #89059
`@bors` rollup=always
|
|
|
|
Also avoid decoding the whole `ty::AssocItem` to get a `has_self` flag
|
|
|
|
Suggest adding a `#[cfg(test)]` to to a test module
closes #88138
|
|
Remove `SymbolStr`
This was originally proposed in https://github.com/rust-lang/rust/pull/74554#discussion_r466203544. As well as removing the icky `SymbolStr` type, it allows the removal of a lot of `&` and `*` occurrences.
Best reviewed one commit at a time.
r? `@oli-obk`
|
|
Use a separate nameless `DefPathData` variant instead
|
|
remove a empty line
import `module_to_string`
use `contains("test")`
show a suggestion in case module starts_with/ends_with "test"
replace `parent` with `containing`
|
|
Include rustc version in `rustc_span::StableCrateId`
`rustc_span::def_id::StableCrateId` is a hash of various data about a crate during compilation. This PR includes the version of `rustc` in the input when computing this hash. From a cursory reading of [RFC 2603](https://rust-lang.github.io/rfcs/2603-rust-symbol-name-mangling-v0.html), this appears to be acceptable within that design.
In order to pass the `mir-opt` and `ui` test suites, this adds new [normalization for hashes and symbol names in `compiletest`](https://github.com/rust-lang/rust/pull/89836/files#diff-03a0567fa80ca04ed5a55f9ac5c711b4f84659be2d0ac4a984196d581c04f76b). These are enabled by default, but we might prefer it to be configurable.
In the UI tests, I had to truncate a significant amount of error annotations in v0 symbols (and maybe some legacy) in order to get the normalization to work correctly. (See https://github.com/rust-lang/rust/issues/90116.)
Closes #85142.
|
|
Handle unordered const/ty generics for object lifetime defaults
*feel like I should have a PR description but cant think of what to put here*
r? ```@lcnr```
|
|
|
|
|
|
Rollup of 7 pull requests
Successful merges:
- #90939 (Tweak errors coming from `for`-loop, `?` and `.await` desugaring)
- #91859 (Iterator::cycle() — document empty iterator special case)
- #91868 (Use `OutputFilenames` to generate output file for `-Zllvm-time-trace`)
- #91870 (Revert setting a default for the MACOSX_DEPLOYMENT_TARGET env var for linking)
- #91881 (Stabilize `iter::zip`)
- #91882 (Remove `in_band_lifetimes` from `rustc_typeck`)
- #91940 (Update cargo)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
By changing `as_str()` to take `&self` instead of `self`, we can just
return `&str`. We're still lying about lifetimes, but it's a smaller lie
than before, where `SymbolStr` contained a (fake) `&'static str`!
|
|
|
|
Avoid suggest adding `self` in visibility spec
Fixes #91783
|
|
|
|
Normalize symbol hashes in compiletest.
Remove DefId sorting
|
|
Co-authored-by: Esteban Kuber <estebank@users.noreply.github.com>
|
|
Do not ICE when suggesting elided lifetimes on non-existent spans.
Fixes https://github.com/rust-lang/rust/issues/91763
r? `@jackh726`
|