mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-15 05:26:47 +00:00
parent
71b68da1bd
commit
e013cf8afc
@ -1109,6 +1109,7 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
|
||||
ItemKind::Trait(_, _, _, generics, _, items)
|
||||
if generics.params.len() != 0
|
||||
|| items.iter().any(|item| matches!(item.kind, AssocItemKind::Type)) => {}
|
||||
ItemKind::TyAlias(_, _, generics) if generics.params.len() != 0 => {}
|
||||
_ => {
|
||||
self.dcx().emit_err(errors::DocSearchUnboxInvalid { span: meta.span() });
|
||||
}
|
||||
|
@ -48,6 +48,7 @@ use crate::{error, fmt, result, sys};
|
||||
/// }
|
||||
/// ```
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
#[cfg_attr(not(bootstrap), doc(search_unbox))]
|
||||
pub type Result<T> = result::Result<T, Error>;
|
||||
|
||||
/// The error type for I/O operations of the [`Read`], [`Write`], [`Seek`], and
|
||||
|
@ -1676,6 +1676,7 @@ impl fmt::Debug for Thread {
|
||||
/// [`Result`]: crate::result::Result
|
||||
/// [`std::panic::resume_unwind`]: crate::panic::resume_unwind
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
#[cfg_attr(not(bootstrap), doc(search_unbox))]
|
||||
pub type Result<T> = crate::result::Result<T, Box<dyn Any + Send + 'static>>;
|
||||
|
||||
// This packet is used to communicate the return value between the spawned
|
||||
|
20
tests/rustdoc-js-std/unbox-type-result.js
Normal file
20
tests/rustdoc-js-std/unbox-type-result.js
Normal file
@ -0,0 +1,20 @@
|
||||
// exact-check
|
||||
|
||||
// Test case for https://github.com/rust-lang/rust/issues/139665
|
||||
// make sure that std::io::Result and std::thread::Result get unboxed
|
||||
|
||||
const EXPECTED = [
|
||||
{
|
||||
query: "File -> Metadata",
|
||||
others: [
|
||||
{ path: "std::fs::File", name: "metadata" },
|
||||
{ path: "std::fs::File", name: "metadata_at" },
|
||||
]
|
||||
},
|
||||
{
|
||||
query: "JoinHandle<T> -> T",
|
||||
others: [
|
||||
{ path: "std::thread::JoinHandle", name: "join" },
|
||||
]
|
||||
},
|
||||
];
|
@ -31,4 +31,10 @@ const EXPECTED = [
|
||||
{ 'path': 'generics_unbox', 'name': 'beta' },
|
||||
],
|
||||
},
|
||||
{
|
||||
'query': '-> Sigma',
|
||||
'others': [
|
||||
{ 'path': 'generics_unbox', 'name': 'delta' },
|
||||
],
|
||||
},
|
||||
];
|
||||
|
@ -42,3 +42,15 @@ pub fn beta<T, U>(_: Inside<T>) -> Out<Out3<T, U>, Out4<U, T>> {
|
||||
pub fn gamma<T, U>(_: Inside<T>) -> Out<Out3<U, T>, Out4<T, U>> {
|
||||
loop {}
|
||||
}
|
||||
|
||||
pub fn delta(_: i32) -> Epsilon<Sigma> {
|
||||
loop {}
|
||||
}
|
||||
|
||||
#[doc(search_unbox)]
|
||||
pub struct Theta<T>(T);
|
||||
|
||||
#[doc(search_unbox)]
|
||||
pub type Epsilon<T> = Theta<T>;
|
||||
|
||||
pub struct Sigma;
|
||||
|
Loading…
Reference in New Issue
Block a user