Restrict EII declarations to functions at lowering time#152384
Restrict EII declarations to functions at lowering time#152384rust-bors[bot] merged 1 commit intorust-lang:mainfrom
Conversation
|
rustbot has assigned @petrochenkov. Use Why was this reviewer chosen?The reviewer was selected based on:
|
This comment has been minimized.
This comment has been minimized.
0ba99f1 to
d2f08a3
Compare
|
previously I tightened |
|
Reminder, once the PR becomes ready for a review, use |
|
r? me I'll look at this tomorrow morning but don't merge anything similar to this pr until I did |
|
I agree with petrochenkov, this has to be solved using PathSource @enthropy7 @rustbot author |
d2f08a3 to
2f52ca9
Compare
|
Moved EII declaration target validation from also updated tests |
2f52ca9 to
6e6d79e
Compare
This comment has been minimized.
This comment has been minimized.
6e6d79e to
76d908b
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
|
@rustbot ready rebased onto latest main. updated |
This comment has been minimized.
This comment has been minimized.
76d908b to
f939ce3
Compare
This comment has been minimized.
This comment has been minimized.
f939ce3 to
5961ba1
Compare
|
@bors r+ rollup |
…uwer Rollup of 8 pull requests Successful merges: - #155047 (Always exhaustively match on typing mode) - #155080 (Simplify `try_load_from_disk_fn`.) - #152384 (Restrict EII declarations to functions at lowering time) - #153796 (Fix ICE when combining #[eii] with #[core::contracts::ensures]) - #154369 (Fix `pattern_from_macro_note` for bit-or expr) - #155027 ( Rename some more of our internal `#[rustc_*]` TEST attributes) - #155031 (delegation: fix unelided lifetime ICE, refactoring of GenericArgPosition) - #155040 (Fix code block whitespace handling in Markdown)
Rollup merge of #152384 - enthropy7:fix-eii-root-resolution-clean, r=jdonszelmann Restrict EII declarations to functions at lowering time We tighten EII declaration resolution so that `lower_path_simple_eii` only accepts function‑like items (`Fn, AssocFn, Ctor(_, Fn)`) as valid EII targets. If name resolution points at something else (like a const with the same name), we now emit a direct error (“`externally implementable items must refer to a function`”) at the declaration site, which prevents bad `DefIds` from ever reaching `compare_eii_function_types` and turning into an ICE this is more robust and root-cause oriented fix to #152337 issue and an alternate of my more simple PR #152365 test included
We tighten EII declaration resolution so that
lower_path_simple_eiionly accepts function‑like items (Fn, AssocFn, Ctor(_, Fn)) as valid EII targets. If name resolution points at something else (like a const with the same name), we now emit a direct error (“externally implementable items must refer to a function”) at the declaration site, which prevents badDefIdsfrom ever reachingcompare_eii_function_typesand turning into an ICEthis is more robust and root-cause oriented fix to #152337 issue and an alternate of my more simple PR #152365
test included