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

Stabilize futures_api #59739

Merged
merged 2 commits into from Apr 24, 2019

Conversation

@cramertj
Copy link
Member

commented Apr 5, 2019

cc #59725.
Based on #59733 and #59119 -- only the last two commits here are relevant.

r? @withoutboats , @oli-obk for the introduction of rustc_allow_const_fn_ptr.


@XAMPPRocky Prefer T-libs for relnotes.

// Centril

@Centril

This comment has been minimized.

Copy link
Member

commented Apr 5, 2019

Marking as blocked on FCP completion in #59725.

@cramertj cramertj force-pushed the cramertj:stabilize branch 2 times, most recently from f48faf9 to b55c014 Apr 5, 2019

@rust-highfive

This comment was marked as outdated.

Copy link
Collaborator

commented Apr 5, 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:0ce09000:start=1554501761518317418,finish=1554501763819717423,duration=2301400005
$ 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
$ export GCP_CACHE_BUCKET=rust-lang-ci-cache
Setting environment variables from .travis.yml
---

[00:04:15] travis_fold:start:tidy
travis_time:start:tidy
tidy check
[00:04:15] tidy error: /checkout/src/test/ui/consts/min_const_fn/allow_const_fn_ptr_feature_gate.rs:7: line longer than 100 chars
[00:04:16] some tidy checks failed
[00:04:16] 
[00:04:16] 
[00:04:16] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/tidy" "/checkout/src" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "--no-vendor" "--quiet"
[00:04:16] 
[00:04:16] 
[00:04:16] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test src/tools/tidy
[00:04:16] Build completed unsuccessfully in 0:00:44
[00:04:16] Build completed unsuccessfully in 0:00:44
[00:04:16] Makefile:67: recipe for target 'tidy' failed
[00:04:16] make: *** [tidy] Error 1
The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:1b96ad82
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
Fri Apr  5 22:07:11 UTC 2019
---
travis_time:end:1a461a5e:start=1554502032577699046,finish=1554502032582221674,duration=4522628
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:1701e322
$ 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:06ccd950
travis_time:start:06ccd950
$ 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:07d1e286
$ 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)

Show resolved Hide resolved src/libcore/task/wake.rs Outdated
Show resolved Hide resolved src/libcore/task/wake.rs

@cramertj cramertj force-pushed the cramertj:stabilize branch from b55c014 to 6ca4d13 Apr 5, 2019

@cramertj cramertj force-pushed the cramertj:stabilize branch from 6ca4d13 to 75e26c7 Apr 5, 2019

@Centril Centril dismissed their stale review Apr 5, 2019

Done

//
// FIXME: remove whenever we have a stable way to accept fn pointers from
// const fn (see rfcs/pull/2632)
#[cfg_attr(not(stage0), rustc_allow_const_fn_ptr)]
pub const fn new(
clone: unsafe fn(*const ()) -> RawWaker,

This comment has been minimized.

Copy link
@eddyb

eddyb Apr 6, 2019

Member

I'm a bit surprised we're stabilizing this implementation detail, I would've expected an actual trait to be involved, and these fn pointers to be obtained internally (which I think is allowed? oh but const fn can't have trait bounds, hmpf).

Also, *const () in a public API? Seems a bit off, I thought we were using extern type pointers nowadays?


Anyway, regarding the matter at hand, which is constructors that happen to have banned types, I think this is how we can allow them without allowing the same types in any non-constructor const fn: rust-rfcs/const-eval#19 (comment) (by making them pattern aliases)

It also means calls would be promotable, which is good, right?

This comment has been minimized.

Copy link
@eddyb

eddyb Apr 6, 2019

Member

Actually, there is no reason for this to this unsafe.

While the fields of this struct have to be unsafe fn(*const ()), the arguments could be fn(&mut T) where the constructor is generic over T.
Sadly, this can't be directly coupled with RawWaker's constructor, but that's only because RawWakerVTable isn't itself generic... RawWaker could store a RawWakerVTable<SomePrivateExternType>, and it would all be much safer.

I'm sorry I haven't remarked this before, I kept thinking this "raw vtable" stuff was kept internal so therefore no need to make it more contrived for safety, I guess I was wrong...

This comment has been minimized.

