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

Overhaul of the AllocRef trait to match allocator-wg's latest consens; Take 2 #70362

Merged
merged 23 commits into from
Apr 2, 2020

Conversation

TimDiekmann
Copy link
Member

GitHub won't let me reopen #69889 so I make a new PR.

In addition to #69889 this fixes the unsoundness of RawVec::into_box when using allocators supporting overallocating. Also it uses MemoryBlock in AllocRef to unify _in_place methods by passing &mut MemoryBlock. Additionally, RawVec now checks for size_of::<T>() again and ignore every ZST. The internal capacity of RawVec isn't used by ZSTs anymore, as into_box now requires a length to be specified.

r? @Amanieu

fixes rust-lang/wg-allocators#38
fixes rust-lang/wg-allocators#41
fixes rust-lang/wg-allocators#44
fixes rust-lang/wg-allocators#51

src/libcore/alloc/mod.rs Outdated Show resolved Hide resolved
src/libcore/alloc/mod.rs Outdated Show resolved Hide resolved
src/libcore/alloc/mod.rs Outdated Show resolved Hide resolved
src/libcore/alloc/mod.rs Outdated Show resolved Hide resolved
src/libstd/alloc.rs Outdated Show resolved Hide resolved
src/liballoc/raw_vec.rs Outdated Show resolved Hide resolved
src/liballoc/raw_vec.rs Outdated Show resolved Hide resolved
src/liballoc/raw_vec.rs Outdated Show resolved Hide resolved
src/liballoc/raw_vec.rs Outdated Show resolved Hide resolved
src/liballoc/raw_vec.rs Outdated Show resolved Hide resolved
@rust-highfive
Copy link
Collaborator

