-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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 8 pull requests #93498
Rollup of 8 pull requests #93498
Conversation
New implementation takes into account contents of `self.buf` and rounds lower bound up instead of down.
`self.buf` can contain a surrogate, but only a leading one.
There's no such CSS rule as `box-shadow-color`, so I instead copied the whole `box-shadow` property to each rule to make it actually apply.
There are cases, when data in the buf might or might not be an error.
Previously the pretty printer would compute indentation always relative to whatever column a block begins at, like this: fn demo(arg1: usize, arg2: usize); This is never the thing to do in the dominant contemporary Rust style. Rustfmt's default and the style used by the vast majority of Rust codebases is block indentation: fn demo( arg1: usize, arg2: usize, ); where every indentation level is a multiple of 4 spaces and each level is indented relative to the indentation of the previous line, not the position that the block starts in.
The `print_expr` method already places an `ibox(INDENT_UNIT)` around every expr that gets printed. Some exprs were then using `self.head` inside of that, which does its own `cbox(INDENT_UNIT)`, resulting in two levels of indentation: while true { stuff; } This commit fixes those cases to produce the expected single level of indentation within every expression containing a block. while true { stuff; }
… r=jackh726 Improve terminology around "after typeck" Closes rust-lang#70258.
…lision, r=jackh726 Allow eliding GATs in expression position Thoughts on whether this is worthwhile? Fixes rust-lang#92836 r? ``@jackh726``
Don't suggest inaccessible fields Fixes: rust-lang#92999
Switch pretty printer to block-based indentation This PR backports dtolnay/prettyplease@401d60c from the `prettyplease` crate into `rustc_ast_pretty`. A before and after: ```diff - let res = - ((::alloc::fmt::format as - for<'r> fn(Arguments<'r>) -> String {format})(((::core::fmt::Arguments::new_v1 - as - fn(&[&'static str], &[ArgumentV1]) -> Arguments {Arguments::new_v1})((&([("test" - as - &str)] - as - [&str; 1]) - as - &[&str; 1]), - (&([] - as - [ArgumentV1; 0]) - as - &[ArgumentV1; 0])) - as - Arguments)) - as String); + let res = + ((::alloc::fmt::format as + for<'r> fn(Arguments<'r>) -> String {format})(((::core::fmt::Arguments::new_v1 + as + fn(&[&'static str], &[ArgumentV1]) -> Arguments {Arguments::new_v1})((&([("test" + as &str)] as [&str; 1]) as + &[&str; 1]), + (&([] as [ArgumentV1; 0]) as &[ArgumentV1; 0])) as + Arguments)) as String); ``` Previously the pretty printer would compute indentation always relative to whatever column a block begins at, like this: ```rust fn demo(arg1: usize, arg2: usize); ``` This is never the thing to do in the dominant contemporary Rust style. Rustfmt's default and the style used by the vast majority of Rust codebases is block indentation: ```rust fn demo( arg1: usize, arg2: usize, ); ``` where every indentation level is a multiple of 4 spaces and each level is indented relative to the indentation of the previous line, not the position that the block starts in. By itself this PR doesn't get perfect formatting in all cases, but it is the smallest possible step in clearly the right direction. More backports from `prettyplease` to tune the ibox/cbox indent levels around various AST node types are upcoming.
Respect doc(hidden) when suggesting available fields Resolves rust-lang#93210
…16_size_hint, r=dtolnay Make `char::DecodeUtf16::size_hist` more precise New implementation takes into account contents of `self.buf` and rounds lower bound up instead of down. Fixes rust-lang#88762 Revival of rust-lang#88763
Clarify documentation on char::MAX As mentioned in rust-lang#91836 (comment), the documentation on `char::MAX` is not quite correct – USVs are not "only ones within a certain range", they are code points _outside_ a certain range. I have corrected this and given the actual numbers as there is no reason to hide them.
…laumeGomez,jsha Fix some CSS warnings and errors from VS Code There's no such CSS rule as `box-shadow-color`, so I instead copied the whole `box-shadow` property to each rule to make it actually apply. r? `@jsha`
@bors r+ rollup=never p=8 |
📌 Commit 2070b22 has been approved by |
⌛ Testing commit 2070b22 with merge eef0b547839e23216f08914b8845caf10b10cb1e... |
The job Click to see the possible cause of the failure (guessed by this bot)
|
💔 Test failed - checks-actions |
@bors retry rustdoc test timeout
|
☀️ Test successful - checks-actions |
Finished benchmarking commit (86f5e17): comparison url. Summary: This benchmark run did not return any relevant results. If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. @rustbot label: -perf-regression |
Successful merges:
char::DecodeUtf16::size_hist
more precise #93347 (Makechar::DecodeUtf16::size_hist
more precise)Failed merges:
r? @ghost
@rustbot modify labels: rollup
Create a similar rollup