-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Rollup of 9 pull requests #142794
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 #142794
Conversation
Implements `trim_prefix` and `trim_suffix` methods for both `slice` and `str` types which remove at most one occurrence of a prefix/suffix while always returning a string/slice (rather than Option), enabling easy method chaining.
Be more consistent with the otherwise top-down organization of this file.
Introduce `MacroTcbCtx` that holds everything relevant to transcription. This allows for the following changes: * Split `transcribe_sequence` and `transcribe_metavar` out of the heavily nested `transcribe` * Split `metavar_expr_concat` out of `transcribe_metavar_expr` This is a nonfunctional change.
We only called it it one place, which isn't generic and can be replaced with a field access.
Add `trim_prefix` and `trim_suffix` methods for both `slice` and `str` types. Implements `trim_prefix` and `trim_suffix` methods for both `slice` and `str` types, which remove at most one occurrence of a prefix/suffix while always returning a string/slice (rather than Option), enabling easy method chaining. ## Tracking issue rust-lang#142312 ## API ```rust impl str { pub fn trim_prefix<P: Pattern>(&self, prefix: P) -> &str; pub fn trim_suffix<P: Pattern>(&self, suffix: P) -> &str where for<'a> P::Searcher<'a>: ReverseSearcher<'a>; } impl<T> [T] { pub fn trim_prefix<P: SlicePattern<Item = T> + ?Sized>(&self, prefix: &P) -> &[T] where T: PartialEq; pub fn trim_suffix<P: SlicePattern<Item = T> + ?Sized>(&self, suffix: &P) -> &[T] where T: PartialEq; } ``` ## Examples ```rust // Method chaining assert_eq!(" <https://example.com/> ".trim().trim_prefix('<').trim_suffix('>').trim(), "https://example.com/"); // Slices let v = &[10, 40, 30]; assert_eq!(v.trim_prefix(&[10]), &[40, 30][..]); ``` ## ACP Originally proposed in rust-lang/libs-team#597
Rework #[cold] attribute parser r? `@oli-obk`
…docs, r=oli-obk Fix missing docs in `rustc_attr_parsing`
… r=oli-obk Better template for `#[repr]` attributes
…ailure, r=lolbinarycat Fix random failure when JS code is executed when the whole file was not read yet Very randomly (and rarely), when I arrived on a page with `?search=something` in the URL, I got this error:  Moving the `initSearch` function at the bottom to ensure everything has been loaded fixes the issue. PS: Sorry for the noise. Pushed to the wrong branch and rust-lang#142496 closed. ><
Ensure copy* intrinsics also perform the static self-init checks fixes rust-lang#142532 r? `@RalfJung`
…petrochenkov Refactor Translator My main motivation was to simplify the usage of `SilentEmitter` for users like rustfmt. A few refactoring opportunities arose along the way. * Replace `Translate` trait with `Translator` struct * Replace `Emitter: Translate` with `Emitter::translator` * Split `SilentEmitter` into `FatalOnlyEmitter` and `SilentEmitter`
…r=petrochenkov mbe: Refactor transcription Introduce `MacroTcbCtx` that holds everything relevant to transcription. This allows for the following changes: * Split `transcribe_sequence` and `transcribe_metavar` out of the heavily nested `transcribe` * Split `metavar_expr_concat` out of `transcribe_metavar_expr` This is a nonfunctional change.
…aumeGomez rustdoc: Remove `FormatRenderer::cache` We only called it it one place, which isn't generic and can be replaced with a field access.
@bors r+ rollup=never p=5 |
Rollup of 9 pull requests Successful merges: - #142331 (Add `trim_prefix` and `trim_suffix` methods for both `slice` and `str` types.) - #142491 (Rework #[cold] attribute parser) - #142494 (Fix missing docs in `rustc_attr_parsing`) - #142495 (Better template for `#[repr]` attributes) - #142497 (Fix random failure when JS code is executed when the whole file was not read yet) - #142575 (Ensure copy* intrinsics also perform the static self-init checks) - #142650 (Refactor Translator) - #142713 (mbe: Refactor transcription) - #142755 (rustdoc: Remove `FormatRenderer::cache`) r? `@ghost` `@rustbot` modify labels: rollup
💔 Test failed - checks-actions |
Logs don't seem to be loading for me |
nor for me, but there were quite some attr PRs in that and atm they are somewhat likely to minorly conflict. this is not the first time, if it ends up being the culprit I might mark them as iffy slightly more often |
I learned on Zulip that you can see this is just a runner fluke https://rust-lang.zulipchat.com/#narrow/channel/242791-t-infra/topic/molasses.20dist-x86_64-musl.20try-build/near/525099247 @bors retry |
oh I see, that explains. I checked out and built the PR locally and the attribute related PRs in this one don't conflict, don't mind me! |
You mean, you think the conflict could result in buggy code or something? I guess you could always mark some |
Ah you answered right before me, don't mind me either then 😆 |
☀️ Test successful - checks-actions |
📌 Perf builds for each rolled up PR:
previous master: 5526a2f47c In the case of a perf regression, run the following command for each PR you suspect might be the cause: |
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 5526a2f (parent) -> 15c701f (this PR) Test differencesShow 184 test diffsStage 1
Stage 2
Additionally, 180 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 15c701fbc995eb6c5b3a86021c18185f8eee020d --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 |
Successful merges:
trim_prefix
andtrim_suffix
methods for bothslice
andstr
types. #142331 (Addtrim_prefix
andtrim_suffix
methods for bothslice
andstr
types.)rustc_attr_parsing
#142494 (Fix missing docs inrustc_attr_parsing
)#[repr]
attributes #142495 (Better template for#[repr]
attributes)FormatRenderer::cache
#142755 (rustdoc: RemoveFormatRenderer::cache
)r? @ghost
@rustbot modify labels: rollup
Create a similar rollup