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
Merged

Stabilize futures_api #59739

merged 2 commits into from
Apr 24, 2019

Conversation

cramertj
Copy link
Member

@cramertj cramertj 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

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 5, 2019
@Centril Centril added the S-blocked Status: Blocked on something else such as an RFC or other implementation work. label Apr 5, 2019
@Centril
Copy link
Contributor

Centril commented Apr 5, 2019

Marking as blocked on FCP completion in #59725.

@cramertj cramertj force-pushed the stabilize branch 2 times, most recently from f48faf9 to b55c014 Compare April 5, 2019 21:37
@rust-highfive

This comment has been minimized.

src/libcore/task/wake.rs Outdated Show resolved Hide resolved
src/libcore/task/wake.rs Show resolved Hide resolved
Centril
Centril previously requested changes Apr 5, 2019
src/test/ui/no-args-non-move-async-closure.rs Outdated Show resolved Hide resolved
src/test/ui/consts/min_const_fn/allow_const_fn_ptr.rs Outdated Show resolved Hide resolved
//
// 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,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-lang/const-eval#19 (comment) (by making them pattern aliases)

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

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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...

Copy link
Member

@eddyb eddyb Apr 6, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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))

src/libcore/task/wake.rs Outdated Show resolved Hide resolved
@bors
Copy link
Contributor

bors 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
@jonas-schievink jonas-schievink added relnotes Marks issues that should be documented in the release notes of the next release. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. labels Apr 12, 2019
@rust-highfive
Copy link
Collaborator

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)

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good to know. Thanks @Nemo157 .

Centril added a commit to Centril/rust that referenced this pull request Apr 23, 2019
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
Copy link
Contributor

Centril commented Apr 23, 2019

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

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Apr 23, 2019
@cramertj
Copy link
Member Author

Updated UI test output.
@bors r=withoutboats

@bors
Copy link
Contributor

bors commented Apr 23, 2019

📌 Commit 858a8f18e747790646038f505e9adb8dacf5dd7b has been approved by withoutboats

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Apr 23, 2019
@cramertj
Copy link
Member Author

@bors r=withoutboats

@bors
Copy link
Contributor

bors 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
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
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
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
@Centril Centril added the T-lang Relevant to the language team, which will review and decide on the PR/issue. label Apr 24, 2019
@cramertj cramertj deleted the stabilize branch April 25, 2019 02:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
relnotes Marks issues that should be documented in the release notes of the next release. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-lang Relevant to the language team, which will review and decide on the PR/issue. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.