Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 16c1a9d

Browse files
committedJan 23, 2022
Auto merge of rust-lang#93220 - matthiaskrgr:rollup-9bkrlk0, r=matthiaskrgr
Rollup of 8 pull requests Successful merges: - rust-lang#90666 (Stabilize arc_new_cyclic) - rust-lang#91122 (impl Not for !) - rust-lang#93068 (Fix spacing for `·` between stability and source) - rust-lang#93103 (Tweak `expr.await` desugaring `Span`) - rust-lang#93113 (Unify search input and buttons size) - rust-lang#93168 (update uclibc instructions for new toolchain, add link from platforms doc) - rust-lang#93185 (rustdoc: Make some `pub` items crate-private) - rust-lang#93196 (Remove dead code from build_helper) Failed merges: - rust-lang#93188 (rustdoc: fix bump down typing search on Safari) r? `@ghost` `@rustbot` modify labels: rollup
2 parents d13e8dd + 1a935a5 commit 16c1a9d

File tree

25 files changed

+191
-187
lines changed

25 files changed

+191
-187
lines changed
 

‎compiler/rustc_ast_lowering/src/expr.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -625,18 +625,18 @@ impl<'hir> LoweringContext<'_, 'hir> {
625625
/// }
626626
/// }
627627
/// ```
628-
fn lower_expr_await(&mut self, await_span: Span, expr: &Expr) -> hir::ExprKind<'hir> {
629-
let dot_await_span = expr.span.shrink_to_hi().to(await_span);
628+
fn lower_expr_await(&mut self, dot_await_span: Span, expr: &Expr) -> hir::ExprKind<'hir> {
629+
let full_span = expr.span.to(dot_await_span);
630630
match self.generator_kind {
631631
Some(hir::GeneratorKind::Async(_)) => {}
632632
Some(hir::GeneratorKind::Gen) | None => {
633633
let mut err = struct_span_err!(
634634
self.sess,
635-
await_span,
635+
dot_await_span,
636636
E0728,
637637
"`await` is only allowed inside `async` functions and blocks"
638638
);
639-
err.span_label(await_span, "only allowed inside `async` functions and blocks");
639+
err.span_label(dot_await_span, "only allowed inside `async` functions and blocks");
640640
if let Some(item_sp) = self.current_item {
641641
err.span_label(item_sp, "this is not `async`");
642642
}
@@ -646,7 +646,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
646646
let span = self.mark_span_with_reason(DesugaringKind::Await, dot_await_span, None);
647647
let gen_future_span = self.mark_span_with_reason(
648648
DesugaringKind::Await,
649-
await_span,
649+
full_span,
650650
self.allow_gen_future.clone(),
651651
);
652652
let expr = self.lower_expr_mut(expr);
@@ -699,9 +699,9 @@ impl<'hir> LoweringContext<'_, 'hir> {
699699
let loop_hir_id = self.lower_node_id(loop_node_id);
700700
let ready_arm = {
701701
let x_ident = Ident::with_dummy_span(sym::result);
702-
let (x_pat, x_pat_hid) = self.pat_ident(span, x_ident);
703-
let x_expr = self.expr_ident(span, x_ident, x_pat_hid);
704-
let ready_field = self.single_pat_field(span, x_pat);
702+
let (x_pat, x_pat_hid) = self.pat_ident(gen_future_span, x_ident);
703+
let x_expr = self.expr_ident(gen_future_span, x_ident, x_pat_hid);
704+
let ready_field = self.single_pat_field(gen_future_span, x_pat);
705705
let ready_pat = self.pat_lang_item_variant(
706706
span,
707707
hir::LangItem::PollReady,
@@ -711,7 +711,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
711711
let break_x = self.with_loop_scope(loop_node_id, move |this| {
712712
let expr_break =
713713
hir::ExprKind::Break(this.lower_loop_destination(None), Some(x_expr));
714-
this.arena.alloc(this.expr(span, expr_break, ThinVec::new()))
714+
this.arena.alloc(this.expr(gen_future_span, expr_break, ThinVec::new()))
715715
});
716716
self.arm(ready_pat, break_x)
717717
};
@@ -783,7 +783,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
783783
// `match ::std::future::IntoFuture::into_future(<expr>) { ... }`
784784
let into_future_span = self.mark_span_with_reason(
785785
DesugaringKind::Await,
786-
await_span,
786+
dot_await_span,
787787
self.allow_into_future.clone(),
788788
);
789789
let into_future_expr = self.expr_call_lang_item_fn(

‎library/alloc/src/rc.rs

Lines changed: 31 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -374,33 +374,51 @@ impl<T> Rc<T> {
374374
}
375375
}
376376

377-
/// Constructs a new `Rc<T>` using a weak reference to itself. Attempting
378-
/// to upgrade the weak reference before this function returns will result
379-
/// in a `None` value. However, the weak reference may be cloned freely and
380-
/// stored for use at a later time.
377+
/// Constructs a new `Rc<T>` using a closure `data_fn` that has access to a
378+
/// weak reference to the constructing `Rc<T>`.
379+
///
380+
/// Generally, a structure circularly referencing itself, either directly or
381+
/// indirectly, should not hold a strong reference to prevent a memory leak.
382+
/// In `data_fn`, initialization of `T` can make use of the weak reference
383+
/// by cloning and storing it inside `T` for use at a later time.
384+
///
385+
/// Since the new `Rc<T>` is not fully-constructed until `Rc<T>::new_cyclic`
386+
/// returns, calling [`upgrade`] on the weak reference inside `data_fn` will
387+
/// fail and result in a `None` value.
388+
///
389+
/// # Panics
390+
/// If `data_fn` panics, the panic is propagated to the caller, and the
391+
/// temporary [`Weak<T>`] is dropped normally.
381392
///
382393
/// # Examples
383394
///
384395
/// ```
385-
/// #![feature(arc_new_cyclic)]
386396
/// #![allow(dead_code)]
387397
/// use std::rc::{Rc, Weak};
388398
///
389399
/// struct Gadget {
390-
/// self_weak: Weak<Self>,
391-
/// // ... more fields
400+
/// me: Weak<Gadget>,
392401
/// }
402+
///
393403
/// impl Gadget {
394-
/// pub fn new() -> Rc<Self> {
395-
/// Rc::new_cyclic(|self_weak| {
396-
/// Gadget { self_weak: self_weak.clone(), /* ... */ }
397-
/// })
404+
/// /// Construct a reference counted Gadget.
405+
/// fn new() -> Rc<Self> {
406+
/// Rc::new_cyclic(|me| Gadget { me: me.clone() })
407+
/// }
408+
///
409+
/// /// Return a reference counted pointer to Self.
410+
/// fn me(&self) -> Rc<Self> {
411+
/// self.me.upgrade().unwrap()
398412
/// }
399413
/// }
400414
/// ```
415+
/// [`upgrade`]: Weak::upgrade
401416
#[cfg(not(no_global_oom_handling))]
402-
#[unstable(feature = "arc_new_cyclic", issue = "75861")]
403-
pub fn new_cyclic(data_fn: impl FnOnce(&Weak<T>) -> T) -> Rc<T> {
417+
#[stable(feature = "arc_new_cyclic", since = "1.60.0")]
418+
pub fn new_cyclic<F>(data_fn: F) -> Rc<T>
419+
where
420+
F: FnOnce(&Weak<T>) -> T,
421+
{
404422
// Construct the inner in the "uninitialized" state with a single
405423
// weak reference.
406424
let uninit_ptr: NonNull<_> = Box::leak(box RcBox {

‎library/alloc/src/sync.rs

Lines changed: 35 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -351,30 +351,51 @@ impl<T> Arc<T> {
351351
unsafe { Self::from_inner(Box::leak(x).into()) }
352352
}
353353

354-
/// Constructs a new `Arc<T>` using a weak reference to itself. Attempting
355-
/// to upgrade the weak reference before this function returns will result
356-
/// in a `None` value. However, the weak reference may be cloned freely and
357-
/// stored for use at a later time.
354+
/// Constructs a new `Arc<T>` using a closure `data_fn` that has access to
355+
/// a weak reference to the constructing `Arc<T>`.
358356
///
359-
/// # Examples
357+
/// Generally, a structure circularly referencing itself, either directly or
358+
/// indirectly, should not hold a strong reference to prevent a memory leak.
359+
/// In `data_fn`, initialization of `T` can make use of the weak reference
360+
/// by cloning and storing it inside `T` for use at a later time.
361+
///
362+
/// Since the new `Arc<T>` is not fully-constructed until
363+
/// `Arc<T>::new_cyclic` returns, calling [`upgrade`] on the weak
364+
/// reference inside `data_fn` will fail and result in a `None` value.
365+
///
366+
/// # Panics
367+
/// If `data_fn` panics, the panic is propagated to the caller, and the
368+
/// temporary [`Weak<T>`] is dropped normally.
369+
///
370+
/// # Example
360371
/// ```
361-
/// #![feature(arc_new_cyclic)]
362372
/// #![allow(dead_code)]
363-
///
364373
/// use std::sync::{Arc, Weak};
365374
///
366-
/// struct Foo {
367-
/// me: Weak<Foo>,
375+
/// struct Gadget {
376+
/// me: Weak<Gadget>,
368377
/// }
369378
///
370-
/// let foo = Arc::new_cyclic(|me| Foo {
371-
/// me: me.clone(),
372-
/// });
379+
/// impl Gadget {
380+
/// /// Construct a reference counted Gadget.
381+
/// fn new() -> Arc<Self> {
382+
/// Arc::new_cyclic(|me| Gadget { me: me.clone() })
383+
/// }
384+
///
385+
/// /// Return a reference counted pointer to Self.
386+
/// fn me(&self) -> Arc<Self> {
387+
/// self.me.upgrade().unwrap()
388+
/// }
389+
/// }
373390
/// ```
391+
/// [`upgrade`]: Weak::upgrade
374392
#[cfg(not(no_global_oom_handling))]
375393
#[inline]
376-
#[unstable(feature = "arc_new_cyclic", issue = "75861")]
377-
pub fn new_cyclic(data_fn: impl FnOnce(&Weak<T>) -> T) -> Arc<T> {
394+
#[stable(feature = "arc_new_cyclic", since = "1.60.0")]
395+
pub fn new_cyclic<F>(data_fn: F) -> Arc<T>
396+
where
397+
F: FnOnce(&Weak<T>) -> T,
398+
{
378399
// Construct the inner in the "uninitialized" state with a single
379400
// weak reference.
380401
let uninit_ptr: NonNull<_> = Box::leak(box ArcInner {

‎library/core/src/ops/bit.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,17 @@ macro_rules! not_impl {
6868

6969
not_impl! { bool usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 }
7070

71+
#[stable(feature = "not_never", since = "1.60.0")]
72+
#[rustc_const_unstable(feature = "const_ops", issue = "90080")]
73+
impl const Not for ! {
74+
type Output = !;
75+
76+
#[inline]
77+
fn not(self) -> ! {
78+
match self {}
79+
}
80+
}
81+
7182
/// The bitwise AND operator `&`.
7283
///
7384
/// Note that `Rhs` is `Self` by default, but this is not mandatory.

‎library/core/tests/ops.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,3 +232,9 @@ fn deref_on_ref() {
232232
let y = deref(&mut x);
233233
assert_eq!(y, 4);
234234
}
235+
236+
#[test]
237+
#[allow(unreachable_code)]
238+
fn test_not_never() {
239+
if !return () {}
240+
}

‎src/build_helper/lib.rs

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,6 @@ pub fn restore_library_path() {
5555
}
5656
}
5757

58-
/// Run the command, printing what we are running.
59-
pub fn run_verbose(cmd: &mut Command) {
60-
println!("running: {:?}", cmd);
61-
run(cmd);
62-
}
63-
6458
pub fn run(cmd: &mut Command) {
6559
if !try_run(cmd) {
6660
std::process::exit(1);
@@ -108,16 +102,6 @@ pub fn try_run_suppressed(cmd: &mut Command) -> bool {
108102
output.status.success()
109103
}
110104

111-
pub fn gnu_target(target: &str) -> &str {
112-
match target {
113-
"i686-pc-windows-msvc" => "i686-pc-win32",
114-
"x86_64-pc-windows-msvc" => "x86_64-pc-win32",
115-
"i686-pc-windows-gnu" => "i686-w64-mingw32",
116-
"x86_64-pc-windows-gnu" => "x86_64-w64-mingw32",
117-
s => s,
118-
}
119-
}
120-
121105
pub fn make(host: &str) -> PathBuf {
122106
if host.contains("dragonfly")
123107
|| host.contains("freebsd")

‎src/doc/rustc/src/SUMMARY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
- [Platform Support](platform-support.md)
1616
- [Template for target-specific documentation](platform-support/TEMPLATE.md)
1717
- [aarch64-apple-ios-sim](platform-support/aarch64-apple-ios-sim.md)
18+
- [armv7-unknown-linux-uclibceabihf](platform-support/armv7-unknown-linux-uclibceabihf.md)
1819
- [\*-kmc-solid_\*](platform-support/kmc-solid.md)
1920
- [x86_64-unknown-none](platform-support/x86_64-unknown-none.md)
2021
- [wasm64-unknown-unknown](platform-support/wasm64-unknown-unknown.md)

‎src/doc/rustc/src/platform-support.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ target | std | host | notes
220220
`armv6-unknown-netbsd-eabihf` | ? | |
221221
`armv6k-nintendo-3ds` | * | | ARMv6K Nintendo 3DS, Horizon (Requires devkitARM toolchain)
222222
`armv7-apple-ios` | ✓ | | ARMv7 iOS, Cortex-a8
223-
`armv7-unknown-linux-uclibceabihf` | ✓ | ? | ARMv7 Linux uClibc
223+
[`armv7-unknown-linux-uclibceabihf`](platform-support/armv7-unknown-linux-uclibceabihf.md) | ✓ | ? | ARMv7 Linux uClibc
224224
`armv7-unknown-freebsd` | ✓ | ✓ | ARMv7 FreeBSD
225225
`armv7-unknown-netbsd-eabihf` | ✓ | ✓ |
226226
`armv7-wrs-vxworks-eabihf` | ? | |

‎src/doc/rustc/src/platform-support/armv7-unknown-linux-uclibceabihf.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ This target is cross compiled, and requires a cross toolchain. You can find sui
1818

1919
Compiling rust for this target has been tested on `x86_64` linux hosts. Other host types have not been tested, but may work, if you can find a suitable cross compilation toolchain for them.
2020

21-
If you don't already have a suitable toolchain, download one [here](https://toolchains.bootlin.com/downloads/releases/toolchains/armv7-eabihf/tarballs/armv7-eabihf--uclibc--bleeding-edge-2020.08-1.tar.bz2), and unpack it into a directory.
21+
If you don't already have a suitable toolchain, download one [here](https://toolchains.bootlin.com/downloads/releases/toolchains/armv7-eabihf/tarballs/armv7-eabihf--uclibc--bleeding-edge-2021.11-1.tar.bz2), and unpack it into a directory.
2222

2323
### Configure rust
2424

‎src/librustdoc/clean/types.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ impl Item {
429429

430430
/// Convenience wrapper around [`Self::from_def_id_and_parts`] which converts
431431
/// `hir_id` to a [`DefId`]
432-
pub fn from_hir_id_and_parts(
432+
crate fn from_hir_id_and_parts(
433433
hir_id: hir::HirId,
434434
name: Option<Symbol>,
435435
kind: ItemKind,
@@ -438,7 +438,7 @@ impl Item {
438438
Item::from_def_id_and_parts(cx.tcx.hir().local_def_id(hir_id).to_def_id(), name, kind, cx)
439439
}
440440

441-
pub fn from_def_id_and_parts(
441+
crate fn from_def_id_and_parts(
442442
def_id: DefId,
443443
name: Option<Symbol>,
444444
kind: ItemKind,
@@ -456,7 +456,7 @@ impl Item {
456456
)
457457
}
458458

459-
pub fn from_def_id_and_attrs_and_parts(
459+
crate fn from_def_id_and_attrs_and_parts(
460460
def_id: DefId,
461461
name: Option<Symbol>,
462462
kind: ItemKind,
@@ -984,26 +984,26 @@ crate fn collapse_doc_fragments(doc_strings: &[DocFragment]) -> String {
984984
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
985985
crate struct ItemLink {
986986
/// The original link written in the markdown
987-
pub(crate) link: String,
987+
crate link: String,
988988
/// The link text displayed in the HTML.
989989
///
990990
/// This may not be the same as `link` if there was a disambiguator
991991
/// in an intra-doc link (e.g. \[`fn@f`\])
992-
pub(crate) link_text: String,
993-
pub(crate) did: DefId,
992+
crate link_text: String,
993+
crate did: DefId,
994994
/// The url fragment to append to the link
995-
pub(crate) fragment: Option<UrlFragment>,
995+
crate fragment: Option<UrlFragment>,
996996
}
997997

998998
pub struct RenderedLink {
999999
/// The text the link was original written as.
10001000
///
10011001
/// This could potentially include disambiguators and backticks.
1002-
pub(crate) original_text: String,
1002+
crate original_text: String,
10031003
/// The text to display in the HTML
1004-
pub(crate) new_text: String,
1004+
crate new_text: String,
10051005
/// The URL to put in the `href`
1006-
pub(crate) href: String,
1006+
crate href: String,
10071007
}
10081008

10091009
/// The attributes on an [`Item`], including attributes like `#[derive(...)]` and `#[inline]`,

‎src/librustdoc/core.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ use crate::passes::{self, Condition::*};
3333
crate use rustc_session::config::{DebuggingOptions, Input, Options};
3434

3535
crate struct ResolverCaches {
36-
pub all_traits: Option<Vec<DefId>>,
37-
pub all_trait_impls: Option<Vec<DefId>>,
36+
crate all_traits: Option<Vec<DefId>>,
37+
crate all_trait_impls: Option<Vec<DefId>>,
3838
}
3939

4040
crate struct DocContext<'tcx> {

‎src/librustdoc/html/render/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ crate struct StylePath {
175175
}
176176

177177
impl StylePath {
178-
pub fn basename(&self) -> Result<String, Error> {
178+
crate fn basename(&self) -> Result<String, Error> {
179179
Ok(try_none!(try_none!(self.path.file_stem(), &self.path).to_str(), &self.path).to_string())
180180
}
181181
}

‎src/librustdoc/html/static/css/rustdoc.css

Lines changed: 19 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -896,11 +896,11 @@ table,
896896

897897
.search-container {
898898
position: relative;
899-
max-width: 960px;
899+
display: flex;
900+
height: 34px;
900901
}
901-
.search-container > div {
902-
display: inline-flex;
903-
width: calc(100% - 63px);
902+
.search-container > * {
903+
height: 100%;
904904
}
905905
.search-results-title {
906906
display: inline;
@@ -931,10 +931,8 @@ table,
931931
background-position: calc(100% - 1px) 56%;
932932
background-image: /* AUTOREPLACE: */url("down-arrow.svg");
933933
}
934-
.search-container > .top-button {
935-
position: absolute;
936-
right: 0;
937-
top: 10px;
934+
.search-container {
935+
margin-top: 4px;
938936
}
939937
.search-input {
940938
/* Override Normalize.css: it has a rule that sets
@@ -947,23 +945,14 @@ table,
947945
-moz-box-sizing: border-box !important;
948946
box-sizing: border-box !important;
949947
outline: none;
950-
border: none;
951-
border-radius: 1px;
952-
margin-top: 5px;
953-
padding: 10px 16px;
948+
border: 1px solid;
949+
border-radius: 2px;
950+
padding: 5px 8px;
954951
font-size: 1.0625rem;
955952
transition: border-color 300ms ease;
956-
transition: border-radius 300ms ease-in-out;
957-
transition: box-shadow 300ms ease-in-out;
958953
width: 100%;
959954
}
960955

961-
.search-input:focus {
962-
border-radius: 2px;
963-
border: 0;
964-
outline: 0;
965-
}
966-
967956
.search-results {
968957
display: none;
969958
padding-bottom: 2em;
@@ -1199,7 +1188,6 @@ a.test-arrow:hover{
11991188
.out-of-band > span.since {
12001189
position: initial;
12011190
font-size: 1.25rem;
1202-
margin-right: 5px;
12031191
}
12041192

12051193
h3.variant {
@@ -1437,43 +1425,36 @@ pre.rust {
14371425

14381426
.theme-picker {
14391427
position: absolute;
1440-
left: -34px;
1441-
top: 9px;
1428+
left: -38px;
1429+
top: 4px;
14421430
}
14431431

14441432
.theme-picker button {
14451433
outline: none;
14461434
}
14471435

14481436
#settings-menu, #help-button {
1449-
position: absolute;
1450-
top: 10px;
1451-
}
1452-
1453-
#settings-menu {
1454-
right: 0;
1437+
margin-left: 4px;
14551438
outline: none;
14561439
}
14571440

1441+
#theme-picker, #copy-path {
1442+
height: 34px;
1443+
}
14581444
#theme-picker, #settings-menu, #help-button, #copy-path {
1459-
padding: 4px;
1460-
/* Rare exception to specifying font sizes in rem. Since these are acting
1461-
as icons, it's okay to specify their sizes in pixels. */
1462-
font-size: 16px;
1463-
width: 27px;
1464-
height: 29px;
1445+
padding: 5px;
1446+
width: 33px;
14651447
border: 1px solid;
1466-
border-radius: 3px;
1448+
border-radius: 2px;
14671449
cursor: pointer;
14681450
}
14691451

14701452
#help-button {
1471-
right: 30px;
14721453
font-family: "Fira Sans", Arial, sans-serif;
14731454
text-align: center;
14741455
/* Rare exception to specifying font sizes in rem. Since this is acting
14751456
as an icon, it's okay to specify their sizes in pixels. */
1476-
font-size: 16px;
1457+
font-size: 20px;
14771458
padding-top: 2px;
14781459
}
14791460

@@ -1910,10 +1891,6 @@ details.rustdoc-toggle[open] > summary.hideme::after {
19101891
display: none !important;
19111892
}
19121893

1913-
.theme-picker {
1914-
z-index: 1;
1915-
}
1916-
19171894
.notable-traits {
19181895
position: absolute;
19191896
left: -22px;
@@ -2000,10 +1977,6 @@ details.rustdoc-toggle[open] > summary.hideme::after {
20001977
width: 100%;
20011978
}
20021979

2003-
.search-container > div {
2004-
width: calc(100% - 32px);
2005-
}
2006-
20071980
/* Display an alternating layout on tablets and phones */
20081981
.search-results > a {
20091982
border-bottom: 1px solid #aaa9;
@@ -2048,30 +2021,11 @@ details.rustdoc-toggle[open] > summary.hideme::after {
20482021
width: 50%;
20492022
}
20502023

2051-
.search-container > div {
2052-
display: block;
2053-
width: calc(100% - 37px);
2054-
}
2055-
20562024
#crate-search {
20572025
border-radius: 4px;
20582026
border: 0;
20592027
}
20602028

2061-
#theme-picker, #settings-menu {
2062-
padding: 5px;
2063-
width: 31px;
2064-
height: 31px;
2065-
}
2066-
2067-
#theme-picker {
2068-
margin-top: -2px;
2069-
}
2070-
2071-
#settings-menu {
2072-
top: 7px;
2073-
}
2074-
20752029
.docblock {
20762030
margin-left: 12px;
20772031
}

‎src/librustdoc/html/static/css/themes/ayu.css

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -233,22 +233,14 @@ details.undocumented > summary::before {
233233
filter: invert(100%);
234234
}
235235

236-
#crate-search {
237-
color: #c5c5c5;
236+
#crate-search, .search-input {
238237
background-color: #141920;
239-
box-shadow: 0 0 0 1px #424c57,0 0 0 2px transparent;
240238
border-color: #424c57;
239+
color: #c5c5c5;
241240
}
242241

243242
.search-input {
244243
color: #ffffff;
245-
background-color: #141920;
246-
box-shadow: 0 0 0 1px #424c57,0 0 0 2px transparent;
247-
transition: box-shadow 150ms ease-in-out;
248-
}
249-
250-
#crate-search+.search-input:focus {
251-
box-shadow: 0 0 0 1px #148099,0 0 0 2px transparent;
252244
}
253245

254246
.module-item .stab,

‎src/librustdoc/html/static/css/themes/dark.css

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -194,27 +194,20 @@ details.undocumented > summary::before {
194194
filter: invert(100%);
195195
}
196196

197-
#crate-search {
197+
#crate-search, .search-input {
198198
color: #111;
199199
background-color: #f0f0f0;
200200
border-color: #000;
201-
box-shadow: 0 0 0 1px #000, 0 0 0 2px transparent;
202201
}
203202

204203
.search-input {
205-
color: #111;
206-
background-color: #f0f0f0;
207-
box-shadow: 0 0 0 1px #000, 0 0 0 2px transparent;
204+
border-color: #e0e0e0;
208205
}
209206

210207
.search-input:focus {
211208
border-color: #008dfd;
212209
}
213210

214-
#crate-search + .search-input:focus {
215-
box-shadow: 0 0 8px 4px #078dd8;
216-
}
217-
218211
.module-item .stab,
219212
.import-item .stab {
220213
color: #ddd;

‎src/librustdoc/html/static/css/themes/light.css

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -186,27 +186,16 @@ details.undocumented > summary::before {
186186
color: #999;
187187
}
188188

189-
#crate-search {
189+
#crate-search, .search-input {
190190
color: #555;
191191
background-color: white;
192192
border-color: #e0e0e0;
193-
box-shadow: 0 0 0 1px #e0e0e0, 0 0 0 2px transparent;
194-
}
195-
196-
.search-input {
197-
color: #555;
198-
background-color: white;
199-
box-shadow: 0 0 0 1px #e0e0e0, 0 0 0 2px transparent;
200193
}
201194

202195
.search-input:focus {
203196
border-color: #66afe9;
204197
}
205198

206-
#crate-search + .search-input:focus {
207-
box-shadow: 0 0 8px #078dd8;
208-
}
209-
210199
.module-item .stab,
211200
.import-item .stab {
212201
color: #000;

‎src/librustdoc/html/templates/page.html

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -110,25 +110,23 @@ <h2 class="location"></h2>
110110
<nav class="sub"> {#- -#}
111111
<div class="theme-picker hidden"> {#- -#}
112112
<button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"> {#- -#}
113-
<img width="18" height="18" alt="Pick another theme!" {# -#}
113+
<img width="22" height="22" alt="Pick another theme!" {# -#}
114114
src="{{static_root_path|safe}}brush{{page.resource_suffix}}.svg"> {#- -#}
115115
</button> {#- -#}
116116
<div id="theme-choices" role="menu"></div> {#- -#}
117117
</div> {#- -#}
118118
<form class="search-form"> {#- -#}
119119
<div class="search-container"> {#- -#}
120-
<div>
121-
<input {# -#}
122-
class="search-input" {# -#}
123-
name="search" {# -#}
124-
autocomplete="off" {# -#}
125-
spellcheck="false" {# -#}
126-
placeholder="Click or press ‘S’ to search, ‘?’ for more options…" {# -#}
127-
type="search"> {#- -#}
128-
</div> {#- -#}
120+
<input {# -#}
121+
class="search-input" {# -#}
122+
name="search" {# -#}
123+
autocomplete="off" {# -#}
124+
spellcheck="false" {# -#}
125+
placeholder="Click or press ‘S’ to search, ‘?’ for more options…" {# -#}
126+
type="search"> {#- -#}
129127
<button type="button" id="help-button" title="help">?</button> {#- -#}
130128
<a id="settings-menu" href="{{page.root_path|safe}}settings.html" title="settings"> {#- -#}
131-
<img width="18" height="18" alt="Change settings" {# -#}
129+
<img width="22" height="22" alt="Change settings" {# -#}
132130
src="{{static_root_path|safe}}wheel{{page.resource_suffix}}.svg"> {#- -#}
133131
</a> {#- -#}
134132
</div> {#- -#}

‎src/librustdoc/html/templates/print_item.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ <h1 class="fqn"> {#- -#}
1616
</h1> {#- -#}
1717
<span class="out-of-band"> {#- -#}
1818
{% if !stability_since_raw.is_empty() %}
19-
{{- stability_since_raw|safe -}} · {# -#}
19+
{{- stability_since_raw|safe }} · {# -#}
2020
{% endif %}
2121
{%- match src_href -%}
2222
{%- when Some with (href) -%}

‎src/librustdoc/passes/collect_intra_doc_links.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ struct DiagnosticInfo<'a> {
362362

363363
#[derive(Clone, Debug, Hash)]
364364
struct CachedLink {
365-
pub res: (Res, Option<UrlFragment>),
365+
res: (Res, Option<UrlFragment>),
366366
}
367367

368368
struct LinkCollector<'a, 'tcx> {

‎src/test/rustdoc/source-version-separator.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
#![stable(feature = "bar", since = "1.0")]
22
#![crate_name = "foo"]
3-
43
#![feature(staged_api)]
54

65
// @has foo/trait.Bar.html
7-
// @has - '//div[@class="main-heading"]/*[@class="out-of-band"]' '1.0· source · '
6+
// @has - '//div[@class="main-heading"]/*[@class="out-of-band"]' '1.0 · source · '
87
#[stable(feature = "bar", since = "1.0")]
98
pub trait Bar {
109
// @has - '//div[@id="tymethod.foo"]/*[@class="rightside"]' '3.0 · source'
@@ -15,7 +14,7 @@ pub trait Bar {
1514
// @has - '//div[@id="implementors-list"]//*[@class="rightside"]' '4.0 · source'
1615

1716
// @has foo/struct.Foo.html
18-
// @has - '//div[@class="main-heading"]/*[@class="out-of-band"]' '1.0· source · '
17+
// @has - '//div[@class="main-heading"]/*[@class="out-of-band"]' '1.0 · source · '
1918
#[stable(feature = "baz", since = "1.0")]
2019
pub struct Foo;
2120

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// edition:2021
2+
// run-rustfix
3+
#![allow(dead_code)]
4+
5+
async fn a() {}
6+
7+
async fn foo() -> Result<(), i32> {
8+
Ok(a().await) //~ ERROR mismatched types
9+
}
10+
11+
fn main() {}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// edition:2021
2+
// run-rustfix
3+
#![allow(dead_code)]
4+
5+
async fn a() {}
6+
7+
async fn foo() -> Result<(), i32> {
8+
a().await //~ ERROR mismatched types
9+
}
10+
11+
fn main() {}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
error[E0308]: mismatched types
2+
--> $DIR/proper-span-for-type-error.rs:8:5
3+
|
4+
LL | a().await
5+
| ^^^^^^^^^ expected enum `Result`, found `()`
6+
|
7+
= note: expected enum `Result<(), i32>`
8+
found unit type `()`
9+
help: try wrapping the expression in `Ok`
10+
|
11+
LL | Ok(a().await)
12+
| +++ +
13+
14+
error: aborting due to previous error
15+
16+
For more information about this error, try `rustc --explain E0308`.

‎src/test/ui/reachable/expr_unary.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
#![deny(unreachable_code)]
66

77
fn foo() {
8-
let x: ! = ! { return; }; //~ ERROR unreachable
9-
//~| ERROR cannot apply unary operator `!` to type `!`
8+
let x: ! = * { return; }; //~ ERROR unreachable
9+
//~| ERROR type `!` cannot be dereferenced
1010
}
1111

1212
fn main() { }

‎src/test/ui/reachable/expr_unary.stderr

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
error[E0600]: cannot apply unary operator `!` to type `!`
1+
error[E0614]: type `!` cannot be dereferenced
22
--> $DIR/expr_unary.rs:8:16
33
|
4-
LL | let x: ! = ! { return; };
5-
| ^^^^^^^^^^^^^ cannot apply unary operator `!`
4+
LL | let x: ! = * { return; };
5+
| ^^^^^^^^^^^^^
66

77
error: unreachable expression
88
--> $DIR/expr_unary.rs:8:16
99
|
10-
LL | let x: ! = ! { return; };
10+
LL | let x: ! = * { return; };
1111
| ^^^^------^^^
1212
| | |
1313
| | any code following this expression is unreachable
@@ -21,4 +21,4 @@ LL | #![deny(unreachable_code)]
2121

2222
error: aborting due to 2 previous errors
2323

24-
For more information about this error, try `rustc --explain E0600`.
24+
For more information about this error, try `rustc --explain E0614`.

0 commit comments

Comments
 (0)
This repository has been archived.