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

Stabilize min_const_unsafe_fn in 1.33 #57067

Merged
merged 3 commits into from Dec 24, 2018

Conversation

Projects
None yet
5 participants
@Centril
Copy link
Contributor

Centril commented Dec 22, 2018

Fixes #55607

r? @oli-obk

@Centril
Copy link
Contributor

Centril left a comment

Not entirely sure about the stage0 stuff...

Show resolved Hide resolved src/libstd/lib.rs
Show resolved Hide resolved src/test/rustdoc/const-display.rs

@Centril Centril referenced this pull request Dec 22, 2018

Closed

Tracking issue for unsafe operations in const fn #55607

4 of 4 tasks complete
@rust-highfive

This comment was marked as resolved.

Copy link
Collaborator

rust-highfive commented Dec 22, 2018

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:04637f34:start=1545502198099955332,finish=1545502254132288765,duration=56032333433
$ 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:56:27] .................................................................................................... 400/5192
[00:56:31] .................................................................................................... 500/5192
[00:56:34] ..............................i..................................................................... 600/5192
[00:56:37] .................................................................................................... 700/5192
[00:56:43] ....................................................F............................................... 800/5192
[00:56:50] ..............................iiiii................................................................. 1000/5192
[00:56:53] .................................................................................................... 1100/5192
[00:56:55] .................................................................................................... 1200/5192
[00:56:57] .................................................................................................... 1300/5192
---
[00:59:07] diff of stderr:
[00:59:07] 
[00:59:07] 5    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^
[00:59:07] 6    |
[00:59:07] 7 note: ...which requires const-evaluating `Foo::bytes::{{constant}}`...
[00:59:07] +   --> $SRC_DIR/libcore/mem.rs:LL:COL
[00:59:07] +    |
[00:59:07] + LL |     intrinsics::size_of::<T>()
[00:59:07] +    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^
[00:59:07] 8 note: ...which requires computing layout of `Foo`...
[00:59:07] 9 note: ...which requires normalizing `ParamEnvAnd { param_env: ParamEnv { caller_bounds: [], reveal: All }, value: [u8; _] }`...
[00:59:07] 10 note: ...which requires const-evaluating + checking `Foo::bytes::{{constant}}`...
[00:59:07] 
[00:59:07] The actual stderr differed from the expected stderr.
[00:59:07] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/consts/const-size_of-cycle/const-size_of-cycle.stderr
[00:59:07] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/consts/const-size_of-cycle/const-size_of-cycle.stderr
[00:59:07] To update references, rerun the tests and pass the `--bless` flag
[00:59:07] To only update this specific test, also pass `--test-args consts/const-size_of-cycle.rs`
[00:59:07] error: 1 errors occurred comparing output.
[00:59:07] status: exit code: 1
[00:59:07] status: exit code: 1
[00:59:07] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/consts/const-size_of-cycle.rs" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/consts/const-size_of-cycle/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/ui/consts/const-size_of-cycle/auxiliary" "-A" "unused"
[00:59:07] ------------------------------------------
[00:59:07] 
[00:59:07] ------------------------------------------
[00:59:07] stderr:
[00:59:07] stderr:
[00:59:07] ------------------------------------------
[00:59:07] {"message":"cycle detected when const-evaluating + checking `Foo::bytes::{{constant}}`","code":{"code":"E0391","explanation":"\nThis error indicates that some types or traits depend on each other\nand therefore cannot be constructed.\n\nThe following example contains a circular dependency between two traits:\n\n```compile_fail,E0391\ntrait FirstTrait : SecondTrait {\n\n}\n\ntrait SecondTrait : FirstTrait {\n\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/consts/const-size_of-cycle.rs","byte_start":559,"byte_end":585,"line_start":16,"line_end":16,"column_start":17,"column_end":43,"is_primary":true,"text":[{"text":"    bytes: [u8; std::mem::size_of::<Foo>()]","highlight_start":17,"highlight_end":43}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"...which requires const-evaluating `Foo::bytes::{{constant}}`...","code":null,"level":"note","spans":[{"file_name":"/checkout/src/libcore/mem.rs","byte_start":9866,"byte_end":9892,"line_start":301,"line_end":301,"column_start":5,"column_end":31,"is_primary":true,"text":[{"text":"    intrinsics::size_of::<T>()","highlight_start":5,"highlight_end":31}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":null},{"message":"...which requires computing layout of `Foo`...","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/consts/const-size_of-cycle.rs","byte_start":0,"byte_end":0,"line_start":1,"line_end":1,"column_start":1,"column_end":1,"is_primary":true,"text":[{"text":"// Copyright 2017 The Rust Project Developers. See the COPYRIGHT","highlight_start":1,"highlight_end":1}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":null},{"message":"...which requires normalizing `ParamEnvAnd { param_env: ParamEnv { caller_bounds: [], reveal: All }, value: [u8; _] }`...","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/consts/const-size_of-cycle.rs","byte_start":0,"byte_end":0,"line_start":1,"line_end":1,"column_start":1,"column_end":1,"is_primary":true,"text":[{"text":"// Copyright 2017 The Rust Project Developers. See the COPYRIGHT","highlight_start":1,"highlight_end":1}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":null},{"message":"...which requires const-evaluating + checking `Foo::bytes::{{constant}}`...","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/consts/const-size_of-cycle.rs","byte_start":559,"byte_end":585,"line_start":16,"line_end":16,"column_start":17,"column_end":43,"is_primary":true,"text":[{"text":"    bytes: [u8; std::mem::size_of::<Foo>()]","highlight_start":17,"highlight_end":43}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":null},{"message":"...which again requires const-evaluating + checking `Foo::bytes::{{constant}}`, completing the cycle","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"cycle used when processing `Foo`","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/consts/const-size_of-cycle.rs","byte_start":530,"byte_end":540,"line_start":15,"line_end":15,"column_start":1,"column_end":11,"is_primary":true,"text":[{"text":"struct Foo {","highlight_start":1,"highlight_end":11}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":null}],"rendered":"error[E0391]: cycle detected when const-evaluating + checking `Foo::bytes::{{constant}}`\n  --> /checkout/src/test/ui/consts/const-size_of-cycle.rs:16:17\n   |\nLL |     bytes: [u8; std::mem::size_of::<Foo>()]\n   |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^\n   |\nnote: ...which requires const-evaluating `Foo::bytes::{{constant}}`...\n  --> /checkout/src/libcore/mem.rs:301:5\n   |\nLL |     intrinsics::size_of::<T>()\n   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^\nnote: ...which requires computing layout of `Foo`...\nnote: ...which requires normalizing `ParamEnvAnd { param_env: ParamEnv { caller_bounds: [], reveal: All }, value: [u8; _] }`...\nnote: ...which requires const-evaluating + checking `Foo::bytes::{{constant}}`...\n  --> /checkout/src/test/ui/consts/const-size_of-cycle.rs:16:17\n   |\nLL |     bytes: [u8; std::mem::size_of::<Foo>()]\n   |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^\n   = note: ...which again requires const-evaluating + checking `Foo::bytes::{{constant}}`, completing the cycle\nnote: cycle used when processing `Foo`\n  --> /checkout/src/test/ui/consts/const-size_of-cycle.rs:15:1\n   |\nLL | struct Foo {\n   | ^^^^^^^^^^\n\n"}
[00:59:07] {"message":"aborting due to previous error","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to previous error\n\n"}
[00:59:07] {"message":"For more information about this error, try `rustc --explain E0391`.","code":null,"level":"","spa4-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"
[00:59:07] 
[00:59:07] 
[00:59:07] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[00:59:07] Build completed unsuccessfully in 0:03:49
[00:59:07] Build completed unsuccessfully in 0:03:49
[00:59:07] make: *** [check] Error 1
[00:59:07] Makefile:58: recipe for target 'check' failed
The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:1bc0e430
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
Sat Dec 22 19:10:10 UTC 2018

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)

@Centril Centril added the relnotes label Dec 22, 2018

@oli-obk

This comment has been minimized.

Copy link
Contributor

oli-obk commented Dec 23, 2018

We need to update the docs, too. At least that's an open point in the issue, so this PR doesn't fix the issue as described in the PR message

@bors

This comment was marked as resolved.

Copy link
Contributor

bors commented Dec 23, 2018

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

@Centril Centril force-pushed the Centril:stabilize-min_const_unsafe_fn branch from 5f324a0 to 7ae6fb2 Dec 23, 2018

@Centril

This comment has been minimized.

Copy link
Contributor

Centril commented Dec 23, 2018

@oli-obk Rebased. I've also filed documentation issue (rust-lang-nursery/reference#482) for the reference; we can track needed documentation changes from there. :)

@oli-obk

This comment has been minimized.

Copy link
Contributor

oli-obk commented Dec 23, 2018

@bors r+

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Dec 23, 2018

📌 Commit 7ae6fb2 has been approved by oli-obk

Centril added a commit to Centril/rust that referenced this pull request Dec 23, 2018

Rollup merge of rust-lang#57067 - Centril:stabilize-min_const_unsafe_…
…fn, r=oli-obk

Stabilize min_const_unsafe_fn in 1.33

Fixes rust-lang#55607

r? @oli-obk

Centril added a commit to Centril/rust that referenced this pull request Dec 23, 2018

Rollup merge of rust-lang#57067 - Centril:stabilize-min_const_unsafe_…
…fn, r=oli-obk

Stabilize min_const_unsafe_fn in 1.33

Fixes rust-lang#55607

r? @oli-obk

bors added a commit that referenced this pull request Dec 23, 2018

Auto merge of #57083 - Centril:rollup, r=Centril
Rollup of 10 pull requests

Successful merges:

 - #56188 (enum type instead of variant suggestion unification )
 - #56916 (Fix mutable references in `static mut`)
 - #56917 (Simplify MIR generation for logical operations)
 - #56953 (Mark tuple structs as live if their constructors are used)
 - #56964 (Remove `TokenStream::JointTree`.)
 - #56966 (Correct strings for raw pointer deref and array access suggestions)
 - #57020 (Point to cause of `fn` expected return type)
 - #57032 (fix deprecation warnings in liballoc benches)
 - #57053 (Fix alignment for array indexing)
 - #57067 (Stabilize min_const_unsafe_fn in 1.33)

Failed merges:

r? @ghost

bors added a commit that referenced this pull request Dec 23, 2018

Auto merge of #57083 - Centril:rollup, r=Centril
Rollup of 10 pull requests

Successful merges:

 - #56188 (enum type instead of variant suggestion unification )
 - #56916 (Fix mutable references in `static mut`)
 - #56917 (Simplify MIR generation for logical operations)
 - #56953 (Mark tuple structs as live if their constructors are used)
 - #56964 (Remove `TokenStream::JointTree`.)
 - #56966 (Correct strings for raw pointer deref and array access suggestions)
 - #57020 (Point to cause of `fn` expected return type)
 - #57032 (fix deprecation warnings in liballoc benches)
 - #57053 (Fix alignment for array indexing)
 - #57067 (Stabilize min_const_unsafe_fn in 1.33)

Failed merges:

r? @ghost

Centril added a commit to Centril/rust that referenced this pull request Dec 23, 2018

Rollup merge of rust-lang#57067 - Centril:stabilize-min_const_unsafe_…
…fn, r=oli-obk

Stabilize min_const_unsafe_fn in 1.33

Fixes rust-lang#55607

r? @oli-obk

bors added a commit that referenced this pull request Dec 24, 2018

Auto merge of #57087 - Centril:rollup, r=Centril
Rollup of 14 pull requests

Successful merges:

 - #56188 (enum type instead of variant suggestion unification )
 - #56342 (Improve docs for collecting into `Option`s)
 - #56916 (Fix mutable references in `static mut`)
 - #56917 (Simplify MIR generation for logical operations)
 - #56939 (Pin stabilization)
 - #56953 (Mark tuple structs as live if their constructors are used)
 - #56964 (Remove `TokenStream::JointTree`.)
 - #56966 (Correct strings for raw pointer deref and array access suggestions)
 - #57020 (Point to cause of `fn` expected return type)
 - #57032 (fix deprecation warnings in liballoc benches)
 - #57053 (Fix alignment for array indexing)
 - #57062 (Fix a comment)
 - #57067 (Stabilize min_const_unsafe_fn in 1.33)
 - #57078 (Ignore two tests on s390x)

Failed merges:

r? @ghost

bors added a commit that referenced this pull request Dec 24, 2018

Auto merge of #57087 - Centril:rollup, r=Centril
Rollup of 14 pull requests

Successful merges:

 - #56188 (enum type instead of variant suggestion unification )
 - #56342 (Improve docs for collecting into `Option`s)
 - #56916 (Fix mutable references in `static mut`)
 - #56917 (Simplify MIR generation for logical operations)
 - #56939 (Pin stabilization)
 - #56953 (Mark tuple structs as live if their constructors are used)
 - #56964 (Remove `TokenStream::JointTree`.)
 - #56966 (Correct strings for raw pointer deref and array access suggestions)
 - #57020 (Point to cause of `fn` expected return type)
 - #57032 (fix deprecation warnings in liballoc benches)
 - #57053 (Fix alignment for array indexing)
 - #57062 (Fix a comment)
 - #57067 (Stabilize min_const_unsafe_fn in 1.33)
 - #57078 (Ignore two tests on s390x)

Failed merges:

r? @ghost

@bors bors merged commit 7ae6fb2 into rust-lang:master Dec 24, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@Centril Centril deleted the Centril:stabilize-min_const_unsafe_fn branch Dec 24, 2018

@jethrogb

This comment has been minimized.

Copy link
Contributor

jethrogb commented Jan 1, 2019

I'm slightly confused as to why this feature was stabilized after being in master for only 18 days. Surely it could've been insta-stable or there should've been an FCP?

@Centril Centril added the T-lang label Jan 10, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment