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

Better Diagnostic for Trait Object Capture #54848

Merged
merged 2 commits into from Oct 11, 2018

Conversation

Projects
None yet
5 participants
@davidtwco
Member

davidtwco commented Oct 5, 2018

Part of #52663.

This commit enhances LaterUseKind detection to identify when a borrow
is captured by a trait object which helps explain why there is a borrow
error.

r? @nikomatsakis
cc @pnkfelix

@bors

This comment was marked as resolved.

Show comment
Hide comment
@bors

bors Oct 7, 2018

Contributor

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

Contributor

bors commented Oct 7, 2018

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

davidtwco added some commits Oct 5, 2018

Identify borrows captured by trait objects.
This commit enhances `LaterUseKind` detection to identify when a borrow
is captured by a trait object which helps explain why there is a borrow
error.
Update logic to search for casts.
This commit updates the captured trait object search logic to look for
unsized casts to boxed types rather than for functions that returned
trait objects.

@pnkfelix pnkfelix added the A-NLL label Oct 8, 2018

@nikomatsakis

This comment has been minimized.

Show comment
Hide comment
@nikomatsakis

nikomatsakis Oct 8, 2018

Contributor

@bors r+

I'm not sure on the wording, but the spans seem correct.

Contributor

nikomatsakis commented Oct 8, 2018

@bors r+

I'm not sure on the wording, but the spans seem correct.

@bors

This comment has been minimized.

Show comment
Hide comment
@bors

bors Oct 8, 2018

Contributor

📌 Commit 72911fb has been approved by nikomatsakis

Contributor

bors commented Oct 8, 2018

📌 Commit 72911fb has been approved by nikomatsakis

@bors

This comment has been minimized.

Show comment
Hide comment
@bors

bors Oct 8, 2018

Contributor

💡 This pull request was already approved, no need to approve it again.

  • There's another pull request that is currently being tested, blocking this pull request: #54907
Contributor

bors commented Oct 8, 2018

💡 This pull request was already approved, no need to approve it again.

  • There's another pull request that is currently being tested, blocking this pull request: #54907
@bors

This comment has been minimized.

Show comment
Hide comment
@bors

bors Oct 8, 2018

Contributor

📌 Commit 72911fb has been approved by nikomatsakis

Contributor

bors commented Oct 8, 2018

📌 Commit 72911fb has been approved by nikomatsakis

pietroalbini added a commit to pietroalbini/rust that referenced this pull request Oct 9, 2018

Rollup merge of rust-lang#54848 - davidtwco:issue-52663-trait-object,…
… r=nikomatsakis

Better Diagnostic for Trait Object Capture

Part of rust-lang#52663.

This commit enhances `LaterUseKind` detection to identify when a borrow
is captured by a trait object which helps explain why there is a borrow
error.

r? @nikomatsakis
cc @pnkfelix

bors added a commit that referenced this pull request Oct 10, 2018

Auto merge of #54944 - pietroalbini:rollup, r=pietroalbini
Rollup of 14 pull requests

Successful merges:

 - #54755 (Documents reference equality by address (#54197))
 - #54811 (During rustc bootstrap, make default for `optimize` independent of `debug`)
 - #54831 (NLL is missing struct field suggestion)
 - #54848 (Better Diagnostic for Trait Object Capture)
 - #54850 (Fix #54707 - parse_trait_item_ now handles interpolated blocks as function body decls)
 - #54860 (Add doc comments about safest way to initialize a vector of zeros)
 - #54869 (Fix mobile docs)
 - #54891 (Fix tracking issue for Once::is_completed)
 - #54893 (Fix internal compiler error on malformed match arm pattern.)
 - #54904 (Stabilize the `Option::replace` method)
 - #54913 (doc fix: it's auto traits that make for automatic implementations)
 - #54917 (Unused result warning: "X which must" ↦ "X that must")
 - #54920 (Fix handling of #[must_use] on unit and uninhabited types)
 - #54936 (impl Eq+Hash for TyLayout)

Failed merges:

r? @ghost

Manishearth added a commit to Manishearth/rust that referenced this pull request Oct 10, 2018

Rollup merge of rust-lang#54848 - davidtwco:issue-52663-trait-object,…
… r=nikomatsakis

Better Diagnostic for Trait Object Capture

Part of rust-lang#52663.

This commit enhances `LaterUseKind` detection to identify when a borrow
is captured by a trait object which helps explain why there is a borrow
error.

