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

Make overflowing and wrapping negation const #58044

Merged
merged 6 commits into from Feb 20, 2019

Conversation

@Lokathor
Copy link
Contributor

commented Feb 1, 2019

Remember that the signed and unsigned versions are slightly different here, so there's four functions made const instead of just two.

Make overflowing and wrapping negation const
Remember that the signed and unsigned versions are slightly different here, so there's four functions made const instead of just two.
@rust-highfive

This comment was marked as outdated.

Copy link
Collaborator

commented Feb 1, 2019

r? @Mark-Simulacrum

(rust_highfive has picked a reviewer for you, use r? to override)

@Lokathor

This comment has been minimized.

Copy link
Contributor Author

commented Feb 1, 2019

PR based on #57536 seeming to sit around for a bit without objection

@rust-highfive

This comment was marked as resolved.

Copy link
Collaborator

commented Feb 1, 2019

The job x86_64-gnu-llvm-6.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.
travis_time:end:0b331f48:start=1549010267388568167,finish=1549010268330003662,duration=941435495
$ git checkout -qf FETCH_HEAD
travis_fold:end:git.checkout

Encrypted environment variables have been removed for security reasons.
See https://docs.travis-ci.com/user/pull-requests/#pull-requests-and-security-restrictions
$ export SCCACHE_BUCKET=rust-lang-ci-sccache2
$ export SCCACHE_REGION=us-west-1
Setting environment variables from .travis.yml
$ export IMAGE=x86_64-gnu-llvm-6.0
---
[00:03:31]    Compiling build_helper v0.1.0 (/checkout/src/build_helper)
[00:03:32] error: expected expression, found `i8`
[00:03:32]     --> src/libcore/num/mod.rs:1533:52
[00:03:32]      |
[00:03:32] 1533 |                   ((self ^ -1).wrapping_add(1), s == $SelfT::min_value())
[00:03:32] ...
[00:03:32] ...
[00:03:32] 2058 | /     int_impl! { i8, i8, u8, 8, -128, 127, "", "", 2, "-0x7e", "0xa", "0x12", "0x12", "0x48",
[00:03:32]      | |____________________________- in this macro invocation
[00:03:32] 
[00:03:32] error: expected expression, found `i16`
[00:03:32]     --> src/libcore/num/mod.rs:1533:52
[00:03:32]     --> src/libcore/num/mod.rs:1533:52
[00:03:32]      |
[00:03:32] 1533 |                   ((self ^ -1).wrapping_add(1), s == $SelfT::min_value())
[00:03:32] ...
[00:03:32] ...
[00:03:32] 2064 | /     int_impl! { i16, i16, u16, 16, -32768, 32767, "", "", 4, "-0x5ffd", "0x3a", "0x1234", "0x3412",
[00:03:32] 2065 | |         "0x2c48", "[0x34, 0x12]", "[0x12, 0x34]" }
[00:03:32] 
[00:03:32] error: expected expression, found `i32`
[00:03:32]     --> src/libcore/num/mod.rs:1533:52
[00:03:32]      |
[00:03:32]      |
[00:03:32] 1533 |                   ((self ^ -1).wrapping_add(1), s == $SelfT::min_value())
[00:03:32] ...
[00:03:32] ...
[00:03:32] 2070 | /     int_impl! { i32, i32, u32, 32, -2147483648, 2147483647, "", "", 8, "0x10000b3", "0xb301",
[00:03:32] 2072 | |         "[0x12, 0x34, 0x56, 0x78]" }
[00:03:32]      | |____________________________________- in this macro invocation
[00:03:32] 
[00:03:32] error: expected expression, found `i64`
[00:03:32] error: expected expression, found `i64`
[00:03:32]     --> src/libcore/num/mod.rs:1533:52
[00:03:32]      |
[00:03:32] 1533 |                   ((self ^ -1).wrapping_add(1), s == $SelfT::min_value())
[00:03:32] ...
[00:03:32] ...
[00:03:32] 2077 | /     int_impl! { i64, i64, u64, 64, -9223372036854775808, 9223372036854775807, "", "", 12,
[00:03:32] 2078 | |          "0xaa00000000006e1", "0x6e10aa", "0x1234567890123456", "0x5634129078563412",
[00:03:32] 2079 | |          "0x6a2c48091e6a2c48", "[0x56, 0x34, 0x12, 0x90, 0x78, 0x56, 0x34, 0x12]",
[00:03:32]      | |_____________________________________________________________- in this macro invocation
[00:03:32] 
[00:03:32] error: expected expression, found `i128`
[00:03:32]     --> src/libcore/num/mod.rs:1533:52
[00:03:32]     --> src/libcore/num/mod.rs:1533:52
[00:03:32]      |
[00:03:32] 1533 |                   ((self ^ -1).wrapping_add(1), s == $SelfT::min_value())
[00:03:32] ...
[00:03:32] ...
[00:03:32] 2085 | /     int_impl! { i128, i128, u128, 128, -170141183460469231731687303715884105728,
[00:03:32] 2086 | |         170141183460469231731687303715884105727, "", "", 16,
[00:03:32] 2088 | |         "0x12907856341290785634129078563412", "0x48091e6a2c48091e6a2c48091e6a2c48",
[00:03:32] ...    |
[00:03:32] 2091 | |         "[0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56, \
[00:03:32] 2092 | |           0x78, 0x90, 0x12, 0x34, 0x56, 0x78, 0x90, 0x12]" }
[00:03:32] 2092 | |           0x78, 0x90, 0x12, 0x34, 0x56, 0x78, 0x90, 0x12]" }
[00:03:32]      | |____________________________________________________________- in this macro invocation
[00:03:32] 
[00:03:32] error: expected expression, found `isize`
[00:03:32]     --> src/libcore/num/mod.rs:1533:52
[00:03:32]      |
[00:03:32] 1533 |                   ((self ^ -1).wrapping_add(1), s == $SelfT::min_value())
[00:03:32] ...
[00:03:32] ...
[00:03:32] 2113 | /     int_impl! { isize, i64, u64, 64, -9223372036854775808, 9223372036854775807, "", "",
[00:03:32] 2114 | |         12, "0xaa00000000006e1", "0x6e10aa",  "0x1234567890123456", "0x5634129078563412",
[00:03:32] 2115 | |          "0x6a2c48091e6a2c48", "[0x56, 0x34, 0x12, 0x90, 0x78, 0x56, 0x34, 0x12]",
[00:03:32]      | |_____________________________________________________________- in this macro invocation
[00:03:32] 
[00:03:36]    Compiling compiler_builtins v0.1.5
[00:03:36]    Compiling cmake v0.1.33
---
[00:03:49] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "build" "--target" "x86_64-unknown-linux-gnu" "-j" "4" "--release" "--locked" "--color" "always" "--features" "panic-unwind backtrace" "--manifest-path" "/checkout/src/libstd/Cargo.toml" "--message-format" "json"
[00:03:49] expected success, got: exit code: 101
[00:03:49] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap build
[00:03:49] Build completed unsuccessfully in 0:00:20
[00:03:49] make: *** [all] Error 1
[00:03:49] Makefile:18: recipe for target 'all' failed
The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:008a86ec
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
Fri Feb  1 08:41:48 UTC 2019
---
travis_time:end:00136800:start=1549010509523914077,finish=1549010509528546641,duration=4632564
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:0410ed53
$ 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 --batch -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:12dcc63b
travis_time:start:12dcc63b
$ 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:23d19f40
$ 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)

@Mark-Simulacrum

This comment has been minimized.

Copy link
Member

commented Feb 1, 2019

@oli-obk

This comment has been minimized.

Copy link
Contributor

commented Feb 1, 2019

Please update the tests for these function to make them check the const eval result against the runtime result. Preexisting examples of such tests are in

const SHR_B: u32 = 128u32.wrapping_shr(128);

Show resolved Hide resolved src/libcore/num/mod.rs Outdated
@Lokathor

This comment has been minimized.

Copy link
Contributor Author

commented Feb 2, 2019

Tests added. I used the playground to set the test input/output values using current stable so it's a "double check" that the new formulas haven't changed the math at all.

@rust-highfive

This comment was marked as resolved.

Copy link
Collaborator

commented Feb 2, 2019

The job x86_64-gnu-llvm-6.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.
travis_time:end:1bb62a10:start=1549072615354026354,finish=1549072690243356171,duration=74889329817
$ git checkout -qf FETCH_HEAD
travis_fold:end:git.checkout

Encrypted environment variables have been removed for security reasons.
See https://docs.travis-ci.com/user/pull-requests/#pull-requests-and-security-restrictions
$ export SCCACHE_BUCKET=rust-lang-ci-sccache2
$ export SCCACHE_REGION=us-west-1
Setting environment variables from .travis.yml
$ export IMAGE=x86_64-gnu-llvm-6.0
---
[00:59:34] .................................................................................................... 100/2946
[00:59:46] .................................................................................i.................. 200/2946
[00:59:54] .................................................................................................... 300/2946
[01:00:05] .................................................................................................... 400/2946
[01:00:14] ..........................................F..F...................................................... 500/2946
[01:00:40] .................................................................................................... 700/2946
[01:00:51] .................................................................................................... 800/2946
[01:00:59] .................................................................................................... 900/2946
[01:01:15] .................................................................................................... 1000/2946
---
[01:05:44] failures:
[01:05:44] 
[01:05:44] ---- [run-pass] run-pass/const-int-overflowing.rs stdout ----
[01:05:44] 
[01:05:44] error: test compilation failed although it shouldn't!
[01:05:44] status: exit code: 1
[01:05:44] status: exit code: 1
[01:05:44] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/run-pass/const-int-overflowing.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass/const-int-overflowing/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass/const-int-overflowing/auxiliary"
[01:05:44] ------------------------------------------
[01:05:44] 
[01:05:44] ------------------------------------------
[01:05:44] stderr:
[01:05:44] stderr:
[01:05:44] ------------------------------------------
[01:05:44] {"message":"no method named `overflowing_neg` found for type `{integer}` in the current scope","code":{"code":"E0599","explanation":"\nThis error occurs when a method is used on a type which doesn't implement it:\n\nErroneous code example:\n\n```compile_fail,E0599\nstruct Mouth;\n\nlet x = Mouth;\nx.chocolate(); // error: no method named `chocolate` found for type `Mouth`\n               //        in the current scope\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/run-pass/const-int-overflowing.rs","byte_start":593,"byte_end":608,"line_start":16,"line_end":16,"column_start":30,"column_end":45,"is_primary":true,"text":[{"text":"const NEG_A: (u32, bool) = 0.overflowing_neg();","highlight_start":30,"highlight_end":45}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0599]: no method named `overflowing_neg` found for type `{integer}` in the current scope\n  --> /checkout/src/test/run-pass/const-int-overflowing.rs:16:30\n   |\nLL | const NEG_A: (u32, bool) = 0.overflowing_neg();\n   |                              ^^^^^^^^^^^^^^^\n\n"}
[01:05:44] {"message":"For more information about this error, try `rustc --explain E0599`.","code":null,"level":"","spans":[],"children":[],"rendered":"For more information about this error, try `rustc --explain E0599`.\n"}
[01:05:44] 
[01:05:44] ------------------------------------------
[01:05:44] 
[01:05:44] 
[01:05:44] thread '[run-pass] run-pass/const-int-overflowing.rs' panicked at 'explicit panic', src/tools/compiletest/src/runtest.rs:3295:9
[01:05:44] note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
[01:05:44] 
[01:05:44] ---- [run-pass] run-pass/const-int-wrapping.rs stdout ----
[01:05:44] normalized stderr:
[01:05:44] warning: constant item is never used: `NEG_A`
[01:05:44]    |
[01:05:44]    |
[01:05:44] LL | const NEG_A: u32 = 5u32.wrapping_neg();
[01:05:44]    |
[01:05:44]    = note: #[warn(dead_code)] on by default
[01:05:44] 
[01:05:44] 
[01:05:44] warning: constant item is never used: `NEG_B`
[01:05:44]    |
[01:05:44]    |
[01:05:44] LL | const NEG_B: u32 = 1234567890u32.wrapping_neg();
[01:05:44] 
[01:05:44] 
[01:05:44] 
[01:05:44] 
[01:05:44] 
[01:05:44] The actual stderr differed from the expected stderr.
[01:05:44] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass/const-int-wrapping/const-int-wrapping.stderr
[01:05:44] To update references, rerun the tests and pass the `--bless` flag
[01:05:44] To only update this specific test, also pass `--test-args const-int-wrapping.rs`
[01:05:44] error: 1 errors occurred comparing output.
[01:05:44] status: exit code: 0
[01:05:44] status: exit code: 0
[01:05:44] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/run-pass/const-int-wrapping.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass/const-int-wrapping/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass/const-int-wrapping/auxiliary"
[01:05:44] ------------------------------------------
[01:05:44] 
[01:05:44] ------------------------------------------
[01:05:44] stderr:
[01:05:44] stderr:
[01:05:44] ------------------------------------------
[01:05:44] {"message":"constant item is never used: `NEG_A`","code":{"code":"dead_code","explanation":null},"level":"warning","spans":[{"file_name":"/checkout/src/test/run-pass/const-int-wrapping.rs","byte_start":464,"byte_end":503,"line_start":16,"line_end":16,"column_start":1,"column_end":40,"is_primary":true,"text":[{"text":"const NEG_A: u32 = 5u32.wrapping_neg();","highlight_start":1,"highlight_end":40}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"#[warn(dead_code)] on by default","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"warning: constant item is never used: `NEG_A`\n  --> /checkout/src/test/run-pass/const-int-wrapping.rs:16:1\n   |\nLL | const NEG_A: u32 = 5u32.wrapping_neg();\n   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n   |\n   = note: #[warn(dead_code)] on by default\n\n"}
[01:05:44] {"message":"constant item is never used: `NEG_B`","code":{"code":"dead_code","explanation":null},"level":"warning","spans":[{"file_name":"/checkout/src/test/run-pass/const-int-wrapping.rs","byte_start":504,"byte_end":552,"line_start":17,"line_end":17,"column_start":1,"column_end":49,"is_primary":true,"text":[{"text":"const NEG_B: u32 = 1234567890u32.wrapping_neg();","highlight_start":1,"highlight_end":49}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"warning: constant item is never used: `NEG_B`\n  --> /checkout/src/test/run-pass/const-int-wrapping.rs:17:1\n   |\nLL | const NEG_B: u32 = 1234567890u32.wrapping_neg();\n   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n"}
[01:05:44] ------------------------------------------
[01:05:44] 
[01:05:44] thread '[run-pass] run-pass/const-int-wrapping.rs' panicked at 'explicit panic', src/tools/compiletest/src/runtest.rs:3295:9
[01:05:44] 
---
[01:05:44] test result: FAILED. 2937 passed; 2 failed; 7 ignored; 0 measured; 0 filtered out
[01:05:44] 
[01:05:44] 
[01:05:44] 
[01:05:44] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/compiletest" "--compile-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib" "--run-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "--rustc-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "--src-base" "/checkout/src/test/run-pass" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass" "--stage-id" "stage2-x86_64-unknown-linux-gnu" "--mode" "run-pass" "--target" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/usr/lib/llvm-6.0/bin/FileCheck" "--host-rustcflags" "-Crpath -O -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--target-rustcflags" "-Crpath -O -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--docck-python" "/usr/bin/python2.7" "--lldb-python" "/usr/bin/python2.7" "--gdb" "/usr/bin/gdb" "--quiet" "--llvm-version" "6.0.0\n" "--system-llvm" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--llvm-cxxflags" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"
[01:05:44] 
[01:05:44] 
[01:05:44] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[01:05:44] Build completed unsuccessfully in 0:10:25
[01:05:44] Build completed unsuccessfully in 0:10:25
[01:05:44] make: *** [check] Error 1
[01:05:44] Makefile:48: recipe for target 'check' failed
The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:04e0e5fd
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
Sat Feb  2 03:04:03 UTC 2019

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)

@oli-obk

This comment has been minimized.

Copy link
Contributor

commented Feb 3, 2019

r? @Centril impl lgtm now, but I don't know what the rules for insta-stable constification are

@rust-highfive rust-highfive assigned Centril and unassigned oli-obk Feb 3, 2019

@Centril

This comment has been minimized.

Copy link
Contributor

commented Feb 3, 2019

@oli-obk Since this is something that doesn't require feature gates, intrinsics, etc., someone from the libs team needs to fcp... for that, r? @SimonSapin

@rust-highfive rust-highfive assigned SimonSapin and unassigned Centril Feb 3, 2019

@kennytm

This comment has been minimized.

Copy link
Member

commented Feb 8, 2019

You don't need to insta-stable the const. See the #[rustc_const_unstable] attribute.

@Centril

This comment has been minimized.

Copy link
Contributor

commented Feb 18, 2019

Ping from triage, @SimonSapin we await your review :)

@SimonSapin

This comment has been minimized.

Copy link
Contributor

commented Feb 19, 2019

@alexcrichton

This comment has been minimized.

Copy link
Member

commented Feb 19, 2019

@rfcbot fcp merge

@rfcbot

This comment has been minimized.

Copy link

commented Feb 19, 2019

Team member @alexcrichton has proposed to merge this. The next step is review by the rest of the tagged team members:

No concerns currently listed.

Once a majority of reviewers approve (and none object), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up!

See this document for info about what commands tagged team members can give me.

@rfcbot

This comment has been minimized.

Copy link

commented Feb 19, 2019

🔔 This is now entering its final comment period, as per the review above. 🔔

@alexcrichton

This comment has been minimized.

Copy link
Member

commented Feb 19, 2019

@bors: r+

@bors

This comment has been minimized.

Copy link
Contributor

commented Feb 19, 2019

📌 Commit e06302f has been approved by alexcrichton

kennytm added a commit to kennytm/rust that referenced this pull request Feb 20, 2019

Rollup merge of rust-lang#58044 - Lokathor:lokathor, r=alexcrichton
Make overflowing and wrapping negation const

Remember that the signed and unsigned versions are slightly different here, so there's four functions made const instead of just two.

bors added a commit that referenced this pull request Feb 20, 2019

Auto merge of #58578 - kennytm:rollup, r=kennytm
Rollup of 24 pull requests

Successful merges:

 - #56470 (Modify doctest's auto-`fn main()` to allow `Result`s)
 - #58044 (Make overflowing and wrapping negation const)
 - #58303 (Improve stability tags display)
 - #58336 (Fix search results interactions)
 - #58384 (Fix tables display)
 - #58392 (Use less explicit shifting in std::net::ip)
 - #58409 (rustdoc: respect alternate flag when formatting impl trait)
 - #58456 (Remove no longer accurate diagnostic code about NLL)
 - #58528 (Don't use an allocation for ItemId in StmtKind)
 - #58530 (Monomorphize less code in fs::{read|write})
 - #58534 (Mention capping forbid lints)
 - #58536 (Remove UB in pointer tests)
 - #58538 (Add missing fmt structs examples)
 - #58539 (Add alias methods to PathBuf for underlying OsString (#58234))
 - #58544 (Fix doc for rustc "-g" flag)
 - #58545 (Add regression test for a specialization-related ICE (#39448))
 - #58546 (librustc_codegen_llvm => 2018)
 - #58551 (Explain a panic in test case net::tcp::tests::double_bind)
 - #58553 (Use more impl header lifetime elision)
 - #58562 (Fix style nits)
 - #58565 (Fix typo in std::future::Future docs)
 - #58568 (Fix a transposition in driver.rs.)
 - #58569 (Reduce Some Code Repetitions like `(n << amt) >> amt`)
 - #58576 (Stabilize iter::successors and iter::from_fn)

bors added a commit that referenced this pull request Feb 20, 2019

Auto merge of #58578 - kennytm:rollup, r=kennytm
Rollup of 24 pull requests

Successful merges:

 - #56470 (Modify doctest's auto-`fn main()` to allow `Result`s)
 - #58044 (Make overflowing and wrapping negation const)
 - #58303 (Improve stability tags display)
 - #58336 (Fix search results interactions)
 - #58384 (Fix tables display)
 - #58392 (Use less explicit shifting in std::net::ip)
 - #58409 (rustdoc: respect alternate flag when formatting impl trait)
 - #58456 (Remove no longer accurate diagnostic code about NLL)
 - #58528 (Don't use an allocation for ItemId in StmtKind)
 - #58530 (Monomorphize less code in fs::{read|write})
 - #58534 (Mention capping forbid lints)
 - #58536 (Remove UB in pointer tests)
 - #58538 (Add missing fmt structs examples)
 - #58539 (Add alias methods to PathBuf for underlying OsString (#58234))
 - #58544 (Fix doc for rustc "-g" flag)
 - #58545 (Add regression test for a specialization-related ICE (#39448))
 - #58546 (librustc_codegen_llvm => 2018)
 - #58551 (Explain a panic in test case net::tcp::tests::double_bind)
 - #58553 (Use more impl header lifetime elision)
 - #58562 (Fix style nits)
 - #58565 (Fix typo in std::future::Future docs)
 - #58568 (Fix a transposition in driver.rs.)
 - #58569 (Reduce Some Code Repetitions like `(n << amt) >> amt`)
 - #58576 (Stabilize iter::successors and iter::from_fn)

@bors bors merged commit e06302f into rust-lang:master Feb 20, 2019

1 check passed

Travis CI - Pull Request Build Passed
Details

netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this pull request Apr 14, 2019

he
Update rust to version 1.34.0.
Pkgsrc changes:
 * Bump required rust version to build to 1.33.0.
 * Adapt patches to changed file locations.
 * (I worry about 32-bit ports, now that Atomic64 apparently is First-Class;
   this has been built on NetBSD/amd64 so far)

Upstream changes:

Version 1.34.0 (2019-04-11)
==========================

Language
--------
- [You can now use `#[deprecated = "reason"]`][58166] as a shorthand for
  `#[deprecated(note = "reason")]`. This was previously allowed by mistake
  but had no effect.
- [You can now accept token streams in `#[attr()]`,`#[attr[]]`, and
  `#[attr{}]` procedural macros.][57367]
- [You can now write `extern crate self as foo;`][57407] to import your
  crate's root into the extern prelude.


Compiler
--------
- [You can now target `riscv64imac-unknown-none-elf` and
  `riscv64gc-unknown-none-elf`.][58406]
- [You can now enable linker plugin LTO optimisations with
  `-C linker-plugin-lto`.][58057] This allows rustc to compile your Rust code
  into LLVM bitcode allowing LLVM to perform LTO optimisations across C/C++ FFI
  boundaries.
- [You can now target `powerpc64-unknown-freebsd`.][57809]


Libraries
---------
- [The trait bounds have been removed on some of `HashMap<K, V, S>`'s and
  `HashSet<T, S>`'s basic methods.][58370] Most notably you no longer require
  the `Hash` trait to create an iterator.
- [The `Ord` trait bounds have been removed on some of `BinaryHeap<T>`'s basic
  methods.][58421] Most notably you no longer require the `Ord` trait to create
  an iterator.
- [The methods `overflowing_neg` and `wrapping_neg` are now `const` functions
  for all numeric types.][58044]
- [Indexing a `str` is now generic over all types that
  implement `SliceIndex<str>`.][57604]
- [`str::trim`, `str::trim_matches`, `str::trim_{start, end}`, and
  `str::trim_{start, end}_matches` are now `#[must_use]`][57106] and will
  produce a warning if their returning type is unused.
- [The methods `checked_pow`, `saturating_pow`, `wrapping_pow`, and
  `overflowing_pow` are now available for all numeric types.][57873] These are
  equivalvent to methods such as `wrapping_add` for the `pow` operation.


Stabilized APIs
---------------

#### std & core
* [`Any::type_id`]
* [`Error::type_id`]
* [`atomic::AtomicI16`]
* [`atomic::AtomicI32`]
* [`atomic::AtomicI64`]
* [`atomic::AtomicI8`]
* [`atomic::AtomicU16`]
* [`atomic::AtomicU32`]
* [`atomic::AtomicU64`]
* [`atomic::AtomicU8`]
* [`convert::Infallible`]
* [`convert::TryFrom`]
* [`convert::TryInto`]
* [`iter::from_fn`]
* [`iter::successors`]
* [`num::NonZeroI128`]
* [`num::NonZeroI16`]
* [`num::NonZeroI32`]
* [`num::NonZeroI64`]
* [`num::NonZeroI8`]
* [`num::NonZeroIsize`]
* [`slice::sort_by_cached_key`]
* [`str::escape_debug`]
* [`str::escape_default`]
* [`str::escape_unicode`]
* [`str::split_ascii_whitespace`]

#### std
* [`Instant::checked_add`]
* [`Instant::checked_sub`]
* [`SystemTime::checked_add`]
* [`SystemTime::checked_sub`]

Cargo
-----
- [You can now use alternative registries to crates.io.][cargo/6654]

Misc
----
- [You can now use the `?` operator in your documentation tests without manually
  adding `fn main() -> Result<(), _> {}`.][56470]

Compatibility Notes
-------------------
- [`Command::before_exec` is now deprecated in favor of the
  unsafe method `Command::pre_exec`.][58059]
- [Use of `ATOMIC_{BOOL, ISIZE, USIZE}_INIT` is now deprecated.][57425] As you
  can now use `const` functions in `static` variables.

[58370]: rust-lang/rust#58370
[58406]: rust-lang/rust#58406
[58421]: rust-lang/rust#58421
[58166]: rust-lang/rust#58166
[58044]: rust-lang/rust#58044
[58057]: rust-lang/rust#58057
[58059]: rust-lang/rust#58059
[57809]: rust-lang/rust#57809
[57873]: rust-lang/rust#57873
[57604]: rust-lang/rust#57604
[57367]: rust-lang/rust#57367
[57407]: rust-lang/rust#57407
[57425]: rust-lang/rust#57425
[57106]: rust-lang/rust#57106
[56470]: rust-lang/rust#56470
[cargo/6654]: rust-lang/cargo#6654
[`Any::type_id`]: https://doc.rust-lang.org/std/any/trait.Any.html#tymethod.type_id
[`Error::type_id`]: https://doc.rust-lang.org/std/error/trait.Error.html#tymethod.type_id
[`atomic::AtomicI16`]: https://doc.rust-lang.org/std/atomic/struct.AtomicI16.html
[`atomic::AtomicI32`]: https://doc.rust-lang.org/std/atomic/struct.AtomicI32.html
[`atomic::AtomicI64`]: https://doc.rust-lang.org/std/atomic/struct.AtomicI64.html
[`atomic::AtomicI8`]: https://doc.rust-lang.org/std/atomic/struct.AtomicI8.html
[`atomic::AtomicU16`]: https://doc.rust-lang.org/std/atomic/struct.AtomicU16.html
[`atomic::AtomicU32`]: https://doc.rust-lang.org/std/atomic/struct.AtomicU32.html
[`atomic::AtomicU64`]: https://doc.rust-lang.org/std/atomic/struct.AtomicU64.html
[`atomic::AtomicU8`]: https://doc.rust-lang.org/std/atomic/struct.AtomicU8.html
[`convert::Infallible`]: https://doc.rust-lang.org/std/convert/enum.Infallible.html
[`convert::TryFrom`]: https://doc.rust-lang.org/std/convert/trait.TryFrom.html
[`convert::TryInto`]: https://doc.rust-lang.org/std/convert/trait.TryInto.html
[`iter::from_fn`]: https://doc.rust-lang.org/std/iter/fn.from_fn.html
[`iter::successors`]: https://doc.rust-lang.org/std/iter/fn.successors.html
[`num::NonZeroI128`]: https://doc.rust-lang.org/std/num/struct.NonZeroI128.html
[`num::NonZeroI16`]: https://doc.rust-lang.org/std/num/struct.NonZeroI16.html
[`num::NonZeroI32`]: https://doc.rust-lang.org/std/num/struct.NonZeroI32.html
[`num::NonZeroI64`]: https://doc.rust-lang.org/std/num/struct.NonZeroI64.html
[`num::NonZeroI8`]: https://doc.rust-lang.org/std/num/struct.NonZeroI8.html
[`num::NonZeroIsize`]: https://doc.rust-lang.org/std/num/struct.NonZeroIsize.html
[`slice::sort_by_cached_key`]: https://doc.rust-lang.org/std/slice/fn.sort_by_cached_key
[`str::escape_debug`]: https://doc.rust-lang.org/std/primitive.str.html#method.escape_debug
[`str::escape_default`]: https://doc.rust-lang.org/std/primitive.str.html#method.escape_default
[`str::escape_unicode`]: https://doc.rust-lang.org/std/primitive.str.html#method.escape_unicode
[`str::split_ascii_whitespace`]: https://doc.rust-lang.org/std/primitive.str.html#method.split_ascii_whitespace
[`Instant::checked_add`]: https://doc.rust-lang.org/std/time/struct.Instant.html#method.checked_add
[`Instant::checked_sub`]: https://doc.rust-lang.org/std/time/struct.Instant.html#method.checked_sub
[`SystemTime::checked_add`]: https://doc.rust-lang.org/std/time/struct.SystemTime.html#method.checked_add
[`SystemTime::checked_sub`]: https://doc.rust-lang.org/std/time/struct.SystemTime.html#method.checked_sub

@Centril Centril added this to the 1.34 milestone Apr 26, 2019

netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this pull request May 19, 2019

he
Update rust to version 1.34.0.
Pkgsrc changes:
 * Bump required rust version to build to 1.33.0.
 * Adapt patches to changed file locations.
 * (I worry about 32-bit ports, now that Atomic64 apparently is First-Class;
   this has been built on NetBSD/amd64 so far)

Upstream changes:

Version 1.34.0 (2019-04-11)
==========================

Language
--------
- [You can now use `#[deprecated = "reason"]`][58166] as a shorthand for
  `#[deprecated(note = "reason")]`. This was previously allowed by mistake
  but had no effect.
- [You can now accept token streams in `#[attr()]`,`#[attr[]]`, and
  `#[attr{}]` procedural macros.][57367]
- [You can now write `extern crate self as foo;`][57407] to import your
  crate's root into the extern prelude.


Compiler
--------
- [You can now target `riscv64imac-unknown-none-elf` and
  `riscv64gc-unknown-none-elf`.][58406]
- [You can now enable linker plugin LTO optimisations with
  `-C linker-plugin-lto`.][58057] This allows rustc to compile your Rust code
  into LLVM bitcode allowing LLVM to perform LTO optimisations across C/C++ FFI
  boundaries.
- [You can now target `powerpc64-unknown-freebsd`.][57809]


Libraries
---------
- [The trait bounds have been removed on some of `HashMap<K, V, S>`'s and
  `HashSet<T, S>`'s basic methods.][58370] Most notably you no longer require
  the `Hash` trait to create an iterator.
- [The `Ord` trait bounds have been removed on some of `BinaryHeap<T>`'s basic
  methods.][58421] Most notably you no longer require the `Ord` trait to create
  an iterator.
- [The methods `overflowing_neg` and `wrapping_neg` are now `const` functions
  for all numeric types.][58044]
- [Indexing a `str` is now generic over all types that
  implement `SliceIndex<str>`.][57604]
- [`str::trim`, `str::trim_matches`, `str::trim_{start, end}`, and
  `str::trim_{start, end}_matches` are now `#[must_use]`][57106] and will
  produce a warning if their returning type is unused.
- [The methods `checked_pow`, `saturating_pow`, `wrapping_pow`, and
  `overflowing_pow` are now available for all numeric types.][57873] These are
  equivalvent to methods such as `wrapping_add` for the `pow` operation.


Stabilized APIs
---------------

#### std & core
* [`Any::type_id`]
* [`Error::type_id`]
* [`atomic::AtomicI16`]
* [`atomic::AtomicI32`]
* [`atomic::AtomicI64`]
* [`atomic::AtomicI8`]
* [`atomic::AtomicU16`]
* [`atomic::AtomicU32`]
* [`atomic::AtomicU64`]
* [`atomic::AtomicU8`]
* [`convert::Infallible`]
* [`convert::TryFrom`]
* [`convert::TryInto`]
* [`iter::from_fn`]
* [`iter::successors`]
* [`num::NonZeroI128`]
* [`num::NonZeroI16`]
* [`num::NonZeroI32`]
* [`num::NonZeroI64`]
* [`num::NonZeroI8`]
* [`num::NonZeroIsize`]
* [`slice::sort_by_cached_key`]
* [`str::escape_debug`]
* [`str::escape_default`]
* [`str::escape_unicode`]
* [`str::split_ascii_whitespace`]

#### std
* [`Instant::checked_add`]
* [`Instant::checked_sub`]
* [`SystemTime::checked_add`]
* [`SystemTime::checked_sub`]

Cargo
-----
- [You can now use alternative registries to crates.io.][cargo/6654]

Misc
----
- [You can now use the `?` operator in your documentation tests without manually
  adding `fn main() -> Result<(), _> {}`.][56470]

Compatibility Notes
-------------------
- [`Command::before_exec` is now deprecated in favor of the
  unsafe method `Command::pre_exec`.][58059]
- [Use of `ATOMIC_{BOOL, ISIZE, USIZE}_INIT` is now deprecated.][57425] As you
  can now use `const` functions in `static` variables.

[58370]: rust-lang/rust#58370
[58406]: rust-lang/rust#58406
[58421]: rust-lang/rust#58421
[58166]: rust-lang/rust#58166
[58044]: rust-lang/rust#58044
[58057]: rust-lang/rust#58057
[58059]: rust-lang/rust#58059
[57809]: rust-lang/rust#57809
[57873]: rust-lang/rust#57873
[57604]: rust-lang/rust#57604
[57367]: rust-lang/rust#57367
[57407]: rust-lang/rust#57407
[57425]: rust-lang/rust#57425
[57106]: rust-lang/rust#57106
[56470]: rust-lang/rust#56470
[cargo/6654]: rust-lang/cargo#6654
[`Any::type_id`]: https://doc.rust-lang.org/std/any/trait.Any.html#tymethod.type_id
[`Error::type_id`]: https://doc.rust-lang.org/std/error/trait.Error.html#tymethod.type_id
[`atomic::AtomicI16`]: https://doc.rust-lang.org/std/atomic/struct.AtomicI16.html
[`atomic::AtomicI32`]: https://doc.rust-lang.org/std/atomic/struct.AtomicI32.html
[`atomic::AtomicI64`]: https://doc.rust-lang.org/std/atomic/struct.AtomicI64.html
[`atomic::AtomicI8`]: https://doc.rust-lang.org/std/atomic/struct.AtomicI8.html
[`atomic::AtomicU16`]: https://doc.rust-lang.org/std/atomic/struct.AtomicU16.html
[`atomic::AtomicU32`]: https://doc.rust-lang.org/std/atomic/struct.AtomicU32.html
[`atomic::AtomicU64`]: https://doc.rust-lang.org/std/atomic/struct.AtomicU64.html
[`atomic::AtomicU8`]: https://doc.rust-lang.org/std/atomic/struct.AtomicU8.html
[`convert::Infallible`]: https://doc.rust-lang.org/std/convert/enum.Infallible.html
[`convert::TryFrom`]: https://doc.rust-lang.org/std/convert/trait.TryFrom.html
[`convert::TryInto`]: https://doc.rust-lang.org/std/convert/trait.TryInto.html
[`iter::from_fn`]: https://doc.rust-lang.org/std/iter/fn.from_fn.html
[`iter::successors`]: https://doc.rust-lang.org/std/iter/fn.successors.html
[`num::NonZeroI128`]: https://doc.rust-lang.org/std/num/struct.NonZeroI128.html
[`num::NonZeroI16`]: https://doc.rust-lang.org/std/num/struct.NonZeroI16.html
[`num::NonZeroI32`]: https://doc.rust-lang.org/std/num/struct.NonZeroI32.html
[`num::NonZeroI64`]: https://doc.rust-lang.org/std/num/struct.NonZeroI64.html
[`num::NonZeroI8`]: https://doc.rust-lang.org/std/num/struct.NonZeroI8.html
[`num::NonZeroIsize`]: https://doc.rust-lang.org/std/num/struct.NonZeroIsize.html
[`slice::sort_by_cached_key`]: https://doc.rust-lang.org/std/slice/fn.sort_by_cached_key
[`str::escape_debug`]: https://doc.rust-lang.org/std/primitive.str.html#method.escape_debug
[`str::escape_default`]: https://doc.rust-lang.org/std/primitive.str.html#method.escape_default
[`str::escape_unicode`]: https://doc.rust-lang.org/std/primitive.str.html#method.escape_unicode
[`str::split_ascii_whitespace`]: https://doc.rust-lang.org/std/primitive.str.html#method.split_ascii_whitespace
[`Instant::checked_add`]: https://doc.rust-lang.org/std/time/struct.Instant.html#method.checked_add
[`Instant::checked_sub`]: https://doc.rust-lang.org/std/time/struct.Instant.html#method.checked_sub
[`SystemTime::checked_add`]: https://doc.rust-lang.org/std/time/struct.SystemTime.html#method.checked_add
[`SystemTime::checked_sub`]: https://doc.rust-lang.org/std/time/struct.SystemTime.html#method.checked_sub
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.