The job mingw-check of your PR failed (pretty log, 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.
2020-03-25T17:46:43.0878218Z ========================== Starting Command Output ===========================
2020-03-25T17:46:43.0880806Z [command]/bin/bash --noprofile --norc /home/vsts/work/_temp/a71544a1-7773-4ac5-8442-fe2d5d50f91b.sh
2020-03-25T17:46:43.0881066Z 
2020-03-25T17:46:43.0885272Z ##[section]Finishing: Disable git automatic line ending conversion
2020-03-25T17:46:43.0904290Z ##[section]Starting: Checkout rust-lang/rust@refs/pull/70362/merge to s
2020-03-25T17:46:43.0907500Z Task         : Get sources
2020-03-25T17:46:43.0907792Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
2020-03-25T17:46:43.0908074Z Version      : 1.0.0
2020-03-25T17:46:43.0908264Z Author       : Microsoft
---
2020-03-25T17:46:44.3634866Z ##[command]git remote add origin https://github.com/rust-lang/rust
2020-03-25T17:46:44.3647773Z ##[command]git config gc.auto 0
2020-03-25T17:46:44.3669255Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2020-03-25T17:46:44.3678330Z ##[command]git config --get-all http.proxy
2020-03-25T17:46:44.3693177Z ##[command]git -c http.extraheader="AUTHORIZATION: basic ***" fetch --force --tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/*:refs/remotes/origin/* +refs/pull/70362/merge:refs/remotes/pull/70362/merge
---
2020-03-25T17:48:57.1223541Z  ---> 3fc1b512c57b
2020-03-25T17:48:57.1223755Z Step 6/7 : ENV RUN_CHECK_WITH_PARALLEL_QUERIES 1
2020-03-25T17:48:57.1224122Z  ---> Using cache
2020-03-25T17:48:57.1224427Z  ---> 5ee4295733f4
2020-03-25T17:48:57.1225892Z Step 7/7 : ENV SCRIPT python2.7 ../x.py test src/tools/expand-yaml-anchors &&            python2.7 ../x.py check --target=i686-pc-windows-gnu --host=i686-pc-windows-gnu &&            python2.7 ../x.py build --stage 0 src/tools/build-manifest &&            python2.7 ../x.py test --stage 0 src/tools/compiletest &&            python2.7 ../x.py test src/tools/tidy &&            /scripts/validate-toolstate.sh
2020-03-25T17:48:57.1227238Z  ---> 3d07a0fa42fe
2020-03-25T17:48:57.1276824Z Successfully built 3d07a0fa42fe
2020-03-25T17:48:57.1302363Z Successfully tagged rust-ci:latest
2020-03-25T17:48:57.1591319Z Built container sha256:3d07a0fa42feb5754fc13bb2f7010ebe13e4b8b8cdbebed0c75d8da320c8c8ad
---
2020-03-25T17:50:59.3979214Z   local time: Wed Mar 25 17:50:59 UTC 2020
2020-03-25T17:50:59.5600303Z   network time: Wed, 25 Mar 2020 17:50:59 GMT
2020-03-25T17:50:59.5600769Z == end clock drift check ==
2020-03-25T17:51:06.2018453Z 
2020-03-25T17:51:06.2057925Z ##[error]Bash exited with code '1'.
2020-03-25T17:51:06.2068696Z ##[section]Finishing: Run build
2020-03-25T17:51:06.2109266Z ##[section]Starting: Checkout rust-lang/rust@refs/pull/70362/merge to s
2020-03-25T17:51:06.2113901Z Task         : Get sources
2020-03-25T17:51:06.2114176Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
2020-03-25T17:51:06.2114438Z Version      : 1.0.0
2020-03-25T17:51:06.2114629Z Author       : Microsoft
2020-03-25T17:51:06.2114629Z Author       : Microsoft
2020-03-25T17:51:06.2114911Z Help         : [More Information](https://go.microsoft.com/fwlink/?LinkId=798199)
2020-03-25T17:51:06.2115234Z ==============================================================================
2020-03-25T17:51:06.5234827Z Cleaning any cached credential from repository: rust-lang/rust (GitHub)
2020-03-25T17:51:06.5283581Z ##[section]Finishing: Checkout rust-lang/rust@refs/pull/70362/merge to s
2020-03-25T17:51:06.5383425Z Cleaning up task key
2020-03-25T17:51:06.5384608Z Start cleaning up orphan processes.
2020-03-25T17:51:06.5563871Z Terminate orphan process: pid (3465) (python)
2020-03-25T17:51:06.5752132Z ##[section]Finishing: Finalize Job

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 @rust-lang/infra. (Feature Requests)

src/liballoc/raw_vec.rs Outdated Show resolved Hide resolved
src/liballoc/raw_vec.rs Outdated Show resolved Hide resolved
@Amanieu
Copy link
Member

Amanieu commented Mar 25, 2020

@bors try @rust-timer queue

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion

@bors
Copy link
Contributor

bors commented Mar 25, 2020

⌛ Trying commit 44440b3cc53fdee09b42d6add442729b7795b6ec with merge 596ca62e7a53ded2213f364156eae2a6a5478c8f...

@bors
Copy link
Contributor

bors commented Mar 26, 2020

☀️ Try build successful - checks-azure
Build commit: 596ca62e7a53ded2213f364156eae2a6a5478c8f (596ca62e7a53ded2213f364156eae2a6a5478c8f)

@rust-timer
Copy link
Collaborator

Queued 596ca62e7a53ded2213f364156eae2a6a5478c8f with parent 3c1d9ad, future comparison URL.

src/libcore/alloc/mod.rs Outdated Show resolved Hide resolved
src/libcore/alloc/mod.rs Outdated Show resolved Hide resolved
@rust-timer
Copy link
Collaborator

Finished benchmarking try commit 596ca62e7a53ded2213f364156eae2a6a5478c8f, comparison URL.

@TimDiekmann
Copy link
Member Author

Finished benchmarking try commit 596ca62, comparison URL.

The average from both, all cpu-clock avg values and all task-clock avg values, is 0.692% and 0.693% respectively, which is fine I think. The biggest regression we have in a stress test, all other regressions (if any) are below 3%. In comparison to the last perf-run this is much better.

@Amanieu
Copy link
Member

Amanieu commented Mar 26, 2020

@bors try @rust-timer queue

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion

@bors
Copy link
Contributor

bors commented Mar 26, 2020

⌛ Trying commit 78f6ca31edcc805151e7cf72cb922673386a738e with merge 266627c4feaf72ec1b9019f3a957804478ef516c...

@bors
Copy link
Contributor

bors commented Mar 26, 2020

☀️ Try build successful - checks-azure
Build commit: 266627c4feaf72ec1b9019f3a957804478ef516c (266627c4feaf72ec1b9019f3a957804478ef516c)

@rust-timer
Copy link
Collaborator

Queued 266627c4feaf72ec1b9019f3a957804478ef516c with parent a17dd36, future comparison URL.

@bors bors mentioned this pull request Apr 1, 2020
@Dylan-DPC-zz
Copy link

@bors retry yield

@bors
Copy link
Contributor

bors commented Apr 2, 2020

⌛ Testing commit 89ed59d with merge 127a11a...

@bors
Copy link
Contributor

bors commented Apr 2, 2020

☀️ Test successful - checks-azure
Approved by: Amanieu
Pushing 127a11a to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Apr 2, 2020
@bors bors merged commit 127a11a into rust-lang:master Apr 2, 2020
@rust-highfive
Copy link
Collaborator

📣 Toolstate changed by #70362!

Tested on commit 127a11a.
Direct link to PR: #70362

💔 nomicon on windows: test-pass → test-fail (cc @Gankra @frewsxcv).
💔 nomicon on linux: test-pass → test-fail (cc @Gankra @frewsxcv).

rust-highfive added a commit to rust-lang-nursery/rust-toolstate that referenced this pull request Apr 2, 2020
Tested on commit rust-lang/rust@127a11a.
Direct link to PR: <rust-lang/rust#70362>

💔 nomicon on windows: test-pass → test-fail (cc @Gankra @frewsxcv).
💔 nomicon on linux: test-pass → test-fail (cc @Gankra @frewsxcv).
bors added a commit to rust-lang/miri that referenced this pull request Apr 2, 2020
bors added a commit to rust-lang/miri that referenced this pull request Apr 2, 2020
@TimDiekmann TimDiekmann deleted the alloc-overhaul branch April 2, 2020 12:07
CAD97 added a commit to CAD97/rust that referenced this pull request Jul 18, 2020
This was accidentally removed in rust-lang#70362
56cbf2f
bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 25, 2020
…ruppe

re-add Layout::for_value_raw

Tracking issue: rust-lang#69835

This was accidentally removed in rust-lang#70362 56cbf2f.
Originally added in rust-lang#69079.
@RalfJung RalfJung mentioned this pull request Jun 28, 2023
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
10 participants