{"action":"created","issue":{"url":"https://api.github.com/repos/rust-lang/rust/issues/51040","repository_url":"https://api.github.com/repos/rust-lang/rust","labels_url":"https://api.github.com/repos/rust-lang/rust/issues/51040/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/rust/issues/51040/comments","events_url":"https://api.github.com/repos/rust-lang/rust/issues/51040/events","html_url":"https://github.com/rust-lang/rust/pull/51040","id":326249760,"number":51040,"title":"[beta] Unstable const fn promotion","user":{"login":"oli-obk","id":332036,"avatar_url":"https://avatars2.githubusercontent.com/u/332036?v=4","gravatar_id":"","url":"https://api.github.com/users/oli-obk","html_url":"https://github.com/oli-obk","followers_url":"https://api.github.com/users/oli-obk/followers","following_url":"https://api.github.com/users/oli-obk/following{/other_user}","gists_url":"https://api.github.com/users/oli-obk/gists{/gist_id}","starred_url":"https://api.github.com/users/oli-obk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oli-obk/subscriptions","organizations_url":"https://api.github.com/users/oli-obk/orgs","repos_url":"https://api.github.com/users/oli-obk/repos","events_url":"https://api.github.com/users/oli-obk/events{/privacy}","received_events_url":"https://api.github.com/users/oli-obk/received_events","type":"User","site_admin":false},"labels":[{"id":583426710,"url":"https://api.github.com/repos/rust-lang/rust/labels/S-waiting-on-review","name":"S-waiting-on-review","color":"d3dddd","default":false}],"state":"open","locked":false,"assignee":{"login":"pietroalbini","id":2299951,"avatar_url":"https://avatars3.githubusercontent.com/u/2299951?v=4","gravatar_id":"","url":"https://api.github.com/users/pietroalbini","html_url":"https://github.com/pietroalbini","followers_url":"https://api.github.com/users/pietroalbini/followers","following_url":"https://api.github.com/users/pietroalbini/following{/other_user}","gists_url":"https://api.github.com/users/pietroalbini/gists{/gist_id}","starred_url":"https://api.github.com/users/pietroalbini/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pietroalbini/subscriptions","organizations_url":"https://api.github.com/users/pietroalbini/orgs","repos_url":"https://api.github.com/users/pietroalbini/repos","events_url":"https://api.github.com/users/pietroalbini/events{/privacy}","received_events_url":"https://api.github.com/users/pietroalbini/received_events","type":"User","site_admin":false},"assignees":[{"login":"pietroalbini","id":2299951,"avatar_url":"https://avatars3.githubusercontent.com/u/2299951?v=4","gravatar_id":"","url":"https://api.github.com/users/pietroalbini","html_url":"https://github.com/pietroalbini","followers_url":"https://api.github.com/users/pietroalbini/followers","following_url":"https://api.github.com/users/pietroalbini/following{/other_user}","gists_url":"https://api.github.com/users/pietroalbini/gists{/gist_id}","starred_url":"https://api.github.com/users/pietroalbini/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pietroalbini/subscriptions","organizations_url":"https://api.github.com/users/pietroalbini/orgs","repos_url":"https://api.github.com/users/pietroalbini/repos","events_url":"https://api.github.com/users/pietroalbini/events{/privacy}","received_events_url":"https://api.github.com/users/pietroalbini/received_events","type":"User","site_admin":false}],"milestone":null,"comments":1,"created_at":"2018-05-24T18:59:50Z","updated_at":"2018-05-24T19:50:14Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/rust-lang/rust/pulls/51040","html_url":"https://github.com/rust-lang/rust/pull/51040","diff_url":"https://github.com/rust-lang/rust/pull/51040.diff","patch_url":"https://github.com/rust-lang/rust/pull/51040.patch"},"body":"r? @pietroalbini "},"comment":{"url":"https://api.github.com/repos/rust-lang/rust/issues/comments/391837639","html_url":"https://github.com/rust-lang/rust/pull/51040#issuecomment-391837639","issue_url":"https://api.github.com/repos/rust-lang/rust/issues/51040","id":391837639,"user":{"login":"rust-highfive","id":7378925,"avatar_url":"https://avatars3.githubusercontent.com/u/7378925?v=4","gravatar_id":"","url":"https://api.github.com/users/rust-highfive","html_url":"https://github.com/rust-highfive","followers_url":"https://api.github.com/users/rust-highfive/followers","following_url":"https://api.github.com/users/rust-highfive/following{/other_user}","gists_url":"https://api.github.com/users/rust-highfive/gists{/gist_id}","starred_url":"https://api.github.com/users/rust-highfive/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rust-highfive/subscriptions","organizations_url":"https://api.github.com/users/rust-highfive/orgs","repos_url":"https://api.github.com/users/rust-highfive/repos","events_url":"https://api.github.com/users/rust-highfive/events{/privacy}","received_events_url":"https://api.github.com/users/rust-highfive/received_events","type":"User","site_admin":false},"created_at":"2018-05-24T19:50:14Z","updated_at":"2018-05-24T19:50:14Z","author_association":"COLLABORATOR","body":"\nThe job `x86_64-gnu-llvm-3.9` of your PR [failed on Travis](https://travis-ci.org/rust-lang/rust/jobs/383350199) ([raw log](https://api.travis-ci.org/v3/job/383350199/log.txt)). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.\n\n<details><summary><i>Click to expand the log.</i></summary>\n\n```plain\nCheck compiletest suite=ui mode=ui (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)\n[00:46:40] \n[00:46:40] running 1388 tests\n[00:46:45] ..................................................................................i.................\n[00:46:51] .............F..................i...................................................................\n[00:46:58] ....................................................................................................\n[00:47:02] ....................................................................................................\n[00:47:05] ....................................................................................................\n[00:47:11] ....................................................................................................\n---\n[00:47:53] ---- [ui] ui/const-eval/dont_promote_unstable_const_fn.rs stdout ----\n[00:47:53]  diff of stderr:\n[00:47:53] \n[00:47:53] 27    |\n[00:47:53] 28    = note: borrowed value must be valid for the static lifetime...\n[00:47:53] - error: aborting due to 3 previous errors\n[00:47:53] - error: aborting due to 3 previous errors\n[00:47:53] + error[E0597]: borrowed value does not live long enough\n[00:47:53] +   --> $DIR/dont_promote_unstable_const_fn.rs:33:26\n[00:47:53] +    |\n[00:47:53] + LL |     let x: &'static _ = &std::time::Duration::from_millis(42).subsec_millis();\n[00:47:53] +    |                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ temporary value does not live long enough\n[00:47:53] + LL | }\n[00:47:53] +    | - temporary value only lives until here\n[00:47:53] +    |\n[00:47:53] +    = note: borrowed value must be valid for the static lifetime...\n[00:47:53] + error: aborting due to 4 previous errors\n[00:47:53] 31 \n[00:47:53] 32 For more information about this error, try `rustc --explain E0597`.\n[00:47:53] 33 \n---\n[00:47:53] /checkout/src/test/ui/update-references.sh '/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui' 'const-eval/dont_promote_unstable_const_fn.rs'\n[00:47:53] \n[00:47:53] error: 1 errors occurred comparing output.\n[00:47:53] status: exit code: 101\n[00:47:53] command: \"/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc\" \"/checkout/src/test/ui/const-eval/dont_promote_unstable_const_fn.rs\" \"-L\" \"/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui\" \"--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/const-eval/dont_promote_unstable_const_fn.stage2-x86_64-unknown-linux-gnu\" \"-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/const-eval/dont_promote_unstable_const_fn.stage2-x86_64-unknown-linux-gnu.aux\" \"-A\" \"unused\"\n[00:47:53] ------------------------------------------\n[00:47:53] \n[00:47:53] ------------------------------------------\n[00:47:53] stderr:\n[00:47:53] stderr:\n[00:47:53] ------------------------------------------\n[00:47:53] {\"message\":\"`foo` is not yet stable as a const fn\",\"code\":null,\"level\":\"error\",\"spans\":[{\"file_name\":\"/checkout/src/test/ui/const-eval/dont_promote_unstable_const_fn.rs\",\"byte_start\":867,\"byte_end\":872,\"line_start\":25,\"line_end\":25,\"column_start\":25,\"column_end\":30,\"is_primary\":true,\"text\":[{\"text\":\"const fn bar() -> u32 { foo() } //~ ERROR `foo` is not yet stable as a const fn\",\"highlight_start\":25,\"highlight_end\":30}],\"label\":null,\"suggested_replacement\":null,\"expansion\":null}],\"children\":[{\"message\":\"in Nightly builds, add `#![feature(foo)]` to the crate attributes to enable\",\"code\":null,\"level\":\"help\",\"spans\":[],\"children\":[],\"rendered\":null}],\"rendered\":\"error: `foo` is not yet stable as a const fn\\n  --> /checkout/src/test/ui/const-eval/dont_promote_unstable_const_fn.rs:25:25\\n   |\\nLL | const fn bar() -> u32 { foo() } //~ ERROR `foo` is not yet stable as a const fn\\n   |                         ^^^^^\\n   |\\n   = help: in Nightly builds, add `#![feature(foo)]` to the crate attributes to enable\\n\\n\"}\n[00:47:53] {\"message\":\"borrowed value does not live long enough\",\"code\":{\"code\":\"E0597\",\"explanation\":\"\\nThis error occurs because a borrow was made inside a variable which has a\\ngreater lifetime than the borrowed one.\\n\\nExample of erroneous code:\\n\\n```compile_fail,E0597\\nstruct Foo<'a> {\\n    x: Option<&'a u32>,\\n}\\n\\nlet mut x = Foo { x: None };\\nlet y = 0;\\nx.x = Some(&y); // error: `y` does not live long enough\\n```\\n\\nIn here, `x` is created before `y` and therefore has a greater lifetime. Always\\nkeep in mind that values in a scope are dropped in the opposite order they are\\ncreated. So to fix the previous example, just make the `y` lifetime greater than\\nthe `x`'s one:\\n\\n```\\nstruct Foo<'a> {\\n    x: Option<&'a u32>,\\n}\\n\\nlet y = 0;\\nlet mut x = Foo { x: None };\\nx.x = Some(&y);\\n```\\n\"},\"level\":\"error\",\"spans\":[{\"file_name\":\"/checkout/src/test/ui/const-eval/dont_promote_unstable_const_fn.rs\",\"byte_start\":960,\"byte_end\":965,\"line_start\":28,\"line_end\":28,\"column_start\":28,\"column_end\":33,\"is_primary\":true,\"text\":[{\"text\":\"    let _: &'static u32 = &foo(); //~ ERROR does not live long enough\",\"highlight_start\":28,\"highlight_end\":33}],\"label\":\"temporary value does not live long enough\",\"suggested_replacement\":null,\"expansion\":null},{\"file_name\":\"/checkout/src/test/ui/const-eval/dont_promote_unstable_const_fn.rs\",\"byte_start\":1003,\"byte_end\":1004,\"line_start\":29,\"line_end\":29,\"column_start\":1,\"column_end\":2,\"is_primary\":false,\"text\":[{\"text\":\"}\",\"highlight_start\":1,\"highlight_end\":2}],\"label\":\"temporary value only lives until here\",\"suggested_replacement\":null,\"expansion\":null}],\"children\":[{\"message\":\"borrowed value must be valid for the static lifetime...\",\"code\":null,\"level\":\"note\",\"spans\":[],\"children\":[],\"rendered\":null}],\"rendered\":\"error[E0597]: borrowed value does not live long enough\\n  --> /checkout/src/test/ui/const-eval/dont_promote_unstable_const_fn.rs:28:28\\n   |\\nLL |     le:1168,\"line_start\":34,\"line_end\":34,\"column_start\":1,\"column_end\":2,\"is_primary\":false,\"text\":[{\"text\":\"}\",\"highlight_start\":1,\"highlight_end\":2}],\"label\":\"temporary value only lives until here\",\"suggested_replacement\":null,\"expansion\":null}],\"children\":[{\"message\":\"borrowed value must be valid for the static lifetime...\",\"code\":null,\"level\":\"note\",\"spans\":[],\"children\":[],\"rendered\":null}],\"rendered\":\"error[E0597]: borrowed value does not live long enough\\n  --> /checkout/src/test/ui/const-eval/dont_promote_unstable_const_fn.rs:32:28\\n   |\\nLL |     let _: &'static u32 = &meh(); //~ ERROR does not live long enough\\n   |                            ^^^^^ temporary value does not live long enough\\nLL |     let x: &'static _ = &std::time::Duration::from_millis(42).subsec_millis();\\nLL | }\\n   | - temporary value only lives until here\\n   |\\n   = note: borrowed value must be valid for the static lifetime...\\n\\n\"}\n[00:47:53] {\"message\":\"borrowed value does not live long enough\",\"code\":{\"code\":\"E0597\",\"explanation\":\"\\nThis error occurs because a borrow was made inside a variable which has a\\ngreater lifetime than the borrowed one.\\n\\nExample of erroneous code:\\n\\n```compile_fail,E0597\\nstruct Foo<'a> {\\n    x: Option<&'a u32>,\\n}\\n\\nlet mut x = Foo { x: None };\\nlet y = 0;\\nx.x = Some(&y); // error: `y` does not live long enough\\n```\\n\\nIn here, `x` is created before `y` and therefore has a greater lifetime. Always\\nkeep in mind that values in a scope are dropped in the opposite order they are\\ncreated. So to fix the previous example, just make the `y` lifetime greater than\\nthe `x`'s one:\\n\\n```\\nstruct Foo<'a> {\\n    x: Option<&'a u32>,\\n}\\n\\nlet y = 0;\\nlet mut x = Foo { x: None };\\nx.x = Some(&y);\\n```\\n\"},\"level\":\"error\",\"spans\":[{\"file_name\":\"/checkout/src/test/ui/const-eval/dont_promote_unstable_const_fn.rs\",\"byte_start\":1113,\"byte_end\":1165,\"line_start\":33,\"line_end\":33,\"column_start\":26,\"column_end\":78,\"is_primary\":true,\"text\":[{\"text\":\"    let x: &'static _ = &std::time::Duration::from_millis(42).subsec_millis();\",\"highlight_start\":26,\"highlight_end\":78}],\"label\":\"temporary value does not live long enough\",\"suggested_replacement\":null,\"expansion\":null},{\"file_name\":\"/checkout/src/test/ui/const-eval/dont_promote_unstable_const_fn.rs\",\"byte_start\":1167,\"byte_end\":1168,\"line_start\":34,\"line_end\":34,\"column_start\":1,\"column_end\":2,\"is_primary\":false,\"text\":[{\"text\":\"}\",\"highlight_start\":1,\"highlight_end\":2}],\"label\":\"temporary value only lives until here\",\"suggested_replacement\":null,\"expansion\":null}],\"children\":[{\"message\":\"borrowed value must be valid for the static lifetime...\",\"code\":null,\"level\":\"note\",\"spans\":[],\"children\":[],\"rendered\":null}],\"rendered\":\"error[E0597]: borrowed value does not live long enough\\n  --> /checkout/src/test/ui/const-eval/dont_promote_unstable_const_fn.rs:33:26\\n   |\\nLL |     let x: &'static _ = &std::time::Duration::from_millis(42).subsec_millis();\\n   |                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ temporary value does not live long enough\\nLL | }\\n   | - temporary value only lives until here\\n   |\\n   = note: borrowed value must be valid for the static lifetime...\\n\\n\"}\n[00:47:53] {\"message\":\"aborting due to 4 previous errors\",\"code\":null,\"level\":\"error\",\"spans\":[],\"children\":[],\"rendered\":\"error: aborting due to 4 previous errors\\n\\n\"}\n[00:47:53] {\"message\":\"For more information about this error, try `rustc --explain E0597`.\",\"code\":null,\"level\":\"\",\"spans\":[],\"children\":[],\"rendered\":\"For more information about this error, try `rustc --explain E0597`.\\n\"}\n[00:47:53] ------------------------------------------\n[00:47:53] \n[00:47:53] thread 'main' panicked at 'Some tests failed', tools/compiletest/src/main.rs:492:22\n[00:47:53] thread '[ui] ui/const-eval/dont_promote_unstable_const_fn.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3033:9\n---\n[00:47:53] test result: FAILED. 1380 passed; 1 failed; 7 ignored; 0 measured; 0 filtered out\n[00:47:53] \n[00:47:53] \n[00:47:53] \n[00:47:53] 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/ui\" \"--build-base\" \"/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui\" \"--stage-id\" \"stage2-x86_64-unknown-linux-gnu\" \"--mode\" \"ui\" \"--target\" \"x86_64-unknown-linux-gnu\" \"--host\" \"x86_64-unknown-linux-gnu\" \"--llvm-filecheck\" \"/usr/lib/llvm-3.9/bin/FileCheck\" \"--host-rustcflags\" \"-Crpath -O -Zunstable-options \" \"--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\" \"3.9.1\\n\" \"--system-llvm\" \"--cc\" \"\" \"--cxx\" \"\" \"--cflags\" \"\" \"--llvm-components\" \"\" \"--llvm-cxxflags\" \"\" \"--adb-path\" \"adb\" \"--adb-test-dir\" \"/data/tmp/work\" \"--android-cross-path\" \"\" \"--color\" \"always\"\n[00:47:53] \n[00:47:53] \n[00:47:53] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test\n[00:47:53] Build completed unsuccessfully in 0:02:30\n[00:47:53] Build completed unsuccessfully in 0:02:30\n[00:47:53] Makefile:58: recipe for target 'check' failed\n[00:47:53] make: *** [check] Error 1\n2728572 ./obj\n2728540 ./obj/build\n1965008 ./obj/build/x86_64-unknown-linux-gnu\n927472 ./.git\n---\n149560 ./.git/modules\n149556 ./.git/modules/src\n149112 ./src/llvm-emscripten/test\n123932 ./obj/build/bootstrap/debug/incremental/bootstrap-368kjpmz08h8o\n123928 ./obj/build/bootstrap/debug/incremental/bootstrap-368kjpmz08h8o/s-f1cct4tn4t-shn094-a5eqdv1qeuis\n112612 ./obj/build/x86_64-unknown-linux-gnu/stage0-tools/x86_64-unknown-linux-gnu\n112608 ./obj/build/x86_64-unknown-linux-gnu/stage0-tools/x86_64-unknown-linux-gnu/release\n108616 ./obj/build/x86_64-unknown-linux-gnu/stage0-tools/x86_64-unknown-linux-gnu/release/deps\n103440 ./obj/build/bootstrap/debug/incremental/bootstrap-152hben4kxal2\n103440 ./obj/build/bootstrap/debug/incremental/bootstrap-152hben4kxal2\n103436 ./obj/build/bootstrap/debug/incremental/bootstrap-152hben4kxal2/s-f1cdzfipci-13aqc0b-18d35k9c9hp7o\n98488 ./obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/incremental\n93352 ./obj/build/x86_64-unknown-linux-gnu/stage1\n93328 ./obj/build/x86_64-unknown-linux-gnu/stage1/lib\n90856 ./obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/incremental/core-31lccp6wy7orz\n90856 ./obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/incremental/core-31lccp6wy7orz\n90852 ./obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/incremental/core-31lccp6wy7orz/s-f1cdwzhutq-z3j9ws-ek2w5d5pqxih\n87768 ./obj/build/x86_64-unknown-linux-gnu/doc/core\n81228 ./obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps\n80932 ./obj/build/x86_64-unknown-linux-gnu/doc/std\n79028 ./obj/build/x86_64-unknown-linux-gnu/stage0-sysroot\n```\n\n</details><p></p>\n\n[I'm a bot](https://github.com/rust-ops/rust-log-analyzer)! 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](https://github.com/rust-ops/rust-log-analyzer/issues?q=is%3Aopen+is%3Aissue+label%3Afeature-request))\n        "}}
{"actor":{"display_login":"rust-highfive"}}