r? @nikomatsakis
cc @pnkfelix

Manishearth added a commit to Manishearth/rust that referenced this pull request Oct 10, 2018

Rollup merge of rust-lang#54848 - davidtwco:issue-52663-trait-object,…
… r=nikomatsakis

Better Diagnostic for Trait Object Capture

Part of rust-lang#52663.

This commit enhances `LaterUseKind` detection to identify when a borrow
is captured by a trait object which helps explain why there is a borrow
error.

r? @nikomatsakis
cc @pnkfelix

bors added a commit that referenced this pull request Oct 10, 2018

Auto merge of #54969 - Manishearth:rollup, r=Manishearth
Rollup of 9 pull requests

Successful merges:

 - #54747 (codegen_llvm: verify that inline assembly operands are scalars)
 - #54848 (Better Diagnostic for Trait Object Capture)
 - #54850 (Fix #54707 - parse_trait_item_ now handles interpolated blocks as function body decls)
 - #54858 (second round of refactorings for universes)
 - #54862 (Implement RFC 2539: cfg_attr with multiple attributes)
 - #54869 (Fix mobile docs)
 - #54870 (Stabilize tool lints)
 - #54893 (Fix internal compiler error on malformed match arm pattern.)
 - #54904 (Stabilize the `Option::replace` method)

Failed merges:

 - #54909 ( Add chalk rules related to associated type defs)

r? @ghost

Manishearth added a commit to Manishearth/rust that referenced this pull request Oct 10, 2018

bors added a commit that referenced this pull request Oct 11, 2018

Auto merge of #54969 - Manishearth:rollup, r=Manishearth
Rollup of 9 pull requests

Successful merges:

 - #54747 (codegen_llvm: verify that inline assembly operands are scalars)
 - #54848 (Better Diagnostic for Trait Object Capture)
 - #54850 (Fix #54707 - parse_trait_item_ now handles interpolated blocks as function body decls)
 - #54858 (second round of refactorings for universes)
 - #54862 (Implement RFC 2539: cfg_attr with multiple attributes)
 - #54869 (Fix mobile docs)
 - #54870 (Stabilize tool lints)
 - #54893 (Fix internal compiler error on malformed match arm pattern.)
 - #54904 (Stabilize the `Option::replace` method)

Failed merges:

 - #54909 ( Add chalk rules related to associated type defs)

r? @ghost
@bors

This comment has been minimized.

Show comment
Hide comment
@bors

bors Oct 11, 2018

Contributor

⌛️ Testing commit 72911fb with merge 9746a2d...

Contributor

bors commented Oct 11, 2018

⌛️ Testing commit 72911fb with merge 9746a2d...

bors added a commit that referenced this pull request Oct 11, 2018

Auto merge of #54848 - davidtwco:issue-52663-trait-object, r=nikomats…
…akis

Better Diagnostic for Trait Object Capture

Part of #52663.

This commit enhances `LaterUseKind` detection to identify when a borrow
is captured by a trait object which helps explain why there is a borrow
error.

r? @nikomatsakis
cc @pnkfelix
@bors

This comment has been minimized.

Show comment
Hide comment
@bors

bors Oct 11, 2018

Contributor

☀️ Test successful - status-appveyor, status-travis
Approved by: nikomatsakis
Pushing 9746a2d to master...

Contributor

bors commented Oct 11, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: nikomatsakis
Pushing 9746a2d to master...

bors added a commit that referenced this pull request Oct 11, 2018

Auto merge of #54969 - Manishearth:rollup, r=Manishearth
Rollup of 9 pull requests

Successful merges:

 - #54747 (codegen_llvm: verify that inline assembly operands are scalars)
 - #54848 (Better Diagnostic for Trait Object Capture)
 - #54850 (Fix #54707 - parse_trait_item_ now handles interpolated blocks as function body decls)
 - #54858 (second round of refactorings for universes)
 - #54862 (Implement RFC 2539: cfg_attr with multiple attributes)
 - #54869 (Fix mobile docs)
 - #54870 (Stabilize tool lints)
 - #54893 (Fix internal compiler error on malformed match arm pattern.)
 - #54904 (Stabilize the `Option::replace` method)

Failed merges:

 - #54909 ( Add chalk rules related to associated type defs)

r? @ghost

@bors bors merged commit 72911fb into rust-lang:master Oct 11, 2018

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details

@davidtwco davidtwco deleted the davidtwco:issue-52663-trait-object branch Oct 11, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment