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

Implement padding for IpAddr without heap alloc #67035

Merged
merged 1 commit into from Dec 27, 2019

Conversation

@Goirad
Copy link
Contributor

Goirad commented Dec 4, 2019

Implements padding for IpAddrs without heap allocations.
This fixes issue #66810 .

cc @jethrogb @mzohreva

@rust-highfive

This comment has been minimized.

Copy link
Collaborator

rust-highfive commented Dec 4, 2019

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @shepmaster (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@Goirad Goirad force-pushed the Goirad:implement-ipadd-padding branch from 1db21c6 to 757014f Dec 4, 2019
src/libstd/net/ip.rs Outdated Show resolved Hide resolved
src/libstd/net/ip.rs Outdated Show resolved Hide resolved
@Goirad Goirad force-pushed the Goirad:implement-ipadd-padding branch from 757014f to f89a0b5 Dec 5, 2019
@rust-highfive

This comment has been minimized.

Copy link
Collaborator

rust-highfive commented Dec 5, 2019

The job mingw-check of your PR failed (pretty log, 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.
2019-12-05T16:49:03.7639200Z ##[command]git remote add origin https://github.com/rust-lang/rust
2019-12-05T16:49:03.7653274Z ##[command]git config gc.auto 0
2019-12-05T16:49:03.7657650Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2019-12-05T16:49:03.7662685Z ##[command]git config --get-all http.proxy
2019-12-05T16:49:03.7668095Z ##[command]git -c http.extraheader="AUTHORIZATION: basic ***" fetch --force --tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/*:refs/remotes/origin/* +refs/pull/67035/merge:refs/remotes/pull/67035/merge
---
2019-12-05T16:54:21.1379284Z     Checking panic_unwind v0.0.0 (/checkout/src/libpanic_unwind)
2019-12-05T16:54:22.0022176Z error: expected identifier, found keyword `const`
2019-12-05T16:54:22.0022589Z    --> src/libstd/net/ip.rs:841:13
2019-12-05T16:54:22.0022906Z     |
2019-12-05T16:54:22.0023295Z 841 |         let const IPV4_BUF_LEN = 16; // Long enough for the longest possible IPv4 address
2019-12-05T16:54:22.0023964Z     |
2019-12-05T16:54:22.0024271Z help: you can escape reserved keywords to use them as identifiers
2019-12-05T16:54:22.0024544Z     |
2019-12-05T16:54:22.0024544Z     |
2019-12-05T16:54:22.0025267Z 841 |         let r#const IPV4_BUF_LEN = 16; // Long enough for the longest possible IPv4 address
2019-12-05T16:54:22.0025905Z 
2019-12-05T16:54:22.0025905Z 
2019-12-05T16:54:22.0026247Z error: expected one of `:`, `;`, `=`, `@`, or `|`, found `IPV4_BUF_LEN`
2019-12-05T16:54:22.0026771Z     |
2019-12-05T16:54:22.0026771Z     |
2019-12-05T16:54:22.0027165Z 841 |         let const IPV4_BUF_LEN = 16; // Long enough for the longest possible IPv4 address
2019-12-05T16:54:22.0027576Z     |                   ^^^^^^^^^^^^ expected one of `:`, `;`, `=`, `@`, or `|` here
2019-12-05T16:54:22.0045143Z error: expected identifier, found keyword `const`
2019-12-05T16:54:22.0045501Z     --> src/libstd/net/ip.rs:1500:13
2019-12-05T16:54:22.0045755Z      |
2019-12-05T16:54:22.0045755Z      |
2019-12-05T16:54:22.0046107Z 1500 |         let const IPV6_BUF_LEN = 48;
2019-12-05T16:54:22.0046725Z      |
2019-12-05T16:54:22.0047054Z help: you can escape reserved keywords to use them as identifiers
2019-12-05T16:54:22.0047296Z      |
2019-12-05T16:54:22.0047296Z      |
2019-12-05T16:54:22.0047624Z 1500 |         let r#const IPV6_BUF_LEN = 48;
2019-12-05T16:54:22.0052307Z 
2019-12-05T16:54:22.0052307Z 
2019-12-05T16:54:22.0057107Z error: expected one of `:`, `;`, `=`, `@`, or `|`, found `IPV6_BUF_LEN`
2019-12-05T16:54:22.0057714Z      |
2019-12-05T16:54:22.0057714Z      |
2019-12-05T16:54:22.0058031Z 1500 |         let const IPV6_BUF_LEN = 48;
2019-12-05T16:54:22.0058451Z      |                   ^^^^^^^^^^^^ expected one of `:`, `;`, `=`, `@`, or `|` here
2019-12-05T16:54:22.9267733Z error: unused import: `crate::io::Write`
2019-12-05T16:54:22.9269074Z   --> src/libstd/net/ip.rs:11:5
2019-12-05T16:54:22.9269665Z    |
2019-12-05T16:54:22.9270210Z 11 | use crate::io::Write;
---
2019-12-05T16:54:25.1944196Z   local time: Thu Dec  5 16:54:25 UTC 2019
2019-12-05T16:54:25.4620394Z   network time: Thu, 05 Dec 2019 16:54:25 GMT
2019-12-05T16:54:25.4623664Z == end clock drift check ==
2019-12-05T16:54:32.0217703Z 
2019-12-05T16:54:32.0324723Z ##[error]Bash exited with code '1'.
2019-12-05T16:54:32.0354310Z ##[section]Starting: Checkout
2019-12-05T16:54:32.0356071Z ==============================================================================
2019-12-05T16:54:32.0356133Z Task         : Get sources
2019-12-05T16:54:32.0356205Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.

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)

@Goirad Goirad force-pushed the Goirad:implement-ipadd-padding branch from f89a0b5 to 64fee0a Dec 5, 2019
src/libstd/net/ip.rs Outdated Show resolved Hide resolved
src/libstd/net/ip.rs Outdated Show resolved Hide resolved
@Goirad Goirad force-pushed the Goirad:implement-ipadd-padding branch from 64fee0a to fbf91e5 Dec 6, 2019
@rust-highfive

This comment has been minimized.

Copy link
Collaborator

rust-highfive commented Dec 6, 2019

The job x86_64-gnu-llvm-7 of your PR failed (pretty log, 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.
2019-12-06T18:51:46.7039288Z ##[command]git remote add origin https://github.com/rust-lang/rust
2019-12-06T18:51:46.7179595Z ##[command]git config gc.auto 0
2019-12-06T18:51:46.7262575Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2019-12-06T18:51:46.7315303Z ##[command]git config --get-all http.proxy
2019-12-06T18:51:46.7456295Z ##[command]git -c http.extraheader="AUTHORIZATION: basic ***" fetch --force --tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/*:refs/remotes/origin/* +refs/pull/67035/merge:refs/remotes/pull/67035/merge
---
2019-12-06T18:57:35.5858739Z    Compiling serde_json v1.0.40
2019-12-06T18:57:37.2387426Z    Compiling tidy v0.1.0 (/checkout/src/tools/tidy)
2019-12-06T18:57:47.7351169Z     Finished release [optimized] target(s) in 1m 23s
2019-12-06T18:57:47.7448552Z tidy check
2019-12-06T18:57:48.8490592Z tidy error: /checkout/src/libstd/net/ip.rs:1923: line longer than 100 chars
2019-12-06T18:57:50.4417648Z some tidy checks failed
2019-12-06T18:57:50.4427586Z Found 486 error codes
2019-12-06T18:57:50.4430084Z Found 0 error codes with no tests
2019-12-06T18:57:50.4430413Z Done!
2019-12-06T18:57:50.4430413Z Done!
2019-12-06T18:57:50.4430736Z 
2019-12-06T18:57:50.4430932Z 
2019-12-06T18:57:50.4433307Z command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/tidy" "/checkout/src" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "--no-vendor"
2019-12-06T18:57:50.4433459Z 
2019-12-06T18:57:50.4433504Z 
2019-12-06T18:57:50.4445286Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test src/tools/tidy
2019-12-06T18:57:50.4445371Z Build completed unsuccessfully in 0:01:27
2019-12-06T18:57:50.4445371Z Build completed unsuccessfully in 0:01:27
2019-12-06T18:57:50.4493628Z == clock drift check ==
2019-12-06T18:57:50.4504571Z   local time: Fri Dec  6 18:57:50 UTC 2019
2019-12-06T18:57:50.4677549Z   network time: Fri, 06 Dec 2019 18:57:50 GMT
2019-12-06T18:57:50.4681787Z == end clock drift check ==
2019-12-06T18:57:51.8729037Z 
2019-12-06T18:57:51.8857354Z ##[error]Bash exited with code '1'.
2019-12-06T18:57:51.8885090Z ##[section]Starting: Checkout
2019-12-06T18:57:51.8886676Z ==============================================================================
2019-12-06T18:57:51.8886749Z Task         : Get sources
2019-12-06T18:57:51.8886795Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.

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)

@Goirad Goirad force-pushed the Goirad:implement-ipadd-padding branch from fbf91e5 to 7e711fc Dec 6, 2019
@Goirad

This comment has been minimized.

Copy link
Contributor Author

Goirad commented Dec 11, 2019

@shepmaster Any thoughts on this?

@llogiq

This comment has been minimized.

Copy link
Contributor

llogiq commented Dec 13, 2019

shepmaster appears to be busy, I'd suggest someone else @rust-lang/libs review this. To me personally, the implementation looks good, but I don't know if I can r+ this (I've only recently been added to the org and no one explained to me how this works yet).

@shepmaster

This comment has been minimized.

Copy link
Member

shepmaster commented Dec 13, 2019

Let's pick someone else from libs, indeed... RNG says:

r? @SimonSapin

@dtolnay

This comment has been minimized.

Copy link
Member

dtolnay commented Dec 13, 2019

FYI please don't ping @SimonSapin unless they are specifically the best person to review. #66341 (comment)

r? @dtolnay

@rust-highfive rust-highfive assigned dtolnay and unassigned SimonSapin Dec 13, 2019
src/libstd/net/ip.rs Outdated Show resolved Hide resolved
src/libstd/net/ip.rs Outdated Show resolved Hide resolved
@dtolnay

This comment has been minimized.

Copy link
Member

dtolnay commented Dec 13, 2019

LGTM once there is a test.

@Goirad Goirad force-pushed the Goirad:implement-ipadd-padding branch from 7e711fc to 5852426 Dec 13, 2019
Copy link
Member

dtolnay left a comment

Looks good. Thanks!

@dtolnay

This comment has been minimized.

Copy link
Member

dtolnay commented Dec 13, 2019

@bors r+

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Dec 13, 2019

📌 Commit 5852426 has been approved by dtolnay

@dtolnay

This comment has been minimized.

Copy link
Member

dtolnay commented Dec 13, 2019

Make sure your work email is listed in https://github.com/settings/emails if you want this commit attributed to your GitHub account.

@Goirad

This comment has been minimized.

Copy link
Contributor Author

Goirad commented Dec 13, 2019

@dtolnay Thanks for the heads up, I didn't even realize this was a thing

@Goirad Goirad force-pushed the Goirad:implement-ipadd-padding branch from 5852426 to a34a96f Dec 13, 2019
@SimonSapin

This comment has been minimized.

Copy link
Contributor

SimonSapin commented Dec 14, 2019

@shepmaster

This comment has been minimized.

Copy link
Member

shepmaster commented Dec 14, 2019

for finding reviewers

Thanks. I tend to just look at the teams page; perhaps it's silly of me to assume they are identical, but the web page is way easier to find.

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Dec 23, 2019

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

@Goirad Goirad force-pushed the Goirad:implement-ipadd-padding branch from a34a96f to 32d6a45 Dec 26, 2019
@Goirad Goirad force-pushed the Goirad:implement-ipadd-padding branch from 32d6a45 to 915686d Dec 26, 2019
@SimonSapin

This comment has been minimized.

Copy link
Contributor

SimonSapin commented Dec 27, 2019

@shepmaster I’ve opened rust-lang/highfive#241 for a potential way to make that easier.

@Goirad

This comment has been minimized.

Copy link
Contributor Author

Goirad commented Dec 27, 2019

@dtolnay I'm not sure if it actually makes a difference for bors, but I think this should be waiting-on-bors instead of waiting-on-author

@dtolnay

This comment has been minimized.

Copy link
Member

dtolnay commented Dec 27, 2019

@bors r+

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Dec 27, 2019

📌 Commit 915686d has been approved by dtolnay

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Dec 27, 2019

⌛️ Testing commit 915686d with merge 74c4e6a...

bors added a commit that referenced this pull request Dec 27, 2019
Implement padding for IpAddr without heap alloc

Implements padding for `IpAddr`s without heap allocations.
This fixes issue #66810 .

cc @jethrogb @mzohreva
@bors

This comment has been minimized.

Copy link
Contributor

bors commented Dec 27, 2019

☀️ Test successful - checks-azure
Approved by: dtolnay
Pushing 74c4e6a to master...

@bors bors added the merged-by-bors label Dec 27, 2019
@bors bors merged commit 915686d into rust-lang:master Dec 27, 2019
5 checks passed
5 checks passed
homu Test successful
Details
pr Build #20191226.26 succeeded
Details
pr (Linux mingw-check) Linux mingw-check succeeded
Details
pr (Linux x86_64-gnu-llvm-7) Linux x86_64-gnu-llvm-7 succeeded
Details
pr (Linux x86_64-gnu-tools) Linux x86_64-gnu-tools succeeded
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.