-
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 4 pull requests #70581
Closed
Closed
Rollup of 4 pull requests #70581
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This diff improves error messages around raw strings in a few ways: - Catch extra trailing `#` in the parser. This can't be handled in the lexer because we could be in a macro that actually expects another # (see test) - Refactor & unify error handling in the lexer between ByteStrings and RawByteStrings - Detect potentially intended terminators (longest sequence of "#*" is suggested)
Made obsolete by b5e35b1
…ie27 improve folder name for persistent doc tests This partially fixes rust-lang#69411 by using the entire path as folder name, but I do not know how to deal with the proc-macro problem, where a doc test is forwarded to multiple generated functions, which have the same line for the doc test (origin). For example ```rust #[derive(ShortHand)] pub struct ExtXMedia { /// The [`MediaType`] associated with this tag. /// /// # Example /// -> /// ``` <- this line is given to `run_test` /// # use hls_m3u8::tags::ExtXMedia; /// use hls_m3u8::types::MediaType; /// /// let mut media = ExtXMedia::new(MediaType::Audio, "ag1", "english audio channel"); /// /// media.set_media_type(MediaType::Video); /// /// assert_eq!(media.media_type(), MediaType::Video); /// ``` /// /// # Note /// /// This attribute is required. #[shorthand(enable(copy))] media_type: MediaType, // the rest of the fields are omitted } ``` and my proc macro generates ```rust #[allow(dead_code)] impl ExtXMedia { /// The [`MediaType`] associated with this tag. /// /// # Example /// /// ``` /// # use hls_m3u8::tags::ExtXMedia; /// use hls_m3u8::types::MediaType; /// /// let mut media = ExtXMedia::new(MediaType::Audio, "ag1", "english audio channel"); /// /// media.set_media_type(MediaType::Video); /// /// assert_eq!(media.media_type(), MediaType::Video); /// ``` /// /// # Note /// /// This attribute is required. #[inline(always)] #[must_use] pub fn media_type(&self) -> MediaType { struct _AssertCopy where MediaType: ::std::marker::Copy; self.media_type } /// The [`MediaType`] associated with this tag. /// /// # Example /// /// ``` /// # use hls_m3u8::tags::ExtXMedia; /// use hls_m3u8::types::MediaType; /// /// let mut media = ExtXMedia::new(MediaType::Audio, "ag1", "english audio channel"); /// /// media.set_media_type(MediaType::Video); /// /// assert_eq!(media.media_type(), MediaType::Video); /// ``` /// /// # Note /// /// This attribute is required. #[inline(always)] pub fn set_media_type<VALUE: ::std::convert::Into<MediaType>>( &mut self, value: VALUE, ) -> &mut Self { self.media_type = value.into(); self } } ``` rustdoc then executes both tests with the same line (the line from the example above the field -> 2 different tests have the same name). We need a way to differentiate between the two tests generated by the proc-macro, so that they do not cause threading issues.
…rochenkov Improve error messages for raw strings (rust-lang#60762) This diff improves error messages around raw strings in a few ways: - Catch extra trailing `#` in the parser. This can't be handled in the lexer because we could be in a macro that actually expects another # (see test) - Refactor & unify error handling in the lexer between ByteStrings and RawByteStrings - Detect potentially intended terminators (longest sequence of "#*" is suggested) Fixes rust-lang#60762 cc @estebank who reviewed the original (abandoned) PR for the same ticket. r? @Centril
resolve, `try_resolve_as_non_binding`: use `delay_span_bug` due to parser recovery Fixes rust-lang#70549 r? @petrochenkov
…henkov remove obsolete comment Made obsolete by b5e35b1
@bors r+ p=4 rollup=never |
📌 Commit 13f6f8a has been approved by |
⌛ Testing commit 13f6f8a with merge 4f6467955250980d60e69792a8b62b55823d613a... |
💔 Test failed - checks-azure |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
rollup
A PR which is a rollup
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Successful merges:
try_resolve_as_non_binding
: usedelay_span_bug
due to parser recovery #70555 (resolve,try_resolve_as_non_binding
: usedelay_span_bug
due to parser recovery)Failed merges:
r? @ghost