Auto merge of #93220 - matthiaskrgr:rollup-9bkrlk0, r=matthiaskrgr
Rollup of 8 pull requests Successful merges: - #90666 (Stabilize arc_new_cyclic) - #91122 (impl Not for !) - #93068 (Fix spacing for `·` between stability and source) - #93103 (Tweak `expr.await` desugaring `Span`) - #93113 (Unify search input and buttons size) - #93168 (update uclibc instructions for new toolchain, add link from platforms doc) - #93185 (rustdoc: Make some `pub` items crate-private) - #93196 (Remove dead code from build_helper) Failed merges: - #93188 (rustdoc: fix bump down typing search on Safari) r? `@ghost` `@rustbot` modify labels: rollup
This commit is contained in:
commit
16c1a9dd7c
25 changed files with 191 additions and 187 deletions
|
@ -625,18 +625,18 @@ impl<'hir> LoweringContext<'_, 'hir> {
|
||||||
/// }
|
/// }
|
||||||
/// }
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
fn lower_expr_await(&mut self, await_span: Span, expr: &Expr) -> hir::ExprKind<'hir> {
|
fn lower_expr_await(&mut self, dot_await_span: Span, expr: &Expr) -> hir::ExprKind<'hir> {
|
||||||
let dot_await_span = expr.span.shrink_to_hi().to(await_span);
|
let full_span = expr.span.to(dot_await_span);
|
||||||
match self.generator_kind {
|
match self.generator_kind {
|
||||||
Some(hir::GeneratorKind::Async(_)) => {}
|
Some(hir::GeneratorKind::Async(_)) => {}
|
||||||
Some(hir::GeneratorKind::Gen) | None => {
|
Some(hir::GeneratorKind::Gen) | None => {
|
||||||
let mut err = struct_span_err!(
|
let mut err = struct_span_err!(
|
||||||
self.sess,
|
self.sess,
|
||||||
await_span,
|
dot_await_span,
|
||||||
E0728,
|
E0728,
|
||||||
"`await` is only allowed inside `async` functions and blocks"
|
"`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 {
|
if let Some(item_sp) = self.current_item {
|
||||||
err.span_label(item_sp, "this is not `async`");
|
err.span_label(item_sp, "this is not `async`");
|
||||||
}
|
}
|
||||||
|
@ -646,7 +646,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
|
||||||
let span = self.mark_span_with_reason(DesugaringKind::Await, dot_await_span, None);
|
let span = self.mark_span_with_reason(DesugaringKind::Await, dot_await_span, None);
|
||||||
let gen_future_span = self.mark_span_with_reason(
|
let gen_future_span = self.mark_span_with_reason(
|
||||||
DesugaringKind::Await,
|
DesugaringKind::Await,
|
||||||
await_span,
|
full_span,
|
||||||
self.allow_gen_future.clone(),
|
self.allow_gen_future.clone(),
|
||||||
);
|
);
|
||||||
let expr = self.lower_expr_mut(expr);
|
let expr = self.lower_expr_mut(expr);
|
||||||
|
@ -699,9 +699,9 @@ impl<'hir> LoweringContext<'_, 'hir> {
|
||||||
let loop_hir_id = self.lower_node_id(loop_node_id);
|
let loop_hir_id = self.lower_node_id(loop_node_id);
|
||||||
let ready_arm = {
|
let ready_arm = {
|
||||||
let x_ident = Ident::with_dummy_span(sym::result);
|
let x_ident = Ident::with_dummy_span(sym::result);
|
||||||
let (x_pat, x_pat_hid) = self.pat_ident(span, x_ident);
|
let (x_pat, x_pat_hid) = self.pat_ident(gen_future_span, x_ident);
|
||||||
let x_expr = self.expr_ident(span, x_ident, x_pat_hid);
|
let x_expr = self.expr_ident(gen_future_span, x_ident, x_pat_hid);
|
||||||
let ready_field = self.single_pat_field(span, x_pat);
|
let ready_field = self.single_pat_field(gen_future_span, x_pat);
|
||||||
let ready_pat = self.pat_lang_item_variant(
|
let ready_pat = self.pat_lang_item_variant(
|
||||||
span,
|
span,
|
||||||
hir::LangItem::PollReady,
|
hir::LangItem::PollReady,
|
||||||
|
@ -711,7 +711,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
|
||||||
let break_x = self.with_loop_scope(loop_node_id, move |this| {
|
let break_x = self.with_loop_scope(loop_node_id, move |this| {
|
||||||
let expr_break =
|
let expr_break =
|
||||||
hir::ExprKind::Break(this.lower_loop_destination(None), Some(x_expr));
|
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)
|
self.arm(ready_pat, break_x)
|
||||||
};
|
};
|
||||||
|
@ -783,7 +783,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
|
||||||
// `match ::std::future::IntoFuture::into_future(<expr>) { ... }`
|
// `match ::std::future::IntoFuture::into_future(<expr>) { ... }`
|
||||||
let into_future_span = self.mark_span_with_reason(
|
let into_future_span = self.mark_span_with_reason(
|
||||||
DesugaringKind::Await,
|
DesugaringKind::Await,
|
||||||
await_span,
|
dot_await_span,
|
||||||
self.allow_into_future.clone(),
|
self.allow_into_future.clone(),
|
||||||
);
|
);
|
||||||
let into_future_expr = self.expr_call_lang_item_fn(
|
let into_future_expr = self.expr_call_lang_item_fn(
|
||||||
|
|
|
@ -374,33 +374,51 @@ impl<T> Rc<T> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Constructs a new `Rc<T>` using a weak reference to itself. Attempting
|
/// Constructs a new `Rc<T>` using a closure `data_fn` that has access to a
|
||||||
/// to upgrade the weak reference before this function returns will result
|
/// weak reference to the constructing `Rc<T>`.
|
||||||
/// in a `None` value. However, the weak reference may be cloned freely and
|
///
|
||||||
/// stored for use at a later time.
|
/// 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<T>` is not fully-constructed until `Rc<T>::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<T>`] is dropped normally.
|
||||||
///
|
///
|
||||||
/// # Examples
|
/// # Examples
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
/// #![feature(arc_new_cyclic)]
|
|
||||||
/// #![allow(dead_code)]
|
/// #![allow(dead_code)]
|
||||||
/// use std::rc::{Rc, Weak};
|
/// use std::rc::{Rc, Weak};
|
||||||
///
|
///
|
||||||
/// struct Gadget {
|
/// struct Gadget {
|
||||||
/// self_weak: Weak<Self>,
|
/// me: Weak<Gadget>,
|
||||||
/// // ... more fields
|
|
||||||
/// }
|
/// }
|
||||||
|
///
|
||||||
/// impl Gadget {
|
/// impl Gadget {
|
||||||
/// pub fn new() -> Rc<Self> {
|
/// /// Construct a reference counted Gadget.
|
||||||
/// Rc::new_cyclic(|self_weak| {
|
/// fn new() -> Rc<Self> {
|
||||||
/// Gadget { self_weak: self_weak.clone(), /* ... */ }
|
/// Rc::new_cyclic(|me| Gadget { me: me.clone() })
|
||||||
/// })
|
/// }
|
||||||
|
///
|
||||||
|
/// /// Return a reference counted pointer to Self.
|
||||||
|
/// fn me(&self) -> Rc<Self> {
|
||||||
|
/// self.me.upgrade().unwrap()
|
||||||
/// }
|
/// }
|
||||||
/// }
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
|
/// [`upgrade`]: Weak::upgrade
|
||||||
#[cfg(not(no_global_oom_handling))]
|
#[cfg(not(no_global_oom_handling))]
|
||||||
#[unstable(feature = "arc_new_cyclic", issue = "75861")]
|
#[stable(feature = "arc_new_cyclic", since = "1.60.0")]
|
||||||
pub fn new_cyclic(data_fn: impl FnOnce(&Weak<T>) -> T) -> Rc<T> {
|
pub fn new_cyclic<F>(data_fn: F) -> Rc<T>
|
||||||
|
where
|
||||||
|
F: FnOnce(&Weak<T>) -> T,
|
||||||
|
{
|
||||||
// Construct the inner in the "uninitialized" state with a single
|
// Construct the inner in the "uninitialized" state with a single
|
||||||
// weak reference.
|
// weak reference.
|
||||||
let uninit_ptr: NonNull<_> = Box::leak(box RcBox {
|
let uninit_ptr: NonNull<_> = Box::leak(box RcBox {
|
||||||
|
|
|
@ -351,30 +351,51 @@ impl<T> Arc<T> {
|
||||||
unsafe { Self::from_inner(Box::leak(x).into()) }
|
unsafe { Self::from_inner(Box::leak(x).into()) }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Constructs a new `Arc<T>` using a weak reference to itself. Attempting
|
/// Constructs a new `Arc<T>` using a closure `data_fn` that has access to
|
||||||
/// to upgrade the weak reference before this function returns will result
|
/// a weak reference to the constructing `Arc<T>`.
|
||||||
/// in a `None` value. However, the weak reference may be cloned freely and
|
|
||||||
/// stored for use at a later time.
|
|
||||||
///
|
///
|
||||||
/// # 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<T>` is not fully-constructed until
|
||||||
|
/// `Arc<T>::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<T>`] is dropped normally.
|
||||||
|
///
|
||||||
|
/// # Example
|
||||||
/// ```
|
/// ```
|
||||||
/// #![feature(arc_new_cyclic)]
|
|
||||||
/// #![allow(dead_code)]
|
/// #![allow(dead_code)]
|
||||||
///
|
|
||||||
/// use std::sync::{Arc, Weak};
|
/// use std::sync::{Arc, Weak};
|
||||||
///
|
///
|
||||||
/// struct Foo {
|
/// struct Gadget {
|
||||||
/// me: Weak<Foo>,
|
/// me: Weak<Gadget>,
|
||||||
/// }
|
/// }
|
||||||
///
|
///
|
||||||
/// let foo = Arc::new_cyclic(|me| Foo {
|
/// impl Gadget {
|
||||||
/// me: me.clone(),
|
/// /// Construct a reference counted Gadget.
|
||||||
/// });
|
/// fn new() -> Arc<Self> {
|
||||||
|
/// Arc::new_cyclic(|me| Gadget { me: me.clone() })
|
||||||
|
/// }
|
||||||
|
///
|
||||||
|
/// /// Return a reference counted pointer to Self.
|
||||||
|
/// fn me(&self) -> Arc<Self> {
|
||||||
|
/// self.me.upgrade().unwrap()
|
||||||
|
/// }
|
||||||
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
|
/// [`upgrade`]: Weak::upgrade
|
||||||
#[cfg(not(no_global_oom_handling))]
|
#[cfg(not(no_global_oom_handling))]
|
||||||
#[inline]
|
#[inline]
|
||||||
#[unstable(feature = "arc_new_cyclic", issue = "75861")]
|
#[stable(feature = "arc_new_cyclic", since = "1.60.0")]
|
||||||
pub fn new_cyclic(data_fn: impl FnOnce(&Weak<T>) -> T) -> Arc<T> {
|
pub fn new_cyclic<F>(data_fn: F) -> Arc<T>
|
||||||
|
where
|
||||||
|
F: FnOnce(&Weak<T>) -> T,
|
||||||
|
{
|
||||||
// Construct the inner in the "uninitialized" state with a single
|
// Construct the inner in the "uninitialized" state with a single
|
||||||
// weak reference.
|
// weak reference.
|
||||||
let uninit_ptr: NonNull<_> = Box::leak(box ArcInner {
|
let uninit_ptr: NonNull<_> = Box::leak(box ArcInner {
|
||||||
|
|
|
@ -68,6 +68,17 @@ macro_rules! not_impl {
|
||||||
|
|
||||||
not_impl! { bool usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 }
|
not_impl! { bool usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 }
|
||||||
|
|
||||||
|
#[stable(feature = "not_never", since = "1.60.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 `&`.
|
/// The bitwise AND operator `&`.
|
||||||
///
|
///
|
||||||
/// Note that `Rhs` is `Self` by default, but this is not mandatory.
|
/// Note that `Rhs` is `Self` by default, but this is not mandatory.
|
||||||
|
|
|
@ -232,3 +232,9 @@ fn deref_on_ref() {
|
||||||
let y = deref(&mut x);
|
let y = deref(&mut x);
|
||||||
assert_eq!(y, 4);
|
assert_eq!(y, 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
#[allow(unreachable_code)]
|
||||||
|
fn test_not_never() {
|
||||||
|
if !return () {}
|
||||||
|
}
|
||||||
|
|
|
@ -55,12 +55,6 @@ pub fn restore_library_path() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Run the command, printing what we are running.
|
|
||||||
pub fn run_verbose(cmd: &mut Command) {
|
|
||||||
println!("running: {:?}", cmd);
|
|
||||||
run(cmd);
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn run(cmd: &mut Command) {
|
pub fn run(cmd: &mut Command) {
|
||||||
if !try_run(cmd) {
|
if !try_run(cmd) {
|
||||||
std::process::exit(1);
|
std::process::exit(1);
|
||||||
|
@ -108,16 +102,6 @@ pub fn try_run_suppressed(cmd: &mut Command) -> bool {
|
||||||
output.status.success()
|
output.status.success()
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn gnu_target(target: &str) -> &str {
|
|
||||||
match target {
|
|
||||||
"i686-pc-windows-msvc" => "i686-pc-win32",
|
|
||||||
"x86_64-pc-windows-msvc" => "x86_64-pc-win32",
|
|
||||||
"i686-pc-windows-gnu" => "i686-w64-mingw32",
|
|
||||||
"x86_64-pc-windows-gnu" => "x86_64-w64-mingw32",
|
|
||||||
s => s,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn make(host: &str) -> PathBuf {
|
pub fn make(host: &str) -> PathBuf {
|
||||||
if host.contains("dragonfly")
|
if host.contains("dragonfly")
|
||||||
|| host.contains("freebsd")
|
|| host.contains("freebsd")
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
- [Platform Support](platform-support.md)
|
- [Platform Support](platform-support.md)
|
||||||
- [Template for target-specific documentation](platform-support/TEMPLATE.md)
|
- [Template for target-specific documentation](platform-support/TEMPLATE.md)
|
||||||
- [aarch64-apple-ios-sim](platform-support/aarch64-apple-ios-sim.md)
|
- [aarch64-apple-ios-sim](platform-support/aarch64-apple-ios-sim.md)
|
||||||
|
- [armv7-unknown-linux-uclibceabihf](platform-support/armv7-unknown-linux-uclibceabihf.md)
|
||||||
- [\*-kmc-solid_\*](platform-support/kmc-solid.md)
|
- [\*-kmc-solid_\*](platform-support/kmc-solid.md)
|
||||||
- [x86_64-unknown-none](platform-support/x86_64-unknown-none.md)
|
- [x86_64-unknown-none](platform-support/x86_64-unknown-none.md)
|
||||||
- [wasm64-unknown-unknown](platform-support/wasm64-unknown-unknown.md)
|
- [wasm64-unknown-unknown](platform-support/wasm64-unknown-unknown.md)
|
||||||
|
|
|
@ -220,7 +220,7 @@ target | std | host | notes
|
||||||
`armv6-unknown-netbsd-eabihf` | ? | |
|
`armv6-unknown-netbsd-eabihf` | ? | |
|
||||||
`armv6k-nintendo-3ds` | * | | ARMv6K Nintendo 3DS, Horizon (Requires devkitARM toolchain)
|
`armv6k-nintendo-3ds` | * | | ARMv6K Nintendo 3DS, Horizon (Requires devkitARM toolchain)
|
||||||
`armv7-apple-ios` | ✓ | | ARMv7 iOS, Cortex-a8
|
`armv7-apple-ios` | ✓ | | ARMv7 iOS, Cortex-a8
|
||||||
`armv7-unknown-linux-uclibceabihf` | ✓ | ? | ARMv7 Linux uClibc
|
[`armv7-unknown-linux-uclibceabihf`](platform-support/armv7-unknown-linux-uclibceabihf.md) | ✓ | ? | ARMv7 Linux uClibc
|
||||||
`armv7-unknown-freebsd` | ✓ | ✓ | ARMv7 FreeBSD
|
`armv7-unknown-freebsd` | ✓ | ✓ | ARMv7 FreeBSD
|
||||||
`armv7-unknown-netbsd-eabihf` | ✓ | ✓ |
|
`armv7-unknown-netbsd-eabihf` | ✓ | ✓ |
|
||||||
`armv7-wrs-vxworks-eabihf` | ? | |
|
`armv7-wrs-vxworks-eabihf` | ? | |
|
||||||
|
|
|
@ -18,7 +18,7 @@ This target is cross compiled, and requires a cross toolchain. You can find sui
|
||||||
|
|
||||||
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.
|
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.
|
||||||
|
|
||||||
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.
|
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.
|
||||||
|
|
||||||
### Configure rust
|
### Configure rust
|
||||||
|
|
||||||
|
|
|
@ -429,7 +429,7 @@ impl Item {
|
||||||
|
|
||||||
/// Convenience wrapper around [`Self::from_def_id_and_parts`] which converts
|
/// Convenience wrapper around [`Self::from_def_id_and_parts`] which converts
|
||||||
/// `hir_id` to a [`DefId`]
|
/// `hir_id` to a [`DefId`]
|
||||||
pub fn from_hir_id_and_parts(
|
crate fn from_hir_id_and_parts(
|
||||||
hir_id: hir::HirId,
|
hir_id: hir::HirId,
|
||||||
name: Option<Symbol>,
|
name: Option<Symbol>,
|
||||||
kind: ItemKind,
|
kind: ItemKind,
|
||||||
|
@ -438,7 +438,7 @@ impl Item {
|
||||||
Item::from_def_id_and_parts(cx.tcx.hir().local_def_id(hir_id).to_def_id(), name, kind, cx)
|
Item::from_def_id_and_parts(cx.tcx.hir().local_def_id(hir_id).to_def_id(), name, kind, cx)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn from_def_id_and_parts(
|
crate fn from_def_id_and_parts(
|
||||||
def_id: DefId,
|
def_id: DefId,
|
||||||
name: Option<Symbol>,
|
name: Option<Symbol>,
|
||||||
kind: ItemKind,
|
kind: ItemKind,
|
||||||
|
@ -456,7 +456,7 @@ impl Item {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn from_def_id_and_attrs_and_parts(
|
crate fn from_def_id_and_attrs_and_parts(
|
||||||
def_id: DefId,
|
def_id: DefId,
|
||||||
name: Option<Symbol>,
|
name: Option<Symbol>,
|
||||||
kind: ItemKind,
|
kind: ItemKind,
|
||||||
|
@ -984,26 +984,26 @@ crate fn collapse_doc_fragments(doc_strings: &[DocFragment]) -> String {
|
||||||
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
|
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
|
||||||
crate struct ItemLink {
|
crate struct ItemLink {
|
||||||
/// The original link written in the markdown
|
/// The original link written in the markdown
|
||||||
pub(crate) link: String,
|
crate link: String,
|
||||||
/// The link text displayed in the HTML.
|
/// The link text displayed in the HTML.
|
||||||
///
|
///
|
||||||
/// This may not be the same as `link` if there was a disambiguator
|
/// This may not be the same as `link` if there was a disambiguator
|
||||||
/// in an intra-doc link (e.g. \[`fn@f`\])
|
/// in an intra-doc link (e.g. \[`fn@f`\])
|
||||||
pub(crate) link_text: String,
|
crate link_text: String,
|
||||||
pub(crate) did: DefId,
|
crate did: DefId,
|
||||||
/// The url fragment to append to the link
|
/// The url fragment to append to the link
|
||||||
pub(crate) fragment: Option<UrlFragment>,
|
crate fragment: Option<UrlFragment>,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct RenderedLink {
|
pub struct RenderedLink {
|
||||||
/// The text the link was original written as.
|
/// The text the link was original written as.
|
||||||
///
|
///
|
||||||
/// This could potentially include disambiguators and backticks.
|
/// This could potentially include disambiguators and backticks.
|
||||||
pub(crate) original_text: String,
|
crate original_text: String,
|
||||||
/// The text to display in the HTML
|
/// The text to display in the HTML
|
||||||
pub(crate) new_text: String,
|
crate new_text: String,
|
||||||
/// The URL to put in the `href`
|
/// The URL to put in the `href`
|
||||||
pub(crate) href: String,
|
crate href: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The attributes on an [`Item`], including attributes like `#[derive(...)]` and `#[inline]`,
|
/// The attributes on an [`Item`], including attributes like `#[derive(...)]` and `#[inline]`,
|
||||||
|
|
|
@ -33,8 +33,8 @@ use crate::passes::{self, Condition::*};
|
||||||
crate use rustc_session::config::{DebuggingOptions, Input, Options};
|
crate use rustc_session::config::{DebuggingOptions, Input, Options};
|
||||||
|
|
||||||
crate struct ResolverCaches {
|
crate struct ResolverCaches {
|
||||||
pub all_traits: Option<Vec<DefId>>,
|
crate all_traits: Option<Vec<DefId>>,
|
||||||
pub all_trait_impls: Option<Vec<DefId>>,
|
crate all_trait_impls: Option<Vec<DefId>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
crate struct DocContext<'tcx> {
|
crate struct DocContext<'tcx> {
|
||||||
|
|
|
@ -175,7 +175,7 @@ crate struct StylePath {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl StylePath {
|
impl StylePath {
|
||||||
pub fn basename(&self) -> Result<String, Error> {
|
crate fn basename(&self) -> Result<String, Error> {
|
||||||
Ok(try_none!(try_none!(self.path.file_stem(), &self.path).to_str(), &self.path).to_string())
|
Ok(try_none!(try_none!(self.path.file_stem(), &self.path).to_str(), &self.path).to_string())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -896,11 +896,11 @@ table,
|
||||||
|
|
||||||
.search-container {
|
.search-container {
|
||||||
position: relative;
|
position: relative;
|
||||||
max-width: 960px;
|
display: flex;
|
||||||
|
height: 34px;
|
||||||
}
|
}
|
||||||
.search-container > div {
|
.search-container > * {
|
||||||
display: inline-flex;
|
height: 100%;
|
||||||
width: calc(100% - 63px);
|
|
||||||
}
|
}
|
||||||
.search-results-title {
|
.search-results-title {
|
||||||
display: inline;
|
display: inline;
|
||||||
|
@ -931,10 +931,8 @@ table,
|
||||||
background-position: calc(100% - 1px) 56%;
|
background-position: calc(100% - 1px) 56%;
|
||||||
background-image: /* AUTOREPLACE: */url("down-arrow.svg");
|
background-image: /* AUTOREPLACE: */url("down-arrow.svg");
|
||||||
}
|
}
|
||||||
.search-container > .top-button {
|
.search-container {
|
||||||
position: absolute;
|
margin-top: 4px;
|
||||||
right: 0;
|
|
||||||
top: 10px;
|
|
||||||
}
|
}
|
||||||
.search-input {
|
.search-input {
|
||||||
/* Override Normalize.css: it has a rule that sets
|
/* Override Normalize.css: it has a rule that sets
|
||||||
|
@ -947,23 +945,14 @@ table,
|
||||||
-moz-box-sizing: border-box !important;
|
-moz-box-sizing: border-box !important;
|
||||||
box-sizing: border-box !important;
|
box-sizing: border-box !important;
|
||||||
outline: none;
|
outline: none;
|
||||||
border: none;
|
border: 1px solid;
|
||||||
border-radius: 1px;
|
border-radius: 2px;
|
||||||
margin-top: 5px;
|
padding: 5px 8px;
|
||||||
padding: 10px 16px;
|
|
||||||
font-size: 1.0625rem;
|
font-size: 1.0625rem;
|
||||||
transition: border-color 300ms ease;
|
transition: border-color 300ms ease;
|
||||||
transition: border-radius 300ms ease-in-out;
|
|
||||||
transition: box-shadow 300ms ease-in-out;
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.search-input:focus {
|
|
||||||
border-radius: 2px;
|
|
||||||
border: 0;
|
|
||||||
outline: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.search-results {
|
.search-results {
|
||||||
display: none;
|
display: none;
|
||||||
padding-bottom: 2em;
|
padding-bottom: 2em;
|
||||||
|
@ -1199,7 +1188,6 @@ a.test-arrow:hover{
|
||||||
.out-of-band > span.since {
|
.out-of-band > span.since {
|
||||||
position: initial;
|
position: initial;
|
||||||
font-size: 1.25rem;
|
font-size: 1.25rem;
|
||||||
margin-right: 5px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
h3.variant {
|
h3.variant {
|
||||||
|
@ -1437,8 +1425,8 @@ pre.rust {
|
||||||
|
|
||||||
.theme-picker {
|
.theme-picker {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: -34px;
|
left: -38px;
|
||||||
top: 9px;
|
top: 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.theme-picker button {
|
.theme-picker button {
|
||||||
|
@ -1446,34 +1434,27 @@ pre.rust {
|
||||||
}
|
}
|
||||||
|
|
||||||
#settings-menu, #help-button {
|
#settings-menu, #help-button {
|
||||||
position: absolute;
|
margin-left: 4px;
|
||||||
top: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#settings-menu {
|
|
||||||
right: 0;
|
|
||||||
outline: none;
|
outline: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#theme-picker, #copy-path {
|
||||||
|
height: 34px;
|
||||||
|
}
|
||||||
#theme-picker, #settings-menu, #help-button, #copy-path {
|
#theme-picker, #settings-menu, #help-button, #copy-path {
|
||||||
padding: 4px;
|
padding: 5px;
|
||||||
/* Rare exception to specifying font sizes in rem. Since these are acting
|
width: 33px;
|
||||||
as icons, it's okay to specify their sizes in pixels. */
|
|
||||||
font-size: 16px;
|
|
||||||
width: 27px;
|
|
||||||
height: 29px;
|
|
||||||
border: 1px solid;
|
border: 1px solid;
|
||||||
border-radius: 3px;
|
border-radius: 2px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
#help-button {
|
#help-button {
|
||||||
right: 30px;
|
|
||||||
font-family: "Fira Sans", Arial, sans-serif;
|
font-family: "Fira Sans", Arial, sans-serif;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
/* Rare exception to specifying font sizes in rem. Since this is acting
|
/* Rare exception to specifying font sizes in rem. Since this is acting
|
||||||
as an icon, it's okay to specify their sizes in pixels. */
|
as an icon, it's okay to specify their sizes in pixels. */
|
||||||
font-size: 16px;
|
font-size: 20px;
|
||||||
padding-top: 2px;
|
padding-top: 2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1910,10 +1891,6 @@ details.rustdoc-toggle[open] > summary.hideme::after {
|
||||||
display: none !important;
|
display: none !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.theme-picker {
|
|
||||||
z-index: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.notable-traits {
|
.notable-traits {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: -22px;
|
left: -22px;
|
||||||
|
@ -2000,10 +1977,6 @@ details.rustdoc-toggle[open] > summary.hideme::after {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.search-container > div {
|
|
||||||
width: calc(100% - 32px);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Display an alternating layout on tablets and phones */
|
/* Display an alternating layout on tablets and phones */
|
||||||
.search-results > a {
|
.search-results > a {
|
||||||
border-bottom: 1px solid #aaa9;
|
border-bottom: 1px solid #aaa9;
|
||||||
|
@ -2048,30 +2021,11 @@ details.rustdoc-toggle[open] > summary.hideme::after {
|
||||||
width: 50%;
|
width: 50%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.search-container > div {
|
|
||||||
display: block;
|
|
||||||
width: calc(100% - 37px);
|
|
||||||
}
|
|
||||||
|
|
||||||
#crate-search {
|
#crate-search {
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
border: 0;
|
border: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#theme-picker, #settings-menu {
|
|
||||||
padding: 5px;
|
|
||||||
width: 31px;
|
|
||||||
height: 31px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#theme-picker {
|
|
||||||
margin-top: -2px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#settings-menu {
|
|
||||||
top: 7px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.docblock {
|
.docblock {
|
||||||
margin-left: 12px;
|
margin-left: 12px;
|
||||||
}
|
}
|
||||||
|
|
|
@ -233,22 +233,14 @@ details.undocumented > summary::before {
|
||||||
filter: invert(100%);
|
filter: invert(100%);
|
||||||
}
|
}
|
||||||
|
|
||||||
#crate-search {
|
#crate-search, .search-input {
|
||||||
color: #c5c5c5;
|
|
||||||
background-color: #141920;
|
background-color: #141920;
|
||||||
box-shadow: 0 0 0 1px #424c57,0 0 0 2px transparent;
|
|
||||||
border-color: #424c57;
|
border-color: #424c57;
|
||||||
|
color: #c5c5c5;
|
||||||
}
|
}
|
||||||
|
|
||||||
.search-input {
|
.search-input {
|
||||||
color: #ffffff;
|
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,
|
.module-item .stab,
|
||||||
|
|
|
@ -194,27 +194,20 @@ details.undocumented > summary::before {
|
||||||
filter: invert(100%);
|
filter: invert(100%);
|
||||||
}
|
}
|
||||||
|
|
||||||
#crate-search {
|
#crate-search, .search-input {
|
||||||
color: #111;
|
color: #111;
|
||||||
background-color: #f0f0f0;
|
background-color: #f0f0f0;
|
||||||
border-color: #000;
|
border-color: #000;
|
||||||
box-shadow: 0 0 0 1px #000, 0 0 0 2px transparent;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.search-input {
|
.search-input {
|
||||||
color: #111;
|
border-color: #e0e0e0;
|
||||||
background-color: #f0f0f0;
|
|
||||||
box-shadow: 0 0 0 1px #000, 0 0 0 2px transparent;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.search-input:focus {
|
.search-input:focus {
|
||||||
border-color: #008dfd;
|
border-color: #008dfd;
|
||||||
}
|
}
|
||||||
|
|
||||||
#crate-search + .search-input:focus {
|
|
||||||
box-shadow: 0 0 8px 4px #078dd8;
|
|
||||||
}
|
|
||||||
|
|
||||||
.module-item .stab,
|
.module-item .stab,
|
||||||
.import-item .stab {
|
.import-item .stab {
|
||||||
color: #ddd;
|
color: #ddd;
|
||||||
|
|
|
@ -186,27 +186,16 @@ details.undocumented > summary::before {
|
||||||
color: #999;
|
color: #999;
|
||||||
}
|
}
|
||||||
|
|
||||||
#crate-search {
|
#crate-search, .search-input {
|
||||||
color: #555;
|
color: #555;
|
||||||
background-color: white;
|
background-color: white;
|
||||||
border-color: #e0e0e0;
|
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 {
|
.search-input:focus {
|
||||||
border-color: #66afe9;
|
border-color: #66afe9;
|
||||||
}
|
}
|
||||||
|
|
||||||
#crate-search + .search-input:focus {
|
|
||||||
box-shadow: 0 0 8px #078dd8;
|
|
||||||
}
|
|
||||||
|
|
||||||
.module-item .stab,
|
.module-item .stab,
|
||||||
.import-item .stab {
|
.import-item .stab {
|
||||||
color: #000;
|
color: #000;
|
||||||
|
|
|
@ -110,14 +110,13 @@
|
||||||
<nav class="sub"> {#- -#}
|
<nav class="sub"> {#- -#}
|
||||||
<div class="theme-picker hidden"> {#- -#}
|
<div class="theme-picker hidden"> {#- -#}
|
||||||
<button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"> {#- -#}
|
<button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"> {#- -#}
|
||||||
<img width="18" height="18" alt="Pick another theme!" {# -#}
|
<img width="22" height="22" alt="Pick another theme!" {# -#}
|
||||||
src="{{static_root_path|safe}}brush{{page.resource_suffix}}.svg"> {#- -#}
|
src="{{static_root_path|safe}}brush{{page.resource_suffix}}.svg"> {#- -#}
|
||||||
</button> {#- -#}
|
</button> {#- -#}
|
||||||
<div id="theme-choices" role="menu"></div> {#- -#}
|
<div id="theme-choices" role="menu"></div> {#- -#}
|
||||||
</div> {#- -#}
|
</div> {#- -#}
|
||||||
<form class="search-form"> {#- -#}
|
<form class="search-form"> {#- -#}
|
||||||
<div class="search-container"> {#- -#}
|
<div class="search-container"> {#- -#}
|
||||||
<div>
|
|
||||||
<input {# -#}
|
<input {# -#}
|
||||||
class="search-input" {# -#}
|
class="search-input" {# -#}
|
||||||
name="search" {# -#}
|
name="search" {# -#}
|
||||||
|
@ -125,10 +124,9 @@
|
||||||
spellcheck="false" {# -#}
|
spellcheck="false" {# -#}
|
||||||
placeholder="Click or press ‘S’ to search, ‘?’ for more options…" {# -#}
|
placeholder="Click or press ‘S’ to search, ‘?’ for more options…" {# -#}
|
||||||
type="search"> {#- -#}
|
type="search"> {#- -#}
|
||||||
</div> {#- -#}
|
|
||||||
<button type="button" id="help-button" title="help">?</button> {#- -#}
|
<button type="button" id="help-button" title="help">?</button> {#- -#}
|
||||||
<a id="settings-menu" href="{{page.root_path|safe}}settings.html" title="settings"> {#- -#}
|
<a id="settings-menu" href="{{page.root_path|safe}}settings.html" title="settings"> {#- -#}
|
||||||
<img width="18" height="18" alt="Change settings" {# -#}
|
<img width="22" height="22" alt="Change settings" {# -#}
|
||||||
src="{{static_root_path|safe}}wheel{{page.resource_suffix}}.svg"> {#- -#}
|
src="{{static_root_path|safe}}wheel{{page.resource_suffix}}.svg"> {#- -#}
|
||||||
</a> {#- -#}
|
</a> {#- -#}
|
||||||
</div> {#- -#}
|
</div> {#- -#}
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
</h1> {#- -#}
|
</h1> {#- -#}
|
||||||
<span class="out-of-band"> {#- -#}
|
<span class="out-of-band"> {#- -#}
|
||||||
{% if !stability_since_raw.is_empty() %}
|
{% if !stability_since_raw.is_empty() %}
|
||||||
{{- stability_since_raw|safe -}} · {# -#}
|
{{- stability_since_raw|safe }} · {# -#}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{%- match src_href -%}
|
{%- match src_href -%}
|
||||||
{%- when Some with (href) -%}
|
{%- when Some with (href) -%}
|
||||||
|
|
|
@ -362,7 +362,7 @@ struct DiagnosticInfo<'a> {
|
||||||
|
|
||||||
#[derive(Clone, Debug, Hash)]
|
#[derive(Clone, Debug, Hash)]
|
||||||
struct CachedLink {
|
struct CachedLink {
|
||||||
pub res: (Res, Option<UrlFragment>),
|
res: (Res, Option<UrlFragment>),
|
||||||
}
|
}
|
||||||
|
|
||||||
struct LinkCollector<'a, 'tcx> {
|
struct LinkCollector<'a, 'tcx> {
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
#![stable(feature = "bar", since = "1.0")]
|
#![stable(feature = "bar", since = "1.0")]
|
||||||
#![crate_name = "foo"]
|
#![crate_name = "foo"]
|
||||||
|
|
||||||
#![feature(staged_api)]
|
#![feature(staged_api)]
|
||||||
|
|
||||||
// @has foo/trait.Bar.html
|
// @has foo/trait.Bar.html
|
||||||
|
|
11
src/test/ui/async-await/proper-span-for-type-error.fixed
Normal file
11
src/test/ui/async-await/proper-span-for-type-error.fixed
Normal file
|
@ -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() {}
|
11
src/test/ui/async-await/proper-span-for-type-error.rs
Normal file
11
src/test/ui/async-await/proper-span-for-type-error.rs
Normal file
|
@ -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() {}
|
16
src/test/ui/async-await/proper-span-for-type-error.stderr
Normal file
16
src/test/ui/async-await/proper-span-for-type-error.stderr
Normal file
|
@ -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`.
|
|
@ -5,8 +5,8 @@
|
||||||
#![deny(unreachable_code)]
|
#![deny(unreachable_code)]
|
||||||
|
|
||||||
fn foo() {
|
fn foo() {
|
||||||
let x: ! = ! { return; }; //~ ERROR unreachable
|
let x: ! = * { return; }; //~ ERROR unreachable
|
||||||
//~| ERROR cannot apply unary operator `!` to type `!`
|
//~| ERROR type `!` cannot be dereferenced
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() { }
|
fn main() { }
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
error[E0600]: cannot apply unary operator `!` to type `!`
|
error[E0614]: type `!` cannot be dereferenced
|
||||||
--> $DIR/expr_unary.rs:8:16
|
--> $DIR/expr_unary.rs:8:16
|
||||||
|
|
|
|
||||||
LL | let x: ! = ! { return; };
|
LL | let x: ! = * { return; };
|
||||||
| ^^^^^^^^^^^^^ cannot apply unary operator `!`
|
| ^^^^^^^^^^^^^
|
||||||
|
|
||||||
error: unreachable expression
|
error: unreachable expression
|
||||||
--> $DIR/expr_unary.rs:8:16
|
--> $DIR/expr_unary.rs:8:16
|
||||||
|
|
|
|
||||||
LL | let x: ! = ! { return; };
|
LL | let x: ! = * { return; };
|
||||||
| ^^^^------^^^
|
| ^^^^------^^^
|
||||||
| | |
|
| | |
|
||||||
| | any code following this expression is unreachable
|
| | any code following this expression is unreachable
|
||||||
|
@ -21,4 +21,4 @@ LL | #![deny(unreachable_code)]
|
||||||
|
|
||||||
error: aborting due to 2 previous errors
|
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`.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue