-
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 7 pull requests #88774
Rollup of 7 pull requests #88774
Commits on Aug 31, 2021
-
Emit proper errors when on missing closure braces
This commit focuses on emitting clean errors for the following syntax error: ``` Some(42).map(|a| dbg!(a); a ); ``` Previous implementation tried to recover after parsing the closure body (the `dbg` expression) by replacing the next `;` with a `,`, which made the next expression belong to the next function argument. As such, the following errors were emitted (among others): - the semicolon token was not expected, - a is not in scope, - Option::map is supposed to take one argument, not two. This commit allows us to gracefully handle this situation by adding giving the parser the ability to remember when it has just parsed a closure body inside a function call. When this happens, we can treat the unexpected `;` specifically and try to parse as much statements as possible in order to eat the whole block. When we can't parse statements anymore, we generate a clean error indicating that the braces are missing, and return an ExprKind::Err.
Sasha Pourcelot committedAug 31, 2021 Configuration menu - View commit details
-
Copy full SHA for 1f5568d - Browse repository at this point
Copy the full SHA 1f5568dView commit details
Commits on Sep 1, 2021
-
Fix grammatical error in error message
Sasha Pourcelot committedSep 1, 2021 Configuration menu - View commit details
-
Copy full SHA for 3bdda1c - Browse repository at this point
Copy the full SHA 3bdda1cView commit details -
Sasha Pourcelot committed
Sep 1, 2021 Configuration menu - View commit details
-
Copy full SHA for eabe41c - Browse repository at this point
Copy the full SHA eabe41cView commit details -
Put the expr error inside the closure body
Sasha Pourcelot committedSep 1, 2021 Configuration menu - View commit details
-
Copy full SHA for e8e76b7 - Browse repository at this point
Copy the full SHA e8e76b7View commit details -
Add ruby-style closure ui tests
Sasha Pourcelot committedSep 1, 2021 Configuration menu - View commit details
-
Copy full SHA for dbe56f4 - Browse repository at this point
Copy the full SHA dbe56f4View commit details
Commits on Sep 2, 2021
-
Configuration menu - View commit details
-
Copy full SHA for 733bdd0 - Browse repository at this point
Copy the full SHA 733bdd0View commit details -
Configuration menu - View commit details
-
Copy full SHA for f23003d - Browse repository at this point
Copy the full SHA f23003dView commit details -
Add comment about ruby_style_closure status
Sasha Pourcelot committedSep 2, 2021 Configuration menu - View commit details
-
Copy full SHA for 3a334a0 - Browse repository at this point
Copy the full SHA 3a334a0View commit details
Commits on Sep 3, 2021
-
Put some notes in a separate note block
Sasha Pourcelot committedSep 3, 2021 Configuration menu - View commit details
-
Copy full SHA for 191bb83 - Browse repository at this point
Copy the full SHA 191bb83View commit details -
Merge branch 'master' into scrabsha/closure-missing-braces
Sasha Pourcelot committedSep 3, 2021 Configuration menu - View commit details
-
Copy full SHA for 1beee86 - Browse repository at this point
Copy the full SHA 1beee86View commit details -
Sasha Pourcelot committed
Sep 3, 2021 Configuration menu - View commit details
-
Copy full SHA for 41ac2c6 - Browse repository at this point
Copy the full SHA 41ac2c6View commit details -
Group closure-related spans in a structure
Sasha Pourcelot committedSep 3, 2021 Configuration menu - View commit details
-
Copy full SHA for 4107396 - Browse repository at this point
Copy the full SHA 4107396View commit details
Commits on Sep 4, 2021
-
Use
summary_opts()
for Markdown summariesIt was accidentally changed to use `opts()` in rust-lang#86451. I also renamed `opts()` to `main_body_opts()` to make this kind of accidental change less likely.
Configuration menu - View commit details
-
Copy full SHA for 208a5fd - Browse repository at this point
Copy the full SHA 208a5fdView commit details -
Enable all main body Markdown options for summaries
This fixes odd renderings when these features are used in the first paragraph of documentation for an item. This is an extension of rust-lang#87270.
Configuration menu - View commit details
-
Copy full SHA for 2cc7b7c - Browse repository at this point
Copy the full SHA 2cc7b7cView commit details -
Sasha Pourcelot committed
Sep 4, 2021 Configuration menu - View commit details
-
Copy full SHA for e9e8b61 - Browse repository at this point
Copy the full SHA e9e8b61View commit details -
last_closure_body -> current_closure
Sasha Pourcelot committedSep 4, 2021 Configuration menu - View commit details
-
Copy full SHA for f91161d - Browse repository at this point
Copy the full SHA f91161dView commit details
Commits on Sep 6, 2021
-
Slightly reword the error message
Sasha Pourcelot committedSep 6, 2021 Configuration menu - View commit details
-
Copy full SHA for 99c46c0 - Browse repository at this point
Copy the full SHA 99c46c0View commit details -
fix ICE on hidden tuple variant fields
this also renders them as `_`, which rustdoc previously did not.
Configuration menu - View commit details
-
Copy full SHA for 4a915ac - Browse repository at this point
Copy the full SHA 4a915acView commit details
Commits on Sep 7, 2021
-
test: add case for mutating iterator
Note that this incorrectly suggests a shared borrow, but at least we know it's happening.
Configuration menu - View commit details
-
Copy full SHA for d6ff916 - Browse repository at this point
Copy the full SHA d6ff916View commit details -
RustWrapper: avoid deleted unclear attribute methods
These were deleted in https://reviews.llvm.org/D108614, and in C++ I definitely see the argument for their removal. I didn't try and propagate the changes up into higher layers of rustc in this change because my initial goal was to get rustc working against LLVM HEAD promptly, but I'm happy to follow up with some refactoring to make the API on the Rust side match the LLVM API more directly (though the way the enum works in Rust makes the API less scary IMO). r? @nagisa cc @nikic
Configuration menu - View commit details
-
Copy full SHA for 532bb80 - Browse repository at this point
Copy the full SHA 532bb80View commit details -
RustWrapper: just use the *AtIndex funcs directly
Otherwise we're kind of reimplementing the inverse of the well-named methods, and that's not a direction we want to go.
Configuration menu - View commit details
-
Copy full SHA for 484b79b - Browse repository at this point
Copy the full SHA 484b79bView commit details
Commits on Sep 8, 2021
-
RustWrapper: remove some uses of AttrBuilder
Turns out we can also use Attribute::get*() methods here, and avoid the AttrBuilder and an extra helper method here.
Configuration menu - View commit details
-
Copy full SHA for 4d04540 - Browse repository at this point
Copy the full SHA 4d04540View commit details
Commits on Sep 9, 2021
-
Improve error when an .rlib can't be parsed
This usually describes either an error in the compiler itself or some sort of IO error. Either way, we should report it to the user rather than just saying "crate not found". This only gives an error if the crate couldn't be loaded at all - if the compiler finds another .rlib or .rmeta file which was valid, it will continue to compile the crate. Example output: ``` error[E0785]: found invalid metadata files for crate `foo` --> bar.rs:3:24 | 3 | println!("{}", foo::FOO_11_49[0]); | ^^^ | = warning: failed to parse rlib '/home/joshua/test-rustdoc/libfoo.rlib': Invalid archive extended name offset ```
Configuration menu - View commit details
-
Copy full SHA for 8549598 - Browse repository at this point
Copy the full SHA 8549598View commit details -
Configuration menu - View commit details
-
Copy full SHA for c86c634 - Browse repository at this point
Copy the full SHA c86c634View commit details -
Rollup merge of rust-lang#88368 - jyn514:metadata-error, r=petrochenkov
Improve error when an .rlib can't be parsed This usually describes either an error in the compiler itself or some sort of IO error. Either way, we should report it to the user rather than just saying "crate not found". This only gives an error if the crate couldn't be loaded at all - if the compiler finds another .rlib or .rmeta file which was valid, it will continue to compile the crate. Example output: ``` error[E0785]: found invalid metadata files for crate `foo` --> bar.rs:3:24 | 3 | println!("{}", foo::FOO_11_49[0]); | ^^^ | = warning: failed to parse rlib '/home/joshua/test-rustdoc/libfoo.rlib': Invalid archive extended name offset ``` cc `@ehuss`
Configuration menu - View commit details
-
Copy full SHA for e8342de - Browse repository at this point
Copy the full SHA e8342deView commit details -
Rollup merge of rust-lang#88546 - scrabsha:scrabsha/closure-missing-b…
…races, r=estebank Emit proper errors when on missing closure braces This commit focuses on emitting clean errors for the following syntax error: ``` Some(42).map(|a| dbg!(a); a ); ``` Previous implementation tried to recover after parsing the closure body (the `dbg` expression) by replacing the next `;` with a `,`, which made the next expression belong to the next function argument. As such, the following errors were emitted (among others): - the semicolon token was not expected, - a is not in scope, - Option::map is supposed to take one argument, not two. This commit allows us to gracefully handle this situation by adding giving the parser the ability to remember when it has just parsed a closure body inside a function call. When this happens, we can treat the unexpected `;` specifically and try to parse as much statements as possible in order to eat the whole block. When we can't parse statements anymore, we generate a clean error indicating that the braces are missing, and return an ExprKind::Err. Closes rust-lang#88065. r? `@estebank`
Configuration menu - View commit details
-
Copy full SHA for 09de880 - Browse repository at this point
Copy the full SHA 09de880View commit details -
Rollup merge of rust-lang#88578 - notriddle:notriddle/suggest-add-ref…
…erence-to-for-loop-iter, r=nagisa fix(rustc): suggest `items` be borrowed in `for i in items[x..]` Fixes rust-lang#87994
Configuration menu - View commit details
-
Copy full SHA for 2471041 - Browse repository at this point
Copy the full SHA 2471041View commit details -
Rollup merge of rust-lang#88632 - camelid:md-opts, r=CraftSpider
Fix issues with Markdown summary options - Use `summary_opts()` for Markdown summaries - Enable all main body Markdown options for summaries
Configuration menu - View commit details
-
Copy full SHA for ff0f5f9 - Browse repository at this point
Copy the full SHA ff0f5f9View commit details -
Rollup merge of rust-lang#88639 - Emilgardis:fix-issue-88600, r=Guill…
…aumeGomez rustdoc: Fix ICE with `doc(hidden)` on tuple variant fields Fixes rust-lang#88600. ```rust pub struct H; pub struct S; pub enum FooEnum { HiddenTupleItem(#[doc(hidden)] H), MultipleHidden(#[doc(hidden)] H, #[doc(hidden)] H), MixedHiddenFirst(#[doc(hidden)] H, S), MixedHiddenLast(S, #[doc(hidden)] H), HiddenStruct { #[doc(hidden)] h: H, s: S, }, } ``` Generates ![image](https://user-images.githubusercontent.com/1502855/132259152-382f9517-c2a0-41d8-acd0-64e5993931fc.png)
Configuration menu - View commit details
-
Copy full SHA for fa7834a - Browse repository at this point
Copy the full SHA fa7834aView commit details -
Rollup merge of rust-lang#88732 - durin42:llvm-14-attrs-2, r=nikic
RustWrapper: avoid deleted unclear attribute methods These were deleted in https://reviews.llvm.org/D108614, and in C++ I definitely see the argument for their removal. I didn't try and propagate the changes up into higher layers of rustc in this change because my initial goal was to get rustc working against LLVM HEAD promptly, but I'm happy to follow up with some refactoring to make the API on the Rust side match the LLVM API more directly (though the way the enum works in Rust makes the API less scary IMO). r? `@nagisa` cc `@nikic`
Configuration menu - View commit details
-
Copy full SHA for f31ac61 - Browse repository at this point
Copy the full SHA f31ac61View commit details -
Rollup merge of rust-lang#88745 - hnj2:allow-trait-impl-missing-code,…
… r=GuillaumeGomez Allow missing code examples in trait impls. Excludes Trait implementations from the items that need to have doc code examples when using the `rustdoc::missing_doc_code_examples` lint. For details see rust-lang#88741 fixes rust-lang#88741 r? `@jyn514`
Configuration menu - View commit details
-
Copy full SHA for 26a98a7 - Browse repository at this point
Copy the full SHA 26a98a7View commit details