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

Rename all mentions of nil to unit #54095

Merged
merged 14 commits into from
Sep 14, 2018
Merged

Conversation

kenta7777
Copy link
Contributor

@kenta7777 kenta7777 commented Sep 10, 2018

Fixes #53719.

Renamed keywords nil to unit.

@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @davidtwco (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.

@rust-highfive
Copy link
Collaborator

⚠️ Warning ⚠️

  • These commits modify submodules.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 10, 2018
@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-5.0 of your PR failed on Travis (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.
[00:02:04] extracting /checkout/obj/build/cache/2018-08-01/cargo-beta-x86_64-unknown-linux-gnu.tar.gz
[00:02:04] error: failed to resolve patches for `https://github.com/rust-lang-nursery/rust-clippy`
[00:02:04] 
[00:02:04] Caused by:
[00:02:04]   patch for `clippy_lints` in `https://github.com/rust-lang-nursery/rust-clippy` did not resolve to any crates. If this is unexpected, you may wish to consult: https://github.com/rust-lang/cargo/issues/4678
[00:02:04] failed to run: /checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo build --manifest-path /checkout/src/bootstrap/Cargo.toml --locked
[00:02:04] make: *** [prepare] Error 1
[00:02:04] Makefile:81: recipe for target 'prepare' failed
[00:02:05] Command failed. Attempt 2/5:
[00:02:05] error: failed to resolve patches for `https://github.com/rust-lang/cargo`
[00:02:05] error: failed to resolve patches for `https://github.com/rust-lang/cargo`
[00:02:05] 
[00:02:05] Caused by:
[00:02:05]   patch for `cargo` in `https://github.com/rust-lang/cargo` did not resolve to any crates. If this is unexpected, you may wish to consult: https://github.com/rust-lang/cargo/issues/4678
[00:02:05] failed to run: /checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo build --manifest-path /checkout/src/bootstrap/Cargo.toml --locked
[00:02:05] Makefile:81: recipe for target 'prepare' failed
[00:02:05] make: *** [prepare] Error 1
[00:02:07] Command failed. Attempt 3/5:
[00:02:07] error: failed to resolve patches for `https://github.com/rust-lang/cargo`
[00:02:07] error: failed to resolve patches for `https://github.com/rust-lang/cargo`
[00:02:07] 
[00:02:07] Caused by:
[00:02:07]   patch for `cargo` in `https://github.com/rust-lang/cargo` did not resolve to any crates. If this is unexpected, you may wish to consult: https://github.com/rust-lang/cargo/issues/4678
[00:02:07] failed to run: /checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo build --manifest-path /checkout/src/bootstrap/Cargo.toml --locked
[00:02:07] make: *** [prepare] Error 1
[00:02:07] Makefile:81: recipe for target 'prepare' failed
[00:02:10] Command failed. Attempt 4/5:
[00:02:10] error: failed to resolve patches for `https://github.com/rust-lang/crates.io-index`
[00:02:10] error: failed to resolve patches for `https://github.com/rust-lang/crates.io-index`
[00:02:10] 
[00:02:10] Caused by:
[00:02:10]   patch for `rustfmt-nightly` in `https://github.com/rust-lang/crates.io-index` did not resolve to any crates. If this is unexpected, you may wish to consult: https://github.com/rust-lang/cargo/issues/4678
[00:02:10] failed to run: /checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo build --manifest-path /checkout/src/bootstrap/Cargo.toml --locked
[00:02:10] make: *** [prepare] Error 1
[00:02:10] Makefile:81: recipe for target 'prepare' failed
[00:02:14] Command failed. Attempt 5/5:
[00:02:14] error: failed to resolve patches for `https://github.com/rust-lang/cargo`
[00:02:14] error: failed to resolve patches for `https://github.com/rust-lang/cargo`
[00:02:14] 
[00:02:14] Caused by:
[00:02:14]   patch for `cargo` in `https://github.com/rust-lang/cargo` did not resolve to any crates. If this is unexpected, you may wish to consult: https://github.com/rust-lang/cargo/issues/4678
[00:02:14] failed to run: /checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo build --manifest-path /checkout/src/bootstrap/Cargo.toml --locked
[00:02:14] make: *** [prepare] Error 1
[00:02:14] Makefile:81: recipe for target 'prepare' failed
[00:02:14] The command has failed after 5 attempts.
travis_time:end:04ac2630:start=1536547046979439518,finish=1536547181764334898,duration=134784895380
---
travis_time:end:18ce3a66:start=1536547182265977098,finish=1536547182276325278,duration=10348180
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:221efcd1
$ ln -s . checkout && for CORE in obj/cores/core.*; do EXE=$(echo $CORE | sed 's|obj/cores/core\.[0-9]*\.!checkout!\(.*\)|\1|;y|!|/|'); if [ -f "$EXE" ]; then printf travis_fold":start:crashlog\n\033[31;1m%s\033[0m\n" "$CORE"; gdb -q -c "$CORE" "$EXE" -iex 'set auto-load off' -iex 'dir src/' -iex 'set sysroot .' -ex bt -ex q; echo travis_fold":"end:crashlog; fi; done || true
travis_fold:end:after_failure.4
travis_fold:start:after_failure.5
travis_time:start:117736f0
travis_time:start:117736f0
$ cat ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers || true
cat: ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers: No such file or directory
travis_fold:end:after_failure.5
travis_fold:start:after_failure.6
travis_time:start:15902808
$ dmesg | grep -i kill

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)

@kenta7777
Copy link
Contributor Author

#53719

@scottmcm
Copy link
Member

This seems to have a bunch of surprising submodule changes?

Copy link
Member

@davidtwco davidtwco left a comment

Choose a reason for hiding this comment

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

Thanks for the PR @kenta7777!

The change from nil to unit seems fine to me (cc @nikomatsakis) but like @scottmcm said, I'm not sure why there are submodule changes? - these seem unrelated to #53719.

@bors
Copy link
Contributor

bors commented Sep 10, 2018

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

@kenta7777 kenta7777 changed the title Kenta7777#53719 Rename all mentions of nil to unit Sep 10, 2018
@kenta7777
Copy link
Contributor Author

@davidtwco @scottmcm Thank you for your review and comment. I had changed the submodule code by mistake. I will fix and send pull request again.

@kenta7777
Copy link
Contributor Author

I reverted my commits about changing submodule codes and committed mk_nil to mk_unit change only.

@davidtwco
Copy link
Member

@kenta7777 This is looking really great. I've spotted a handful of other places in the compiler (such as those below) where there are still references to nil:

rust/src/librustc/ty/sty.rs

Lines 1461 to 1466 in 7f81604

pub fn is_nil(&self) -> bool {
match self.sty {
Tuple(ref tys) => tys.is_empty(),
_ => false,
}
}

#[inline]
fn emit_nil(&mut self) -> EncodeResult {
Ok(())
}

If you could tackle these (and any remaining references to nil that I missed - perhaps run a grep) and maybe squash some of your commits down to one or two then that'd be great!

@kenta7777
Copy link
Contributor Author

@davidtwco Thank you for your prompt response. I'll tackle with at least is_nil and emit_nil.

@nikomatsakis
Copy link
Contributor

I think this seems fine — I agree that "nil" isn't really standard Rust terminology these days.

Nice job @davidtwco catching the missing cases.

@davidtwco
Copy link
Member

Great work @kenta7777!

@bors r+

@bors
Copy link
Contributor

bors commented Sep 11, 2018

📌 Commit 8134ee2 has been approved by davidtwco

@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 Sep 11, 2018
@bors
Copy link
Contributor

bors commented Sep 11, 2018

☔ The latest upstream changes (presumably #53873) 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 Sep 11, 2018
@davidtwco
Copy link
Member

@kenta7777 Looks like you need to rebase this. Consider squashing to fewer commits when doing so. Once you do I'll take another look and re-approve.

@kenta7777
Copy link
Contributor Author

@davidtwco I rebased this and resolved the merge conflicts.

@davidtwco
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Sep 12, 2018

📌 Commit 26dbf56 has been approved by davidtwco

@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 Sep 12, 2018
kennytm added a commit to kennytm/rust that referenced this pull request Sep 14, 2018
Rename all mentions of `nil` to `unit`

Fixes rust-lang#53719.

Renamed keywords nil to unit.
bors added a commit that referenced this pull request Sep 14, 2018
Rollup of 8 pull requests

Successful merges:

 - #53218 (Add a implementation of `From` for converting `&'a Option<T>` into `Option<&'a T>`)
 - #54024 (Fix compiling some rustc crates to wasm)
 - #54095 (Rename all mentions of `nil` to `unit`)
 - #54173 (Suggest valid crate type if invalid crate type is found)
 - #54194 (Remove println!() statement from HashMap unit test)
 - #54203 (Fix the stable release of os_str_str_ref_eq)
 - #54207 (re-mark the never docs as unstable)
 - #54210 (Update Cargo)

Failed merges:

r? @ghost
@bors bors merged commit 26dbf56 into rust-lang:master Sep 14, 2018
@kenta7777
Copy link
Contributor Author

Thanks!

@kenta7777 kenta7777 deleted the kenta7777#53719 branch September 14, 2018 12:17
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.

6 participants