From a4bff741d0bd128dc92a7e36c96af91461bd3611 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Sun, 21 Nov 2021 19:09:14 -0800 Subject: [PATCH 01/13] Test not never Currently fails to build: error[E0600]: cannot apply unary operator `!` to type `!` --> library/core/tests/ops.rs:239:8 | 239 | if !return () {} | ^^^^^^^^^^ cannot apply unary operator `!` --- library/core/tests/ops.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/library/core/tests/ops.rs b/library/core/tests/ops.rs index aa79dbac8f39d..0c81cba35b3df 100644 --- a/library/core/tests/ops.rs +++ b/library/core/tests/ops.rs @@ -232,3 +232,9 @@ fn deref_on_ref() { let y = deref(&mut x); assert_eq!(y, 4); } + +#[test] +#[allow(unreachable_code)] +fn test_not_never() { + if !return () {} +} From 9e834785787961646fd3951757b48d87f1afe6ef Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Sun, 21 Nov 2021 19:06:35 -0800 Subject: [PATCH 02/13] impl Not for ! --- library/core/src/ops/bit.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/library/core/src/ops/bit.rs b/library/core/src/ops/bit.rs index 255f6cb7933a2..d9ce84541cf9f 100644 --- a/library/core/src/ops/bit.rs +++ b/library/core/src/ops/bit.rs @@ -68,6 +68,17 @@ macro_rules! not_impl { not_impl! { bool usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 } +#[stable(feature = "not_never", since = "1.58.0")] +#[rustc_const_unstable(feature = "const_ops", issue = "90080")] +impl const Not for ! { + type Output = !; + + #[inline] + fn not(self) -> ! { + match self {} + } +} + /// The bitwise AND operator `&`. /// /// Note that `Rhs` is `Self` by default, but this is not mandatory. From 881e093f6d3c68caaad64fa28a5def6d308c52cd Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Sun, 21 Nov 2021 19:30:17 -0800 Subject: [PATCH 03/13] Replace ! with * in ui test of unary expr reachability --- src/test/ui/reachable/expr_unary.rs | 4 ++-- src/test/ui/reachable/expr_unary.stderr | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/test/ui/reachable/expr_unary.rs b/src/test/ui/reachable/expr_unary.rs index e229d22ebc798..190c7447dccbe 100644 --- a/src/test/ui/reachable/expr_unary.rs +++ b/src/test/ui/reachable/expr_unary.rs @@ -5,8 +5,8 @@ #![deny(unreachable_code)] fn foo() { - let x: ! = ! { return; }; //~ ERROR unreachable - //~| ERROR cannot apply unary operator `!` to type `!` + let x: ! = * { return; }; //~ ERROR unreachable + //~| ERROR type `!` cannot be dereferenced } fn main() { } diff --git a/src/test/ui/reachable/expr_unary.stderr b/src/test/ui/reachable/expr_unary.stderr index 063d841c25e39..0a763087c6f13 100644 --- a/src/test/ui/reachable/expr_unary.stderr +++ b/src/test/ui/reachable/expr_unary.stderr @@ -1,13 +1,13 @@ -error[E0600]: cannot apply unary operator `!` to type `!` +error[E0614]: type `!` cannot be dereferenced --> $DIR/expr_unary.rs:8:16 | -LL | let x: ! = ! { return; }; - | ^^^^^^^^^^^^^ cannot apply unary operator `!` +LL | let x: ! = * { return; }; + | ^^^^^^^^^^^^^ error: unreachable expression --> $DIR/expr_unary.rs:8:16 | -LL | let x: ! = ! { return; }; +LL | let x: ! = * { return; }; | ^^^^------^^^ | | | | | any code following this expression is unreachable @@ -21,4 +21,4 @@ LL | #![deny(unreachable_code)] error: aborting due to 2 previous errors -For more information about this error, try `rustc --explain E0600`. +For more information about this error, try `rustc --explain E0614`. From ef472f1dc93ee4c953e296e7316ead7f3de4c09f Mon Sep 17 00:00:00 2001 From: bdbai Date: Mon, 13 Dec 2021 21:41:21 +0800 Subject: [PATCH 04/13] Stabilize arc_new_cyclic --- library/alloc/src/rc.rs | 39 +++++++++++++++++++++++----------- library/alloc/src/sync.rs | 44 +++++++++++++++++++++++++++------------ 2 files changed, 58 insertions(+), 25 deletions(-) diff --git a/library/alloc/src/rc.rs b/library/alloc/src/rc.rs index 33bee4324fd38..b92fbac36d92e 100644 --- a/library/alloc/src/rc.rs +++ b/library/alloc/src/rc.rs @@ -374,32 +374,47 @@ impl Rc { } } - /// Constructs a new `Rc` using a weak reference to itself. Attempting - /// to upgrade the weak reference before this function returns will result - /// in a `None` value. However, the weak reference may be cloned freely and - /// stored for use at a later time. + /// Constructs a new `Rc` using a closure `data_fn` that has access to a + /// weak reference to the constructing `Rc`. + /// + /// Generally, a structure circularly referencing itself, either directly or + /// indirectly, should not hold a strong reference to prevent a memory leak. + /// In `data_fn`, initialization of `T` can make use of the weak reference + /// by cloning and storing it inside `T` for use at a later time. + /// + /// Since the new `Rc` is not fully-constructed until `Rc::new_cyclic` + /// returns, calling [`upgrade`] on the weak reference inside `data_fn` will + /// fail and result in a `None` value. + /// + /// # Panics + /// If `data_fn` panics, the panic is propagated to the caller, and the + /// temporary [`Weak`] is dropped normally. /// /// # Examples /// /// ``` - /// #![feature(arc_new_cyclic)] /// #![allow(dead_code)] /// use std::rc::{Rc, Weak}; /// /// struct Gadget { - /// self_weak: Weak, - /// // ... more fields + /// me: Weak, /// } + /// /// impl Gadget { - /// pub fn new() -> Rc { - /// Rc::new_cyclic(|self_weak| { - /// Gadget { self_weak: self_weak.clone(), /* ... */ } - /// }) + /// /// Construct a reference counted Gadget. + /// fn new() -> Rc { + /// Rc::new_cyclic(|me| Gadget { me: me.clone() }) + /// } + /// + /// /// Return a reference counted pointer to Self. + /// fn me(&self) -> Rc { + /// self.me.upgrade().unwrap() /// } /// } /// ``` + /// [`upgrade`]: Weak::upgrade #[cfg(not(no_global_oom_handling))] - #[unstable(feature = "arc_new_cyclic", issue = "75861")] + #[stable(feature = "arc_new_cyclic", since = "1.59.0")] pub fn new_cyclic(data_fn: impl FnOnce(&Weak) -> T) -> Rc { // Construct the inner in the "uninitialized" state with a single // weak reference. diff --git a/library/alloc/src/sync.rs b/library/alloc/src/sync.rs index 7c065f37d1fa8..4deec0146e472 100644 --- a/library/alloc/src/sync.rs +++ b/library/alloc/src/sync.rs @@ -351,29 +351,47 @@ impl Arc { unsafe { Self::from_inner(Box::leak(x).into()) } } - /// Constructs a new `Arc` using a weak reference to itself. Attempting - /// to upgrade the weak reference before this function returns will result - /// in a `None` value. However, the weak reference may be cloned freely and - /// stored for use at a later time. + /// Constructs a new `Arc` using a closure `data_fn` that has access to + /// a weak reference to the constructing `Arc`. /// - /// # Examples + /// Generally, a structure circularly referencing itself, either directly or + /// indirectly, should not hold a strong reference to prevent a memory leak. + /// In `data_fn`, initialization of `T` can make use of the weak reference + /// by cloning and storing it inside `T` for use at a later time. + /// + /// Since the new `Arc` is not fully-constructed until + /// `Arc::new_cyclic` returns, calling [`upgrade`] on the weak + /// reference inside `data_fn` will fail and result in a `None` value. + /// + /// # Panics + /// If `data_fn` panics, the panic is propagated to the caller, and the + /// temporary [`Weak`] is dropped normally. + /// + /// # Example /// ``` - /// #![feature(arc_new_cyclic)] /// #![allow(dead_code)] - /// /// use std::sync::{Arc, Weak}; /// - /// struct Foo { - /// me: Weak, + /// struct Gadget { + /// me: Weak, /// } /// - /// let foo = Arc::new_cyclic(|me| Foo { - /// me: me.clone(), - /// }); + /// impl Gadget { + /// /// Construct a reference counted Gadget. + /// fn new() -> Arc { + /// Arc::new_cyclic(|me| Gadget { me: me.clone() }) + /// } + /// + /// /// Return a reference counted pointer to Self. + /// fn me(&self) -> Arc { + /// self.me.upgrade().unwrap() + /// } + /// } /// ``` + /// [`upgrade`]: Weak::upgrade #[cfg(not(no_global_oom_handling))] #[inline] - #[unstable(feature = "arc_new_cyclic", issue = "75861")] + #[stable(feature = "arc_new_cyclic", since = "1.59.0")] pub fn new_cyclic(data_fn: impl FnOnce(&Weak) -> T) -> Arc { // Construct the inner in the "uninitialized" state with a single // weak reference. From ce31cbc7a35131d0386f03982d7cac8786f574f4 Mon Sep 17 00:00:00 2001 From: bdbai Date: Thu, 30 Dec 2021 21:55:18 +0800 Subject: [PATCH 05/13] use generic params for arc_new_cyclic --- library/alloc/src/rc.rs | 5 ++++- library/alloc/src/sync.rs | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/library/alloc/src/rc.rs b/library/alloc/src/rc.rs index b92fbac36d92e..e373be5bb6e2d 100644 --- a/library/alloc/src/rc.rs +++ b/library/alloc/src/rc.rs @@ -415,7 +415,10 @@ impl Rc { /// [`upgrade`]: Weak::upgrade #[cfg(not(no_global_oom_handling))] #[stable(feature = "arc_new_cyclic", since = "1.59.0")] - pub fn new_cyclic(data_fn: impl FnOnce(&Weak) -> T) -> Rc { + pub fn new_cyclic(data_fn: F) -> Rc + where + F: FnOnce(&Weak) -> T, + { // Construct the inner in the "uninitialized" state with a single // weak reference. let uninit_ptr: NonNull<_> = Box::leak(box RcBox { diff --git a/library/alloc/src/sync.rs b/library/alloc/src/sync.rs index 4deec0146e472..aba45f36c1532 100644 --- a/library/alloc/src/sync.rs +++ b/library/alloc/src/sync.rs @@ -392,7 +392,10 @@ impl Arc { #[cfg(not(no_global_oom_handling))] #[inline] #[stable(feature = "arc_new_cyclic", since = "1.59.0")] - pub fn new_cyclic(data_fn: impl FnOnce(&Weak) -> T) -> Arc { + pub fn new_cyclic(data_fn: F) -> Arc + where + F: FnOnce(&Weak) -> T, + { // Construct the inner in the "uninitialized" state with a single // weak reference. let uninit_ptr: NonNull<_> = Box::leak(box ArcInner { From 7356e28abbd56ff600dff1d34553b5bebcfc8767 Mon Sep 17 00:00:00 2001 From: Esteban Kuber Date: Thu, 20 Jan 2022 04:09:46 +0000 Subject: [PATCH 06/13] Tweak `expr.await` desugaring `Span` Fix #93074 --- compiler/rustc_ast_lowering/src/expr.rs | 20 +++++++++---------- .../proper-span-for-type-error.fixed | 11 ++++++++++ .../async-await/proper-span-for-type-error.rs | 11 ++++++++++ .../proper-span-for-type-error.stderr | 16 +++++++++++++++ 4 files changed, 48 insertions(+), 10 deletions(-) create mode 100644 src/test/ui/async-await/proper-span-for-type-error.fixed create mode 100644 src/test/ui/async-await/proper-span-for-type-error.rs create mode 100644 src/test/ui/async-await/proper-span-for-type-error.stderr diff --git a/compiler/rustc_ast_lowering/src/expr.rs b/compiler/rustc_ast_lowering/src/expr.rs index 6c172d59f837b..9c3945efe502d 100644 --- a/compiler/rustc_ast_lowering/src/expr.rs +++ b/compiler/rustc_ast_lowering/src/expr.rs @@ -630,18 +630,18 @@ impl<'hir> LoweringContext<'_, 'hir> { /// } /// } /// ``` - fn lower_expr_await(&mut self, await_span: Span, expr: &Expr) -> hir::ExprKind<'hir> { - let dot_await_span = expr.span.shrink_to_hi().to(await_span); + fn lower_expr_await(&mut self, dot_await_span: Span, expr: &Expr) -> hir::ExprKind<'hir> { + let full_span = expr.span.to(dot_await_span); match self.generator_kind { Some(hir::GeneratorKind::Async(_)) => {} Some(hir::GeneratorKind::Gen) | None => { let mut err = struct_span_err!( self.sess, - await_span, + dot_await_span, E0728, "`await` is only allowed inside `async` functions and blocks" ); - err.span_label(await_span, "only allowed inside `async` functions and blocks"); + err.span_label(dot_await_span, "only allowed inside `async` functions and blocks"); if let Some(item_sp) = self.current_item { err.span_label(item_sp, "this is not `async`"); } @@ -651,7 +651,7 @@ impl<'hir> LoweringContext<'_, 'hir> { let span = self.mark_span_with_reason(DesugaringKind::Await, dot_await_span, None); let gen_future_span = self.mark_span_with_reason( DesugaringKind::Await, - await_span, + full_span, self.allow_gen_future.clone(), ); let expr = self.lower_expr_mut(expr); @@ -704,9 +704,9 @@ impl<'hir> LoweringContext<'_, 'hir> { let loop_hir_id = self.lower_node_id(loop_node_id); let ready_arm = { let x_ident = Ident::with_dummy_span(sym::result); - let (x_pat, x_pat_hid) = self.pat_ident(span, x_ident); - let x_expr = self.expr_ident(span, x_ident, x_pat_hid); - let ready_field = self.single_pat_field(span, x_pat); + let (x_pat, x_pat_hid) = self.pat_ident(gen_future_span, x_ident); + let x_expr = self.expr_ident(gen_future_span, x_ident, x_pat_hid); + let ready_field = self.single_pat_field(gen_future_span, x_pat); let ready_pat = self.pat_lang_item_variant( span, hir::LangItem::PollReady, @@ -716,7 +716,7 @@ impl<'hir> LoweringContext<'_, 'hir> { let break_x = self.with_loop_scope(loop_node_id, move |this| { let expr_break = hir::ExprKind::Break(this.lower_loop_destination(None), Some(x_expr)); - this.arena.alloc(this.expr(span, expr_break, ThinVec::new())) + this.arena.alloc(this.expr(gen_future_span, expr_break, ThinVec::new())) }); self.arm(ready_pat, break_x) }; @@ -788,7 +788,7 @@ impl<'hir> LoweringContext<'_, 'hir> { // `match ::std::future::IntoFuture::into_future() { ... }` let into_future_span = self.mark_span_with_reason( DesugaringKind::Await, - await_span, + dot_await_span, self.allow_into_future.clone(), ); let into_future_expr = self.expr_call_lang_item_fn( diff --git a/src/test/ui/async-await/proper-span-for-type-error.fixed b/src/test/ui/async-await/proper-span-for-type-error.fixed new file mode 100644 index 0000000000000..1f1e1184dcc02 --- /dev/null +++ b/src/test/ui/async-await/proper-span-for-type-error.fixed @@ -0,0 +1,11 @@ +// edition:2021 +// run-rustfix +#![allow(dead_code)] + +async fn a() {} + +async fn foo() -> Result<(), i32> { + Ok(a().await) //~ ERROR mismatched types +} + +fn main() {} diff --git a/src/test/ui/async-await/proper-span-for-type-error.rs b/src/test/ui/async-await/proper-span-for-type-error.rs new file mode 100644 index 0000000000000..00ccde1bf9962 --- /dev/null +++ b/src/test/ui/async-await/proper-span-for-type-error.rs @@ -0,0 +1,11 @@ +// edition:2021 +// run-rustfix +#![allow(dead_code)] + +async fn a() {} + +async fn foo() -> Result<(), i32> { + a().await //~ ERROR mismatched types +} + +fn main() {} diff --git a/src/test/ui/async-await/proper-span-for-type-error.stderr b/src/test/ui/async-await/proper-span-for-type-error.stderr new file mode 100644 index 0000000000000..611dc0407bf96 --- /dev/null +++ b/src/test/ui/async-await/proper-span-for-type-error.stderr @@ -0,0 +1,16 @@ +error[E0308]: mismatched types + --> $DIR/proper-span-for-type-error.rs:8:5 + | +LL | a().await + | ^^^^^^^^^ expected enum `Result`, found `()` + | + = note: expected enum `Result<(), i32>` + found unit type `()` +help: try wrapping the expression in `Ok` + | +LL | Ok(a().await) + | +++ + + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. From 3136c5f752837ce48d2e6cf1cc643929d294cfe0 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Wed, 19 Jan 2022 23:30:42 -0800 Subject: [PATCH 07/13] Update stabilization version of impl Not for ! --- library/core/src/ops/bit.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/core/src/ops/bit.rs b/library/core/src/ops/bit.rs index d9ce84541cf9f..7c664226fc256 100644 --- a/library/core/src/ops/bit.rs +++ b/library/core/src/ops/bit.rs @@ -68,7 +68,7 @@ macro_rules! not_impl { not_impl! { bool usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 } -#[stable(feature = "not_never", since = "1.58.0")] +#[stable(feature = "not_never", since = "1.60.0")] #[rustc_const_unstable(feature = "const_ops", issue = "90080")] impl const Not for ! { type Output = !; From f0525da1242cc50297e7fa97f3ba148c2734bea8 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Thu, 20 Jan 2022 14:18:59 +0100 Subject: [PATCH 08/13] Unify search input and buttons size --- src/librustdoc/html/static/css/rustdoc.css | 83 +++++-------------- src/librustdoc/html/static/css/themes/ayu.css | 12 +-- .../html/static/css/themes/dark.css | 11 +-- .../html/static/css/themes/light.css | 13 +-- src/librustdoc/html/templates/page.html | 20 ++--- 5 files changed, 33 insertions(+), 106 deletions(-) diff --git a/src/librustdoc/html/static/css/rustdoc.css b/src/librustdoc/html/static/css/rustdoc.css index bdd8aa430b2d1..d9fa257085633 100644 --- a/src/librustdoc/html/static/css/rustdoc.css +++ b/src/librustdoc/html/static/css/rustdoc.css @@ -873,11 +873,11 @@ h2.small-section-header > .anchor { .search-container { position: relative; - max-width: 960px; + display: flex; + height: 34px; } -.search-container > div { - display: inline-flex; - width: calc(100% - 63px); +.search-container > * { + height: 100%; } .search-results-title { display: inline; @@ -908,10 +908,8 @@ h2.small-section-header > .anchor { background-position: calc(100% - 1px) 56%; background-image: /* AUTOREPLACE: */url("down-arrow.svg"); } -.search-container > .top-button { - position: absolute; - right: 0; - top: 10px; +.search-container { + margin-top: 4px; } .search-input { /* Override Normalize.css: it has a rule that sets @@ -924,23 +922,14 @@ h2.small-section-header > .anchor { -moz-box-sizing: border-box !important; box-sizing: border-box !important; outline: none; - border: none; - border-radius: 1px; - margin-top: 5px; - padding: 10px 16px; + border: 1px solid; + border-radius: 2px; + padding: 5px 8px; font-size: 1.0625rem; transition: border-color 300ms ease; - transition: border-radius 300ms ease-in-out; - transition: box-shadow 300ms ease-in-out; width: 100%; } -.search-input:focus { - border-radius: 2px; - border: 0; - outline: 0; -} - .search-results { display: none; padding-bottom: 2em; @@ -1414,8 +1403,8 @@ pre.rust { .theme-picker { position: absolute; - left: -34px; - top: 9px; + left: -38px; + top: 4px; } .theme-picker button { @@ -1423,34 +1412,27 @@ pre.rust { } #settings-menu, #help-button { - position: absolute; - top: 10px; -} - -#settings-menu { - right: 0; + margin-left: 4px; outline: none; } +#theme-picker, #copy-path { + height: 34px; +} #theme-picker, #settings-menu, #help-button, #copy-path { - padding: 4px; - /* Rare exception to specifying font sizes in rem. Since these are acting - as icons, it's okay to specify their sizes in pixels. */ - font-size: 16px; - width: 27px; - height: 29px; + padding: 5px; + width: 33px; border: 1px solid; - border-radius: 3px; + border-radius: 2px; cursor: pointer; } #help-button { - right: 30px; font-family: "Fira Sans", Arial, sans-serif; text-align: center; /* Rare exception to specifying font sizes in rem. Since this is acting as an icon, it's okay to specify their sizes in pixels. */ - font-size: 16px; + font-size: 20px; padding-top: 2px; } @@ -1887,10 +1869,6 @@ details.rustdoc-toggle[open] > summary.hideme::after { display: none !important; } - .theme-picker { - z-index: 1; - } - .notable-traits { position: absolute; left: -22px; @@ -1977,10 +1955,6 @@ details.rustdoc-toggle[open] > summary.hideme::after { width: 100%; } - .search-container > div { - width: calc(100% - 32px); - } - /* Display an alternating layout on tablets and phones */ .search-results > a { border-bottom: 1px solid #aaa9; @@ -2025,30 +1999,11 @@ details.rustdoc-toggle[open] > summary.hideme::after { width: 50%; } - .search-container > div { - display: block; - width: calc(100% - 37px); - } - #crate-search { border-radius: 4px; border: 0; } - #theme-picker, #settings-menu { - padding: 5px; - width: 31px; - height: 31px; - } - - #theme-picker { - margin-top: -2px; - } - - #settings-menu { - top: 7px; - } - .docblock { margin-left: 12px; } diff --git a/src/librustdoc/html/static/css/themes/ayu.css b/src/librustdoc/html/static/css/themes/ayu.css index 69097b81b9f1c..b217d0e27f3fc 100644 --- a/src/librustdoc/html/static/css/themes/ayu.css +++ b/src/librustdoc/html/static/css/themes/ayu.css @@ -233,22 +233,14 @@ details.undocumented > summary::before { filter: invert(100%); } -#crate-search { - color: #c5c5c5; +#crate-search, .search-input { background-color: #141920; - box-shadow: 0 0 0 1px #424c57,0 0 0 2px transparent; border-color: #424c57; + color: #c5c5c5; } .search-input { color: #ffffff; - background-color: #141920; - box-shadow: 0 0 0 1px #424c57,0 0 0 2px transparent; - transition: box-shadow 150ms ease-in-out; -} - -#crate-search+.search-input:focus { - box-shadow: 0 0 0 1px #148099,0 0 0 2px transparent; } .module-item .stab, diff --git a/src/librustdoc/html/static/css/themes/dark.css b/src/librustdoc/html/static/css/themes/dark.css index 39165b2fc058f..ead1e08386e8f 100644 --- a/src/librustdoc/html/static/css/themes/dark.css +++ b/src/librustdoc/html/static/css/themes/dark.css @@ -194,27 +194,20 @@ details.undocumented > summary::before { filter: invert(100%); } -#crate-search { +#crate-search, .search-input { color: #111; background-color: #f0f0f0; border-color: #000; - box-shadow: 0 0 0 1px #000, 0 0 0 2px transparent; } .search-input { - color: #111; - background-color: #f0f0f0; - box-shadow: 0 0 0 1px #000, 0 0 0 2px transparent; + border-color: #e0e0e0; } .search-input:focus { border-color: #008dfd; } -#crate-search + .search-input:focus { - box-shadow: 0 0 8px 4px #078dd8; -} - .module-item .stab, .import-item .stab { color: #ddd; diff --git a/src/librustdoc/html/static/css/themes/light.css b/src/librustdoc/html/static/css/themes/light.css index 448c9ac603c82..cd77b80cd385f 100644 --- a/src/librustdoc/html/static/css/themes/light.css +++ b/src/librustdoc/html/static/css/themes/light.css @@ -186,27 +186,16 @@ details.undocumented > summary::before { color: #999; } -#crate-search { +#crate-search, .search-input { color: #555; background-color: white; border-color: #e0e0e0; - box-shadow: 0 0 0 1px #e0e0e0, 0 0 0 2px transparent; -} - -.search-input { - color: #555; - background-color: white; - box-shadow: 0 0 0 1px #e0e0e0, 0 0 0 2px transparent; } .search-input:focus { border-color: #66afe9; } -#crate-search + .search-input:focus { - box-shadow: 0 0 8px #078dd8; -} - .module-item .stab, .import-item .stab { color: #000; diff --git a/src/librustdoc/html/templates/page.html b/src/librustdoc/html/templates/page.html index 1322b854b7fc7..3325515bef606 100644 --- a/src/librustdoc/html/templates/page.html +++ b/src/librustdoc/html/templates/page.html @@ -110,25 +110,23 @@