Skip to content

Fix incorrect return type error diagnostic #59403

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

Closed
wants to merge 53 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
d1add97
Auto merge of #57696 - rust-lang:beta-next, r=Mark-Simulacrum
bors Jan 17, 2019
79a942b
Update beta to released compiler
Mark-Simulacrum Jan 19, 2019
ad5d12b
beta: Update RLS version to 1.33
Xanewok Jan 19, 2019
5209162
Auto merge of #57763 - Mark-Simulacrum:beta-next, r=Mark-Simulacrum
bors Jan 20, 2019
4df66ba
Auto merge of #57766 - Xanewok:beta-rls-version-bump, r=pietroalbini
bors Jan 21, 2019
f9b492f
make sure to accept all android licenses
pietroalbini Jan 23, 2019
dc52f0f
Fix issue 57762
tromey Jan 22, 2019
676ade5
Simplify the version check
tromey Jan 22, 2019
1652c7d
Fix typo bug in DepGraph::try_mark_green().
michaelwoerister Jan 17, 2019
635817b
Auto merge of #57878 - pietroalbini:beta-backports, r=pietroalbini
bors Jan 24, 2019
2cccf59
rustbuild: fix build with rust 1.33
Keruspe Jan 30, 2019
1045131
Auto merge of #57990 - Keruspe:beta, r=alexcrichton
bors Jan 31, 2019
b8527ab
Pass correct arguments to places_conflict
matthewjasper Jan 30, 2019
1983205
Don't panic when accessing enum variant ctor using `Self` in match
estebank Jan 30, 2019
872c966
Fix bug in integer range matching
varkor Feb 1, 2019
edb41d8
Build the standard library for thumbv7neon-unknown-linux-gnueabihf in CI
hsivonen Jan 28, 2019
13542d8
Fix release manifest generation
Jan 16, 2019
b203178
Auto merge of #58159 - pietroalbini:beta-backports, r=pietroalbini
bors Feb 5, 2019
81571bf
libpanic_unwind => 2018: fix ICEs.
Centril Feb 12, 2019
08f1073
Auto merge of #58501 - oli-obk:beta, r=eddyb
bors Feb 16, 2019
119335e
[BETA] Update cargo
ehuss Feb 16, 2019
94ca417
Make `intern_lazy_const` actually intern its argument.
nnethercote Feb 6, 2019
04d6d7b
Lower constant patterns with ascribed types.
davidtwco Feb 4, 2019
8a1b7da
#56411 do not suggest a fix for a import conflict in a macro
mockersf Dec 18, 2018
e4120ee
Address review comments and cleanup code
petrochenkov Jan 25, 2019
5f39bc7
Do not initiate nested probe within `assemble_probe`.
pnkfelix Jan 22, 2019
d820e21
unit test for issue 57673.
pnkfelix Jan 22, 2019
d30f5be
add some comments to method::probe::Candidate
arielb1 Jan 28, 2019
552e2fa
add tests to a few edge cases in method lookup
arielb1 Jan 28, 2019
062e817
avoid committing to autoderef in object method probing
arielb1 Jan 28, 2019
e583c62
Fixes text becoming invisible when element targetted
GuillaumeGomez Jan 15, 2019
bbe9e21
Rollup merge of #58522 - ehuss:update-beta-cargo, r=pietroalbini
pietroalbini Feb 17, 2019
1f84156
Auto merge of #58537 - pietroalbini:beta-backports, r=pietroalbini
bors Feb 20, 2019
f22755f
Fix #57979 by allowing a legitimate type error to take precedence ove…
pnkfelix Feb 22, 2019
687c449
make generalization code create new variables in correct universe
nikomatsakis Feb 1, 2019
f599ab6
s/skol_/placeholder_/
nikomatsakis Feb 20, 2019
4916c8f
reintroduce `commit_if_ok` call into `higher_ranked_sub`
nikomatsakis Feb 19, 2019
2a8c36c
reintroduce `commit_if_ok` calls to `subtype_predicate`
nikomatsakis Feb 19, 2019
3693f18
introduce a dummy leak check and invoke it in all the right places
nikomatsakis Feb 20, 2019
85a24b1
restore the actual leak-check
nikomatsakis Feb 20, 2019
542ad5e
update test files to reflect new output
nikomatsakis Feb 20, 2019
551aafc
partially revert 904a0bde93f0348f69914ee90b1f8b6e4e0d7cbc
nikomatsakis Feb 21, 2019
600ca1e
improve Pin documentation
RalfJung Feb 22, 2019
fdd5467
Updated RELEASES.md for 1.33.0
Feb 6, 2019
a63575c
Fix invalid background color
GuillaumeGomez Jan 23, 2019
5c6eb4e
Fix non-clickable urls
GuillaumeGomez Jan 17, 2019
bb2d0ea
Auto merge of #58656 - Mark-Simulacrum:beta-rollups, r=pietroalbini
bors Feb 23, 2019
ab4c12a
stable 1.33.0 release
pietroalbini Feb 25, 2019
b270e14
Auto merge of #58721 - pietroalbini:stable-1.33.0, r=pietroalbini
bors Feb 25, 2019
e48ffae
Fix release note problems noticed after merging.
Mark-Simulacrum Feb 28, 2019
bd1f032
Permit unwinding through FFI by default
Mark-Simulacrum Feb 28, 2019
2aa4c46
Auto merge of #58795 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum
bors Feb 28, 2019
be89474
58982 fix incorrect error diagnostic
pmccarter Mar 24, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
58982 fix incorrect error diagnostic
pmccarter committed Mar 24, 2019
commit be89474c0c0740b119e6710695e11df960b3af84
16 changes: 10 additions & 6 deletions src/librustc_typeck/check/coercion.rs
Original file line number Diff line number Diff line change
@@ -1224,17 +1224,21 @@ impl<'gcx, 'tcx, 'exprs, E> CoerceMany<'gcx, 'tcx, 'exprs, E>
cause.span,
blk_id,
);
if let Some(sp) = fcx.ret_coercion_span.borrow().as_ref() {
if !sp.overlaps(cause.span) {
db.span_label(*sp, reason_label);
if let ty::Infer(..) = self.expected_ty.sty {
if let Some(sp) = fcx.ret_coercion_span.borrow().as_ref() {
if !sp.overlaps(cause.span) {
db.span_label(*sp, reason_label);
}
}
}
}
_ => {
db = fcx.report_mismatched_types(cause, expected, found, err);
if let Some(sp) = fcx.ret_coercion_span.borrow().as_ref() {
if !sp.overlaps(cause.span) {
db.span_label(*sp, reason_label);
if let ty::Infer(..) = self.expected_ty.sty {
if let Some(sp) = fcx.ret_coercion_span.borrow().as_ref() {
if !sp.overlaps(cause.span) {
db.span_label(*sp, reason_label);
}
}
}
}
2 changes: 1 addition & 1 deletion src/test/ui/liveness/liveness-forgot-ret.stderr
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
--> $DIR/liveness-forgot-ret.rs:3:19
|
LL | fn f(a: isize) -> isize { if god_exists(a) { return 5; }; }
| - ^^^^^ expected isize, found () - expected because of this statement
| - ^^^^^ expected isize, found ()
| |
| this function's body doesn't return
|