Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upStabilize GlobalAlloc and #[global_allocator] #51241
Conversation
rust-highfive
assigned
aidanhs
May 31, 2018
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
rust-highfive
May 31, 2018
Collaborator
r? @aidanhs
(rust_highfive has picked a reviewer for you, use r? to override)
|
r? @aidanhs (rust_highfive has picked a reviewer for you, use r? to override) |
rust-highfive
added
the
S-waiting-on-review
label
May 31, 2018
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
Cc: @SimonSapin |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
SimonSapin
May 31, 2018
Contributor
Oh, I have pretty much the same branch and was only waiting to add docs before I submit it… :)
|
Oh, I have pretty much the same branch and was only waiting to add docs before I submit it… :) |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
glandium
May 31, 2018
Contributor
I wanted to see how that would impact me, so I went ahead but didn't bother with the doc. :)
|
I wanted to see how that would impact me, so I went ahead but didn't bother with the doc. :) |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
rust-highfive
May 31, 2018
Collaborator
The job x86_64-gnu-llvm-3.9 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.
[00:45:09] ......................................................................i.............................
[00:45:13] ....................................................................................................
[00:45:19] ....................................................................................................
[00:45:25] ....................................................................................................
[00:45:29] ..i.................iiiiiiiii...................................................
[00:45:29]
[00:45:29] travis_fold:start:test_ui_nll
travis_time:start:test_ui_nll
Check compiletest suite=ui mode=ui compare_mode=nll (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
---
[00:46:17] ......................................................................i.............................
[00:46:22] ....................................................................................................
[00:46:27] ....................................................................................................
[00:46:32] ....................................................................................................
[00:46:36] ..i.................iiiiiiiii...................................................
[00:46:36]
[00:46:36] finished in 67.009
[00:46:36] travis_fold:end:test_ui_nll
---
travis_time:start:test_run-pass
Check compiletest suite=run-pass mode=run-pass (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
[00:46:36]
[00:46:36] running 3017 tests
[00:46:50] .............F......................................................................................
[00:47:19] ....................................................................................................
[00:47:32] ....................................................................................................
[00:47:44] ....................................................................................................
[00:48:03] ....................................................................................................
---
[00:54:57]
[00:54:57] thread 'main' panicked at 'Some tests failed', tools/compiletest/src/main.rs:498:22
[00:54:57]
[00:54:57]
[00:54:57] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/compiletest" "--compile-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib" "--run-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "--rustc-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "--src-base" "/checkout/src/test/run-pass" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass" "--stage-id" "stage2-x86_64-unknown-linux-gnu" "--mode" "run-pass" "--target" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/usr/lib/llvm-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"
[00:54:57]
[00:54:57]
[00:54:57] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[00:54:57] Build completed unsuccessfully in 0:12:00
[00:54:57] Build completed unsuccessfully in 0:12:00
[00:54:57] Makefile:58: recipe for target 'check' failed
[00:54:57] make: *** [check] Error 1
The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:0d807eb0
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
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)
|
The job Click to expand the log.
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 |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
rust-highfive
May 31, 2018
Collaborator
The job x86_64-gnu-llvm-3.9 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.
[00:46:02] ......................................................................i.............................
[00:46:06] ....................................................................................................
[00:46:12] ....................................................................................................
[00:46:19] ....................................................................................................
[00:46:22] ..i.................iiiiiiiii...................................................
[00:46:22]
[00:46:22] travis_fold:start:test_ui_nll
travis_time:start:test_ui_nll
Check compiletest suite=ui mode=ui compare_mode=nll (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
---
[00:47:13] ......................................................................i.............................
[00:47:18] ....................................................................................................
[00:47:23] ....................................................................................................
[00:47:29] ....................................................................................................
[00:47:33] ..i.................iiiiiiiii...................................................
[00:47:33]
[00:47:33] finished in 70.534
[00:47:33] travis_fold:end:test_ui_nll
---
travis_time:start:test_run-pass
Check compiletest suite=run-pass mode=run-pass (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
[00:47:33]
[00:47:33] running 3017 tests
[00:47:48] ........F...........................................................................................
[00:48:18] ....................................................................................................
[00:48:32] ....................................................................................................
[00:48:44] ....................................................................................................
[00:49:05] ....................................................................................................
---
[00:56:10] ---- [run-pass] run-pass/allocator/custom.rs stdout ----
[00:56:10]
[00:56:10] error: compilation failed!
[00:56:10] status: exit code: 101
[00:56:10] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/run-pass/allocator/custom.rs" "--target=x86_64-unknown-linux-gnu" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass/allocator/custom/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass/allocator/custom/auxiliary"
[00:56:10] ------------------------------------------
[00:56:10]
[00:56:10] ------------------------------------------
[00:56:10] stderr:
[00:56:10] stderr:
[00:56:10] ------------------------------------------
[00:56:10] error[E0599]: no method named `unwrap` found for type `*mut u8` in the current scope
[00:56:10] --> /checkout/src/test/run-pass/allocator/custom.rs:48:41
[00:56:10] |
[00:56:10] 48 | let ptr = alloc(layout.clone()).unwrap();
[00:56:10]
[00:56:10]
[00:56:10] error[E0277]: the trait bound `std::fmt::Debug: std::marker::Sized` is not satisfied
[00:56:10] --> /checkout/src/test/run-pass/allocator/custom.rs:48:13
[00:56:10] |
[00:56:10] 48 | let ptr = alloc(layout.clone()).unwrap();
[00:56:10] | ^^^ `std::fmt::Debug` does not have a constant size known at compile-time
[00:56:10] |
[00:56:10] = help: the trait `std::marker::Sized` is not implemented for `std::fmt::Debug`
[00:56:10] = note: all local variables must have a statically known size
[00:56:10] error[E0308]: mismatched types
[00:56:10] --> /checkout/src/test/run-pass/allocator/custom.rs:51:17
[00:56:10] |
[00:56:10] |
[00:56:10] 51 | dealloc(ptr, layout.clone());
[00:56:10] | ^^^ expected *-ptr, found trait std::fmt::Debug
[00:56:10] |
[00:56:10] = note: expected type `*mut u8`
[00:56:10] found type `std::fmt::Debug`
[00:56:10]
[00:56:10] error[E0599]: no method named `alloc` found for type `std::heap::System` in the current scope
[00:56:10] --> /checkout/src/test/run-pass/allocator/custom.rs:60:26
[00:56:10] |
[00:56:10] 60 | let ptr = System.alloc(layout.clone()).unwrap();
[00:56:10] |
[00:56:10] = help: items from traits can only be used if the trait is in scope
[00:56:10] help: the following trait is implemented but not in scope, perhaps add a `use` for it:
[00:56:10] |
[00:56:10] |
[00:56:10] 18 | use std::heap::GlobalAlloc;
[00:56:10] |
[00:56:10]
[00:56:10] error[E0277]: the trait bound `std::fmt::Debug: std::marker::Sized` is not satisfied
[00:56:10] --> /checkout/src/test/run-pass/allocator/custom.rs:60:13
[00:56:10] |
[00:56:10] 60 | let ptr = System.alloc(layout.clone()).unwrap();
[00:56:10] | ^^^ `std::fmt::Debug` does not have a constant size known at compile-time
[00:56:10] |
[00:56:10] = help: the trait `std::marker::Sized` is not implemented for `std::fmt::Debug`
[00:56:10] = note: all local variables must have a statically known size
[00:56:10]
[00:56:10] error[E0599]: no method named `dealloc` found for type `std::heap::System` in the current scope
[00:56:10] --> /checkout/src/test/run-pass/allocator/custom.rs:63:16
[00:56:10] |
[00:56:10] 63 | System.dealloc(ptr, layout);
[00:56:10] |
[00:56:10] = help: items from traits can only be used if the trait is in scope
[00:56:10] help: the following trait is implemented but not in scope, perhaps add a `use` for it:
[00:56:10] |
---
[00:56:10]
[00:56:10] thread 'main' panicked at 'Some tests failed', tools/compiletest/src/main.rs:498:22
[00:56:10]
[00:56:10]
[00:56:10] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/compiletest" "--compile-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib" "--run-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "--rustc-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "--src-base" "/checkout/src/test/run-pass" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-pass" "--stage-id" "stage2-x86_64-unknown-linux-gnu" "--mode" "run-pass" "--target" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/usr/lib/llvm-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"
[00:56:10]
[00:56:10]
[00:56:10] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[00:56:10] Build completed unsuccessfully in 0:12:30
[00:56:10] Build completed unsuccessfully in 0:12:30
[00:56:10] make: *** [check] Error 1
[00:56:10] Makefile:58: recipe for target 'check' failed
The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:12c84752
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
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)
|
The job Click to expand the log.
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 |
SimonSapin
changed the title from
Final changes to GlobalAlloc for stabilization
to
Stabilize GlobalAlloc and #[global_allocator]
May 31, 2018
SimonSapin
added
A-allocators
T-libs
labels
May 31, 2018
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
SimonSapin
May 31, 2018
Contributor
I’ve pushed additional commits to this PR. @glandium’s commits look good to me, mine still need review. In particular for the new docs and the API contracts they describe.
Both tracking issues for features being stabilized have already finished FCP, but since we’re making last minute changes let’s have a final Final Comment Perdiod:
@rfcbot fcp merge
|
I’ve pushed additional commits to this PR. @glandium’s commits look good to me, mine still need review. In particular for the new docs and the API contracts they describe. Both tracking issues for features being stabilized have already finished FCP, but since we’re making last minute changes let’s have a final Final Comment Perdiod: @rfcbot fcp merge |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
rfcbot
May 31, 2018
Team member @SimonSapin has proposed to merge this. The next step is review by the rest of the tagged teams:
No concerns currently listed.
Once a majority of reviewers approve (and none object), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up!
See this document for info about what commands tagged team members can give me.
rfcbot
commented
May 31, 2018
•
|
Team member @SimonSapin has proposed to merge this. The next step is review by the rest of the tagged teams: No concerns currently listed. Once a majority of reviewers approve (and none object), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! See this document for info about what commands tagged team members can give me. |
rfcbot
added
proposed-final-comment-period
disposition-merge
labels
May 31, 2018
This was referenced May 31, 2018
kennytm
added
the
relnotes
label
May 31, 2018
src/libcore/alloc.rs
| @@ -357,23 +360,28 @@ impl fmt::Display for AllocErr { | ||
| /// The `CannotReallocInPlace` error is used when `grow_in_place` or | ||
| /// `shrink_in_place` were unable to reuse the given memory block for | ||
| /// a requested layout. | ||
| // FIXME: should this be in libcore or liballoc? |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Amanieu
May 31, 2018
Contributor
This is used in the Alloc trait and therefore needs to be in libcore.
Amanieu
May 31, 2018
Contributor
This is used in the Alloc trait and therefore needs to be in libcore.
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
| impl fmt::Display for CannotReallocInPlace { | ||
| fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { | ||
| write!(f, "{}", self.description()) | ||
| } | ||
| } | ||
| /// Augments `AllocErr` with a CapacityOverflow variant. | ||
| // FIXME: should this be in libcore or liballoc? |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Amanieu
May 31, 2018
Contributor
This could probably be moved to liballoc since it is only used by collections.
Amanieu
May 31, 2018
Contributor
This could probably be moved to liballoc since it is only used by collections.
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
SimonSapin
Jun 1, 2018
Contributor
I moved it when I created the core::alloc module because it doesn’t depend on anything else, but with "collections" in the name maybe it belongs more where collections are define. I’ll leave this to whenever those APIs are stabilized.
SimonSapin
Jun 1, 2018
Contributor
I moved it when I created the core::alloc module because it doesn’t depend on anything else, but with "collections" in the name maybe it belongs more where collections are define. I’ll leave this to whenever those APIs are stabilized.
src/libcore/alloc.rs
| /// | ||
| /// * Pointers returned from allocation functions must point to valid memory and | ||
| /// retain their validity until at least the instance of `GlobalAlloc` is dropped | ||
| /// itself. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Amanieu
May 31, 2018
Contributor
Does the concept of dropping an instance of GlobalAlloc really make sense? Should we just require pointers to be valid forever until explicitly freed?
Amanieu
May 31, 2018
Contributor
Does the concept of dropping an instance of GlobalAlloc really make sense? Should we just require pointers to be valid forever until explicitly freed?
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
SimonSapin
Jun 1, 2018
Contributor
Good point, a static is never dropped. I copied this from Alloc docs but it doesn’t make sense here, removed.
SimonSapin
Jun 1, 2018
Contributor
Good point, a static is never dropped. I copied this from Alloc docs but it doesn’t make sense here, removed.
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
rust-highfive
May 31, 2018
Collaborator
The job x86_64-gnu-llvm-3.9 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.
[00:42:43] Documenting core v0.0.0 (file:///checkout/src/libcore)
[00:42:43] Compiling std v0.0.0 (file:///checkout/src/libstd)
[00:43:30] warning: [1] cannot be resolved, ignoring it...
[00:43:30]
[00:43:31] warning: [oom] cannot be resolved, ignoring it...
[00:43:31] warning: [x] cannot be resolved, ignoring it...
[00:43:31]
[00:43:31] warning: [] cannot be resolved, ignoring it...
[00:43:31]
---
[00:43:40] Checking unwind v0.0.0 (file:///checkout/src/libunwind)
[00:43:40] Checking alloc_system v0.0.0 (file:///checkout/src/liballoc_system)
[00:43:40] Checking panic_abort v0.0.0 (file:///checkout/src/libpanic_abort)
[00:43:40] Checking alloc_jemalloc v0.0.0 (file:///checkout/src/liballoc_jemalloc)
[00:43:44] warning: [std::alloc::set_oom_hook] cannot be resolved, ignoring it...
[00:43:44]
[00:43:44] warning: [std::alloc::take_oom_hook] cannot be resolved, ignoring it...
[00:43:44] Checking rustc_tsan v0.0.0 (file:///checkout/src/librustc_tsan)
[00:43:44] Checking rustc_msan v0.0.0 (file:///checkout/src/librustc_msan)
[00:43:44] Checking rustc_lsan v0.0.0 (file:///checkout/src/librustc_lsan)
[00:43:44] Checking panic_unwind v0.0.0 (file:///checkout/src/libpanic_unwind)
[00:43:44] Checking panic_unwind v0.0.0 (file:///checkout/src/libpanic_unwind)
[00:43:44] Checking rustc_asan v0.0.0 (file:///checkout/src/librustc_asan)
[00:43:44] Documenting std v0.0.0 (file:///checkout/src/libstd)
[00:43:55] warning: [oom] cannot be resolved, ignoring it...
[00:43:55]
[00:43:57] warning: [System] cannot be resolved, ignoring it...
[00:43:57]
[00:43:57] warning: [GlobalAlloc] cannot be resolved, ignoring it...
[00:44:02] Finished release [optimized] target(s) in 1m 19.61s
[00:44:02] Documenting stage2 test (x86_64-unknown-linux-gnu)
[00:44:03] Checking getopts v0.2.17
[00:44:03] Checking term v0.0.0 (file:///checkout/src/libterm)
[00:44:03] Checking term v0.0.0 (file:///checkout/src/libterm)
[00:44:03] Documenting test v0.0.0 (file:///checkout/src/libtest)
[00:44:04] warning: [System] cannot be resolved, ignoring it...
[00:44:04]
[00:44:04] warning: [GlobalAlloc] cannot be resolved, ignoring it...
[00:44:04] Finished release [optimized] target(s) in 2.07s
[00:44:05] Documenting stage2 whitelisted compiler (x86_64-unknown-linux-gnu)
[00:44:05] Checking nodrop v0.1.12
[00:44:05] Checking cfg-if v0.1.2
---
[00:44:15] Checking syntax_pos v0.0.0 (file:///checkout/src/libsyntax_pos)
[00:44:17] Checking rustc_errors v0.0.0 (file:///checkout/src/librustc_errors)
[00:44:18] Checking syntax v0.0.0 (file:///checkout/src/libsyntax)
[00:44:35] Documenting proc_macro v0.0.0 (file:///checkout/src/libproc_macro)
[00:44:36] warning: [System] cannot be resolved, ignoring it...
[00:44:36]
[00:44:36] warning: [GlobalAlloc] cannot be resolved, ignoring it...
[00:44:36] warning: [cfg] cannot be resolved, ignoring it...
[00:44:36]
[00:44:36] warning: [rayon::prelude] cannot be resolved, ignoring it...
[00:44:36]
---
[00:47:02] ......................................................................i.............................
[00:47:06] ....................................................................................................
[00:47:12] ....................................................................................................
[00:47:18] ....................................................................................................
[00:47:22] ..i.................iiiiiiiii...................................................
[00:47:22]
[00:47:22] travis_fold:start:test_ui_nll
travis_time:start:test_ui_nll
Check compiletest suite=ui mode=ui compare_mode=nll (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
---
[00:48:10] ......................................................................i.............................
[00:48:14] ....................................................................................................
[00:48:19] ....................................................................................................
[00:48:25] ....................................................................................................
[00:48:29] ..i..................iiiiiiiii..................................................
[00:48:29]
[00:48:29] finished in 66.965
[00:48:29] travis_fold:end:test_ui_nll
---
[01:29:30]
[01:29:30] ---- [ui] rustdoc-ui/intra-links-warning.rs stdout ----
[01:29:30] diff of stderr:
[01:29:30]
[01:29:30] + warning: [System] cannot be resolved, ignoring it...
[01:29:30] +
[01:29:30] + warning: [GlobalAlloc] cannot be resolved, ignoring it...
[01:29:30] +
[01:29:30] 1 warning: [Foo::baz] cannot be resolved, ignoring it...
[01:29:30] 2
[01:29:30] 3 warning: [Bar::foo] cannot be resolved, ignoring it...
[01:29:30]
[01:29:30] The actual stderr differed from the expected stderr.
[01:29:30] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/rustdoc-ui/intra-links-warning/intra-links-warning.stderr
[01:29:30] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/rustdoc-ui/intra-links-warning/intra-links-warning.stderr
[01:29:30] To update references, rerun the tests and pass the `--bless` flag
[01:29:30] To only update this specific test, also pass `--test-args intra-links-warning.rs`
[01:29:30] error: 1 errors occurred comparing output.
[01:29:30] status: exit code: 0
[01:29:30] status: exit code: 0
[01:29:30] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustdoc" "/checkout/src/test/rustdoc-ui/intra-links-warning.rs" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/rustdoc-ui/intra-links-warning/a" "-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/rustdoc-ui/intra-links-warning/auxiliary"
[01:29:30] ------------------------------------------
[01:29:30]
[01:29:30] ------------------------------------------
[01:29:30] stderr:
[01:29:30] stderr:
[01:29:30] ------------------------------------------
[01:29:30] {"message":"[System] cannot be resolved, ignoring it...","code":null,"level":"warning","spans":[],"children":[],"rendered":"warning: [System] cannot be resolved, ignoring it...\n\n"}
[01:29:30] {"message":"[GlobalAlloc] cannot be resolved, ignoring it...","code":null,"level":"warning","spans":[],"children":[],"rendered":"warning: [GlobalAlloc] cannot be resolved, ignoring it...\n\n"}
[01:29:30] {"message":"[Foo::baz] cannot be resolved, ignoring it...","code":null,"level":"warning","spans":[],"children":[],"rendered":"warning: [Foo::baz] cannot be resolved, ignoring it...\n\n"}
[01:29:30] {"message":"[Bar::foo] cannot be resolved, ignoring it...","code":null,"level":"warning","spans":[],"children":[],"rendered":"warning: [Bar::foo] cannot be resolved, ignoring it...\n\n"}
[01:29:30] {"message":"[Uniooon::X] cannot be resolved, ignoring it...","code":null,"level":"warning","spans":[],"children":[],"rendered":"warning: [Uniooon::X] cannot be resolved, ignoring it...\n\n"}
[01:29:30] ------------------------------------------
[01:29:30]
[01:29:30] thread '[ui] rustdoc-ui/intra-links-warning.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3096:9
[01:29:30] note: Run with `RUST_BACKTRACE=1` for a backtrace.
[01:29:30] note: Run with `RUST_BACKTRACE=1` for a backtrace.
[01:29:30]
[01:29:30] ---- [ui] rustdoc-ui/deprecated-attrs.rs stdout ----
[01:29:30] diff of stderr:
[01:29:30]
[01:29:30] + warning: [System] cannot be resolved, ignoring it...
[01:29:30] +
[01:29:30] + warning: [GlobalAlloc] cannot be resolved, ignoring it...
[01:29:30] +
[01:29:30] 1 warning: the `#![doc(no_default_passes)]` attribute is considered deprecated
[01:29:30] 3 = warning: please see https://github.com/rust-lang/rust/issues/44136
[01:29:30]
[01:29:30]
[01:29:30] The actual stderr differed from the expected stderr.
[01:29:30] The actual stderr differed from the expected stderr.
[01:29:30] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/rustdoc-ui/deprecated-attrs/deprecated-attrs.stderr
[01:29:30] To update references, rerun the tests and pass the `--bless` flag
[01:29:30] To only update this specific test, also pass `--test-args deprecated-attrs.rs`
[01:29:30] error: 1 errors occurred comparing output.
[01:29:30] status: exit code: 0
[01:29:30] status: exit code: 0
[01:29:30] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustdoc" "/checkout/src/test/rustdoc-ui/deprecated-attrs.rs" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/rustdoc-ui/deprecated-attrs/a" "-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/rustdoc-ui/deprecated-attrs/auxiliary"
[01:29:30] ------------------------------------------
[01:29:30]
[01:29:30] ------------------------------------------
[01:29:30] stderr:
[01:29:30] stderr:
[01:29:30] ------------------------------------------
[01:29:30] {"message":"[System] cannot be resolved, ignoring it...","code":null,"level":"warning","spans":[],"children":[],"rendered":"warning: [System] cannot be resolved, ignoring it...\n\n"}
[01:29:30] {"message":"[GlobalAlloc] cannot be resolved, ignoring it...","code":null,"level":"warning","spans":[],"children":[],"rendered":"warning: [GlobalAlloc] cannot be resolved, ignoring it...\n\n"}
[01:29:30] {"message":"the `#![doc(no_default_passes)]` attribute is considered deprecated","code":null,"level":"warning","spans":[],"children":[{"message":"please see https://github.com/rust-lang/rust/issues/44136","code":null,"level":"warning","spans":[],"children":[],"rendered":null},{"message":"you may want to use `#![doc(document_private_items)]`","code":null,"level":"help","spans":[],"children":[],"rendered":null}],"rendered":"warning: the `#![doc(no_default_passes)]` attribute is considered deprecated\n |\n = warning: please see https://github.com/rust-lang/rust/issues/44136\n = help: you may want to use `#![doc(document_private_items)]`\n\n"}
[01:29:30] {"message":"the `#![doc(passes = \"...\")]` attribute is considered deprecated","code":null,"level":"warning","spans":[],"children":[{"message":"please see https://github.com/rust-lang/rust/issues/44136","code":null,"level":"warning","spans":[],"children":[],"rendered":null}],"rendered":"warning: the `#![doc(passes = \"...\")]` attribute is considered deprecated\n |\n = warning: please see https://github.com/rust-lang/rust/issues/44136\n\n"}
[01:29:30] ------------------------------------------
[01:29:30]
[01:29:30] thread '[ui] rustdoc-ui/deprecated-attrs.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3096:9
[01:29:30]
---
[01:29:30] test result: FAILED. 0 passed; 2 failed; 0 ignored; 0 measured; 0 filtered out
[01:29:30]
[01:29:30]
[01:29:30]
[01:29:30] 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" "--rustdoc-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustdoc" "--src-base" "/checkout/src/test/rustdoc-ui" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/rustdoc-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" "-Zunstable-options " "--target-rustcflags" "-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"
[01:29:30]
[01:29:30]
[01:29:30] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[01:29:30] Build completed unsuccessfully in 0:44:46
[01:29:30] Build completed unsuccessfully in 0:44:46
[01:29:30] make: *** [check] Error 1
[01:29:30] Makefile:58: recipe for target 'check' failed
The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:11e8453e
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
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)
|
The job Click to expand the log.
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 |
| /// library that aborts on memory exhaustion.) | ||
| /// | ||
| /// Clients wishing to abort computation in response to an | ||
| /// allocation error are encouraged to call the [`oom`] function, |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
SimonSapin
Jun 1, 2018
Contributor
I hoped it would, but it doesn’t when the target is not in the source crate (or its dependencies?). Will fix.
SimonSapin
Jun 1, 2018
Contributor
I hoped it would, but it doesn’t when the target is not in the source crate (or its dependencies?). Will fix.
| /// or NULL to indicate reallocation failure. | ||
| /// If this returns a non-null pointer, then ownership of the memory block | ||
| /// referenced by `ptr` has been transferred to this alloctor. | ||
| /// The memory may or may not have been deallocated, |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
SimonSapin
Jun 1, 2018
Contributor
I’m not sure, I copied this form Alloc::realloc docs. Maybe when realloc succeeds in place and returns the same pointer? Would you rather I remove that sentence?
SimonSapin
Jun 1, 2018
Contributor
I’m not sure, I copied this form Alloc::realloc docs. Maybe when realloc succeeds in place and returns the same pointer? Would you rather I remove that sentence?
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
glandium
Jun 1, 2018
Contributor
ownership of the memory block referenced by
ptrhas been transferred to this alloctor.
There's a typo on allocator. I'd add a "back" after transferred, too, to make it subtly clearer that ownership of the memory block started from this allocator.
glandium
Jun 1, 2018
Contributor
ownership of the memory block referenced by
ptrhas been transferred to this alloctor.
There's a typo on allocator. I'd add a "back" after transferred, too, to make it subtly clearer that ownership of the memory block started from this allocator.
| //! dox | ||
| //! Memory allocation APIs | ||
| //! | ||
| //! In a given program, the standard library has one “global” memory allocator |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
steveklabnik
Jun 1, 2018
Member
We try to use smart quotes in the docs, but the API reference is all over the place. The book uses them 100%. Either way is fine by me.
steveklabnik
Jun 1, 2018
Member
We try to use smart quotes in the docs, but the API reference is all over the place. The book uses them 100%. Either way is fine by me.
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
Couple of doc nits, but LGTM! |
geofft
referenced this pull request
Jun 1, 2018
Open
Use stable Rust (tracking ticket for unstable features we use) #41
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
bors
Jun 1, 2018
Contributor
|
|
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
rfcbot
commented
Jun 1, 2018
|
|
rfcbot
added
final-comment-period
and removed
proposed-final-comment-period
labels
Jun 1, 2018
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
Rebased. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
bors
Jun 3, 2018
Contributor
|
|
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
Does #44113 need to be fixed before this is stabilized? |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
sfackler
Jun 3, 2018
Member
@mark-i-m I don't think it needs to be fixed, but we should probably have a better error message.
|
@mark-i-m I don't think it needs to be fixed, but we should probably have a better error message. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
mark-i-m
Jun 3, 2018
Contributor
The current error happens simply because the current implementation causes weird hygeine bugs. I tried to fix it, but hygiene is hard. Neither I nor @alexcrichton knew how to fix it.
In the end, we agreed that maybe for now global_allocator should be disallowed in submodules. I started to implement that but ran into an error in #49320. If anyone has suggestions, I would be glad to fix that up and submit it.
|
The current error happens simply because the current implementation causes weird hygeine bugs. I tried to fix it, but hygiene is hard. Neither I nor @alexcrichton knew how to fix it. In the end, we agreed that maybe for now global_allocator should be disallowed in submodules. I started to implement that but ran into an error in #49320. If anyone has suggestions, I would be glad to fix that up and submit it. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
SimonSapin
Jun 3, 2018
Contributor
I think that #44113 should be fixed eventually, but that it doesn’t need to block stabilization.
|
I think that #44113 should be fixed eventually, but that it doesn’t need to block stabilization. |
mark-i-m
referenced this pull request
Jun 4, 2018
Merged
Prohibit `global_allocator` in submodules #51335
glandium
and others
added some commits
May 31, 2018
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
@bors r=sfackler,SimonSapin |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
|
bors
added
S-waiting-on-bors
and removed
S-waiting-on-review
labels
Jun 11, 2018
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
added a commit
that referenced
this pull request
Jun 12, 2018
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
bors
Jun 12, 2018
Contributor
Approved by: sfackler,SimonSapin
Pushing 4367e41 to master...
|
|
bors
merged commit 7f0d54d
into
rust-lang:master
Jun 12, 2018
This was referenced Jun 12, 2018
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
glandium
Jun 13, 2018
Contributor
Now that docs are up-to-date on https://doc.rust-lang.org/nightly/std/alloc/index.html, it feels like the docs for the reexports should be "inlined" (e.g. alloc, alloc_zeroed, oom), since the alloc crate is still unstable.
|
Now that docs are up-to-date on https://doc.rust-lang.org/nightly/std/alloc/index.html, it feels like the docs for the reexports should be "inlined" (e.g. |
glandium commentedMay 31, 2018
•
edited by SimonSapin
Edited 1 time
-
SimonSapin
edited May 31, 2018 (most recent)
-
glandium
created May 31, 2018
This PR implements the changes discussed in #49668 (comment)
Fixes #49668
Fixes #27389
This does not change the default global allocator: #36963