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

Add support for bound types #55330

Merged
merged 11 commits into from
Nov 3, 2018
Merged

Add support for bound types #55330

merged 11 commits into from
Nov 3, 2018

Conversation

scalexm
Copy link
Member

@scalexm scalexm commented Oct 24, 2018

This PR may have some slight performance impacts, I don't know how hot is the code I touched.

Also, this breaks clippy and miri.

r? @nikomatsakis

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 24, 2018
@estebank
Copy link
Contributor

@bors try

@bors
Copy link
Contributor

bors commented Oct 24, 2018

⌛ Trying commit 235c848 with merge 2b86a36d9530d0a26855c5a8ec6759e21fce2efc...

@bors
Copy link
Contributor

bors commented Oct 25, 2018

☀️ Test successful - status-travis
State: approved= try=True

@estebank
Copy link
Contributor

@rust-timer build 2b86a36

@rust-timer
Copy link
Collaborator

Insufficient permissions to issue commands to rust-timer.

@Mark-Simulacrum
Copy link
Member

@rust-timer build 2b86a36

@rust-timer
Copy link
Collaborator

Please provide the full 40 character commit hash.

@Mark-Simulacrum
Copy link
Member

@rust-timer build 2b86a36d9530d0a26855c5a8ec6759e21fce2efc

@rust-timer
Copy link
Collaborator

Success: Queued 2b86a36d9530d0a26855c5a8ec6759e21fce2efc with parent f99911a, comparison URL.

@rust-timer
Copy link
Collaborator

Finished benchmarking try commit 2b86a36d9530d0a26855c5a8ec6759e21fce2efc

Copy link
Contributor

@nikomatsakis nikomatsakis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Left some nits.

