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

typeck: Prohibit RPIT types that inherit lifetimes #62849

Merged
merged 1 commit into from Aug 14, 2019

Conversation

@davidtwco
Copy link
Member

commented Jul 21, 2019

Part of #61949.

This PR prohibits return position impl Trait types that "inherit
lifetimes" from the parent scope. The intent is to forbid cases that are
challenging until they can be addressed properly.

cc @nikomatsakis

@rust-highfive

This comment has been minimized.

Copy link
Collaborator

commented Jul 21, 2019

r? @matthewjasper

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

@cramertj

This comment has been minimized.

Copy link
Member

commented Jul 23, 2019

@bors try (for crater)

@bors

This comment has been minimized.

Copy link
Contributor

commented Jul 23, 2019

⌛️ Trying commit 62f89e0 with merge 2110aa1...

bors added a commit that referenced this pull request Jul 23, 2019

Auto merge of #62849 - davidtwco:prohibit-inheriting-lifetimes, r=<try>
typeck: Prohibit RPIT types that inherit lifetimes

Part of #61949.

This PR prohibits return position `impl Trait` types that "inherit
lifetimes" from the parent scope. The intent is to forbid cases that are
challenging until they can be addressed properly.

cc @nikomatsakis
@bors

This comment has been minimized.

Copy link
Contributor

commented Jul 23, 2019

☀️ Try build successful - checks-azure
Build commit: 2110aa1

@cramertj

This comment has been minimized.

Copy link
Member

commented Jul 23, 2019

@craterbot run mode=check-only

@@ -0,0 +1,8 @@
error: `async fn` return type cannot contain a projection or `Self` that references lifetimes from a parent scope

This comment has been minimized.

Copy link
@nikomatsakis

nikomatsakis Jul 25, 2019

Contributor

I wonder if we should try to give some clue for how to workaround this -- this is basically a rustc bug.

In the case of Self, the suggestion would be to write the Self type explicitly.

This comment has been minimized.

Copy link
@davidtwco

davidtwco Jul 26, 2019

Author Member

I've dug around for a bit and I've not been able to find a way to determine if the return type was originally Self from here. I'm happy to add a suggestion if anyone knows a way to determine this.

This comment has been minimized.

Copy link
@nikomatsakis

nikomatsakis Aug 12, 2019

Contributor

At minimum we could just -- for this particular issue -- give it an error code and direct them to some chapter in the async book where we explain in more depth (in the extended explanation). But we'd need a link first. Maybe we can just file a follow-up issue on the matter to improve diagnostics.

Show resolved Hide resolved src/test/ui/async-await/issue-61949-self-return-type.stderr
@Centril

This comment has been minimized.

Copy link
Member

commented Jul 26, 2019

@craterbot run mode=check-only

@craterbot

This comment has been minimized.

Copy link
Collaborator

commented Jul 26, 2019

🚨 Error: missing start toolchain

🆘 If you have any trouble with Crater please ping @rust-lang/infra!
ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@edmilsonefs

This comment has been minimized.

Copy link

commented Jul 30, 2019

Hey! This is a ping from triage, we would like to know if you @davidtwco could give us a few more minutes to update here by fixing the conflicting files so we can move forward.

Thanks.

@rustbot modify labels to +S-waiting-on-author, -S-waiting-on-review

@davidtwco davidtwco force-pushed the davidtwco:prohibit-inheriting-lifetimes branch from 62f89e0 to 686de3a Jul 30, 2019

@davidtwco

This comment has been minimized.

Copy link
Member Author

commented Jul 30, 2019

@edmilsonefs thanks, I've resolved the conflict.

@Centril

This comment has been minimized.

Copy link
Member

commented Aug 1, 2019

@bors try

@bors

This comment has been minimized.

Copy link
Contributor

commented Aug 1, 2019

⌛️ Trying commit 686de3a with merge b5c7f15...

bors added a commit that referenced this pull request Aug 1, 2019

Auto merge of #62849 - davidtwco:prohibit-inheriting-lifetimes, r=<try>
typeck: Prohibit RPIT types that inherit lifetimes

Part of #61949.

This PR prohibits return position `impl Trait` types that "inherit
lifetimes" from the parent scope. The intent is to forbid cases that are
challenging until they can be addressed properly.

