about summary refs log tree commit diff
path: root/compiler/rustc_resolve/src
AgeCommit message (Collapse)AuthorLines
2023-02-19Make public API, docs algorithm-agnosticJacob Pratt-5/+5
2023-02-18Correctly handle if a link starts with a whitespaceGuillaume Gomez-0/+1
2023-02-18doc links: Filter away autolinks in both rustc and rustdocVadim Petrochenkov-2/+19
2023-02-18rustdoc: Cleanup broken link callbacksVadim Petrochenkov-13/+10
2023-02-17Rollup merge of #107489 - compiler-errors:non_lifetime_binders, r=cjgillotMatthias Krüger-2/+8
Implement partial support for non-lifetime binders This implements support for non-lifetime binders. It's pretty useless currently, but I wanted to put this up so the implementation can be discussed. Specifically, this piggybacks off of the late-bound lifetime collection code in `rustc_hir_typeck::collect::lifetimes`. This seems like a necessary step given the fact we don't resolve late-bound regions until this point, and binders are sometimes merged. Q: I'm not sure if I should go along this route, or try to modify the earlier nameres code to compute the right bound var indices for type and const binders eagerly... If so, I'll need to rename all these queries to something more appropriate (I've done this for `resolve_lifetime::Region` -> `resolve_lifetime::ResolvedArg`) cc rust-lang/types-team#81 r? `@ghost`
2023-02-16Rollup merge of #108099 - matthiaskrgr:str_to_char, r=GuillaumeGomezMatthias Krüger-1/+1
use chars instead of strings where applicable
2023-02-16`if $c:expr { Some($r:expr) } else { None }` =>> `$c.then(|| $r)`Maybe Waffle-5/+3
2023-02-16Make things actually workMichael Goulet-1/+7
2023-02-16Rename some region-specific stuffMichael Goulet-2/+2
2023-02-15use chars instead of strings where applicableMatthias Krüger-1/+1
2023-02-15Auto merge of #108006 - cjgillot:def-impl, r=oli-obkbors-1/+1
Avoid accessing HIR when it can be avoided Experiment to see if it helps some incremental cases. Will be rebased once https://github.com/rust-lang/rust/pull/107942 gets merged. r? `@ghost`
2023-02-14Add `of_trait` to DefKind::Impl.Camille GILLOT-1/+1
2023-02-14Separate the lifetime of the session and the arena in the resolverOli Scherer-66/+69
2023-02-13resolve: Fix doc links referring to other crates when documenting proc macro ↵Vadim Petrochenkov-1/+6
crates directly
2023-02-13rustc_resolve: Remove `Resolver::clone_output`Vadim Petrochenkov-48/+1
And remove `Clone` impls and `Lrc`s that are no longer necessary
2023-02-13rustdoc: Eliminate remaining uses of resolverVadim Petrochenkov-51/+40
2023-02-11Auto merge of #94857 - petrochenkov:doclink2, r=oli-obkbors-34/+570
Resolve documentation links in rustc and store the results in metadata This PR implements MCP https://github.com/rust-lang/compiler-team/issues/584. Doc links are now resolved in rustc and stored into metadata, so rustdoc simply retrieves them through a query (local or extern), Code that is no longer used is removed, and some code that no longer needs to be public is privatized. The removed code includes resolver cloning, so this PR fixes https://github.com/rust-lang/rust/issues/83761.
2023-02-10Auto merge of #107652 - estebank:re_error, r=oli-obkbors-1/+0
Introduce `ReError` CC #69314 r? `@nagisa`
2023-02-10Skip doc link resolution for some crate types and non-exported itemsVadim Petrochenkov-14/+65
2023-02-10Stop resolving doc links on `mod` items twiceVadim Petrochenkov-2/+16
2023-02-10Resolve documentation links in rustc and store the results in metadataVadim Petrochenkov-31/+502
This commit implements MCP https://github.com/rust-lang/compiler-team/issues/584 It also removes code that is no longer used, and that includes code cloning resolver, so issue #83761 is fixed.
2023-02-09Introduce `ReError`Esteban Küber-1/+0
CC #69314
2023-02-03unused-lifetimes: don't warn about lifetimes originating from expanded codeMatthias Krüger-12/+16
previously, we would warn like this: ```` warning: lifetime parameter `'s` never used --> /tmp/unusedlif/code.rs:6:62 | 5 | #[derive(Clone)] | - help: elide the unused lifetime 6 | struct ShimMethod4<T: Trait2 + 'static>(pub &'static dyn for<'s> Fn(&'s mut T::As)); | ^^ | = note: requested on the command line with `-W unused-lifetimes` ```` Fixes #104432
2023-02-02Rename `rust_2015` => `is_rust_2015`Maybe Waffle-10/+13
2023-01-31Rollup merge of #107508 - WaffleLapkin:uneq'15, r=oli-obkGuillaume Gomez-3/+2
`Edition` micro refactor r? ``@oli-obk``
2023-01-31Don't do `.edition().rust_*()`Maybe Waffle-1/+1
2023-01-31Use `Edition` methods a bit moreMaybe Waffle-3/+2
2023-01-30Replace enum `==`s with `match`es where it makes senseMaybe Waffle-14/+15
2023-01-25suggest qualifying bare associated constantsAndy Russell-5/+12
2023-01-22Auto merge of #107185 - compiler-errors:rollup-wkomjma, r=compiler-errorsbors-3/+19
Rollup of 8 pull requests Successful merges: - #103418 (Add `SEMICOLON_IN_EXPRESSIONS_FROM_MACROS` to future-incompat report) - #106113 (llvm-wrapper: adapt for LLVM API change) - #106144 (Improve the documentation of `black_box`) - #106578 (Label closure captures/generator locals that make opaque types recursive) - #106749 (Update cc to 1.0.77) - #106935 (Fix `SingleUseLifetime` ICE) - #107015 (Re-enable building rust-analyzer on riscv64) - #107029 (Add new bootstrap members to triagebot.toml) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-01-21Rollup merge of #106935 - TaKO8Ki:fix-104440, r=cjgillotMichael Goulet-3/+19
Fix `SingleUseLifetime` ICE Fixes #104440 cc: ``@matthiaskrgr``
2023-01-22Auto merge of #107133 - pnkfelix:revert-pr-84022-for-issue-106337, ↵bors-13/+70
r=Mark-Simulacrum Revert "Make PROC_MACRO_DERIVE_RESOLUTION_FALLBACK a hard error" This reverts commit 7d82cadd97acc66993b69304c5a1a04ef7d1fa36 aka PR #84022 I am doing this to buy us some time with respect to issue #106337 w.r.t. the 1.67 release.
2023-01-21Auto merge of #106977 - michaelwoerister:unord_id_collections, r=oli-obkbors-5/+5
Use UnordMap and UnordSet for id collections (DefIdMap, LocalDefIdMap, etc) This PR changes the `rustc_data_structures::define_id_collections!` macro to use `UnordMap` and `UnordSet` instead of `FxHashMap` and `FxHashSet`. This should account for a large portion of hash-maps being used in places where they can cause trouble. The changes required are moderate but non-zero: - In some places the collections are extracted into sorted vecs. - There are a few instances where for-loops have been changed to extends. ~~Let's see what the performance impact is. With a bit more refactoring, we might be able to get rid of some of the additional sorting -- but the change set is already big enough. Unless there's a performance impact, I'd like to do further changes in subsequent PRs.~~ Performance does not seem to be negatively affected ([perf-run here](https://github.com/rust-lang/rust/pull/106977#issuecomment-1396776699)). Part of [MCP 533](https://github.com/rust-lang/compiler-team/issues/533). r? `@ghost`
2023-01-20Revert "Make PROC_MACRO_DERIVE_RESOLUTION_FALLBACK a hard error"Felix S. Klock II-13/+70
This reverts commit 7d82cadd97acc66993b69304c5a1a04ef7d1fa36. I am doing this to buy us some time with respect to issue #106337 w.r.t. the 1.67 release.
2023-01-20diagnostics: remvoe unnecessary use of `source_map.start_point`Michael Howell-1/+1
2023-01-20diagnostics: use `module_path` to check crate import instead of stringsMichael Howell-20/+4
2023-01-20diagnostics: add `};` only if `{` was added tooMichael Howell-5/+5
2023-01-20diagnostics: suggest changing `s@self::{macro}@::macro` for exportedMichael Howell-1/+29
Fixes #99695
2023-01-19Use UnordMap instead of FxHashMap in define_id_collections!().Michael Woerister-5/+5
2023-01-17Rollup merge of #104505 - WaffleLapkin:no-double-spaces-in-comments, r=jackh726Matthias Krüger-6/+6
Remove double spaces after dots in comments Most of the comments do not have double spaces, so I assume these are typos.
2023-01-17Remove double spaces after dots in commentsMaybe Waffle-6/+6
2023-01-17note -> helpMichael Goulet-1/+1
2023-01-17Fix use suggestion spanMichael Goulet-7/+9
2023-01-16fix #104440Takayuki Maeda-3/+19
2023-01-15Only suggest adding type param if path being resolved was a typeMichael Goulet-1/+1
2023-01-13Rollup merge of #106813 - oli-obk:sess_cleanup, r=GuillaumeGomez,petrochenkovMatthias Krüger-1/+5
Remove redundant session field There was already a session available in the resolver, so we access that session.
2023-01-13Remove redundant session fieldOli Scherer-1/+5
2023-01-12Don't suggest dyn as parameter to addMichael Goulet-1/+5
2023-01-12Render missing generics suggestion verboselyMichael Goulet-1/+1
2023-01-11review comments: Tweak outputEsteban Küber-14/+29
* Account for `struct S(pub(super)Ty);` in suggestion * Suggest changing field visibility in E0603 too