-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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 5 pull requests #86806
Merged
Merged
Rollup of 5 pull requests #86806
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
The recursion_limit attribute avoids the following error: ``` error[E0275]: overflow evaluating the requirement `std::ptr::Unique<rustc_ast::Pat>: std::marker::Send` | = help: consider adding a `#![recursion_limit="256"]` attribute to your crate (`rustfmt_nightly`) ```
…crate-load, r=jyn514 Revert "Don't load all extern crates unconditionally" Fixes rust-lang#84738. This reverts rust-lang#83738. For the "smart" load of external crates, we need to be able to access their items in order to check their doc comments, which seems, if not impossible, quite complicated using only the AST. For some context, I first tried to extend the `IntraLinkCrateLoader` visitor by adding `visit_foreign_item`. Unfortunately, it never enters into this call, so definitely not the right place... I then added `visit_use_tree` to then check all the imports outside with something like this: ```rust let mut loader = crate::passes::collect_intra_doc_links::IntraLinkCrateLoader::new(resolver); ast::visit::walk_crate(&mut loader, krate); let mut items = Vec::new(); for import in &loader.imports_to_check { if let Some(item) = krate.items.iter().find(|i| i.id == *import) { items.push(item); } } for item in items { ast::visit::walk_item(&mut item); for attr in &item.attrs { loader.check_attribute(attr); } } ``` This was, of course, a failure. We find the items without problems, but we still can't go into the external crate to check its items' attributes. Finally, `@jyn514` suggested to look into the [`CrateLoader`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_metadata/creader/struct.CrateLoader.html), but it only seems to provide metadata (I went through [`CStore`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_metadata/creader/struct.CStore.html) and [`CrateMetadata`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_metadata/rmeta/decoder/struct.CrateMetadata.html)). I think we are too limited here (with AST only) to be able to determine the crates we actually need to import, but it's very likely that I missed something. Maybe `@petrochenkov` or `@Aaron1011` have an idea? So until we find a way to make it work completely, we need to revert it to fix the ICE. Once merged, we'll need to re-open rust-lang#68427. r? `@jyn514`
…ethods, r=Amanieu Add linked list cursor end methods I add several methods to `LinkedList::CursorMut` and `LinkedList::Cursor`. These methods allow you to access/manipulate the ends of a list via the cursor. This is especially helpful when scanning through a list and reordering. For example: ```rust let mut c = ll.back_cursor_mut(); let mut moves = 10; while c.current().map(|x| x > 5).unwrap_or(false) { let n = c.remove_current(); c.push_front(n); if moves > 0 { break; } else { moves -= 1; } } ``` I encountered this problem working on my bachelors thesis doing graph index manipulation. While this problem can be avoided by splicing, it is awkward. I asked about the problem [here](https://internals.rust-lang.org/t/linked-list-cursurmut-missing-methods/14921/4) and it was suggested I write a PR. All methods added consist of ```rust Cursor::front(&self) -> Option<&T>; Cursor::back(&self) -> Option<&T>; CursorMut::front(&self) -> Option<&T>; CursorMut::back(&self) -> Option<&T>; CursorMut::front_mut(&mut self) -> Option<&mut T>; CursorMut::back_mut(&mut self) -> Option<&mut T>; CursorMut::push_front(&mut self, elt: T); CursorMut::push_back(&mut self, elt: T); CursorMut::pop_front(&mut self) -> Option<T>; CursorMut::pop_back(&mut self) -> Option<T>; ``` #### Design decisions: I tried to remain as consistent as possible with what was already present for linked lists. The methods `front`, `front_mut`, `back` and `back_mut` are identical to their `LinkedList` equivalents. I tried to make the `pop_front` and `pop_back` methods work the same way (vis a vis the "ghost" node) as `remove_current`. I thought this was the closest analog. `push_front` and `push_back` do not change the "current" node, even if it is the "ghost" node. I thought it was most intuitive to say that if you add to the list, current will never change. Any feedback would be welcome 😄
Document rustfmt on nightly-rustc - Refactor the doc step for Rustdoc into a macro - Call the macro for both rustdoc and rustfmt - Add a `recursion_limit` macro to avoid overflow errors This does not currently pass --document-private-items for rustfmt due to rust-lang/cargo#8422 (comment). r? `@Mark-Simulacrum` cc `@calebcartwright`
…rochenkov Skip layout query when computing integer type size during mangling
…jyn514 Stabilize `Bound::cloned()` This PR stabilizes the function `Bound::cloned()`. Closes rust-lang#61356.
@bors: r+ p=5 rollup=never |
📌 Commit cd3a48f has been approved by |
bors
added
the
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
label
Jul 2, 2021
☀️ Test successful - checks-actions |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
merged-by-bors
This PR was explicitly merged by bors.
rollup
A PR which is a rollup
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
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:
Bound::cloned()
#86797 (StabilizeBound::cloned()
)Failed merges:
r? @ghost
@rustbot modify labels: rollup
Create a similar rollup