On return type impl Trait for block with no expr point at last semi#58204
Merged
bors merged 3 commits intorust-lang:masterfrom Mar 9, 2019
Merged
On return type impl Trait for block with no expr point at last semi#58204bors merged 3 commits intorust-lang:masterfrom
impl Trait for block with no expr point at last semi#58204bors merged 3 commits intorust-lang:masterfrom
Conversation
Contributor
|
r? @eddyb (rust_highfive has picked a reviewer for you, use r? to override) |
Contributor
Author
|
cc @cramertj |
Member
|
Nice! This looks like a great improvement. |
Contributor
Author
|
r? @zackmdavis |
zackmdavis
approved these changes
Feb 7, 2019
Contributor
zackmdavis
left a comment
There was a problem hiding this comment.
requested reference comment; otherwise, r=me
5134e7c to
0afda05
Compare
Contributor
Author
|
@bors r=zackmdavis |
Collaborator
|
📌 Commit 0afda05 has been approved by |
Centril
added a commit
to Centril/rust
that referenced
this pull request
Feb 13, 2019
On return type `impl Trait` for block with no expr point at last semi
Partial solution, doesn't actually validate that the last statement in the function body can satisfy the trait bound, but it's a good incremental improvement over the status quo.
```
error[E0277]: the trait bound `(): Bar` is not satisfied
--> $DIR/impl-trait-return-trailing-semicolon.rs:3:13
|
LL | fn foo() -> impl Bar {
| ^^^^^^^^ the trait `Bar` is not implemented for `()`
LL | 5;
| - consider removing this semicolon
|
= note: the return type of a function must have a statically known size
```
Partially addresses rust-lang#54771.
Contributor
|
Failed in rollup (#58426 (comment)) due to combination with #58167. @bors r- |
0afda05 to
bf777a9
Compare
This comment has been minimized.
This comment has been minimized.
Contributor
|
Ping from triage @estebank, any thoughts on moving forward? |
Contributor
Author
|
@Centril I'll fix this soon |
bf777a9 to
e6387b6
Compare
Contributor
Author
|
@bors r=zackmdavis |
Collaborator
|
📌 Commit e6387b6 has been approved by |
Contributor
Author
|
@bors rollup |
emilyalbini
added a commit
to emilyalbini/rust
that referenced
this pull request
Mar 8, 2019
On return type `impl Trait` for block with no expr point at last semi
Partial solution, doesn't actually validate that the last statement in the function body can satisfy the trait bound, but it's a good incremental improvement over the status quo.
```
error[E0277]: the trait bound `(): Bar` is not satisfied
--> $DIR/impl-trait-return-trailing-semicolon.rs:3:13
|
LL | fn foo() -> impl Bar {
| ^^^^^^^^ the trait `Bar` is not implemented for `()`
LL | 5;
| - consider removing this semicolon
|
= note: the return type of a function must have a statically known size
```
Partially addresses rust-lang#54771.
bors
added a commit
that referenced
this pull request
Mar 9, 2019
Rollup of 24 pull requests Successful merges: - #58080 (Add FreeBSD armv6 and armv7 targets) - #58204 (On return type `impl Trait` for block with no expr point at last semi) - #58269 (Add librustc and libsyntax to rust-src distribution.) - #58369 (Make the Entry API of HashMap<K, V> Sync and Send) - #58861 (Expand where negative supertrait specific error is shown) - #58877 (Suggest removal of `&` when borrowing macro and appropriate) - #58883 (Suggest appropriate code for unused field when destructuring pattern) - #58891 (Remove stray ` in the docs for the FromIterator implementation for Option) - #58893 (race condition in thread local storage example) - #58906 (Monomorphize generator field types for debuginfo) - #58911 (Regression test for #58435.) - #58912 (Regression test for #58813) - #58916 (Fix release note problems noticed after merging.) - #58918 (Regression test added for an async ICE.) - #58921 (Add an explicit test for issue #50582) - #58926 (Make the lifetime parameters of tcx consistent.) - #58931 (Elide invalid method receiver error when it contains TyErr) - #58940 (Remove JSBackend from config.toml) - #58950 (Add self to mailmap) - #58961 (On incorrect cfg literal/identifier, point at the right span) - #58963 (libstd: implement Error::source for io::Error) - #58970 (delay_span_bug in wfcheck's ty.lift_to_tcx unwrap) - #58984 (Teach `-Z treat-err-as-bug` to take a number of errors to emit) - #59007 (Add a test for invalid const arguments) Failed merges: - #58959 (Add release notes for PR #56243) r? @ghost
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Partial solution, doesn't actually validate that the last statement in the function body can satisfy the trait bound, but it's a good incremental improvement over the status quo.
Partially addresses #54771.