-
Notifications
You must be signed in to change notification settings - Fork 13k
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
rustdoc: general cleanup #63453
rustdoc: general cleanup #63453
Conversation
This comment has been minimized.
This comment has been minimized.
902d1b0
to
d58399f
Compare
This comment has been minimized.
This comment has been minimized.
d58399f
to
5972ab6
Compare
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
tcx.crate_name is the appropriate way to retrieve the crate name.
This drops the parking_lot dependency; the ReentrantMutex type appeared to be unused (at least, no compilation failures occurred). This is technically a possible change in behavior of its users, as lock() would wait on other threads releasing their guards, but since we didn't actually remove any threading or such in this code, it appears that we never used that behavior (the behavior change is only noticeable if the type previously was used in two threads, in a single thread ReentrantMutex is useless).
This is already a query so we're just needlessly copying the data around.
These impls prevent ergonomic use of the config (e.g., forcing us to use RefCell) despite all usecases for these structs only using their Display impls once.
7977ada
to
9a0b44e
Compare
Utilize `?` instead of and_then/map operators
9a0b44e
to
3b8a24d
Compare
@@ -27,7 +28,7 @@ impl<'a, 'tcx> BlanketImplFinder<'a, 'tcx> { | |||
|
|||
debug!("get_blanket_impls({:?})", ty); | |||
let mut impls = Vec::new(); | |||
for &trait_def_id in self.cx.all_traits.iter() { | |||
for &trait_def_id in self.cx.tcx.all_traits(LOCAL_CRATE).iter() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if this won't remove some auto impl discovering...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is (AFAICT) equivalent because queries once evaluated are always the same, and in this case we don't touch the all_traits vector except on creation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, if tests pass then I guess nothing changed in the trait discovery so that's all good.
src/librustdoc/html/markdown.rs
Outdated
//! let html = format!("{}", Markdown(s, &[], RefCell::new(&mut id_map), | ||
//! ErrorCodes::Yes, Edition::Edition2015, None)); | ||
//! let md = Markdown(s, &[], RefCell::new(&mut id_map), | ||
//! ErrorCodes::Yes, Edition::Edition2015, None); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The alignment is quite bad in this line...
Thanks a lot, this is awesome! r=me once CI pass. |
@bors r=GuillaumeGomez |
📌 Commit 3b8a24d has been approved by |
…GuillaumeGomez rustdoc: general cleanup Almost all commits stand alone; but all commits can be reviewed individually.
Rollup of 8 pull requests Successful merges: - #61969 (Add #[repr(transparent)] for several types) - #63346 (Lint on some incorrect uses of mem::zeroed / mem::uninitialized) - #63433 (Miri shouldn't look at types) - #63440 (rename RUST_CTFE_BACKTRACE to RUSTC_CTFE_BACKTRACE) - #63441 (Derive Debug for CrateInfo) - #63442 (Add an example to show how to insert item to a sorted vec) - #63453 (rustdoc: general cleanup) - #63464 (Copy ty::Instance instead of passing by reference) Failed merges: r? @ghost
Almost all commits stand alone; but all commits can be reviewed individually.