Copy link
@eddyb

eddyb Apr 6, 2019

Member

Bonus: you could pass a closure where a fn(&mut T) is expected, and it will just work!

So you can add extra behavior or w/e, pretty easily.

This comment has been minimized.

Copy link
@Nemo157

Nemo157 Apr 6, 2019

Contributor

I think making the arguments &mut would make this implementation unsound since it uses the same data pointer for all instances.

This comment has been minimized.

Copy link
@cramertj

cramertj Apr 8, 2019

Author Member

This was already discussed on the RFC (why it isn't a trait and why futures-rs will provide a safe trait for it).

This comment has been minimized.

Copy link
@eddyb

eddyb Apr 16, 2019

Member

@cramertj oops, I should've made separate comments, your resolving meant people wouldn't see my approval of rustc_allow_const_fn_ptr (#59739 (comment))

Show resolved Hide resolved src/libcore/task/wake.rs Outdated

@eddyb eddyb referenced this pull request Apr 6, 2019

Closed

[Stabilization] Future APIs #59725

@oli-obk

oli-obk approved these changes Apr 6, 2019

@bors

This comment has been minimized.

Copy link
Contributor

commented Apr 7, 2019

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

@jonas-schievink jonas-schievink added this to the 1.36 milestone Apr 12, 2019

@cramertj cramertj force-pushed the cramertj:stabilize branch from 75e26c7 to 684f09e Apr 16, 2019

@rust-highfive

This comment has been minimized.

Copy link
Collaborator

commented Apr 16, 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:2eedb140:start=1555379039076918081,finish=1555379041119706030,duration=2042787949
$ 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
$ export GCP_CACHE_BUCKET=rust-lang-ci-cache
$ export AWS_ACCESS_KEY_ID=AKIA46X5W6CZEJZ6XT55
---
[01:03:57] .................................................................................................... 500/5542
[01:04:01] ................................................i................................................... 600/5542
[01:04:04] .................................................................................................... 700/5542
[01:04:09] .................................................................................................... 800/5542
[01:04:13] .....................................................................F.............................. 900/5542
[01:04:21] ..............................................iiiii................................................. 1100/5542
[01:04:25] .................................................................................................... 1200/5542
[01:04:27] .................................................................................................... 1300/5542
[01:04:30] .................................................................................................... 1400/5542
[01:04:30] .................................................................................................... 1400/5542
[01:04:33] .................................................................................................... 1500/5542
[01:04:35] ...........................FF....................................................................... 1600/5542
[01:04:42] .................................................................................................... 1800/5542
[01:04:46] .................................................................................................... 1900/5542
[01:04:49] .................................................................................................... 2000/5542
[01:04:53] .................................................................................................... 2100/5542
---
[01:07:03] 
[01:07:03] ---- [ui] ui/consts/min_const_fn/allow_const_fn_ptr_feature_gate.rs stdout ----
[01:07:03] diff of stderr:
[01:07:03] 
[01:07:03] - error[E0658]: unless otherwise specified, attributes with the prefix `rustc_` are reserved for internal compiler diagnostics (see issue #29642)
[01:07:03] + error[E0658]: unless otherwise specified, attributes with the prefix `rustc_` are reserved for internal compiler diagnostics
[01:07:03] 2   --> $DIR/allow_const_fn_ptr_feature_gate.rs:7:3
[01:07:03] 4 LL | #[rustc_allow_const_fn_ptr]
[01:07:03] 
[01:07:03] 5    |   ^^^^^^^^^^^^^^^^^^^^^^^^
[01:07:03] 6    |
[01:07:03] 6    |
[01:07:03] +    = note: for more information, see https://github.com/rust-lang/rust/issues/29642
[01:07:03] 7    = help: add #![feature(rustc_attrs)] to the crate attributes to enable
[01:07:03] 8 
[01:07:03] 9 error: aborting due to previous error
[01:07:03] 
[01:07:03] 
[01:07:03] The actual stderr differed from the expected stderr.
[01:07:03] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/consts/min_const_fn/allow_const_fn_ptr_feature_gate/allow_const_fn_ptr_feature_gate.stderr
[01:07:03] To update references, rerun the tests and pass the `--bless` flag
[01:07:03] To only update this specific test, also pass `--test-args consts/min_const_fn/allow_const_fn_ptr_feature_gate.rs`
[01:07:03] error: 1 errors occurred comparing output.
[01:07:03] status: exit code: 1
[01:07:03] status: exit code: 1
[01:07:03] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/consts/min_const_fn/allow_const_fn_ptr_feature_gate.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/ui/consts/min_const_fn/allow_const_fn_ptr_feature_gate/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/min_const_fn/allow_const_fn_ptr_feature_gate/auxiliary" "-A" "unused"
[01:07:03] ------------------------------------------
[01:07:03] 
[01:07:03] ------------------------------------------
[01:07:03] stderr:
[01:07:03] stderr:
[01:07:03] ------------------------------------------
[01:07:03] {"message":"unless otherwise specified, attributes with the prefix `rustc_` are reserved for internal compiler diagnostics","code":{"code":"E0658","explanation":"\nAn unstable feature was used.\n\nErroneous code example:\n\n```compile_fail,E658\n#[repr(u128)] // error: use of unstable library feature 'repr128'\nenum Foo {\n    Bar(u64),\n}\n```\n\nIf you're using a stable or a beta version of rustc, you won't be able to use\nany unstable features. In order to do so, please switch to a nightly version of\nrustc (by using rustup).\n\nIf you're using a nightly version of rustc, just add the corresponding feature\nto be able to use it:\n\n```\n#![feature(repr128)]\n\n#[repr(u128)] // ok!\nenum Foo {\n    Bar(u64),\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/consts/min_const_fn/allow_const_fn_ptr_feature_gate.rs","byte_start":147,"byte_end":171,"line_start":7,"line_end":7,"column_start":3,"column_end":27,"is_primary":true,"text":[{"text":"#[rustc_allow_const_fn_ptr]","highlight_start":3,"highlight_end":27}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"for more information, see https://github.com/rust-lang/rust/issues/29642","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"add #![feature(rustc_attrs)] to the crate attributes to enable","code":null,"level":"help","spans":[],"children":[],"rendered":null}],"rendered":"error[E0658]: unless otherwise specified, attributes with the prefix `rustc_` are reserved for internal compiler diagnostics\n  --> /checkout/src/test/ui/consts/min_const_fn/allow_const_fn_ptr_feature_gate.rs:7:3\n   |\nLL | #[rustc_allow_const_fn_ptr]\n   |   ^^^^^^^^^^^^^^^^^^^^^^^^\n   |\n   = note: for more information, see https://github.com/rust-lang/rust/issues/29642\n   = help: add #![feature(rustc_attrs)] to the crate attributes to enable\n\n"}
[01:07:03] {"message":"For more information about this error, try `rustc --explain E0658`.","code":null,"level":"","spans":[],"children":[],"rendered":"For more information about this error, try `rustc --explain E0658`.\n"}
[01:07:03] 
[01:07:03] ------------------------------------------
[01:07:03] 
[01:07:03] 
[01:07:03] thread '[ui] ui/consts/min_const_fn/allow_const_fn_ptr_feature_gate.rs' panicked at 'explicit panic', src/tools/compiletest/src/runtest.rs:3469:9
[01:07:03] note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
[01:07:03] 
[01:07:03] ---- [ui] ui/feature-gates/feature-gate-async-await.rs stdout ----
[01:07:03] diff of stderr:
[01:07:03] 
[01:07:03] - error[E0658]: async fn is unstable (see issue #50547)
[01:07:03] + error[E0658]: async fn is unstable
[01:07:03] 3    |
[01:07:03] 3    |
[01:07:03] 4 LL | async fn foo() {}
[01:07:03] 7    = note: for more information, see https://github.com/rust-lang/rust/issues/50547
[01:07:03] 7    = note: for more information, see https://github.com/rust-lang/rust/issues/50547
[01:07:03] 8    = help: add #![feature(async_await)] to the crate attributes to enable
[01:07:03] 9 
[01:07:03] - error[E0658]: async blocks are unstable (see issue #50547)
[01:07:03] + error[E0658]: async blocks are unstable
[01:07:03] 12    |
[01:07:03] 12    |
[01:07:03] 13 LL |     let _ = async {};
[01:07:03] 16    = note: for more information, see https://github.com/rust-lang/rust/issues/50547
[01:07:03] 16    = note: for more information, see https://github.com/rust-lang/rust/issues/50547
[01:07:03] 17    = help: add #![feature(async_await)] to the crate attributes to enable
[01:07:03] 18 
[01:07:03] - error[E0658]: async closures are unstable (see issue #50547)
[01:07:03] + error[E0658]: async closures are unstable
[01:07:03] 21    |
[01:07:03] 21    |
[01:07:03] 22 LL |     let _ = async || {};
[01:07:03] 
[01:07:03] The actual stderr differed from the expected stderr.
[01:07:03] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/feature-gates/feature-gate-async-await/feature-gate-async-await.stderr
[01:07:03] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/feature-gates/feature-gate-async-await/feature-gate-async-await.stderr
[01:07:03] To update references, rerun the tests and pass the `--bless` flag
[01:07:03] To only update this specific test, also pass `--test-args feature-gates/feature-gate-async-await.rs`
[01:07:03] error: 1 errors occurred comparing output.
[01:07:03] status: exit code: 1
[01:07:03] status: exit code: 1
[01:07:03] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/feature-gates/feature-gate-async-await.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/ui/feature-gates/feature-gate-async-await/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--edition=2018" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/feature-gates/feature-gate-async-await/auxiliary" "-A" "unused"
[01:07:03] ------------------------------------------
[01:07:03] 
[01:07:03] ------------------------------------------
[01:07:03] stderr:
[01:07:03] stderr:
[01:07:03] ------------------------------------------
[01:07:03] {"message":"async fn is unstable","code":{"code":"E0658","explanation":"\nAn unstable feature was used.\n\nErroneous code example:\n\n```compile_fail,E658\n#[repr(u128)] // error: use of unstable library feature 'repr128'\nenum Foo {\n    Bar(u64),\n}\n```\n\nIf you're using a stable or a beta version of rustc, you won't be able to use\nany unstable features. In order to do so, please switch to a nightly version of\nrustc (by using rustup).\n\nIf you're using a nightly version of rustc, just add the corresponding feature\nto be able to use it:\n\n```\n#![feature(repr128)]\n\n#[repr(u128)] // ok!\nenum Foo {\n    Bar(u64),\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/feature-gates/feature-gate-async-await.rs","byte_start":17,"byte_end":34,"line_start":3,"line_end":3,"column_start":1,"column_end":18,"is_primary":true,"text":[{"text":"async fn foo() {} //~ ERROR async fn is unstable","highlight_start":1,"highlight_end":18}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"for more information, see https://github.com/rust-lang/rust/issues/50547","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"add #![feature(async_await)] to the crate attributes to enable","code":null,"level":"help","spans":[],"children":[],"rendered":null}],"rendered":"error[E0658]: async fn is unstable\n  --> /checkout/src/test/ui/feature-gates/feature-gate-async-await.rs:3:1\n   |\nLL | async fn foo() {} //~ ERROR async fn is unstable\n   | ^^^^^^^^^^^^^^^^^\n   |\n   = note: for more information, see https://github.com/rust-lang/rust/issues/50547\n   = help: add #![feature(async_await)] to the crate attributes to enable\n\n"}
[01:07:03] {"message":"async blocks are unstable","code":{"code":"E0658","explanation":"\nAn unstable feature was used.\n\nErroneous code example:\n\n```compile_fail,E658\n#[repr(u128)] // error: use of unstable library feature 'repr128'\nenum Foo {\n    Bar(u64),\n}\n```\n\nIf you're using a stable or a beta version of rustc, you won't be able to use\nany unstable features. In order to do so, please switch to a nightly version of\nrustc (by using rustup).\n\nIf you're using a nightly version of rustc, just add the corresponding feature\nto be able to use it:\n\n```\n#![feature(repr128)]\n\n#[repr(u128)] // ok!\nenum Foo {\n    Bar(u64),\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/feature-gates/feature-gate-async-await.rs","byte_start":91,"byte_end":99,"line_start":6,"line_end":6,"column_start":13,"column_end":21,"is_primary":true,"text":[{"text":"    let _ = async {}; //~ ERROR async blocks are unstable","highlight_start":13,"highlight_end":21}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"for more information, see https://github.com/rust-lang/rust/issues/50547","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"add #![feature(async_await)] to the crate attributes to enable","code":null,"level":"help","spans":[],"children":[],"rendered":null}],"rendered":"error[E0658]: async blocks are unstable\n  --> /checkout/src/test/ui/feature-gates/feature-gate-async-await.rs:6:13\n   |\nLL |     let _ = async {}; //~ ERROR async blocks are unstable\n   |             ^^^^^^^^\n   |\n   = note: for more information, see https://github.com/rust-lang/rust/issues/50547\n   = help: add #![feature(async_await)] to the crate attributes to enable\n\n"}
[01:07:03] {"message":"async closures are unstable","code":{"code":"E0658","explanation":"\nAn unstable feature was used.\n\nErroneous code example:\n\n```compile_fail,E658\n#[repr(u128)] // error: use of unstable library feature 'repr128'\nenum Foo {\n    Bar(u64),\n}\n```\n\nIf you're using a stable or a beta version of rustc, you won't be able to use\nany unstable features. In order to do so, please switch to a nightly version of\nrustc (by using rustup).\n\nIf you're using a nightly version of rustc, just add the corresponding feature\nto be able to use it:\n\n```\n#![feature(repr128)]\n\n#[repr(u128)] // ok!\nenum Foo {\n    Bar(u64),\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/feature-gates/feature-gate-async-await.rs","byte_start":149,"byte_end":160,"line_start":7,"line_end":7,"column_start":13,"column_end":24,"is_primary":true,"text":[{"text":"    let _ = async || {}; //~ ERROR async closures are unstable","highlight_start":13,"highlight_end":24}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"for more information, see https://github.com/rust-lang/rust/issues/50547","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"add #![feature(async_await)] to the crate attributes to enable","code":null,"level":"help","spans":[],"children":[],"rendered":null}],"rendered":"error[E0658]: async closures are unstable\n  --> /checkout/src/test/ui/feature-gates/feature-gate-async-await.rs:7:13\n   |\nLL |     let _ = async || {}; //~ ERROR async closures are unstable\n   |             ^^^^^^^^^^^\n   |\n   = note: for more information, see https://github.com/rust-lang/rust/issues/50547\n   = help: add #![feature(async_await)] to the crate attributes to enable\n\n"}
[01:07:03] {"message":"For more information about this error, try `rustc --explain E0658`.","code":null,"level":"","spans":[],"children":[],"rendered":"For more information about this error, try `rustc --explain E0658`.\n"}
[01:07:03] 
[01:07:03] ------------------------------------------
[01:07:03] 
[01:07:03] 
[01:07:03] thread '[ui] ui/feature-gates/feature-gate-async-await.rs' panicked at 'explicit panic', src/tools/compiletest/src/runtest.rs:3469:9
[01:07:03] 
[01:07:03] ---- [ui] ui/feature-gates/feature-gate-async-await-2015-edition.rs stdout ----
[01:07:03] diff of stderr:
[01:07:03] 
[01:07:03] 16 LL |     let _ = async || { true };
[01:07:03] 18 
[01:07:03] 18 
[01:07:03] - error[E0658]: async fn is unstable (see issue #50547)
[01:07:03] + error[E0658]: async fn is unstable
[01:07:03] 21    |
[01:07:03] 21    |
[01:07:03] 22 LL | async fn foo() {}
[01:07:03] 
[01:07:03] The actual stderr differed from the expected stderr.
[01:07:03] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/feature-gates/feature-gate-async-await-2015-edition/feature-gate-async-await-2015-edition.stderr
[01:07:03] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/feature-gates/feature-gate-async-await-2015-edition/feature-gate-async-await-2015-edition.stderr
[01:07:03] To update references, rerun the tests and pass the `--bless` flag
[01:07:03] To only update this specific test, also pass `--test-args feature-gates/feature-gate-async-await-2015-edition.rs`
[01:07:03] error: 1 errors occurred comparing output.
[01:07:03] status: exit code: 1
[01:07:03] status: exit code: 1
[01:07:03] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/feature-gates/feature-gate-async-await-2015-edition.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/ui/feature-gates/feature-gate-async-await-2015-edition/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--edition=2015" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/feature-gates/feature-gate-async-await-2015-edition/auxiliary" "-A" "unused"
[01:07:03] ------------------------------------------
[01:07:03] 
[01:07:03] ------------------------------------------
[01:07:03] stderr:
[01:07:03] stderr:
[01:07:03] ------------------------------------------
[01:07:03] {"message":"`async fn` is not permitted in the 2015 edition","code":{"code":"E0670","explanation":"\nRust 2015 does not permit the use of `async fn`.\n\nExample of erroneous code:\n\n```compile_fail,E0670\nasync fn foo() {}\n```\n\nSwitch to the Rust 2018 edition to use `async fn`.\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/feature-gates/feature-gate-async-await-2015-edition.rs","byte_start":17,"byte_end":22,"line_start":3,"line_end":3,"column_start":1,"column_end":6,"is_primary":true,"text":[{"text":"async fn foo() {} //~ ERROR `async fn` is not permitted in the 2015 edition","highlight_start":1,"highlight_end":6}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0670]: `async fn` is not permitted in the 2015 edition\n  --> /checkout/src/test/ui/feature-gates/feature-gate-async-await-2015-edition.rs:3:1\n   |\nLL | async fn foo() {} //~ ERROR `async fn` is not permitted in the 2015 edition\n   | ^^^^^\n\n"}
[01:07:03] {"message":"cannot find struct, variant or union type `async` in this scope","code":{"code":"E0422","explanation":"\nYou are trying to use an identifier that is either undefined or not a struct.\nErroneous code example:\n\n```compile_fail,E0422\nfn main () {\n    let x = Foo { x: 1, y: 2 };\n}\n```\n\nIn this case, `Foo` is undefined, so it inherently isn't anything, and\ndefinitely not a struct.\n\n```compile_fail\nfn main () {\n    let foo = 1;\n    let x = foo { x: 1, y: 2 };\n}\n```\n\nIn this case, `foo` is defined, but is not a struct, so Rust can't use it as\none.\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/feature-gates/feature-gate-async-await-2015-edition.rs","byte_start":168,"byte_end":173,"line_start":7,"line_end":7,"column_start":13,"column_end":18,"is_primary":true,"text":[{"text":"    let _ = async {}; //~ ERROR cannot find struct, variant or union type `async`","highlight_start":13,"highlight_end":18}],"label":"not found in this scope","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0422]: cannot find struct, variant or union type `async` in this scope\n  --> /checkout/src/test/ui/feature-gates/feature-gate-async-await-2015-edition.rs:7:13\n   |\nLL |     let _ = async {}; //~ ERROR cannot find struct, variant or union type `async`\n   |             ^^^^^ not found in this scope\n\n"}
[01:07:03] {"message":"cannot find value `async` in this scope","code":{"code":"E0425","explanation":"\nAn unresolved name was used.\n\nErroneous code examples:\n\n```compile_fail,E0425\nsomething_that_doesnt_exist::foo;\n// error: unresolved name `something_that_doesnt_exist::foo`\n\n// or:\n\ntrait Foo {\n    fn bar() {\n        Self; // error: unresolved name `Self`\n    }\n}\n\n// or:\n\nlet x = unknown_variable;  // error: unresolved name `unknown_variable`\n```\n\nPlease verify that the name wasn't misspelled and ensure that the\nidentifier being referred to is valid for the given situation. Example:\n\n```\nenum something_that_does_exist {\n    Foo,\n}\n```\n\nOr:\n\n```\nmod something_that_does_exist {\n    pub static foo : i32 = 0i32;\n}\n\nsomething_that_does_exist::foo; // ok!\n```\n\nOr:\n\n```\nlet unknown_variable = 12u32;\nlet x = unknown_variable; // ok!\n```\n\nIf the item is not defined in the current module, it must be imported using a\n`use` statement, like so:\n\n```\n# mod foo { pub fn bar() {} }\n# fn main() {\nuse foo::bar;\nbar();\n# }\n```\n\nIf the item you are importing is not defined in some super-module of the\ncurrent module, then it must also be declared as public (e.g., `pub fn`).\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/feature-gates/feature-gate-async-await-2015-edition.rs","byte_start":250,"byte_end":255,"line_start":8,"line_end":8,"column_start":13,"column_end":18,"is_primary":true,"text":[{"text":"    let _ = async || { true }; //~ ERROR cannot find value `async` in this scope","highlight_start":13,"highlight_end":18}],"label":"not found in this scope","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0425]: cannot find value `async` in this scope\n  --> /checkout/src/test/ui/feature-gates/feature-gate-async-await-2015-edition.rs:8:13\n   |\nLL |     let _ = async || { true }; //~ ERROR cannot find value `async` in this scope\n   |             ^^^^^ not found in this scope\n\n"}
[01:07:03] {"message":"async fn is unstable","code":{"code":"E0658","explanation":"\nAn unstable feature was used.\n\nErroneous code example:\n\n```compile_fail,E658\n#[repr(u128)] // error: use of unstable library feature 'repr128'\nenum Foo {\n    Bar(u64),\n}\n```\n\nIf you're using a stable or a beta version of rustc, you won't be able to use\nany unstable features. In order to do so, please switch to a nightly version of\nrustc (by using rustup).\n\nIf you're using a nightly version of rustc, just add the corresponding feature\nto be able to use it:\n\n```\n#![feature(repr128)]\n\n#[repr(u128)] // ok!\nenum Foo {\n    Bar(u64),\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/feature-gates/feature-gate-async-await-2015-edition.rs","byte_start":17,"byte_end":34,"line_start":3,"line_end":3,"column_start":1,"column_end":18,"is_primary":true,"text":[{"text":"async fn foo() {} //~ ERROR `async fn` is not permitted in the 2015 edition","highlight_start":1,"highlight_end":18}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"for more information, see https://github.com/rust-lang/rust/issues/50547","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"add #![feature(async_await)] to the crate attributes to enable","code":null,"level":"help","spans":[],"children":[],"rendered":null}],"rendered":"error[E0658]: async fn is unstable\n  --> /checkout/src/test/ui/feature-gates/feature-gate-async-await-2015-edition.rs:3:1\n   |\nLL | async fn foo() {} //~ ERROR `async fn` is not permitted in the 2015 edition\n   | ^^^^^^^^^^^^^^^^^\n   |\n   = note: for more information, see https://github.com/rust-lang/rust/issues/50547\n   = help: add #![feature(async_await)] to the crate attributes to enable\n\n"}
[01:07:03] {"message":"aborting due to 4 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to 4 previous errors\n\n"}
[01:07:03] {"message":"Some errors occurred: E0422, E0425, E0658, E0670.","code":null,"level":"","spans":[],"children":[],"rendered":"Some errors occurred: E0422, E0425, E0658, E0670.\n"}
[01:07:03] 
[01:07:03] ------------------------------------------
[01:07:03] 
[01:07:03] thread '[ui] ui/feature-gates/feature-gate-async-await-2015-edition.rs' panicked at 'explicit panic', src/tools/compiletest/src/runtest.rs:3469:9
---
[01:07:03] 
[01:07:03] thread 'main' panicked at 'Some tests failed', src/tools/compiletest/src/main.rs:517:22
[01:07:03] 
[01:07:03] 
[01:07:03] 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-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:07:03] 
[01:07:03] 
[01:07:03] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[01:07:03] Build completed unsuccessfully in 0:04:18
[01:07:03] Build completed unsuccessfully in 0:04:18
[01:07:03] make: *** [check] Error 1
[01:07:03] Makefile:48: recipe for target 'check' failed
The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:003ba3d6
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
Tue Apr 16 02:51:15 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)

@cramertj cramertj force-pushed the cramertj:stabilize branch 2 times, most recently from cb64506 to bea79a1 Apr 16, 2019

@eddyb

eddyb approved these changes Apr 17, 2019

#[stable(feature = "futures_api", since = "1.36.0")]
Ready(
#[stable(feature = "futures_api", since = "1.36.0")]
T

This comment has been minimized.

Copy link
@lzutao

lzutao Apr 17, 2019

Contributor

I wonder why we stabilize this field. Is this intended?

This comment has been minimized.

Copy link
@Nemo157

Nemo157 Apr 17, 2019

Contributor

@lzutao other std enums with exposed fields have stabilization attributes as well e.g.

Some(#[stable(feature = "rust1", since = "1.0.0")] T),

The main way to use Poll is to match on it and access the field directly, it's basically a context specific version of Option.

This comment has been minimized.

Copy link
@lzutao

lzutao Apr 17, 2019

Contributor

Good to know. Thanks @Nemo157 .

Centril added a commit to Centril/rust that referenced this pull request Apr 23, 2019

Rollup merge of rust-lang#59739 - cramertj:stabilize, r=withoutboats
Stabilize futures_api

cc rust-lang#59725.
Based on rust-lang#59733 and rust-lang#59119 -- only the last two commits here are relevant.

r? @withoutboats , @oli-obk for the introduction of `rustc_allow_const_fn_ptr`.

bors added a commit that referenced this pull request Apr 23, 2019

Auto merge of #60208 - Centril:rollup-vg8gl67, r=Centril
Rollup of 6 pull requests

Successful merges:

 - #59739 (Stabilize futures_api)
 - #59839 (Warn on unused results for operation methods on nums)
 - #60146 (Update fonts used by rustdoc)
 - #60169 (Warn when ignore-tidy-linelength is present, but no lines are too long)
 - #60177 (Promote rust comments to rustdoc)
 - #60191 (Add f16c target_feature)

Failed merges:

r? @ghost
@Centril

This comment has been minimized.

Copy link
Member

commented Apr 23, 2019

Failed in #60208 (comment), @bors r-

@cramertj cramertj force-pushed the cramertj:stabilize branch from 795a15a to 858a8f1 Apr 23, 2019

@cramertj

This comment has been minimized.

Copy link
Member Author

commented Apr 23, 2019

Updated UI test output.
@bors r=withoutboats

@bors

This comment has been minimized.

Copy link
Contributor

commented Apr 23, 2019

📌 Commit 858a8f1 has been approved by withoutboats

@cramertj cramertj force-pushed the cramertj:stabilize branch from 858a8f1 to 3f966dc Apr 23, 2019

@cramertj

This comment has been minimized.

Copy link
Member Author

commented Apr 23, 2019

@bors r=withoutboats

@bors

This comment has been minimized.

Copy link
Contributor

commented Apr 23, 2019

📌 Commit 3f966dc has been approved by withoutboats

Centril added a commit to Centril/rust that referenced this pull request Apr 24, 2019

Rollup merge of rust-lang#59739 - cramertj:stabilize, r=withoutboats
Stabilize futures_api

cc rust-lang#59725.
Based on rust-lang#59733 and rust-lang#59119 -- only the last two commits here are relevant.

r? @withoutboats , @oli-obk for the introduction of `rustc_allow_const_fn_ptr`.

Centril added a commit to Centril/rust that referenced this pull request Apr 24, 2019

Rollup merge of rust-lang#59739 - cramertj:stabilize, r=withoutboats
Stabilize futures_api

cc rust-lang#59725.
Based on rust-lang#59733 and rust-lang#59119 -- only the last two commits here are relevant.

r? @withoutboats , @oli-obk for the introduction of `rustc_allow_const_fn_ptr`.

bors added a commit that referenced this pull request Apr 24, 2019

Auto merge of #60224 - Centril:rollup-lfuhhsk, r=Centril
Rollup of 5 pull requests

Successful merges:

 - #56278 (Future-proof MIR for dedicated debuginfo.)
 - #59739 (Stabilize futures_api)
 - #59822 (Fix dark css rule)
 - #60186 (Temporarily accept [i|u][32|size] suffixes on a tuple index and warn)
 - #60190 (Don't generate unnecessary rmeta files.)

Failed merges:

r? @ghost

@bors bors merged commit 3f966dc into rust-lang:master Apr 24, 2019

1 check passed

Travis CI - Pull Request Build Passed
Details

@Centril Centril added the T-lang label Apr 24, 2019

@blackgear blackgear referenced this pull request Apr 24, 2019

Merged

Mark futures_api merged #15

@marcelbuesing marcelbuesing referenced this pull request Apr 25, 2019

Merged

Remove futures_api feature flag #17

1 of 3 tasks complete

@cramertj cramertj deleted the cramertj:stabilize branch Apr 25, 2019

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.