let r2 = substitute_value(self.tcx, &result_subst, &r2);
if k1 != r2.into() {
Some(ty::Binder::bind(ty::OutlivesPredicate(k1, r2)))
let ty::OutlivesPredicate(k1, r2) = r_c.skip_binder(); // reconstructed below
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All this binder shuffling feels a bit complex. I think I micro-optimized this, though not necessarily for very good reason. Mostly I think I was trying to avoid allocating a whole vector of substituted results and instead substitute them lazilly. I wonder if it'd be simpler to do:

let r_c = substitute_value(self.tcx, &result_substs, r_c);

// Screen out `'a: 'a` cases -- we skip the binder here but
// only care the inner values to one another, so they are still at
// consistent binding levels.
let ty::OutlivesPredicate(k1, r2) = r_c.skip_binder();
if k1 != r2.into() {
    Some(r_c)
} else {
    None
}

/// regions with anonymous late bound regions. This method asserts that
/// we have an anonymous late bound region, which hence may refer to
/// a canonical variable.
pub fn as_bound_var(&self) -> BoundVar {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we call this assert_bound_var()? I forget how consistently we use this convention, but I like it (since you are not returning an Option here...)

@nikomatsakis
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Oct 25, 2018

📌 Commit 2b205dc has been approved by nikomatsakis

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 25, 2018
Mark-Simulacrum added a commit to Mark-Simulacrum/rust that referenced this pull request Oct 27, 2018
Add support for bound types

This PR may have some slight performance impacts, I don't know how hot is the code I touched.

Also, this breaks clippy and miri.

r? @nikomatsakis
@bors
Copy link
Contributor

bors commented Nov 2, 2018

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

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Nov 2, 2018
@scalexm
Copy link
Member Author

scalexm commented Nov 2, 2018

@bors r=nikomatsakis

@bors
Copy link
Contributor

bors commented Nov 2, 2018

📌 Commit a38a6d09b101dfe0afa1ef9475ed71cd78a9e203 has been approved by nikomatsakis

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Nov 2, 2018
@scalexm
Copy link
Member Author

scalexm commented Nov 3, 2018

@bors r=nikomatsakis p=1

@bors
Copy link
Contributor

bors commented Nov 3, 2018

📌 Commit c5ed72f has been approved by nikomatsakis

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Nov 3, 2018
@scalexm
Copy link
Member Author

scalexm commented Nov 3, 2018

The failure above comes from a renaming that I made in this PR. It went unnoticed because my branch was not even with rust's master, hence some recently added commits were still using the "old" name.

I'm setting p=1 to prevent this from happening again

@bors
Copy link
Contributor

bors commented Nov 3, 2018

⌛ Testing commit c5ed72f with merge 2ad8c7b...

bors added a commit that referenced this pull request Nov 3, 2018
Add support for bound types

This PR may have some slight performance impacts, I don't know how hot is the code I touched.

Also, this breaks clippy and miri.

r? @nikomatsakis
@bors
Copy link
Contributor

bors commented Nov 3, 2018

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

@bors bors merged commit c5ed72f into rust-lang:master Nov 3, 2018
@rust-highfive
Copy link
Collaborator

📣 Toolstate changed by #55330!

Tested on commit 2ad8c7b.
Direct link to PR: #55330

💔 clippy-driver on windows: test-pass → build-fail (cc @Manishearth @llogiq @mcarton @oli-obk, @rust-lang/infra).
💔 clippy-driver on linux: test-pass → build-fail (cc @Manishearth @llogiq @mcarton @oli-obk, @rust-lang/infra).
💔 rls on windows: test-pass → build-fail (cc @nrc, @rust-lang/infra).
💔 rls on linux: test-pass → build-fail (cc @nrc, @rust-lang/infra).

rust-highfive added a commit to rust-lang-nursery/rust-toolstate that referenced this pull request Nov 3, 2018
Tested on commit rust-lang/rust@2ad8c7b.
Direct link to PR: <rust-lang/rust#55330>

💔 clippy-driver on windows: test-pass → build-fail (cc @Manishearth @llogiq @mcarton @oli-obk, @rust-lang/infra).
💔 clippy-driver on linux: test-pass → build-fail (cc @Manishearth @llogiq @mcarton @oli-obk, @rust-lang/infra).
💔 rls on windows: test-pass → build-fail (cc @nrc, @rust-lang/infra).
💔 rls on linux: test-pass → build-fail (cc @nrc, @rust-lang/infra).
@scalexm scalexm deleted the bound-ty branch November 3, 2018 15:15
@scalexm
Copy link
Member Author

scalexm commented Nov 3, 2018

📣 Toolstate changed by #55330!

Tested on commit 2ad8c7b.
Direct link to PR: #55330

💔 clippy-driver on windows: test-pass → build-fail (cc @Manishearth @llogiq @mcarton @oli-obk, @rust-lang/infra).
💔 clippy-driver on linux: test-pass → build-fail (cc @Manishearth @llogiq @mcarton @oli-obk, @rust-lang/infra).
💔 rls on windows: test-pass → build-fail (cc @nrc, @rust-lang/infra).
💔 rls on linux: test-pass → build-fail (cc @nrc, @rust-lang/infra).

I'll open PRs to fix what I broke :p

matthiaskrgr added a commit to matthiaskrgr/rust-clippy that referenced this pull request Nov 3, 2018
bors bot added a commit to rust-lang/rust-clippy that referenced this pull request Nov 3, 2018
3404: rustup rust-lang/rust#55330 r=phansch a=matthiaskrgr



Co-authored-by: Matthias Krüger <matthias.krueger@famsik.de>
bors bot added a commit to rust-lang/rust-clippy that referenced this pull request Nov 3, 2018
3404: rustup rust-lang/rust#55330 r=phansch a=matthiaskrgr



Co-authored-by: Matthias Krüger <matthias.krueger@famsik.de>
phansch added a commit to rust-lang/rust-clippy that referenced this pull request Nov 3, 2018
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Nov 3, 2018
Should fix clippy toolstat.

Changes:

````
rustup rust-lang#55330
Update stderr
Rename test files
Also lint cfg_attr(.., rustfmt::skip)
Add tests from rustfmt::skip test file
Run update_lints.py script
Add test for non-crate-level inner attributes
Differ between inner and outer attributes
Add tests
Add cfg_attr(rustfmt) lint
Addressed comments.
Fix dogfood error.
Added lints `into_iter_on_ref` and `into_iter_on_array`. Fix rust-lang#1565.
Allow single_match_else
Update stderr
Add copyright statement©
Fix typos
Fix dogfood error
Fix typo and indentation
run update_lints script
Add tests for unknwon_clippy_lints lint
Add new lint: unknwon_clippy_lintsg
clippy: fix pedantic warnings and run clippy::pedantic lints on the codebase.
Fix a false-positive of needless_borrow
UI test cleanup: Extract match_overlapping_arm tests
UI test cleanup: Extract expect_fun_call tests
Add missing code of conduct file
Use slice patterns instead of padding
Fix dogfood and pedantic lints
ci: when installing rust-toolchain-installer-master, install it in debug mode to save some time in ci.
RIIR update lints: Generate deprecated lints
Replace big if/else expression with match
````
bors added a commit that referenced this pull request Nov 3, 2018
submodules: update clippy from a20599a to 71ec4ff

Should fix clippy toolstat.

Changes:

````
rustup #55330
Update stderr
Rename test files
Also lint cfg_attr(.., rustfmt::skip)
Add tests from rustfmt::skip test file
Run update_lints.py script
Add test for non-crate-level inner attributes
Differ between inner and outer attributes
Add tests
Add cfg_attr(rustfmt) lint
Addressed comments.
Fix dogfood error.
Added lints `into_iter_on_ref` and `into_iter_on_array`. Fix #1565.
Allow single_match_else
Update stderr
Add copyright statement©
Fix typos
Fix dogfood error
Fix typo and indentation
run update_lints script
Add tests for unknwon_clippy_lints lint
Add new lint: unknwon_clippy_lintsg
clippy: fix pedantic warnings and run clippy::pedantic lints on the codebase.
Fix a false-positive of needless_borrow
UI test cleanup: Extract match_overlapping_arm tests
UI test cleanup: Extract expect_fun_call tests
Add missing code of conduct file
Use slice patterns instead of padding
Fix dogfood and pedantic lints
ci: when installing rust-toolchain-installer-master, install it in debug mode to save some time in ci.
RIIR update lints: Generate deprecated lints
Replace big if/else expression with match
````
flip1995 pushed a commit to flip1995/rust-clippy that referenced this pull request May 5, 2020
Should fix clippy toolstat.

Changes:

````
rustup rust-lang/rust#55330
Update stderr
Rename test files
Also lint cfg_attr(.., rustfmt::skip)
Add tests from rustfmt::skip test file
Run update_lints.py script
Add test for non-crate-level inner attributes
Differ between inner and outer attributes
Add tests
Add cfg_attr(rustfmt) lint
Addressed comments.
Fix dogfood error.
Added lints `into_iter_on_ref` and `into_iter_on_array`. Fix rust-lang#1565.
Allow single_match_else
Update stderr
Add copyright statement©
Fix typos
Fix dogfood error
Fix typo and indentation
run update_lints script
Add tests for unknwon_clippy_lints lint
Add new lint: unknwon_clippy_lintsg
clippy: fix pedantic warnings and run clippy::pedantic lints on the codebase.
Fix a false-positive of needless_borrow
UI test cleanup: Extract match_overlapping_arm tests
UI test cleanup: Extract expect_fun_call tests
Add missing code of conduct file
Use slice patterns instead of padding
Fix dogfood and pedantic lints
ci: when installing rust-toolchain-installer-master, install it in debug mode to save some time in ci.
RIIR update lints: Generate deprecated lints
Replace big if/else expression with match
````
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants