-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide context on E0308 involving fn items #73630
Conversation
r? @eddyb (rust_highfive has picked a reviewer for you, use r? to override) |
r? @davidtwco |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, a couple minor comments - if you don't think they're worth addressing then r=me.
src/test/ui/fn/fn-item-type.stderr
Outdated
@@ -6,34 +6,57 @@ LL | eq(foo::<u8>, bar::<u8>); | |||
| | |||
= note: expected fn item `fn(_) -> _ {foo::<u8>}` | |||
found fn item `fn(_) -> _ {bar::<u8>}` | |||
= note: different `fn` items always have unique types, even if their signatures are the same | |||
= help: change the expectation to require function pointer `fn(isize) -> isize` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find the "expectation" terminology to be confusing here - it took me a little bit to understand what that would mean in terms of concrete changes to the source. I don't have any better suggestions though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed the wording to
= help: change the expected type to be function pointer `fn(isize) -> isize`
= help: if the expected type is due to type inference, cast the expected `fn` to a function pointer: `foo::<u8> as fn(isize) -> isize`
@bors r=davidtwco |
📌 Commit 6e8aa1f has been approved by |
Provide context on E0308 involving fn items Fix rust-lang#73487.
…arth Rollup of 11 pull requests Successful merges: - rust-lang#72780 (Enforce doc alias check) - rust-lang#72876 (Mention that BTreeMap::new() doesn't allocate) - rust-lang#73244 (Check for assignments between non-conflicting generator saved locals) - rust-lang#73488 (code coverage foundation for hash and num_counters) - rust-lang#73523 (Fix -Z unpretty=everybody_loops) - rust-lang#73587 (Move remaining `NodeId` APIs from `Definitions` to `Resolver`) - rust-lang#73601 (Point at the call span when overflow occurs during monomorphization) - rust-lang#73613 (The const propagator cannot trace references.) - rust-lang#73614 (fix `intrinsics::needs_drop` docs) - rust-lang#73630 (Provide context on E0308 involving fn items) - rust-lang#73665 (rustc: Modernize wasm checks for atomics) Failed merges: r? @ghost
Fix #73487.