Skip to content
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

Account for tail expressions when pointing at return type #64802

Merged
merged 4 commits into from Sep 28, 2019

Conversation

@estebank
Copy link
Contributor

commented Sep 26, 2019

When there's a type mismatch we make an effort to check if it was
caused by a function's return type. This logic now makes sure to
only point at the return type if the error happens in a tail
expression.

Turn walk_parent_nodes method into an iterator.

CC #39968, CC #40799.

@rust-highfive

This comment has been minimized.

Copy link
Collaborator

commented Sep 26, 2019

r? @matthewjasper

(rust_highfive has picked a reviewer for you, use r? to override)

Copy link
Contributor

left a comment

r=me with comment addressed

src/librustc/hir/map/mod.rs Outdated Show resolved Hide resolved
@estebank

This comment was marked as outdated.

Copy link
Contributor Author

commented Sep 26, 2019

@bors r=matthewjasper

@bors

This comment was marked as outdated.

Copy link
Contributor

commented Sep 26, 2019

📌 Commit fdeb4ca has been approved by matthewjasper

Centril added a commit to Centril/rust that referenced this pull request Sep 27, 2019
…atthewjasper

Account for tail expressions when pointing at return type

When there's a type mismatch we make an effort to check if it was
caused by a function's return type. This logic now makes sure to
only point at the return type if the error happens in a tail
expression.

Turn `walk_parent_nodes` method into an iterator.

CC rust-lang#39968, CC rust-lang#40799.
bors added a commit that referenced this pull request Sep 27, 2019
Rollup of 10 pull requests

Successful merges:

 - #63937 ( Fix ICE in rustdoc when merging generic and where bounds of an Fn with an output)
 - #64419 (Deduplicate some code between miri and const prop)
 - #64546 (Bugfix/rfc 2451 rerebalance tests)
 - #64589 (Differentiate AArch64 bare-metal targets between hf and non-hf.)
 - #64745 (Include message on tests that should panic but do not)
 - #64793 (Fix format macro expansions spans to be macro-generated)
 - #64799 (Fix double panic when printing query stack during an ICE)
 - #64802 (Account for tail expressions when pointing at return type)
 - #64815 (Fix div_duration() marked as stable by mistake)
 - #64818 (update rtpSpawn's parameters type(It's prototype has been updated in libc))

Failed merges:

r? @ghost
@bors

This comment was marked as resolved.

Copy link
Contributor

commented Sep 27, 2019

☔️ The latest upstream changes (presumably #64813) made this pull request unmergeable. Please resolve the merge conflicts.

estebank added 3 commits Sep 26, 2019
When there's a type mismatch we make an effort to check if it was
caused by a function's return type. This logic now makes sure to
only point at the return type if the error happens in a tail
expression.
@estebank estebank force-pushed the estebank:walk-parents-iterator branch from fdeb4ca to e537d06 Sep 27, 2019
@estebank

This comment has been minimized.

Copy link
Contributor Author

commented Sep 27, 2019

@bors r=matthewjasper

@bors

This comment has been minimized.

Copy link
Contributor

commented Sep 27, 2019

📌 Commit a284822 has been approved by matthewjasper

Centril added a commit to Centril/rust that referenced this pull request Sep 28, 2019
…atthewjasper

Account for tail expressions when pointing at return type

When there's a type mismatch we make an effort to check if it was
caused by a function's return type. This logic now makes sure to
only point at the return type if the error happens in a tail
expression.

Turn `walk_parent_nodes` method into an iterator.

CC rust-lang#39968, CC rust-lang#40799.
bors added a commit that referenced this pull request Sep 28, 2019
Rollup of 14 pull requests

Successful merges:

 - #63492 (Remove redundancy from the implementation of C variadics.)
 - #64703 (Docs: slice elements are equidistant)
 - #64745 (Include message on tests that should panic but do not)
 - #64781 (Remove stray references to the old global tcx)
 - #64794 (Remove unused DepTrackingMap)
 - #64802 (Account for tail expressions when pointing at return type)
 - #64809 (hir: Disallow `target_feature` on constants)
 - #64815 (Fix div_duration() marked as stable by mistake)
 - #64818 (update rtpSpawn's parameters type(It's prototype has been updated in libc))
 - #64830 (Thou shallt not `.abort_if_errors()`)
 - #64836 (Stabilize map_get_key_value feature)
 - #64845 (pin.rs: fix links to primitives in documentation)
 - #64847 (Upgrade env_logger to 0.7)
 - #64851 (Add mailmap entry for Dustin Bensing by request)

Failed merges:

 - #64824 (No StableHasherResult everywhere)

r? @ghost
Centril added a commit to Centril/rust that referenced this pull request Sep 28, 2019
…atthewjasper

Account for tail expressions when pointing at return type

When there's a type mismatch we make an effort to check if it was
caused by a function's return type. This logic now makes sure to
only point at the return type if the error happens in a tail
expression.

Turn `walk_parent_nodes` method into an iterator.

CC rust-lang#39968, CC rust-lang#40799.
bors added a commit that referenced this pull request Sep 28, 2019
Rollup of 14 pull requests

Successful merges:

 - #64703 (Docs: slice elements are equidistant)
 - #64745 (Include message on tests that should panic but do not)
 - #64781 (Remove stray references to the old global tcx)
 - #64794 (Remove unused DepTrackingMap)
 - #64802 (Account for tail expressions when pointing at return type)
 - #64809 (hir: Disallow `target_feature` on constants)
 - #64815 (Fix div_duration() marked as stable by mistake)
 - #64818 (update rtpSpawn's parameters type(It's prototype has been updated in libc))
 - #64830 (Thou shallt not `.abort_if_errors()`)
 - #64836 (Stabilize map_get_key_value feature)
 - #64845 (pin.rs: fix links to primitives in documentation)
 - #64847 (Upgrade env_logger to 0.7)
 - #64851 (Add mailmap entry for Dustin Bensing by request)
 - #64859 (check_match: improve diagnostics for `let A = 2;` with `const A: i32 = 3`)

Failed merges:

r? @ghost
@bors bors merged commit a284822 into rust-lang:master Sep 28, 2019
4 checks passed
4 checks passed
pr Build #20190927.36 succeeded
Details
pr (Linux mingw-check) Linux mingw-check succeeded
Details
pr (Linux x86_64-gnu-llvm-6.0) Linux x86_64-gnu-llvm-6.0 succeeded
Details
pr (LinuxTools) LinuxTools succeeded
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.