-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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 epoch to edition #49035
rename epoch to edition #49035
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @cramertj (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. |
is there a preferred way of resolving merge conflicts, or can I do that however I want? |
Ah, I can already see there's a string that I missed. |
I've modified my script to replace all instances of
In doing a quick scan of this output, it looks like we've got everything now. Unless there is some weird casing of epoch hanging around. |
|
Ping from triage, @cramertj ! |
@klnusbaum you do have another merge conflict at this point.
I believe that in general, it's preferred if you rebase. (I'd personally also squash your "fix one more..." commit with the appropriate earlier commit. |
This seems fine to me so far, but it doesn't look like CI has been able to run successfully due to merge conflicts. |
66fa91d
to
7440257
Compare
Rebased and pushed. @bors r+ |
@klnusbaum I'll shepherd this from here, thanks for doing this! If you'd like, we need the same thing to be done on the cargo codebase. Note that the tests won't pass until this PR lands and is in a nightly, but you can start working on it earlier. |
@Manishearth sorry, just saw your message. I rebased, and did a little squashing. Hopefully that doesn't screw things up for you. I'll let you take it from here, but let me know if there's anything else you need :) |
Also, happy to take a crack at cargo. I'll make a new task in the cargo project :) |
I'd already rebased! 😄 Doesn't screw anything up, just need to re-r+ @bors r+ |
📌 Commit 11f1406 has been approved by |
@bors rollup |
rename epoch to edition As outlined in rust-lang#49001 we'd like to rename all instances of `epoch` to `edition`. I developed the following bash script to assist in the rename. It renames all instances of `epoch` to `edition` and `Epoch` to `Edition` in all of the files I was able to determine were relevant. It then renames a few relevant files that had `epoch` in there name and finally prints out all of the remaining instance of the strings `epoch` and `Epoch` (which, as far as I can tell should not be changed). Here is the script: ``` replace() { sed -i '' "s/epoch/edition/g" "$1" sed -i '' "s/Epoch/Edition/g" "$1" } replace "src/librustc/lint/context.rs" replace "src/librustc/lint/mod.rs" replace "src/librustc/session/config.rs" replace "src/librustc/session/mod.rs" replace "src/librustc_driver/driver.rs" replace "src/librustc_lint/lib.rs" replace "src/librustc_typeck/check/method/probe.rs" replace "src/libsyntax/config.rs" replace "src/libsyntax/epoch.rs" replace "src/libsyntax/feature_gate.rs" replace "src/libsyntax/lib.rs" replace "src/test/compile-fail/epoch-raw-pointer-method-2015.rs" replace "src/test/compile-fail/epoch-raw-pointer-method-2018.rs" replace "src/test/run-pass/dyn-trait.rs" replace "src/test/run-pass/epoch-gate-feature.rs" replace "src/test/ui/inference-variable-behind-raw-pointer.stderr" git mv src/libsyntax/epoch.rs src/libsyntax/edition.rs git mv src/test/compile-fail/epoch-raw-pointer-method-2015.rs src/test/compile-fail/edition-raw-pointer-method-2015.rs git mv src/test/compile-fail/epoch-raw-pointer-method-2018.rs src/test/compile-fail/edition-raw-pointer-method-2018.rs git grep "epoch" ./* git grep "Epoch" ./* ``` And here is the output of the script: ``` kurtis-rust$ ./epoch_to_edition.sh src/Cargo.lock: "crossbeam-epoch 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", src/Cargo.lock:name = "crossbeam-epoch" src/Cargo.lock:"checksum crossbeam-epoch 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "59796cc6cbbdc6bb319161349db0c3250ec73ec7fcb763a51065ec4e2e158552" src/ci/docker/scripts/android-start-emulator.sh:# Using the default qemu2 engine makes time::tests::since_epoch fails because src/ci/docker/scripts/android-start-emulator.sh:# the emulator date is set to unix epoch (in armeabi-v7a-18 image). Using src/librustc_incremental/persist/fs.rs: let micros_since_unix_epoch = u64::from_str_radix(s, INT_ENCODE_BASE as u32); src/librustc_incremental/persist/fs.rs: if micros_since_unix_epoch.is_err() { src/librustc_incremental/persist/fs.rs: let micros_since_unix_epoch = micros_since_unix_epoch.unwrap(); src/librustc_incremental/persist/fs.rs: let duration = Duration::new(micros_since_unix_epoch / 1_000_000, src/librustc_incremental/persist/fs.rs: 1000 * (micros_since_unix_epoch % 1_000_000) as u32); src/libstd/sys/cloudabi/abi/cloudabi.rs: /// The epoch of this clock is undefined. The absolute src/libstd/time.rs: let one_second_from_epoch = UNIX_EPOCH + Duration::new(1, 0); src/libstd/time.rs: let one_second_from_epoch2 = UNIX_EPOCH + Duration::new(0, 500_000_000) src/libstd/time.rs: assert_eq!(one_second_from_epoch, one_second_from_epoch2); src/libstd/time.rs: fn since_epoch() { src/test/run-pass/issue-29540.rs: pub mon_min_osdmap_epochs: String, src/test/run-pass/issue-29540.rs: pub mon_max_pgmap_epochs: String, src/test/run-pass/issue-29540.rs: pub mon_max_log_epochs: String, src/test/run-pass/issue-29540.rs: pub mon_max_mdsmap_epochs: String, src/test/run-pass/issue-29540.rs: pub osd_map_share_max_epochs: String, src/test/run-pass/issue-29540.rs: pub osd_pg_epoch_persisted_max_stale: String, ``` If it looks like I've missed any things that should be converted, please let me know. There were also some notes in `src/libsyntax/epoch.rs` that indicated there might be some necessary/parallel changes that need to made in cargo. But we should probably make a separate issue for that.
rename epoch to edition As outlined in rust-lang#49001 we'd like to rename all instances of `epoch` to `edition`. I developed the following bash script to assist in the rename. It renames all instances of `epoch` to `edition` and `Epoch` to `Edition` in all of the files I was able to determine were relevant. It then renames a few relevant files that had `epoch` in there name and finally prints out all of the remaining instance of the strings `epoch` and `Epoch` (which, as far as I can tell should not be changed). Here is the script: ``` replace() { sed -i '' "s/epoch/edition/g" "$1" sed -i '' "s/Epoch/Edition/g" "$1" } replace "src/librustc/lint/context.rs" replace "src/librustc/lint/mod.rs" replace "src/librustc/session/config.rs" replace "src/librustc/session/mod.rs" replace "src/librustc_driver/driver.rs" replace "src/librustc_lint/lib.rs" replace "src/librustc_typeck/check/method/probe.rs" replace "src/libsyntax/config.rs" replace "src/libsyntax/epoch.rs" replace "src/libsyntax/feature_gate.rs" replace "src/libsyntax/lib.rs" replace "src/test/compile-fail/epoch-raw-pointer-method-2015.rs" replace "src/test/compile-fail/epoch-raw-pointer-method-2018.rs" replace "src/test/run-pass/dyn-trait.rs" replace "src/test/run-pass/epoch-gate-feature.rs" replace "src/test/ui/inference-variable-behind-raw-pointer.stderr" git mv src/libsyntax/epoch.rs src/libsyntax/edition.rs git mv src/test/compile-fail/epoch-raw-pointer-method-2015.rs src/test/compile-fail/edition-raw-pointer-method-2015.rs git mv src/test/compile-fail/epoch-raw-pointer-method-2018.rs src/test/compile-fail/edition-raw-pointer-method-2018.rs git grep "epoch" ./* git grep "Epoch" ./* ``` And here is the output of the script: ``` kurtis-rust$ ./epoch_to_edition.sh src/Cargo.lock: "crossbeam-epoch 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", src/Cargo.lock:name = "crossbeam-epoch" src/Cargo.lock:"checksum crossbeam-epoch 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "59796cc6cbbdc6bb319161349db0c3250ec73ec7fcb763a51065ec4e2e158552" src/ci/docker/scripts/android-start-emulator.sh:# Using the default qemu2 engine makes time::tests::since_epoch fails because src/ci/docker/scripts/android-start-emulator.sh:# the emulator date is set to unix epoch (in armeabi-v7a-18 image). Using src/librustc_incremental/persist/fs.rs: let micros_since_unix_epoch = u64::from_str_radix(s, INT_ENCODE_BASE as u32); src/librustc_incremental/persist/fs.rs: if micros_since_unix_epoch.is_err() { src/librustc_incremental/persist/fs.rs: let micros_since_unix_epoch = micros_since_unix_epoch.unwrap(); src/librustc_incremental/persist/fs.rs: let duration = Duration::new(micros_since_unix_epoch / 1_000_000, src/librustc_incremental/persist/fs.rs: 1000 * (micros_since_unix_epoch % 1_000_000) as u32); src/libstd/sys/cloudabi/abi/cloudabi.rs: /// The epoch of this clock is undefined. The absolute src/libstd/time.rs: let one_second_from_epoch = UNIX_EPOCH + Duration::new(1, 0); src/libstd/time.rs: let one_second_from_epoch2 = UNIX_EPOCH + Duration::new(0, 500_000_000) src/libstd/time.rs: assert_eq!(one_second_from_epoch, one_second_from_epoch2); src/libstd/time.rs: fn since_epoch() { src/test/run-pass/issue-29540.rs: pub mon_min_osdmap_epochs: String, src/test/run-pass/issue-29540.rs: pub mon_max_pgmap_epochs: String, src/test/run-pass/issue-29540.rs: pub mon_max_log_epochs: String, src/test/run-pass/issue-29540.rs: pub mon_max_mdsmap_epochs: String, src/test/run-pass/issue-29540.rs: pub osd_map_share_max_epochs: String, src/test/run-pass/issue-29540.rs: pub osd_pg_epoch_persisted_max_stale: String, ``` If it looks like I've missed any things that should be converted, please let me know. There were also some notes in `src/libsyntax/epoch.rs` that indicated there might be some necessary/parallel changes that need to made in cargo. But we should probably make a separate issue for that.
As outlined in #49001 we'd like to rename all instances of
epoch
toedition
. I developed the following bash script to assist in the rename. It renames all instances ofepoch
toedition
andEpoch
toEdition
in all of the files I was able to determine were relevant. It then renames a few relevant files that hadepoch
in there name and finally prints out all of the remaining instance of the stringsepoch
andEpoch
(which, as far as I can tell should not be changed). Here is the script:And here is the output of the script:
If it looks like I've missed any things that should be converted, please let me know. There were also some notes in
src/libsyntax/epoch.rs
that indicated there might be some necessary/parallel changes that need to made in cargo. But we should probably make a separate issue for that.