-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
Rollup of 9 pull requests #94567
Rollup of 9 pull requests #94567
Commits on Feb 21, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 55f938b - Browse repository at this point
Copy the full SHA 55f938bView commit details -
Configuration menu - View commit details
-
Copy full SHA for ba2e0ca - Browse repository at this point
Copy the full SHA ba2e0caView commit details
Commits on Mar 2, 2022
-
Use cgroup quotas for calculating
available_parallelism
Manually tested via ``` // spawn a new cgroup scope for the current user $ sudo systemd-run -p CPUQuota="300%" --uid=$(id -u) -tdS // quota.rs #![feature(available_parallelism)] fn main() { println!("{:?}", std::thread::available_parallelism()); // prints Ok(3) } ``` Caveats * cgroup v1 is ignored * funky mountpoints (containing spaces, newlines or control chars) for cgroupfs will not be handled correctly since that would require unescaping /proc/self/mountinfo The escaping behavior of procfs seems to be undocumented. systemd and docker default to `/sys/fs/cgroup` so it should be fine for most systems. * quota will be ignored when `sched_getaffinity` doesn't work * assumes procfs is mounted under `/proc` and cgroupfs mounted and readable somewhere in the directory tree
Configuration menu - View commit details
-
Copy full SHA for bac5523 - Browse repository at this point
Copy the full SHA bac5523View commit details -
hardcode /sys/fs/cgroup instead of doing a lookup via mountinfo
this avoids parsing mountinfo which can be huge on some systems and something might be emulating cgroup fs for sandboxing reasons which means it wouldn't show up as mountpoint additionally the new implementation operates on a single pathbuffer, reducing allocations
Configuration menu - View commit details
-
Copy full SHA for af6d2ed - Browse repository at this point
Copy the full SHA af6d2edView commit details -
update available_parallelism docs since cgroups and sched_getaffinity…
… are now taken into account
Configuration menu - View commit details
-
Copy full SHA for e18abbf - Browse repository at this point
Copy the full SHA e18abbfView commit details
Commits on Mar 3, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 37c1eb0 - Browse repository at this point
Copy the full SHA 37c1eb0View commit details -
Configuration menu - View commit details
-
Copy full SHA for e3f04de - Browse repository at this point
Copy the full SHA e3f04deView commit details -
Improve if/else formatting in macro_parser.rs.
To avoid the strange style where comments force `else` onto its own line. The commit also removes several else-after-return constructs, which can be hard to read.
Configuration menu - View commit details
-
Copy full SHA for 11c565f - Browse repository at this point
Copy the full SHA 11c565fView commit details -
Configuration menu - View commit details
-
Copy full SHA for b9fabc3 - Browse repository at this point
Copy the full SHA b9fabc3View commit details -
Introduce
MatcherPosRepetition
.There are three `Option` fields in `MatcherPos` that are only used in tandem. This commit combines them, making the code slightly easier to read. (It also makes clear that the `sep` field arguably should have been `Option<Option<Token>>`!)
Configuration menu - View commit details
-
Copy full SHA for 643ba50 - Browse repository at this point
Copy the full SHA 643ba50View commit details -
Use a better return type for
inner_parse_loop
.Because `inner_parse_loop` has only one way to not succeed, not three.
Configuration menu - View commit details
-
Copy full SHA for e5f3fd6 - Browse repository at this point
Copy the full SHA e5f3fd6View commit details -
Configuration menu - View commit details
-
Copy full SHA for 97eb1b4 - Browse repository at this point
Copy the full SHA 97eb1b4View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5164884 - Browse repository at this point
Copy the full SHA 5164884View commit details -
Configuration menu - View commit details
-
Copy full SHA for 188ae00 - Browse repository at this point
Copy the full SHA 188ae00View commit details -
Configuration menu - View commit details
-
Copy full SHA for 00fffdd - Browse repository at this point
Copy the full SHA 00fffddView commit details -
Configuration menu - View commit details
-
Copy full SHA for ff19c05 - Browse repository at this point
Copy the full SHA ff19c05View commit details -
Rollup merge of rust-lang#92697 - the8472:cgroups, r=joshtriplett
Use cgroup quotas for calculating `available_parallelism` Automated tests for this are possible but would require a bunch of assumptions. It requires root + a recent kernel, systemd and maybe docker. And even then it would need a helper binary since the test has to run in a separate process. Limitations * only supports cgroup v2 and assumes it's mounted under `/sys/fs/cgroup` * procfs must be available * the quota gets mixed into `sched_getaffinity`, so if the latter doesn't work then quota information gets ignored too Manually tested via ``` // spawn a new cgroup scope for the current user $ sudo systemd-run -p CPUQuota="300%" --uid=$(id -u) -tdS // quota.rs #![feature(available_parallelism)] fn main() { println!("{:?}", std::thread::available_parallelism()); // prints Ok(3) } ``` strace: ``` sched_getaffinity(3041643, 32, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47]) = 32 openat(AT_FDCWD, "/proc/self/cgroup", O_RDONLY|O_CLOEXEC) = 3 statx(0, NULL, AT_STATX_SYNC_AS_STAT, STATX_ALL, NULL) = -1 EFAULT (Bad address) statx(3, "", AT_STATX_SYNC_AS_STAT|AT_EMPTY_PATH, STATX_ALL, {stx_mask=STATX_BASIC_STATS|STATX_MNT_ID, stx_attributes=0, stx_mode=S_IFREG|0444, stx_size=0, ...}) = 0 lseek(3, 0, SEEK_CUR) = 0 read(3, "0::/system.slice/run-u31477.serv"..., 128) = 36 read(3, "", 92) = 0 close(3) = 0 statx(AT_FDCWD, "/sys/fs/cgroup/system.slice/run-u31477.service/cgroup.controllers", AT_STATX_SYNC_AS_STAT, STATX_ALL, {stx_mask=STATX_BASIC_STATS|STATX_MNT_ID, stx_attributes=0, stx_mode=S_IFREG|0444, stx_size=0, ...}) = 0 openat(AT_FDCWD, "/sys/fs/cgroup/system.slice/run-u31477.service/cpu.max", O_RDONLY|O_CLOEXEC) = 3 statx(3, "", AT_STATX_SYNC_AS_STAT|AT_EMPTY_PATH, STATX_ALL, {stx_mask=STATX_BASIC_STATS|STATX_MNT_ID, stx_attributes=0, stx_mode=S_IFREG|0644, stx_size=0, ...}) = 0 lseek(3, 0, SEEK_CUR) = 0 read(3, "300000 100000\n", 20) = 14 read(3, "", 6) = 0 close(3) = 0 openat(AT_FDCWD, "/sys/fs/cgroup/system.slice/cpu.max", O_RDONLY|O_CLOEXEC) = 3 statx(3, "", AT_STATX_SYNC_AS_STAT|AT_EMPTY_PATH, STATX_ALL, {stx_mask=STATX_BASIC_STATS|STATX_MNT_ID, stx_attributes=0, stx_mode=S_IFREG|0644, stx_size=0, ...}) = 0 lseek(3, 0, SEEK_CUR) = 0 read(3, "max 100000\n", 20) = 11 read(3, "", 9) = 0 close(3) = 0 openat(AT_FDCWD, "/sys/fs/cgroup/cpu.max", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) sched_getaffinity(0, 128, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47]) = 40 ``` r? ``````@joshtriplett`````` cc ``````@yoshuawuyts`````` Tracking issue and previous discussion: rust-lang#74479
Configuration menu - View commit details
-
Copy full SHA for f776177 - Browse repository at this point
Copy the full SHA f776177View commit details -
Rollup merge of rust-lang#94057 - lcnr:simplify_type-uwu, r=nikomatsakis
improve comments for `simplify_type` Should now correctly describe what's going on. Experimented with checking the invariant for projections but that ended up requiring fairly involved changes. I assume that it is not possible to get unsoundness here, at least for now and I can pretty much guarantee that it's impossible to trigger it by accident. r? ````@nikomatsakis```` cc rust-lang#92721
Configuration menu - View commit details
-
Copy full SHA for 55ddf7d - Browse repository at this point
Copy the full SHA 55ddf7dView commit details -
Rollup merge of rust-lang#94547 - nnethercote:parse_tt-cleanups, r=pe…
…trochenkov `parse_tt` cleanups I've been looking closely at this code, and saw some opportunities to improve its readability. r? ``````@petrochenkov``````
Configuration menu - View commit details
-
Copy full SHA for c1cac49 - Browse repository at this point
Copy the full SHA c1cac49View commit details -
Rollup merge of rust-lang#94550 - GuillaumeGomez:HKF-macros, r=notriddle
rustdoc: Add test for higher kinded functions generated by macros Fixes rust-lang#75564. The problem has been solved apparently so adding a test to prevent a regression. r? ``@notriddle``
Configuration menu - View commit details
-
Copy full SHA for 770a7ec - Browse repository at this point
Copy the full SHA 770a7ecView commit details -
Rollup merge of rust-lang#94551 - darnuria:doc-map-backstick, r=dtolnay
Doc: Fix use of quote instead of backstick in Adapter::map. A little commit to fix documentation rendering and semantics in https://doc.rust-lang.org/std/iter/struct.Map.html#notes-about-side-effects `"` where used around an expression instead \`. Screenshot on doc.rust-lang.org: ![2022-03-03 11-21-43_backstick](https://user-images.githubusercontent.com/2827553/156546536-569b7692-7ac4-4388-8e93-c1628ddc6a0f.png) Looking forward: Maybe reworking the doc to use assert_eq like the upper paragraph: ``` let v: Vec<i32> = vec![1, 2, 3].into_iter().map(|x| x + 1).rev().collect(); assert_eq!(v, [4, 3, 2]); ```
Configuration menu - View commit details
-
Copy full SHA for 0c14a12 - Browse repository at this point
Copy the full SHA 0c14a12View commit details -
Rollup merge of rust-lang#94553 - lcnr:add-tests, r=Dylan-DPC
add tests for rust-lang#94502 cc rust-lang#94552
Configuration menu - View commit details
-
Copy full SHA for aaac4f9 - Browse repository at this point
Copy the full SHA aaac4f9View commit details -
Rollup merge of rust-lang#94554 - Urgau:stmt-node-id-ice, r=petrochenkov
Fix invalid lint_node_id being put on a removed stmt This pull-request remove a invalid `assign_id!` being put on an stmt node. The problem is that this node is being removed away by a cfg making it unreachable when triggering a buffered lint. The comment in the other match arm already tell to not assign a id because it could have a `#[cfg()]` so this is just respecting the comment. Fixes rust-lang#94523 r? ``````@petrochenkov``````
Configuration menu - View commit details
-
Copy full SHA for 7ea81d6 - Browse repository at this point
Copy the full SHA 7ea81d6View commit details -
Rollup merge of rust-lang#94555 - cuishuang:master, r=oli-obk
all: fix some typos Signed-off-by: cuishuang <imcusg@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for bb8a82e - Browse repository at this point
Copy the full SHA bb8a82eView commit details -
Rollup merge of rust-lang#94563 - TaKO8Ki:remove-unnecessary-patten-f…
…or-ignoring-remaining-parts, r=Dylan-DPC Remove a unnecessary `..` pattern
Configuration menu - View commit details
-
Copy full SHA for 2894281 - Browse repository at this point
Copy the full SHA 2894281View commit details