-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Rollup of 18 pull requests #143074
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 18 pull requests #143074
Conversation
No need to call into fold when the first item is already None, this avoids some redundant work for empty iterators. "But it uses Fuse" one might want to protest, but Fuse is specialized and may call into the inner iterator anyway.
It is currently possible to create a dangling `Weak` to a DST by calling `Weak::new()` for a sized type, then doing an unsized coercion. Therefore, the comments are wrong. These comments were added in <rust-lang#73845>. As far as I can tell, the guarantee in the comment was only previously used in the `as_ptr` method. However, the current implementation of `as_ptr` no longer relies on this guarantee.
…ssible_obligation
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
…he error Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
…reject such constants as patterns
Co-authored-by: Josh Stone <cuviper@gmail.com>
…li-obk make RefCell unstably const Now that we can do interior mutability in `const`, most of the `RefCell` API can be `const fn`. The main exceptions are APIs which use `FnOnce` (`RefCell::replace_with` and `Ref[Mut]::[filter_]map[_split]`) and `RefCell::take` which calls `Default::default`. Tracking issue: rust-lang#137844
const-eval: allow constants to refer to mutable/external memory, but reject such constants as patterns This fixes rust-lang#140653 by accepting code such as this: ```rust static FOO: AtomicU32 = AtomicU32::new(0); const C: &'static AtomicU32 = &FOO; ``` This can be written entirely in safe code, so there can't really be anything wrong with it. We also accept the much more questionable following code, since it looks very similar to the interpreter: ```rust static mut FOO2: u32 = 0; const C2: &'static u32 = unsafe { &mut FOO2 }; ``` Using this without causing UB is at least very hard (the details are unclear since it is related to how the aliasing model deals with the staging of const-eval vs runtime code). If a constant like `C2` is used as a pattern, we emit an error: ``` error: constant BAD_PATTERN cannot be used as pattern --> $DIR/const_refs_to_static_fail.rs:30:9 | LL | BAD_PATTERN => {}, | ^^^^^^^^^^^ | = note: constants that reference mutable or external memory cannot be used as pattern ``` (If you somehow manage to build a pattern with constant `C`, you'd get the same error, but that should be impossible: we don't have a type that can be used in patterns and that has interior mutability.) The same treatment is afforded for shared references to `extern static`, for the same reason: the const evaluation is entirely fine with it, we just can't build a pattern for it -- and when using interior mutability, this can be totally sound. We do still not accept anything where there is an `&mut` in the final value of the const, as that should always require unsafe code and it's hard to imagine a sound use-case that would require this.
…tgross35 small iter.intersperse.fold() optimization No need to call into fold when the first item is already None, this avoids some redundant work for empty iterators. "But it uses Fuse" one might want to protest, but Fuse is specialized and may call into the inner iterator anyway.
Remove some glob imports from the type system Namely, remove the glob imports for `BoundRegionConversionTime`, `RegionVariableOrigin`, `SubregionOrigin`, `TyOrConstInferVar`, `RegionResolutionError`, `SelectionError`, `ProjectionCandidate`, `ProjectionCandidateSet`, and some more specific scoped globs (like `Inserted` in the impl overlap graph construction. These glob imports are IMO very low value, since they're not used nearly as often as other globs (like `TyKind`).
This should be disjoint from #143057, but I fear that PR will fail anyways with a CI timeout since it seems like the apple-1 job is hanging. |
@bors r+ rollup=never p=9 |
☀️ Test successful - checks-actions |
What is this?This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.Comparing 513999b (parent) -> e61dd43 (this PR) Test differencesShow 1060 test diffsStage 1
(and 552 additional test diffs) Additionally, 408 doctest diffs were found. These are ignored, as they are noisy. Job group index
Test dashboardRun cargo run --manifest-path src/ci/citool/Cargo.toml -- \
test-dashboard e61dd437f33b5a640e67dc3628397689c664c17f --output-dir test-dashboard And then open Job duration changes
How to interpret the job duration changes?Job durations can vary a lot, based on the actual runner instance |
📌 Perf builds for each rolled up PR:
previous master: 513999b936 In the case of a perf regression, run the following command for each PR you suspect might be the cause: |
Finished benchmarking commit (e61dd43): comparison URL. Overall result: ❌ regressions - no action needed@rustbot label: -perf-regression Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (primary -2.7%, secondary 2.8%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesThis benchmark run did not return any relevant results for this metric. Binary sizeResults (primary -0.0%, secondary 0.0%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Bootstrap: 692.298s -> 692.733s (0.06%) |
Successful merges:
Weak
#142700 (Remove incorrect comments inWeak
)find_const_ty_from_env
#142927 (Add note tofind_const_ty_from_env
)#[export_name]
to the new attribute parsing infrastructure #142986 (Port#[export_name]
to the new attribute parsing infrastructure)browser-ui-test
version to0.20.7
#143010 (Updatebrowser-ui-test
version to0.20.7
)sym::macro_pin
diagnostic item forcore::pin::pin!()
#143015 (Addsym::macro_pin
diagnostic item forcore::pin::pin!()
)iter_macro
#143067 (Tracking issue number foriter_macro
)Failed merges:
r? @ghost
@rustbot modify labels: rollup
Create a similar rollup