cc @nikomatsakis
@bors

This comment has been minimized.

Copy link
Contributor

commented Aug 1, 2019

☀️ Try build successful - checks-azure
Build commit: b5c7f15

@Centril

This comment has been minimized.

Copy link
Member

commented Aug 1, 2019

@craterbot run mode=check-only

@craterbot

This comment has been minimized.

Copy link
Collaborator

commented Aug 1, 2019

👌 Experiment pr-62849 created and queued.
🤖 Automatically detected try build b5c7f15
🔍 You can check out the queue and this experiment's details.

ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@Centril Centril referenced this pull request Aug 2, 2019

Open

Stabilize `async_await` in Rust 1.39.0 #63209

8 of 9 tasks complete
@craterbot

This comment has been minimized.

Copy link
Collaborator

commented Aug 8, 2019

🚧 Experiment pr-62849 is now running on agent aws-1.

ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@craterbot

This comment has been minimized.

Copy link
Collaborator

commented Aug 12, 2019

🎉 Experiment pr-62849 is completed!
📊 0 regressed and 0 fixed (70078 total)
📰 Open the full report.

⚠️ If you notice any spurious failure please add them to the blacklist!
ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

bors added a commit that referenced this pull request Aug 13, 2019

Auto merge of #63515 - Centril:rollup-r0z0yi8, r=Centril
Rollup of 11 pull requests

Successful merges:

 - #62760 (Deduplicate error messages in `librsctc_mir`)
 - #62849 (typeck: Prohibit RPIT types that inherit lifetimes)
 - #63383 (`async fn` lifetime elision tests)
 - #63421 (Implement Clone, Display for ascii::EscapeDefault)
 - #63459 (syntax: account for CVarArgs being in the argument list.)
 - #63475 (Bring back suggestion for splitting `<-` into `< -`)
 - #63485 (ci: move mirrors to their standalone bucket)
 - #63486 (Document `From` trait for `BinaryHeap`)
 - #63488 (improve DiagnosticBuilder docs)
 - #63493 (Remove unneeded comment in src/libcore/hash/mod.rs)
 - #63499 (handle elision in async fn correctly)

Failed merges:

r? @ghost
@bors

This comment has been minimized.

Copy link
Contributor

commented Aug 13, 2019

⌛️ Testing commit 861d1bb with merge b18b72c...

bors added a commit that referenced this pull request Aug 13, 2019

Auto merge of #62849 - davidtwco:prohibit-inheriting-lifetimes, r=nik…
…omatsakis

typeck: Prohibit RPIT types that inherit lifetimes

Part of #61949.

This PR prohibits return position `impl Trait` types that "inherit
lifetimes" from the parent scope. The intent is to forbid cases that are
challenging until they can be addressed properly.

cc @nikomatsakis

Centril added a commit to Centril/rust that referenced this pull request Aug 13, 2019

Rollup merge of rust-lang#62849 - davidtwco:prohibit-inheriting-lifet…
…imes, r=nikomatsakis

typeck: Prohibit RPIT types that inherit lifetimes

Part of rust-lang#61949.

This PR prohibits return position `impl Trait` types that "inherit
lifetimes" from the parent scope. The intent is to forbid cases that are
challenging until they can be addressed properly.

cc @nikomatsakis
@Centril

This comment was marked as resolved.

Copy link
Member

commented Aug 13, 2019

@bors retry rolled up.

@bors

This comment was marked as resolved.

Copy link
Contributor

commented Aug 13, 2019

⌛️ Testing commit 861d1bb with merge 78f3ed1...

bors added a commit that referenced this pull request Aug 13, 2019

Auto merge of #62849 - davidtwco:prohibit-inheriting-lifetimes, r=nik…
…omatsakis

typeck: Prohibit RPIT types that inherit lifetimes

Part of #61949.

This PR prohibits return position `impl Trait` types that "inherit
lifetimes" from the parent scope. The intent is to forbid cases that are
challenging until they can be addressed properly.

cc @nikomatsakis
@Centril

This comment has been minimized.

Copy link
Member

commented Aug 13, 2019

@bors retry rolled up (oops, forgot to adjust prio)

