Uh oh!
There was an error while loading. Please reload this page.
Collect lang items from AST, get rid of GenericBound::LangItemTrait - #118396
Conversation
This comment has been minimized.
This comment has been minimized.
compiler-errors
commented
Nov 28, 2023
tools! i never check tools! @rustbot author |
rustbot
commented
Nov 28, 2023
Some changes occurred in src/tools/clippy cc @rust-lang/clippy |
This comment has been minimized.
This comment has been minimized.
This comment was marked as outdated.
This comment was marked as outdated.
Actually, I have no idea what is going on here, and I have no idea where to begin debugging this. Help would be appreciated. |
petrochenkov
commented
Nov 28, 2023
Previous attempt - #103662. |
compiler-errors
commented
Nov 28, 2023
Oh, thanks for that link, @petrochenkov. I see that the same CI failure here was happening on that PR -- ec485f3. I will just cherry-pick that commit. |
QPath::LangItemGenericBound::LangItemTrait106ddbb to
13f1a3fCompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as resolved.
This comment was marked as resolved.
| items: LanguageItems, | ||
| tcx: TyCtxt<'tcx>, | ||
| resolver: &'ast ResolverAstLowering, | ||
| item_spans: FxHashMap<DefId, Span>, |
There was a problem hiding this comment.
I wonder if we should #118552 to avoid having to maintain such map. Could you add a FIXME with the issue so we can retrieve the question?
Uh oh!
There was an error while loading. Please reload this page.
13f1a3f to
7c801fcComparecompiler-errors
commented
Dec 5, 2023
@rustbot ready |
This comment has been minimized.
This comment has been minimized.
This comment was marked as resolved.
This comment was marked as resolved.
12220af to
fb142f8Compare
This comment was marked as resolved.
This comment was marked as resolved.
cjgillot
commented
Dec 9, 2023
r=me after rebase |
fb142f8 to
28bccb7Comparecompiler-errors
commented
Dec 9, 2023
I had to modify the check for the number of generic params to handle associated items correctly. This should be ready to go, but I guess I will wait for @cjgillot to look at the last commit in particular. |
petrochenkov
commented
Dec 9, 2023
(I'll also look today or tomorrow.) |
| | | ||
| LL | fn panic_impl(info: &PanicInfo) -> ! { | ||
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| LL | / fn panic_impl(info: &PanicInfo) -> ! { |
There was a problem hiding this comment.
The old def_span logic is supposedly reproduced in this PR, so why do some spans change?
There was a problem hiding this comment.
I don't reproduce it fully -- I'm just caching the item span here.
In HIR, we do some special span creation to essentially compute the "head span" of each item:
rust/compiler/rustc_middle/src/hir/map/mod.rs
Lines 839 to 948 in ff2c563
bors
commented
Dec 13, 2023
☔ The latest upstream changes (presumably #118500) made this pull request unmergeable. Please resolve the merge conflicts. |
28bccb7 to
bc1ca6bComparecjgillot
commented
Dec 15, 2023
@bors r+ |
bors
commented
Dec 15, 2023
…kingjubilee Rollup of 5 pull requests Successful merges: - rust-lang#118396 (Collect lang items from AST, get rid of `GenericBound::LangItemTrait`) - rust-lang#118727 (Don't pass lint back out of lint decorator) - rust-lang#118956 (Make CStr documentation consistent ("nul" instead of "null")) - rust-lang#118981 (Remove an unneeded allocation) - rust-lang#118998 (Link to is_benchmark from the Ipv6Addr::is_global documentation) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#118396 - compiler-errors:ast-lang-items, r=cjgillot Collect lang items from AST, get rid of `GenericBound::LangItemTrait` r? `@cjgillot` cc rust-lang#115178 Looking forward, the work to remove `QPath::LangItem` will also be significantly more difficult, but I plan on doing it as well. Specifically, we have to change: 1. A lot of `rustc_ast_lowering` for things like expr `..` 2. A lot of astconv, since we actually instantiate lang and non-lang paths quite differently. 3. A ton of diagnostics and clippy lints that are special-cased via `QPath::LangItem` Meanwhile, it was pretty easy to remove `GenericBound::LangItemTrait`, so I just did that here.
pnkfelix
commented
Dec 19, 2023
If I'm interpreting the data on PR #119002 correctly, it seems like this PR was the primary cause of some ~38 smallish (<0.5%) regressions, mostly to check builds, that were flagged in that rollup. |
r? @cjgillot
cc #115178
Looking forward, the work to remove
QPath::LangItemwill also be significantly more difficult, but I plan on doing it as well. Specifically, we have to change:rustc_ast_loweringfor things like expr..QPath::LangItemMeanwhile, it was pretty easy to remove
GenericBound::LangItemTrait, so I just did that here.