bors added a commit that referenced this pull request Aug 13, 2019

Auto merge of #63517 - Centril:rollup-8qbalaf, r=Centril
Rollup of 10 pull requests

Successful merges:

 - #62760 (Deduplicate error messages in `librsctc_mir`)
 - #62849 (typeck: Prohibit RPIT types that inherit lifetimes)
 - #63383 (`async fn` lifetime elision tests)
 - #63421 (Implement Clone, Display for ascii::EscapeDefault)
 - #63459 (syntax: account for CVarArgs being in the argument list.)
 - #63475 (Bring back suggestion for splitting `<-` into `< -`)
 - #63485 (ci: move mirrors to their standalone bucket)
 - #63486 (Document `From` trait for `BinaryHeap`)
 - #63488 (improve DiagnosticBuilder docs)
 - #63493 (Remove unneeded comment in src/libcore/hash/mod.rs)

Failed merges:

r? @ghost
@rust-highfive

This comment was marked as spam.

Copy link
Collaborator

commented Aug 13, 2019

Your PR failed (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

bors added a commit that referenced this pull request Aug 13, 2019

Auto merge of #63517 - Centril:rollup-8qbalaf, r=Centril
Rollup of 10 pull requests

Successful merges:

 - #62760 (Deduplicate error messages in `librsctc_mir`)
 - #62849 (typeck: Prohibit RPIT types that inherit lifetimes)
 - #63383 (`async fn` lifetime elision tests)
 - #63421 (Implement Clone, Display for ascii::EscapeDefault)
 - #63459 (syntax: account for CVarArgs being in the argument list.)
 - #63475 (Bring back suggestion for splitting `<-` into `< -`)
 - #63485 (ci: move mirrors to their standalone bucket)
 - #63486 (Document `From` trait for `BinaryHeap`)
 - #63488 (improve DiagnosticBuilder docs)
 - #63493 (Remove unneeded comment in src/libcore/hash/mod.rs)

Failed merges:

r? @ghost

bors added a commit that referenced this pull request Aug 13, 2019

Auto merge of #63517 - Centril:rollup-8qbalaf, r=Centril
Rollup of 10 pull requests

Successful merges:

 - #62760 (Deduplicate error messages in `librsctc_mir`)
 - #62849 (typeck: Prohibit RPIT types that inherit lifetimes)
 - #63383 (`async fn` lifetime elision tests)
 - #63421 (Implement Clone, Display for ascii::EscapeDefault)
 - #63459 (syntax: account for CVarArgs being in the argument list.)
 - #63475 (Bring back suggestion for splitting `<-` into `< -`)
 - #63485 (ci: move mirrors to their standalone bucket)
 - #63486 (Document `From` trait for `BinaryHeap`)
 - #63488 (improve DiagnosticBuilder docs)
 - #63493 (Remove unneeded comment in src/libcore/hash/mod.rs)

Failed merges:

r? @ghost

bors added a commit that referenced this pull request Aug 13, 2019

Auto merge of #63517 - Centril:rollup-8qbalaf, r=Centril
Rollup of 10 pull requests

Successful merges:

 - #62760 (Deduplicate error messages in `librsctc_mir`)
 - #62849 (typeck: Prohibit RPIT types that inherit lifetimes)
 - #63383 (`async fn` lifetime elision tests)
 - #63421 (Implement Clone, Display for ascii::EscapeDefault)
 - #63459 (syntax: account for CVarArgs being in the argument list.)
 - #63475 (Bring back suggestion for splitting `<-` into `< -`)
 - #63485 (ci: move mirrors to their standalone bucket)
 - #63486 (Document `From` trait for `BinaryHeap`)
 - #63488 (improve DiagnosticBuilder docs)
 - #63493 (Remove unneeded comment in src/libcore/hash/mod.rs)

Failed merges:

r? @ghost

Mark-Simulacrum added a commit to Mark-Simulacrum/rust that referenced this pull request Aug 14, 2019

Rollup merge of rust-lang#62849 - davidtwco:prohibit-inheriting-lifet…
…imes, r=nikomatsakis

typeck: Prohibit RPIT types that inherit lifetimes

Part of rust-lang#61949.

This PR prohibits return position `impl Trait` types that "inherit
lifetimes" from the parent scope. The intent is to forbid cases that are
challenging until they can be addressed properly.

cc @nikomatsakis

bors added a commit that referenced this pull request Aug 14, 2019

Auto merge of #63540 - Mark-Simulacrum:rollup-t0qq657, r=Mark-Simulacrum
Rollup of 11 pull requests

Successful merges:

 - #62760 (Deduplicate error messages in `librsctc_mir`)
 - #62849 (typeck: Prohibit RPIT types that inherit lifetimes)
 - #63383 (`async fn` lifetime elision tests)
 - #63421 (Implement Clone, Display for ascii::EscapeDefault)
 - #63459 (syntax: account for CVarArgs being in the argument list.)
 - #63470 (Utilize -Zbinary-dep-depinfo in rustbuild)
 - #63475 (Bring back suggestion for splitting `<-` into `< -`)
 - #63485 (ci: move mirrors to their standalone bucket)
 - #63488 (improve DiagnosticBuilder docs)
 - #63491 (Update RLS)
 - #63534 (Bump to 1.39)

Failed merges:

 - #63487 (Remove meaningless comments in src/test)

r? @ghost

Centril added a commit to Centril/rust that referenced this pull request Aug 14, 2019

Rollup merge of rust-lang#62849 - davidtwco:prohibit-inheriting-lifet…
…imes, r=nikomatsakis

typeck: Prohibit RPIT types that inherit lifetimes

Part of rust-lang#61949.

This PR prohibits return position `impl Trait` types that "inherit
lifetimes" from the parent scope. The intent is to forbid cases that are
challenging until they can be addressed properly.

cc @nikomatsakis

bors added a commit that referenced this pull request Aug 14, 2019

Auto merge of #63541 - Centril:rollup-d3q7074, r=Centril
Rollup of 16 pull requests

Successful merges:

 - #62760 (Deduplicate error messages in `librsctc_mir`)
 - #62849 (typeck: Prohibit RPIT types that inherit lifetimes)
 - #63383 (`async fn` lifetime elision tests)
 - #63421 (Implement Clone, Display for ascii::EscapeDefault)
 - #63459 (syntax: account for CVarArgs being in the argument list.)
 - #63475 (Bring back suggestion for splitting `<-` into `< -`)
 - #63485 (ci: move mirrors to their standalone bucket)
 - #63486 (Document `From` trait for `BinaryHeap`)
 - #63488 (improve DiagnosticBuilder docs)
 - #63493 (Remove unneeded comment in src/libcore/hash/mod.rs)
 - #63499 (handle elision in async fn correctly)
 - #63501 (use `ParamName` to track in-scope lifetimes instead of Ident)
 - #63512 (Provide map_ok and map_err method for Poll<Option<Result<T, E>>>)
 - #63529 (RELEASES.md: ? is one of three Kleene operators)
 - #63530 (Fix typo in error message.)
 - #63534 (Bump to 1.39)

Failed merges:

r? @ghost
@bors

This comment has been minimized.

Copy link
Contributor

commented Aug 14, 2019

⌛️ Testing commit 861d1bb with merge ade6230...

bors added a commit that referenced this pull request Aug 14, 2019

Auto merge of #62849 - davidtwco:prohibit-inheriting-lifetimes, r=nik…
…omatsakis

typeck: Prohibit RPIT types that inherit lifetimes

Part of #61949.

This PR prohibits return position `impl Trait` types that "inherit
lifetimes" from the parent scope. The intent is to forbid cases that are
challenging until they can be addressed properly.

cc @nikomatsakis

Centril added a commit to Centril/rust that referenced this pull request Aug 14, 2019

Rollup merge of rust-lang#62849 - davidtwco:prohibit-inheriting-lifet…
…imes, r=nikomatsakis

typeck: Prohibit RPIT types that inherit lifetimes

Part of rust-lang#61949.

This PR prohibits return position `impl Trait` types that "inherit
lifetimes" from the parent scope. The intent is to forbid cases that are
challenging until they can be addressed properly.

cc @nikomatsakis
@Centril

This comment has been minimized.

Copy link
Member

commented Aug 14, 2019

@bors retry rolled up.

bors added a commit that referenced this pull request Aug 14, 2019

Auto merge of #63544 - Centril:rollup-qhqfcov, r=Centril
Rollup of 17 pull requests

Successful merges:

 - #62760 (Deduplicate error messages in `librsctc_mir`)
 - #62849 (typeck: Prohibit RPIT types that inherit lifetimes)
 - #63383 (`async fn` lifetime elision tests)
 - #63421 (Implement Clone, Display for ascii::EscapeDefault)
 - #63459 (syntax: account for CVarArgs being in the argument list.)
 - #63475 (Bring back suggestion for splitting `<-` into `< -`)
 - #63485 (ci: move mirrors to their standalone bucket)
 - #63486 (Document `From` trait for `BinaryHeap`)
 - #63488 (improve DiagnosticBuilder docs)
 - #63493 (Remove unneeded comment in src/libcore/hash/mod.rs)
 - #63499 (handle elision in async fn correctly)
 - #63501 (use `ParamName` to track in-scope lifetimes instead of Ident)
 - #63508 (Do not ICE when synthesizing spans falling inside unicode chars)
 - #63511 (ci: add a check for clock drift)
 - #63512 (Provide map_ok and map_err method for Poll<Option<Result<T, E>>>)
 - #63529 (RELEASES.md: ? is one of three Kleene operators)
 - #63530 (Fix typo in error message.)

Failed merges:

r? @ghost

bors added a commit that referenced this pull request Aug 14, 2019

Auto merge of #63517 - Centril:rollup-8qbalaf, r=Centril
Rollup of 10 pull requests

Successful merges:

 - #62760 (Deduplicate error messages in `librsctc_mir`)
 - #62849 (typeck: Prohibit RPIT types that inherit lifetimes)
 - #63383 (`async fn` lifetime elision tests)
 - #63421 (Implement Clone, Display for ascii::EscapeDefault)
 - #63459 (syntax: account for CVarArgs being in the argument list.)
 - #63475 (Bring back suggestion for splitting `<-` into `< -`)
 - #63485 (ci: move mirrors to their standalone bucket)
 - #63486 (Document `From` trait for `BinaryHeap`)
 - #63488 (improve DiagnosticBuilder docs)
 - #63493 (Remove unneeded comment in src/libcore/hash/mod.rs)

Failed merges:

r? @ghost

bors added a commit that referenced this pull request Aug 14, 2019

Auto merge of #63544 - Centril:rollup-qhqfcov, r=Centril
Rollup of 17 pull requests

Successful merges:

 - #62760 (Deduplicate error messages in `librsctc_mir`)
 - #62849 (typeck: Prohibit RPIT types that inherit lifetimes)
 - #63383 (`async fn` lifetime elision tests)
 - #63421 (Implement Clone, Display for ascii::EscapeDefault)
 - #63459 (syntax: account for CVarArgs being in the argument list.)
 - #63475 (Bring back suggestion for splitting `<-` into `< -`)
 - #63485 (ci: move mirrors to their standalone bucket)
 - #63486 (Document `From` trait for `BinaryHeap`)
 - #63488 (improve DiagnosticBuilder docs)
 - #63493 (Remove unneeded comment in src/libcore/hash/mod.rs)
 - #63499 (handle elision in async fn correctly)
 - #63501 (use `ParamName` to track in-scope lifetimes instead of Ident)
 - #63508 (Do not ICE when synthesizing spans falling inside unicode chars)
 - #63511 (ci: add a check for clock drift)
 - #63512 (Provide map_ok and map_err method for Poll<Option<Result<T, E>>>)
 - #63529 (RELEASES.md: ? is one of three Kleene operators)
 - #63530 (Fix typo in error message.)

Failed merges:

r? @ghost

@bors bors merged commit 861d1bb into rust-lang:master Aug 14, 2019

4 of 5 checks passed

homu Testing commit 861d1bb365419c4a9ae8eb14257323e9877e5d42 with merge ade62304ed223496e69511fa5fb9b83420b7d5c9...
Details
pr Build #20190812.46 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

@davidtwco davidtwco deleted the davidtwco:prohibit-inheriting-lifetimes branch Aug 17, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
You can’t perform that action at this time.