mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-28 11:07:42 +00:00
Auto merge of #100511 - compiler-errors:rollup-vrte4w5, r=compiler-errors
Rollup of 11 pull requests Successful merges: - #100355 (rustdoc: Rename ``@has` FILE PATTERN` to ``@hasraw` FILE PATTERN`) - #100407 (avoid some int2ptr casts in thread_local_key tests) - #100434 (Fix HIR pretty printing of let else) - #100438 (Erase regions better in `promote_candidate`) - #100445 (adapt test for msan message change) - #100447 (Remove more Clean trait implementations) - #100464 (Make `[rust] use-lld=true` work on windows) - #100475 (Give a helpful diagnostic when the next struct field has an attribute) - #100490 (wf: correctly `shallow_resolve` consts) - #100501 (nicer Miri backtraces for from_exposed_addr) - #100509 (merge two test directories that mean the same thing) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
This commit is contained in:
commit
b76fec3ca8
@ -839,17 +839,12 @@ impl<'a, 'tcx> Promoter<'a, 'tcx> {
|
||||
let mut promoted_operand = |ty, span| {
|
||||
promoted.span = span;
|
||||
promoted.local_decls[RETURN_PLACE] = LocalDecl::new(ty, span);
|
||||
let substs = tcx.erase_regions(InternalSubsts::identity_for_item(tcx, def.did));
|
||||
let _const = tcx.mk_const(ty::ConstS {
|
||||
ty,
|
||||
kind: ty::ConstKind::Unevaluated(ty::Unevaluated {
|
||||
def,
|
||||
substs: InternalSubsts::for_item(tcx, def.did, |param, _| {
|
||||
if let ty::GenericParamDefKind::Lifetime = param.kind {
|
||||
tcx.lifetimes.re_erased.into()
|
||||
} else {
|
||||
tcx.mk_param_from_def(param)
|
||||
}
|
||||
}),
|
||||
substs,
|
||||
promoted: Some(promoted_id),
|
||||
}),
|
||||
});
|
||||
|
@ -911,6 +911,10 @@ impl<'a> State<'a> {
|
||||
if let Some(els) = els {
|
||||
self.nbsp();
|
||||
self.word_space("else");
|
||||
// containing cbox, will be closed by print-block at `}`
|
||||
self.cbox(0);
|
||||
// head-box, will be closed by print-block after `{`
|
||||
self.ibox(0);
|
||||
self.print_block(els);
|
||||
}
|
||||
|
||||
|
@ -1544,8 +1544,12 @@ impl<'a> Parser<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
if self.token.is_ident() {
|
||||
// This is likely another field; emit the diagnostic and keep going
|
||||
if self.token.is_ident()
|
||||
|| (self.token.kind == TokenKind::Pound
|
||||
&& (self.look_ahead(1, |t| t == &token::OpenDelim(Delimiter::Bracket))))
|
||||
{
|
||||
// This is likely another field, TokenKind::Pound is used for `#[..]` attribute for next field,
|
||||
// emit the diagnostic and keep going
|
||||
err.span_suggestion(
|
||||
sp,
|
||||
"try adding a comma",
|
||||
|
@ -31,26 +31,24 @@ pub fn obligations<'a, 'tcx>(
|
||||
if resolved_ty == ty {
|
||||
// No progress, bail out to prevent "livelock".
|
||||
return None;
|
||||
}
|
||||
|
||||
} else {
|
||||
resolved_ty
|
||||
}
|
||||
}
|
||||
_ => ty,
|
||||
}
|
||||
.into()
|
||||
}
|
||||
GenericArgKind::Const(ct) => {
|
||||
match ct.kind() {
|
||||
ty::ConstKind::Infer(infer) => {
|
||||
let resolved = infcx.shallow_resolve(infer);
|
||||
if resolved == infer {
|
||||
ty::ConstKind::Infer(_) => {
|
||||
let resolved = infcx.shallow_resolve(ct);
|
||||
if resolved == ct {
|
||||
// No progress.
|
||||
return None;
|
||||
} else {
|
||||
resolved
|
||||
}
|
||||
|
||||
infcx
|
||||
.tcx
|
||||
.mk_const(ty::ConstS { kind: ty::ConstKind::Infer(resolved), ty: ct.ty() })
|
||||
}
|
||||
_ => ct,
|
||||
}
|
||||
|
@ -603,6 +603,7 @@ pub const fn invalid_mut<T>(addr: usize) -> *mut T {
|
||||
#[must_use]
|
||||
#[inline]
|
||||
#[unstable(feature = "strict_provenance", issue = "95228")]
|
||||
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
|
||||
pub fn from_exposed_addr<T>(addr: usize) -> *const T
|
||||
where
|
||||
T: Sized,
|
||||
@ -639,6 +640,7 @@ where
|
||||
#[must_use]
|
||||
#[inline]
|
||||
#[unstable(feature = "strict_provenance", issue = "95228")]
|
||||
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
|
||||
pub fn from_exposed_addr_mut<T>(addr: usize) -> *mut T
|
||||
where
|
||||
T: Sized,
|
||||
|
@ -1,4 +1,5 @@
|
||||
use super::{Key, StaticKey};
|
||||
use core::ptr;
|
||||
|
||||
fn assert_sync<T: Sync>() {}
|
||||
fn assert_send<T: Send>() {}
|
||||
@ -12,8 +13,8 @@ fn smoke() {
|
||||
let k2 = Key::new(None);
|
||||
assert!(k1.get().is_null());
|
||||
assert!(k2.get().is_null());
|
||||
k1.set(1 as *mut _);
|
||||
k2.set(2 as *mut _);
|
||||
k1.set(ptr::invalid_mut(1));
|
||||
k2.set(ptr::invalid_mut(2));
|
||||
assert_eq!(k1.get() as usize, 1);
|
||||
assert_eq!(k2.get() as usize, 2);
|
||||
}
|
||||
@ -26,8 +27,8 @@ fn statik() {
|
||||
unsafe {
|
||||
assert!(K1.get().is_null());
|
||||
assert!(K2.get().is_null());
|
||||
K1.set(1 as *mut _);
|
||||
K2.set(2 as *mut _);
|
||||
K1.set(ptr::invalid_mut(1));
|
||||
K2.set(ptr::invalid_mut(2));
|
||||
assert_eq!(K1.get() as usize, 1);
|
||||
assert_eq!(K2.get() as usize, 2);
|
||||
}
|
||||
|
@ -658,7 +658,12 @@ impl Step for Rustc {
|
||||
|
||||
// With LLD, we can use ICF (identical code folding) to reduce the executable size
|
||||
// of librustc_driver/rustc and to improve i-cache utilization.
|
||||
if builder.config.use_lld {
|
||||
//
|
||||
// -Wl,[link options] doesn't work on MSVC. However, /OPT:ICF (technically /OPT:REF,ICF)
|
||||
// is already on by default in MSVC optimized builds, which is interpreted as --icf=all:
|
||||
// https://github.com/llvm/llvm-project/blob/3329cec2f79185bafd678f310fafadba2a8c76d2/lld/COFF/Driver.cpp#L1746
|
||||
// https://github.com/rust-lang/rust/blob/f22819bcce4abaff7d1246a56eec493418f9f4ee/compiler/rustc_codegen_ssa/src/back/linker.rs#L827
|
||||
if builder.config.use_lld && !compiler.host.contains("msvc") {
|
||||
cargo.rustflag("-Clink-args=-Wl,--icf=all");
|
||||
}
|
||||
|
||||
|
@ -41,15 +41,15 @@ There are a number of supported commands:
|
||||
`PATH` is relative to the output directory. It can be given as `-`
|
||||
which repeats the most recently used `PATH`.
|
||||
|
||||
* `@has PATH PATTERN` and `@matches PATH PATTERN` checks for
|
||||
the occurrence of the given pattern `PATTERN` in the specified file.
|
||||
* `@hasraw PATH PATTERN` and `@matchesraw PATH PATTERN` checks
|
||||
for the occurrence of the given pattern `PATTERN` in the specified file.
|
||||
Only one occurrence of the pattern is enough.
|
||||
|
||||
For `@has`, `PATTERN` is a whitespace-normalized (every consecutive
|
||||
For `@hasraw`, `PATTERN` is a whitespace-normalized (every consecutive
|
||||
whitespace being replaced by one single space character) string.
|
||||
The entire file is also whitespace-normalized including newlines.
|
||||
|
||||
For `@matches`, `PATTERN` is a Python-supported regular expression.
|
||||
For `@matchesraw`, `PATTERN` is a Python-supported regular expression.
|
||||
The file remains intact but the regexp is matched without the `MULTILINE`
|
||||
and `IGNORECASE` options. You can still use a prefix `(?m)` or `(?i)`
|
||||
to override them, and `\A` and `\Z` for definitely matching
|
||||
@ -542,19 +542,23 @@ ERR_COUNT = 0
|
||||
def check_command(c, cache):
|
||||
try:
|
||||
cerr = ""
|
||||
if c.cmd == 'has' or c.cmd == 'matches': # string test
|
||||
regexp = (c.cmd == 'matches')
|
||||
if len(c.args) == 1 and not regexp: # @has <path> = file existence
|
||||
if c.cmd in ['has', 'hasraw', 'matches', 'matchesraw']: # string test
|
||||
regexp = c.cmd.startswith('matches')
|
||||
|
||||
# @has <path> = file existence
|
||||
if len(c.args) == 1 and not regexp and 'raw' not in c.cmd:
|
||||
try:
|
||||
cache.get_file(c.args[0])
|
||||
ret = True
|
||||
except FailedCheck as err:
|
||||
cerr = str(err)
|
||||
ret = False
|
||||
elif len(c.args) == 2: # @has/matches <path> <pat> = string test
|
||||
# @hasraw/matchesraw <path> <pat> = string test
|
||||
elif len(c.args) == 2 and 'raw' in c.cmd:
|
||||
cerr = "`PATTERN` did not match"
|
||||
ret = check_string(cache.get_file(c.args[0]), c.args[1], regexp)
|
||||
elif len(c.args) == 3: # @has/matches <path> <pat> <match> = XML tree test
|
||||
# @has/matches <path> <pat> <match> = XML tree test
|
||||
elif len(c.args) == 3 and 'raw' not in c.cmd:
|
||||
cerr = "`XPATH PATTERN` did not match"
|
||||
ret = get_nb_matching_elements(cache, c, regexp, True) != 0
|
||||
else:
|
||||
|
@ -1322,14 +1322,17 @@ fn clean_qpath<'tcx>(hir_ty: &hir::Ty<'tcx>, cx: &mut DocContext<'tcx>) -> Type
|
||||
let trait_def = cx.tcx.associated_item(p.res.def_id()).container_id(cx.tcx);
|
||||
let trait_ = self::Path {
|
||||
res: Res::Def(DefKind::Trait, trait_def),
|
||||
segments: trait_segments.iter().map(|x| x.clean(cx)).collect(),
|
||||
segments: trait_segments.iter().map(|x| clean_path_segment(x, cx)).collect(),
|
||||
};
|
||||
register_res(cx, trait_.res);
|
||||
let self_def_id = DefId::local(qself.hir_id.owner.local_def_index);
|
||||
let self_type = clean_ty(qself, cx);
|
||||
let should_show_cast = compute_should_show_cast(Some(self_def_id), &trait_, &self_type);
|
||||
Type::QPath {
|
||||
assoc: Box::new(p.segments.last().expect("segments were empty").clean(cx)),
|
||||
assoc: Box::new(clean_path_segment(
|
||||
p.segments.last().expect("segments were empty"),
|
||||
cx,
|
||||
)),
|
||||
should_show_cast,
|
||||
self_type: Box::new(self_type),
|
||||
trait_,
|
||||
@ -1349,7 +1352,7 @@ fn clean_qpath<'tcx>(hir_ty: &hir::Ty<'tcx>, cx: &mut DocContext<'tcx>) -> Type
|
||||
let self_type = clean_ty(qself, cx);
|
||||
let should_show_cast = compute_should_show_cast(self_def_id, &trait_, &self_type);
|
||||
Type::QPath {
|
||||
assoc: Box::new(segment.clean(cx)),
|
||||
assoc: Box::new(clean_path_segment(segment, cx)),
|
||||
should_show_cast,
|
||||
self_type: Box::new(self_type),
|
||||
trait_,
|
||||
@ -1507,7 +1510,7 @@ pub(crate) fn clean_ty<'tcx>(ty: &hir::Ty<'tcx>, cx: &mut DocContext<'tcx>) -> T
|
||||
if !lifetime.is_elided() { Some(clean_lifetime(*lifetime, cx)) } else { None };
|
||||
DynTrait(bounds, lifetime)
|
||||
}
|
||||
TyKind::BareFn(barefn) => BareFunction(Box::new(barefn.clean(cx))),
|
||||
TyKind::BareFn(barefn) => BareFunction(Box::new(clean_bare_fn_ty(barefn, cx))),
|
||||
// Rustdoc handles `TyKind::Err`s by turning them into `Type::Infer`s.
|
||||
TyKind::Infer | TyKind::Err => Infer,
|
||||
TyKind::Typeof(..) => panic!("unimplemented type {:?}", ty.kind),
|
||||
@ -1823,7 +1826,10 @@ fn clean_variant_data<'tcx>(
|
||||
}
|
||||
|
||||
fn clean_path<'tcx>(path: &hir::Path<'tcx>, cx: &mut DocContext<'tcx>) -> Path {
|
||||
Path { res: path.res, segments: path.segments.iter().map(|x| x.clean(cx)).collect() }
|
||||
Path {
|
||||
res: path.res,
|
||||
segments: path.segments.iter().map(|x| clean_path_segment(x, cx)).collect(),
|
||||
}
|
||||
}
|
||||
|
||||
fn clean_generic_args<'tcx>(
|
||||
@ -1861,28 +1867,30 @@ fn clean_generic_args<'tcx>(
|
||||
}
|
||||
}
|
||||
|
||||
impl<'tcx> Clean<'tcx, PathSegment> for hir::PathSegment<'tcx> {
|
||||
fn clean(&self, cx: &mut DocContext<'tcx>) -> PathSegment {
|
||||
PathSegment { name: self.ident.name, args: clean_generic_args(self.args(), cx) }
|
||||
}
|
||||
fn clean_path_segment<'tcx>(
|
||||
path: &hir::PathSegment<'tcx>,
|
||||
cx: &mut DocContext<'tcx>,
|
||||
) -> PathSegment {
|
||||
PathSegment { name: path.ident.name, args: clean_generic_args(path.args(), cx) }
|
||||
}
|
||||
|
||||
impl<'tcx> Clean<'tcx, BareFunctionDecl> for hir::BareFnTy<'tcx> {
|
||||
fn clean(&self, cx: &mut DocContext<'tcx>) -> BareFunctionDecl {
|
||||
fn clean_bare_fn_ty<'tcx>(
|
||||
bare_fn: &hir::BareFnTy<'tcx>,
|
||||
cx: &mut DocContext<'tcx>,
|
||||
) -> BareFunctionDecl {
|
||||
let (generic_params, decl) = enter_impl_trait(cx, |cx| {
|
||||
// NOTE: generics must be cleaned before args
|
||||
let generic_params = self
|
||||
let generic_params = bare_fn
|
||||
.generic_params
|
||||
.iter()
|
||||
.filter(|p| !is_elided_lifetime(p))
|
||||
.map(|x| clean_generic_param(cx, None, x))
|
||||
.collect();
|
||||
let args = clean_args_from_types_and_names(cx, self.decl.inputs, self.param_names);
|
||||
let decl = clean_fn_decl_with_args(cx, self.decl, args);
|
||||
let args = clean_args_from_types_and_names(cx, bare_fn.decl.inputs, bare_fn.param_names);
|
||||
let decl = clean_fn_decl_with_args(cx, bare_fn.decl, args);
|
||||
(generic_params, decl)
|
||||
});
|
||||
BareFunctionDecl { unsafety: self.unsafety, abi: self.abi, decl, generic_params }
|
||||
}
|
||||
BareFunctionDecl { unsafety: bare_fn.unsafety, abi: bare_fn.abi, decl, generic_params }
|
||||
}
|
||||
|
||||
fn clean_maybe_renamed_item<'tcx>(
|
||||
|
@ -24,5 +24,5 @@ mod private_module {
|
||||
}
|
||||
|
||||
// @has foo/all.html '//a[@href="struct.ReexportedStruct.html"]' 'ReexportedStruct'
|
||||
// @!has foo/all.html 'private_module'
|
||||
// @!hasraw foo/all.html 'private_module'
|
||||
pub use private_module::ReexportedStruct;
|
||||
|
@ -5,7 +5,7 @@ pub trait Foo {
|
||||
const FOO: usize = 12 + 1;
|
||||
// @has - '//*[@id="associatedconstant.FOO_NO_DEFAULT"]' 'const FOO_NO_DEFAULT: bool'
|
||||
const FOO_NO_DEFAULT: bool;
|
||||
// @!has - FOO_HIDDEN
|
||||
// @!hasraw - FOO_HIDDEN
|
||||
#[doc(hidden)]
|
||||
const FOO_HIDDEN: u8 = 0;
|
||||
}
|
||||
@ -18,7 +18,7 @@ impl Foo for Bar {
|
||||
const FOO: usize = 12;
|
||||
// @has - '//*[@id="associatedconstant.FOO_NO_DEFAULT"]' 'const FOO_NO_DEFAULT: bool'
|
||||
const FOO_NO_DEFAULT: bool = false;
|
||||
// @!has - FOO_HIDDEN
|
||||
// @!hasraw - FOO_HIDDEN
|
||||
#[doc(hidden)]
|
||||
const FOO_HIDDEN: u8 = 0;
|
||||
}
|
||||
@ -50,9 +50,9 @@ impl Bar {
|
||||
}
|
||||
|
||||
impl Bar {
|
||||
// @!has assoc_consts/struct.Bar.html 'BAR_PRIVATE'
|
||||
// @!hasraw assoc_consts/struct.Bar.html 'BAR_PRIVATE'
|
||||
const BAR_PRIVATE: char = 'a';
|
||||
// @!has assoc_consts/struct.Bar.html 'BAR_HIDDEN'
|
||||
// @!hasraw assoc_consts/struct.Bar.html 'BAR_HIDDEN'
|
||||
#[doc(hidden)]
|
||||
pub const BAR_HIDDEN: &'static str = "a";
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ pub const fn foo() -> u32 { 42 }
|
||||
pub const unsafe fn foo_unsafe() -> u32 { 42 }
|
||||
|
||||
// @has 'foo/fn.foo2.html' '//pre' 'pub const fn foo2() -> u32'
|
||||
// @!has - '//span[@class="since"]'
|
||||
// @!hasraw - '//span[@class="since"]'
|
||||
#[unstable(feature = "humans", issue = "none")]
|
||||
pub const fn foo2() -> u32 { 42 }
|
||||
|
||||
@ -32,7 +32,7 @@ pub const fn bar2() -> u32 { 42 }
|
||||
|
||||
|
||||
// @has 'foo/fn.foo2_gated.html' '//pre' 'pub const unsafe fn foo2_gated() -> u32'
|
||||
// @!has - '//span[@class="since"]'
|
||||
// @!hasraw - '//span[@class="since"]'
|
||||
#[unstable(feature = "foo2", issue = "none")]
|
||||
pub const unsafe fn foo2_gated() -> u32 { 42 }
|
||||
|
||||
@ -43,7 +43,7 @@ pub const unsafe fn foo2_gated() -> u32 { 42 }
|
||||
pub const unsafe fn bar2_gated() -> u32 { 42 }
|
||||
|
||||
// @has 'foo/fn.bar_not_gated.html' '//pre' 'pub const unsafe fn bar_not_gated() -> u32'
|
||||
// @!has - '//span[@class="since"]'
|
||||
// @!hasraw - '//span[@class="since"]'
|
||||
pub const unsafe fn bar_not_gated() -> u32 { 42 }
|
||||
|
||||
pub struct Foo;
|
||||
|
@ -5,8 +5,8 @@ pub struct Foo0;
|
||||
|
||||
impl Foo0 {
|
||||
// @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.1: fn_with_doc'
|
||||
// @has - 'fn_with_doc short'
|
||||
// @has - 'fn_with_doc full'
|
||||
// @hasraw - 'fn_with_doc short'
|
||||
// @hasraw - 'fn_with_doc full'
|
||||
/// fn_with_doc short
|
||||
///
|
||||
/// fn_with_doc full
|
||||
@ -52,8 +52,8 @@ pub struct Foo1;
|
||||
|
||||
impl Bar for Foo1 {
|
||||
// @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.3: fn_empty_with_doc'
|
||||
// @has - 'fn_empty_with_doc_impl short'
|
||||
// @has - 'fn_empty_with_doc_impl full'
|
||||
// @hasraw - 'fn_empty_with_doc_impl short'
|
||||
// @hasraw - 'fn_empty_with_doc_impl full'
|
||||
/// fn_empty_with_doc_impl short
|
||||
///
|
||||
/// fn_empty_with_doc_impl full
|
||||
@ -63,8 +63,8 @@ impl Bar for Foo1 {
|
||||
fn fn_empty_without_doc() {}
|
||||
|
||||
// @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.5: fn_def_with_doc'
|
||||
// @has - 'fn_def_with_doc_impl short'
|
||||
// @has - 'fn_def_with_doc_impl full'
|
||||
// @hasraw - 'fn_def_with_doc_impl short'
|
||||
// @hasraw - 'fn_def_with_doc_impl full'
|
||||
/// fn_def_with_doc_impl short
|
||||
///
|
||||
/// fn_def_with_doc_impl full
|
||||
@ -74,8 +74,8 @@ impl Bar for Foo1 {
|
||||
fn fn_def_without_doc() {}
|
||||
|
||||
// @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.7: fn_def_def_with_doc'
|
||||
// @has - 'fn_def_def_with_doc short'
|
||||
// @!has - 'fn_def_def_with_doc full'
|
||||
// @hasraw - 'fn_def_def_with_doc short'
|
||||
// @!hasraw - 'fn_def_def_with_doc full'
|
||||
|
||||
// @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.8: fn_def_def_without_doc'
|
||||
}
|
||||
@ -85,34 +85,34 @@ pub struct Foo2;
|
||||
|
||||
impl Bar for Foo2 {
|
||||
// @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.3: fn_empty_with_doc'
|
||||
// @has - 'fn_empty_with_doc short'
|
||||
// @!has - 'fn_empty_with_doc full'
|
||||
// @hasraw - 'fn_empty_with_doc short'
|
||||
// @!hasraw - 'fn_empty_with_doc full'
|
||||
fn fn_empty_with_doc() {}
|
||||
|
||||
// @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.4: fn_empty_without_doc'
|
||||
// @has - 'fn_empty_without_doc_impl short'
|
||||
// @has - 'fn_empty_without_doc_impl full'
|
||||
// @hasraw - 'fn_empty_without_doc_impl short'
|
||||
// @hasraw - 'fn_empty_without_doc_impl full'
|
||||
/// fn_empty_without_doc_impl short
|
||||
///
|
||||
/// fn_empty_without_doc_impl full
|
||||
fn fn_empty_without_doc() {}
|
||||
|
||||
// @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.5: fn_def_with_doc'
|
||||
// @has - 'fn_def_with_doc short'
|
||||
// @!has - 'fn_def_with_doc full'
|
||||
// @hasraw - 'fn_def_with_doc short'
|
||||
// @!hasraw - 'fn_def_with_doc full'
|
||||
fn fn_def_with_doc() {}
|
||||
|
||||
// @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.6: fn_def_without_doc'
|
||||
// @has - 'fn_def_without_doc_impl short'
|
||||
// @has - 'fn_def_without_doc_impl full'
|
||||
// @hasraw - 'fn_def_without_doc_impl short'
|
||||
// @hasraw - 'fn_def_without_doc_impl full'
|
||||
/// fn_def_without_doc_impl short
|
||||
///
|
||||
/// fn_def_without_doc_impl full
|
||||
fn fn_def_without_doc() {}
|
||||
|
||||
// @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.7: fn_def_def_with_doc'
|
||||
// @has - 'fn_def_def_with_doc short'
|
||||
// @!has - 'fn_def_def_with_doc full'
|
||||
// @hasraw - 'fn_def_def_with_doc short'
|
||||
// @!hasraw - 'fn_def_def_with_doc full'
|
||||
|
||||
// @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.8: fn_def_def_without_doc'
|
||||
}
|
||||
|
@ -11,33 +11,33 @@ pub struct Ref<'a>(&'a u32);
|
||||
type ARef<'a> = Ref<'a>;
|
||||
|
||||
// @has foo/fn.test1.html
|
||||
// @matches - "Ref</a><'_>"
|
||||
// @matchesraw - "Ref</a><'_>"
|
||||
pub fn test1(a: &u32) -> Ref {
|
||||
Ref(a)
|
||||
}
|
||||
|
||||
// @has foo/fn.test2.html
|
||||
// @matches - "Ref</a><'_>"
|
||||
// @matchesraw - "Ref</a><'_>"
|
||||
pub fn test2(a: &u32) -> Ref<'_> {
|
||||
Ref(a)
|
||||
}
|
||||
|
||||
// @has foo/fn.test3.html
|
||||
// @matches - "Ref</a><'_>"
|
||||
// @matchesraw - "Ref</a><'_>"
|
||||
pub fn test3(a: &u32) -> ARef {
|
||||
Ref(a)
|
||||
}
|
||||
|
||||
// @has foo/fn.test4.html
|
||||
// @matches - "Ref</a><'_>"
|
||||
// @matchesraw - "Ref</a><'_>"
|
||||
pub fn test4(a: &u32) -> ARef<'_> {
|
||||
Ref(a)
|
||||
}
|
||||
|
||||
// Ensure external paths in inlined docs also display elided lifetime
|
||||
// @has foo/bar/fn.test5.html
|
||||
// @matches - "Ref</a><'_>"
|
||||
// @matchesraw - "Ref</a><'_>"
|
||||
// @has foo/bar/fn.test6.html
|
||||
// @matches - "Ref</a><'_>"
|
||||
// @matchesraw - "Ref</a><'_>"
|
||||
#[doc(inline)]
|
||||
pub extern crate bar;
|
||||
|
@ -1,16 +1,16 @@
|
||||
// compile-flags: --document-private-items
|
||||
|
||||
// @has 'empty_mod_private/index.html' '//a[@href="foo/index.html"]' 'foo'
|
||||
// @has 'empty_mod_private/sidebar-items.js' 'foo'
|
||||
// @hasraw 'empty_mod_private/sidebar-items.js' 'foo'
|
||||
// @matches 'empty_mod_private/foo/index.html' '//h1' 'Module empty_mod_private::foo'
|
||||
mod foo {}
|
||||
|
||||
// @has 'empty_mod_private/index.html' '//a[@href="bar/index.html"]' 'bar'
|
||||
// @has 'empty_mod_private/sidebar-items.js' 'bar'
|
||||
// @hasraw 'empty_mod_private/sidebar-items.js' 'bar'
|
||||
// @matches 'empty_mod_private/bar/index.html' '//h1' 'Module empty_mod_private::bar'
|
||||
mod bar {
|
||||
// @has 'empty_mod_private/bar/index.html' '//a[@href="baz/index.html"]' 'baz'
|
||||
// @has 'empty_mod_private/bar/sidebar-items.js' 'baz'
|
||||
// @hasraw 'empty_mod_private/bar/sidebar-items.js' 'baz'
|
||||
// @matches 'empty_mod_private/bar/baz/index.html' '//h1' 'Module empty_mod_private::bar::baz'
|
||||
mod baz {}
|
||||
}
|
||||
|
@ -1,14 +1,14 @@
|
||||
// @has 'empty_mod_public/index.html' '//a[@href="foo/index.html"]' 'foo'
|
||||
// @has 'empty_mod_public/sidebar-items.js' 'foo'
|
||||
// @hasraw 'empty_mod_public/sidebar-items.js' 'foo'
|
||||
// @matches 'empty_mod_public/foo/index.html' '//h1' 'Module empty_mod_public::foo'
|
||||
pub mod foo {}
|
||||
|
||||
// @has 'empty_mod_public/index.html' '//a[@href="bar/index.html"]' 'bar'
|
||||
// @has 'empty_mod_public/sidebar-items.js' 'bar'
|
||||
// @hasraw 'empty_mod_public/sidebar-items.js' 'bar'
|
||||
// @matches 'empty_mod_public/bar/index.html' '//h1' 'Module empty_mod_public::bar'
|
||||
pub mod bar {
|
||||
// @has 'empty_mod_public/bar/index.html' '//a[@href="baz/index.html"]' 'baz'
|
||||
// @has 'empty_mod_public/bar/sidebar-items.js' 'baz'
|
||||
// @hasraw 'empty_mod_public/bar/sidebar-items.js' 'baz'
|
||||
// @matches 'empty_mod_public/bar/baz/index.html' '//h1' 'Module empty_mod_public::bar::baz'
|
||||
pub mod baz {}
|
||||
}
|
||||
|
@ -5,7 +5,7 @@
|
||||
pub struct Foo;
|
||||
|
||||
// @has foo/struct.Foo.html
|
||||
// @!has - 'Auto Trait Implementations'
|
||||
// @!hasraw - 'Auto Trait Implementations'
|
||||
impl !Send for Foo {}
|
||||
impl !Sync for Foo {}
|
||||
impl !std::marker::Unpin for Foo {}
|
||||
|
@ -8,6 +8,6 @@ pub trait Trait {
|
||||
// Make sure that the elided lifetime shows up
|
||||
|
||||
// @has foo/type.T.html
|
||||
// @has - "pub type T = "
|
||||
// @has - "<'_>"
|
||||
// @hasraw - "pub type T = "
|
||||
// @hasraw - "<'_>"
|
||||
pub type T = fn(&<() as Trait>::Gat<'_>);
|
||||
|
@ -11,7 +11,7 @@ pub mod __hidden {
|
||||
}
|
||||
|
||||
// @has foo/trait.Clone.html
|
||||
// @!has - 'Foo'
|
||||
// @!hasraw - 'Foo'
|
||||
// @has implementors/core/clone/trait.Clone.js
|
||||
// @!has - 'Foo'
|
||||
// @!hasraw - 'Foo'
|
||||
pub use std::clone::Clone;
|
||||
|
@ -15,5 +15,5 @@
|
||||
/// ```
|
||||
pub fn foo() {}
|
||||
|
||||
// @!has hidden_line/fn.foo.html invisible
|
||||
// @!hasraw hidden_line/fn.foo.html invisible
|
||||
// @matches - //pre "#\[derive\(PartialEq\)\] // Bar"
|
||||
|
@ -17,13 +17,13 @@ pub mod hidden {
|
||||
}
|
||||
|
||||
// @has foo/struct.Foo.html
|
||||
// @!has - 'Methods'
|
||||
// @!hasraw - 'Methods'
|
||||
// @!has - '//code' 'impl Foo'
|
||||
// @!has - 'this_should_be_hidden'
|
||||
// @!hasraw - 'this_should_be_hidden'
|
||||
pub use hidden::Foo;
|
||||
|
||||
// @has foo/struct.Bar.html
|
||||
// @!has - 'Methods'
|
||||
// @!hasraw - 'Methods'
|
||||
// @!has - '//code' 'impl Bar'
|
||||
// @!has - 'this_should_be_hidden'
|
||||
// @!hasraw - 'this_should_be_hidden'
|
||||
pub use hidden::Bar;
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
extern crate unstable_trait;
|
||||
|
||||
// @has foo/struct.Foo.html 'bar'
|
||||
// @has foo/struct.Foo.html 'bar2'
|
||||
// @hasraw foo/struct.Foo.html 'bar'
|
||||
// @hasraw foo/struct.Foo.html 'bar2'
|
||||
#[doc(inline)]
|
||||
pub use unstable_trait::Foo;
|
||||
|
@ -12,9 +12,9 @@ pub struct Bar<T> { t: T }
|
||||
// full impl string. Instead, just make sure something from each part
|
||||
// is mentioned.
|
||||
|
||||
// @has implementors/rustdoc_impl_parts_crosscrate/trait.AnAutoTrait.js Bar
|
||||
// @has - Send
|
||||
// @has - !AnAutoTrait
|
||||
// @has - Copy
|
||||
// @hasraw implementors/rustdoc_impl_parts_crosscrate/trait.AnAutoTrait.js Bar
|
||||
// @hasraw - Send
|
||||
// @hasraw - !AnAutoTrait
|
||||
// @hasraw - Copy
|
||||
impl<T: Send> !rustdoc_impl_parts_crosscrate::AnAutoTrait for Bar<T>
|
||||
where T: Copy {}
|
||||
|
@ -3,11 +3,11 @@
|
||||
trait MyTrait {}
|
||||
impl MyTrait for i32 {}
|
||||
|
||||
// @has impl_trait_alias/type.Foo.html 'Foo'
|
||||
// @hasraw impl_trait_alias/type.Foo.html 'Foo'
|
||||
/// debug type
|
||||
pub type Foo = impl MyTrait;
|
||||
|
||||
// @has impl_trait_alias/fn.foo.html 'foo'
|
||||
// @hasraw impl_trait_alias/fn.foo.html 'foo'
|
||||
/// debug function
|
||||
pub fn foo() -> Foo {
|
||||
1
|
||||
|
@ -4,6 +4,6 @@ extern crate inner;
|
||||
|
||||
|
||||
// @has add_docs/struct.MyStruct.html
|
||||
// @has add_docs/struct.MyStruct.html "Doc comment from ‘pub use’, Doc comment from definition"
|
||||
// @hasraw add_docs/struct.MyStruct.html "Doc comment from ‘pub use’, Doc comment from definition"
|
||||
/// Doc comment from 'pub use',
|
||||
pub use inner::MyStruct;
|
||||
|
@ -7,10 +7,10 @@
|
||||
extern crate assoc_items;
|
||||
|
||||
// @has foo/struct.MyStruct.html
|
||||
// @!has - 'PrivateConst'
|
||||
// @!hasraw - 'PrivateConst'
|
||||
// @has - '//*[@id="associatedconstant.PublicConst"]' 'pub const PublicConst: u8'
|
||||
// @has - '//*[@class="docblock"]' 'docs for PublicConst'
|
||||
// @!has - 'private_method'
|
||||
// @!hasraw - 'private_method'
|
||||
// @has - '//*[@id="method.public_method"]' 'pub fn public_method()'
|
||||
// @has - '//*[@class="docblock"]' 'docs for public_method'
|
||||
// @has - '//*[@id="associatedconstant.ConstNoDefault"]' 'const ConstNoDefault: i16'
|
||||
|
@ -5,8 +5,8 @@
|
||||
extern crate rustdoc_hidden;
|
||||
|
||||
// @has hidden_use/index.html
|
||||
// @!has - 'rustdoc_hidden'
|
||||
// @!has - 'Bar'
|
||||
// @!hasraw - 'rustdoc_hidden'
|
||||
// @!hasraw - 'Bar'
|
||||
// @!has hidden_use/struct.Bar.html
|
||||
#[doc(hidden)]
|
||||
pub use rustdoc_hidden::Bar;
|
||||
|
@ -12,25 +12,25 @@ extern crate some_macros;
|
||||
// @has proc_macro/derive.SomeDerive.html
|
||||
|
||||
// @has proc_macro/macro.some_proc_macro.html
|
||||
// @has - 'a proc-macro that swallows its input and does nothing.'
|
||||
// @hasraw - 'a proc-macro that swallows its input and does nothing.'
|
||||
pub use some_macros::some_proc_macro;
|
||||
|
||||
// @has proc_macro/macro.reexported_macro.html
|
||||
// @has - 'Doc comment from the original crate'
|
||||
// @hasraw - 'Doc comment from the original crate'
|
||||
pub use some_macros::reexported_macro;
|
||||
|
||||
// @has proc_macro/attr.some_proc_attr.html
|
||||
// @has - 'a proc-macro attribute that passes its item through verbatim.'
|
||||
// @hasraw - 'a proc-macro attribute that passes its item through verbatim.'
|
||||
pub use some_macros::some_proc_attr;
|
||||
|
||||
// @has proc_macro/derive.SomeDerive.html
|
||||
// @has - 'a derive attribute that adds nothing to its input.'
|
||||
// @hasraw - 'a derive attribute that adds nothing to its input.'
|
||||
pub use some_macros::SomeDerive;
|
||||
|
||||
// @has proc_macro/attr.first_attr.html
|
||||
// @has - 'Generated doc comment'
|
||||
// @hasraw - 'Generated doc comment'
|
||||
pub use some_macros::first_attr;
|
||||
|
||||
// @has proc_macro/attr.second_attr.html
|
||||
// @has - 'Generated doc comment'
|
||||
// @hasraw - 'Generated doc comment'
|
||||
pub use some_macros::second_attr;
|
||||
|
@ -12,14 +12,14 @@ mod mod1 {
|
||||
pub use mod1::*;
|
||||
|
||||
// @has foo/index.html
|
||||
// @has - "mod1"
|
||||
// @has - "public_fn"
|
||||
// @!has - "private_fn"
|
||||
// @hasraw - "mod1"
|
||||
// @hasraw - "public_fn"
|
||||
// @!hasraw - "private_fn"
|
||||
// @has foo/fn.public_fn.html
|
||||
// @!has foo/fn.private_fn.html
|
||||
|
||||
// @has foo/mod1/index.html
|
||||
// @has - "public_fn"
|
||||
// @has - "private_fn"
|
||||
// @hasraw - "public_fn"
|
||||
// @hasraw - "private_fn"
|
||||
// @has foo/mod1/fn.public_fn.html
|
||||
// @has foo/mod1/fn.private_fn.html
|
||||
|
@ -10,9 +10,9 @@ mod mod1 {
|
||||
pub use mod1::*;
|
||||
|
||||
// @has foo/index.html
|
||||
// @!has - "mod1"
|
||||
// @has - "public_fn"
|
||||
// @!has - "private_fn"
|
||||
// @!hasraw - "mod1"
|
||||
// @hasraw - "public_fn"
|
||||
// @!hasraw - "private_fn"
|
||||
// @has foo/fn.public_fn.html
|
||||
// @!has foo/fn.private_fn.html
|
||||
|
||||
|
@ -15,31 +15,31 @@ mod mod1 {
|
||||
pub use mod1::*;
|
||||
|
||||
// @has foo/index.html
|
||||
// @has - "mod1"
|
||||
// @has - "Mod1Public"
|
||||
// @!has - "Mod1Private"
|
||||
// @!has - "mod2"
|
||||
// @has - "Mod2Public"
|
||||
// @!has - "Mod2Private"
|
||||
// @hasraw - "mod1"
|
||||
// @hasraw - "Mod1Public"
|
||||
// @!hasraw - "Mod1Private"
|
||||
// @!hasraw - "mod2"
|
||||
// @hasraw - "Mod2Public"
|
||||
// @!hasraw - "Mod2Private"
|
||||
// @has foo/struct.Mod1Public.html
|
||||
// @!has foo/struct.Mod1Private.html
|
||||
// @has foo/struct.Mod2Public.html
|
||||
// @!has foo/struct.Mod2Private.html
|
||||
|
||||
// @has foo/mod1/index.html
|
||||
// @has - "mod2"
|
||||
// @has - "Mod1Public"
|
||||
// @has - "Mod1Private"
|
||||
// @!has - "Mod2Public"
|
||||
// @!has - "Mod2Private"
|
||||
// @hasraw - "mod2"
|
||||
// @hasraw - "Mod1Public"
|
||||
// @hasraw - "Mod1Private"
|
||||
// @!hasraw - "Mod2Public"
|
||||
// @!hasraw - "Mod2Private"
|
||||
// @has foo/mod1/struct.Mod1Public.html
|
||||
// @has foo/mod1/struct.Mod1Private.html
|
||||
// @!has foo/mod1/struct.Mod2Public.html
|
||||
// @!has foo/mod1/struct.Mod2Private.html
|
||||
|
||||
// @has foo/mod1/mod2/index.html
|
||||
// @has - "Mod2Public"
|
||||
// @has - "Mod2Private"
|
||||
// @hasraw - "Mod2Public"
|
||||
// @hasraw - "Mod2Private"
|
||||
// @has foo/mod1/mod2/struct.Mod2Public.html
|
||||
// @has foo/mod1/mod2/struct.Mod2Private.html
|
||||
|
||||
|
@ -13,12 +13,12 @@ mod mod1 {
|
||||
pub use mod1::*;
|
||||
|
||||
// @has foo/index.html
|
||||
// @!has - "mod1"
|
||||
// @has - "Mod1Public"
|
||||
// @!has - "Mod1Private"
|
||||
// @!has - "mod2"
|
||||
// @has - "Mod2Public"
|
||||
// @!has - "Mod2Private"
|
||||
// @!hasraw - "mod1"
|
||||
// @hasraw - "Mod1Public"
|
||||
// @!hasraw - "Mod1Private"
|
||||
// @!hasraw - "mod2"
|
||||
// @hasraw - "Mod2Public"
|
||||
// @!hasraw - "Mod2Private"
|
||||
// @has foo/struct.Mod1Public.html
|
||||
// @!has foo/struct.Mod1Private.html
|
||||
// @has foo/struct.Mod2Public.html
|
||||
|
@ -3,8 +3,8 @@ mod private {
|
||||
}
|
||||
|
||||
// @has hidden_use/index.html
|
||||
// @!has - 'private'
|
||||
// @!has - 'Foo'
|
||||
// @!hasraw - 'private'
|
||||
// @!hasraw - 'Foo'
|
||||
// @!has hidden_use/struct.Foo.html
|
||||
#[doc(hidden)]
|
||||
pub use private::Foo;
|
||||
|
@ -7,7 +7,7 @@ macro_rules! foo {
|
||||
|
||||
// @has macro_by_example/macros/index.html
|
||||
pub mod macros {
|
||||
// @!has - 'pub use foo as bar;'
|
||||
// @!hasraw - 'pub use foo as bar;'
|
||||
// @has macro_by_example/macros/macro.bar.html
|
||||
// @has - '//*[@class="docblock"]' 'docs for foo'
|
||||
// @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.2.3: text'
|
||||
|
@ -4,7 +4,7 @@ pub mod foo {
|
||||
|
||||
// @has please_inline/a/index.html
|
||||
pub mod a {
|
||||
// @!has - 'pub use foo::'
|
||||
// @!hasraw - 'pub use foo::'
|
||||
// @has please_inline/a/struct.Foo.html
|
||||
#[doc(inline)]
|
||||
pub use foo::Foo;
|
||||
@ -12,7 +12,7 @@ pub mod a {
|
||||
|
||||
// @has please_inline/b/index.html
|
||||
pub mod b {
|
||||
// @has - 'pub use foo::'
|
||||
// @hasraw - 'pub use foo::'
|
||||
// @!has please_inline/b/struct.Foo.html
|
||||
#[feature(inline)]
|
||||
pub use foo::Foo;
|
||||
|
@ -3,13 +3,15 @@
|
||||
// Check that the unstable marker is not added for "rustc_private".
|
||||
|
||||
// @!matches internal/index.html \
|
||||
// '//*[@class="item-right docblock-short"]/span[@class="stab unstable"]'
|
||||
// '//*[@class="item-right docblock-short"]/span[@class="stab unstable"]' \
|
||||
// ''
|
||||
// @!matches internal/index.html \
|
||||
// '//*[@class="item-right docblock-short"]/span[@class="stab internal"]'
|
||||
// '//*[@class="item-right docblock-short"]/span[@class="stab internal"]' \
|
||||
// ''
|
||||
// @matches - '//*[@class="item-right docblock-short"]' 'Docs'
|
||||
|
||||
// @!has internal/struct.S.html '//*[@class="stab unstable"]'
|
||||
// @!has internal/struct.S.html '//*[@class="stab internal"]'
|
||||
// @!has internal/struct.S.html '//*[@class="stab unstable"]' ''
|
||||
// @!has internal/struct.S.html '//*[@class="stab internal"]' ''
|
||||
/// Docs
|
||||
pub struct S;
|
||||
|
||||
|
@ -25,11 +25,11 @@ impl G<usize> for ExternType {
|
||||
}
|
||||
|
||||
// @has 'extern_type/foreigntype.ExternType.html'
|
||||
// @has 'extern_type/fn.links_to_extern_type.html' \
|
||||
// @hasraw 'extern_type/fn.links_to_extern_type.html' \
|
||||
// 'href="foreigntype.ExternType.html#method.f"'
|
||||
// @has 'extern_type/fn.links_to_extern_type.html' \
|
||||
// @hasraw 'extern_type/fn.links_to_extern_type.html' \
|
||||
// 'href="foreigntype.ExternType.html#method.test"'
|
||||
// @has 'extern_type/fn.links_to_extern_type.html' \
|
||||
// @hasraw 'extern_type/fn.links_to_extern_type.html' \
|
||||
// 'href="foreigntype.ExternType.html#method.g"'
|
||||
/// See also [ExternType::f]
|
||||
/// See also [ExternType::test]
|
||||
|
@ -1,6 +1,6 @@
|
||||
pub struct Foo;
|
||||
|
||||
// @has issue_16265_1/traits/index.html 'source'
|
||||
// @hasraw issue_16265_1/traits/index.html 'source'
|
||||
pub mod traits {
|
||||
impl PartialEq for super::Foo {
|
||||
fn eq(&self, _: &super::Foo) -> bool {
|
||||
|
@ -1,4 +1,4 @@
|
||||
// @has issue_16265_2/index.html 'source'
|
||||
// @hasraw issue_16265_2/index.html 'source'
|
||||
|
||||
trait Y {}
|
||||
impl Y for Option<u32> {}
|
||||
|
@ -6,7 +6,7 @@ pub mod str {
|
||||
#![doc(primitive = "str")]
|
||||
|
||||
impl str {
|
||||
// @has search-index.js foo
|
||||
// @hasraw search-index.js foo
|
||||
#[rustc_allow_incoherent_impl]
|
||||
pub fn foo(&self) {}
|
||||
}
|
||||
|
@ -16,10 +16,10 @@ doc! {
|
||||
}
|
||||
|
||||
// @has issue_23812/Foo/index.html
|
||||
// @has - 'Outer comment'
|
||||
// @!has - '/// Outer comment'
|
||||
// @has - 'Inner comment'
|
||||
// @!has - '//! Inner comment'
|
||||
// @hasraw - 'Outer comment'
|
||||
// @!hasraw - '/// Outer comment'
|
||||
// @hasraw - 'Inner comment'
|
||||
// @!hasraw - '//! Inner comment'
|
||||
|
||||
|
||||
doc! {
|
||||
@ -30,7 +30,7 @@ doc! {
|
||||
}
|
||||
|
||||
// @has issue_23812/Bar/index.html
|
||||
// @has - 'Outer block comment'
|
||||
// @!has - '/** Outer block comment */'
|
||||
// @has - 'Inner block comment'
|
||||
// @!has - '/*! Inner block comment */'
|
||||
// @hasraw - 'Outer block comment'
|
||||
// @!hasraw - '/** Outer block comment */'
|
||||
// @hasraw - 'Inner block comment'
|
||||
// @!hasraw - '/*! Inner block comment */'
|
||||
|
@ -3,8 +3,8 @@
|
||||
// ignore-cross-compile
|
||||
|
||||
// @has issue_27104/index.html
|
||||
// @!has - 'extern crate std'
|
||||
// @!has - 'use std::prelude::'
|
||||
// @!hasraw - 'extern crate std'
|
||||
// @!hasraw - 'use std::prelude::'
|
||||
|
||||
// @has - 'pub extern crate empty'
|
||||
// @hasraw - 'pub extern crate empty'
|
||||
pub extern crate empty;
|
||||
|
@ -4,11 +4,11 @@
|
||||
#![unstable(feature="test", issue="27759")]
|
||||
|
||||
// @has issue_27759/unstable/index.html
|
||||
// @has - '<code>test</code> <a href="http://issue_url/27759">#27759</a>'
|
||||
// @hasraw - '<code>test</code> <a href="http://issue_url/27759">#27759</a>'
|
||||
#[unstable(feature="test", issue="27759")]
|
||||
pub mod unstable {
|
||||
// @has issue_27759/unstable/fn.issue.html
|
||||
// @has - '<code>test_function</code> <a href="http://issue_url/12345">#12345</a>'
|
||||
// @hasraw - '<code>test_function</code> <a href="http://issue_url/12345">#12345</a>'
|
||||
#[unstable(feature="test_function", issue="12345")]
|
||||
pub fn issue() {}
|
||||
}
|
||||
|
@ -4,5 +4,5 @@
|
||||
extern crate issue_29584;
|
||||
|
||||
// @has issue_29584/struct.Foo.html
|
||||
// @!has - 'impl Bar for'
|
||||
// @!hasraw - 'impl Bar for'
|
||||
pub use issue_29584::Foo;
|
||||
|
@ -1,8 +1,8 @@
|
||||
// @has issue_31899/index.html
|
||||
// @has - 'Make this line a bit longer.'
|
||||
// @!has - 'rust rust-example-rendered'
|
||||
// @!has - 'use ndarray::arr2'
|
||||
// @!has - 'prohibited'
|
||||
// @hasraw - 'Make this line a bit longer.'
|
||||
// @!hasraw - 'rust rust-example-rendered'
|
||||
// @!hasraw - 'use ndarray::arr2'
|
||||
// @!hasraw - 'prohibited'
|
||||
|
||||
/// A tuple or fixed size array that can be used to index an array.
|
||||
/// Make this line a bit longer.
|
||||
|
@ -10,7 +10,7 @@
|
||||
|
||||
// @has issue_32374/struct.T.html '//*[@class="stab deprecated"]' \
|
||||
// '👎 Deprecated since 1.0.0: text'
|
||||
// @has - '<code>test</code> <a href="https://issue_url/32374">#32374</a>'
|
||||
// @hasraw - '<code>test</code> <a href="https://issue_url/32374">#32374</a>'
|
||||
// @matches issue_32374/struct.T.html '//*[@class="stab unstable"]' \
|
||||
// '🔬 This is a nightly-only experimental API. \(test\s#32374\)$'
|
||||
/// Docs
|
||||
|
@ -3,13 +3,13 @@
|
||||
// ignore-cross-compile
|
||||
|
||||
// @has variant_struct/enum.Foo.html
|
||||
// @!has - 'pub qux'
|
||||
// @!has - 'pub(crate) qux'
|
||||
// @!has - 'pub Bar'
|
||||
// @!hasraw - 'pub qux'
|
||||
// @!hasraw - 'pub(crate) qux'
|
||||
// @!hasraw - 'pub Bar'
|
||||
extern crate variant_struct;
|
||||
|
||||
// @has issue_32395/enum.Foo.html
|
||||
// @!has - 'pub qux'
|
||||
// @!has - 'pub(crate) qux'
|
||||
// @!has - 'pub Bar'
|
||||
// @!hasraw - 'pub qux'
|
||||
// @!hasraw - 'pub(crate) qux'
|
||||
// @!hasraw - 'pub Bar'
|
||||
pub use variant_struct::Foo;
|
||||
|
@ -5,7 +5,7 @@ mod second {
|
||||
}
|
||||
|
||||
// @has foo/index.html
|
||||
// @!has - SomeTypeWithLongName
|
||||
// @!hasraw - SomeTypeWithLongName
|
||||
// @has foo/struct.SomeType.html
|
||||
// @!has foo/struct.SomeTypeWithLongName.html
|
||||
pub use second::{SomeTypeWithLongName as SomeType};
|
||||
|
@ -1,11 +1,11 @@
|
||||
// @has issue_41783/struct.Foo.html
|
||||
// @!has - 'space'
|
||||
// @!has - 'comment'
|
||||
// @has - '# <span class="ident">single'
|
||||
// @has - '## <span class="ident">double</span>'
|
||||
// @has - '### <span class="ident">triple</span>'
|
||||
// @has - '<span class="attribute">#[<span class="ident">outer</span>]</span>'
|
||||
// @has - '<span class="attribute">#![<span class="ident">inner</span>]</span>'
|
||||
// @!hasraw - 'space'
|
||||
// @!hasraw - 'comment'
|
||||
// @hasraw - '# <span class="ident">single'
|
||||
// @hasraw - '## <span class="ident">double</span>'
|
||||
// @hasraw - '### <span class="ident">triple</span>'
|
||||
// @hasraw - '<span class="attribute">#[<span class="ident">outer</span>]</span>'
|
||||
// @hasraw - '<span class="attribute">#![<span class="ident">inner</span>]</span>'
|
||||
|
||||
/// ```no_run
|
||||
/// # # space
|
||||
|
@ -5,7 +5,7 @@
|
||||
extern crate issue_53689;
|
||||
|
||||
// @has foo/trait.MyTrait.html
|
||||
// @!has - 'MyStruct'
|
||||
// @!hasraw - 'MyStruct'
|
||||
// @count - '//*[h3="impl<T> MyTrait for T"]' 1
|
||||
pub trait MyTrait {}
|
||||
|
||||
|
@ -5,11 +5,11 @@ extern crate foo;
|
||||
// @has issue_61592/index.html
|
||||
// @has - '//a[@href="#reexports"]' 'Re-exports'
|
||||
// @has - '//code' 'pub use foo::FooTrait as _;'
|
||||
// @!has - '//a[@href="trait._.html"]'
|
||||
// @!has - '//a[@href="trait._.html"]' ''
|
||||
pub use foo::FooTrait as _;
|
||||
|
||||
// @has issue_61592/index.html
|
||||
// @has - '//a[@href="#reexports"]' 'Re-exports'
|
||||
// @has - '//code' 'pub use foo::FooStruct as _;'
|
||||
// @!has - '//a[@href="struct._.html"]'
|
||||
// @!has - '//a[@href="struct._.html"]' ''
|
||||
pub use foo::FooStruct as _;
|
||||
|
@ -3,8 +3,8 @@
|
||||
#![no_core]
|
||||
#![feature(no_core)]
|
||||
|
||||
// @matches 'issue_89852/sidebar-items.js' '"repro"'
|
||||
// @!matches 'issue_89852/sidebar-items.js' '"repro".*"repro"'
|
||||
// @matchesraw 'issue_89852/sidebar-items.js' '"repro"'
|
||||
// @!matchesraw 'issue_89852/sidebar-items.js' '"repro".*"repro"'
|
||||
|
||||
#[macro_export]
|
||||
macro_rules! repro {
|
||||
|
@ -6,4 +6,4 @@
|
||||
//!
|
||||
//! [foo]: url 'title & <stuff> & "things"'
|
||||
|
||||
// @has 'foo/index.html' 'title & <stuff> & "things"'
|
||||
// @hasraw 'foo/index.html' 'title & <stuff> & "things"'
|
||||
|
@ -10,15 +10,15 @@
|
||||
//
|
||||
// compile-flags: --document-private-items
|
||||
|
||||
// @has macro_document_private_duplicate/index.html 'Doc 1.'
|
||||
// @has macro_document_private_duplicate/macro.a_macro.html 'Doc 1.'
|
||||
// @hasraw macro_document_private_duplicate/index.html 'Doc 1.'
|
||||
// @hasraw macro_document_private_duplicate/macro.a_macro.html 'Doc 1.'
|
||||
/// Doc 1.
|
||||
macro_rules! a_macro {
|
||||
() => ()
|
||||
}
|
||||
|
||||
// @has macro_document_private_duplicate/index.html 'Doc 2.'
|
||||
// @!has macro_document_private_duplicate/macro.a_macro.html 'Doc 2.'
|
||||
// @hasraw macro_document_private_duplicate/index.html 'Doc 2.'
|
||||
// @!hasraw macro_document_private_duplicate/macro.a_macro.html 'Doc 2.'
|
||||
/// Doc 2.
|
||||
macro_rules! a_macro {
|
||||
() => ()
|
||||
|
@ -6,13 +6,13 @@
|
||||
// This is a regression text for issue #88453.
|
||||
#![feature(decl_macro)]
|
||||
|
||||
// @!has macro_private_not_documented/index.html 'a_macro'
|
||||
// @!hasraw macro_private_not_documented/index.html 'a_macro'
|
||||
// @!has macro_private_not_documented/macro.a_macro.html
|
||||
macro_rules! a_macro {
|
||||
() => ()
|
||||
}
|
||||
|
||||
// @!has macro_private_not_documented/index.html 'another_macro'
|
||||
// @!hasraw macro_private_not_documented/index.html 'another_macro'
|
||||
// @!has macro_private_not_documented/macro.another_macro.html
|
||||
macro another_macro {
|
||||
() => ()
|
||||
|
@ -7,27 +7,27 @@
|
||||
// @has - '//span[@class="macro"]' 'macro_rules!'
|
||||
// @has - '//span[@class="ident"]' 'todo'
|
||||
|
||||
// @has - '{ () => { ... }; ($('
|
||||
// @hasraw - '{ () => { ... }; ($('
|
||||
// @has - '//span[@class="macro-nonterminal"]' '$'
|
||||
// @has - '//span[@class="macro-nonterminal"]' 'arg'
|
||||
// @has - ':'
|
||||
// @hasraw - ':'
|
||||
// @has - '//span[@class="ident"]' 'tt'
|
||||
// @has - ')+'
|
||||
// @has - ') => { ... }; }'
|
||||
// @hasraw - ')+'
|
||||
// @hasraw - ') => { ... }; }'
|
||||
pub use std::todo;
|
||||
|
||||
mod mod1 {
|
||||
// @has 'foo/macro.macro1.html'
|
||||
// @has - 'macro_rules!'
|
||||
// @has - 'macro1'
|
||||
// @has - '{ () => { ... }; ($('
|
||||
// @hasraw - 'macro_rules!'
|
||||
// @hasraw - 'macro1'
|
||||
// @hasraw - '{ () => { ... }; ($('
|
||||
// @has - '//span[@class="macro-nonterminal"]' '$'
|
||||
// @has - '//span[@class="macro-nonterminal"]' 'arg'
|
||||
// @has - ':'
|
||||
// @has - 'expr'
|
||||
// @has - '),'
|
||||
// @has - '+'
|
||||
// @has - ') => { ... }; }'
|
||||
// @hasraw - ':'
|
||||
// @hasraw - 'expr'
|
||||
// @hasraw - '),'
|
||||
// @hasraw - '+'
|
||||
// @hasraw - ') => { ... }; }'
|
||||
#[macro_export]
|
||||
macro_rules! macro1 {
|
||||
() => {};
|
||||
|
@ -7,21 +7,21 @@
|
||||
//!
|
||||
//! [link]: https://example.com
|
||||
|
||||
// @has search-index.js 'This <em>summary</em> has a link and <code>code</code>.'
|
||||
// @!has - 'second paragraph'
|
||||
// @hasraw search-index.js 'This <em>summary</em> has a link and <code>code</code>.'
|
||||
// @!hasraw - 'second paragraph'
|
||||
|
||||
/// This `code` will be rendered in a code tag.
|
||||
///
|
||||
/// This text should not be rendered.
|
||||
pub struct Sidebar;
|
||||
|
||||
// @has search-index.js 'This <code>code</code> will be rendered in a code tag.'
|
||||
// @has summaries/sidebar-items.js 'This `code` will be rendered in a code tag.'
|
||||
// @!has - 'text should not be rendered'
|
||||
// @hasraw search-index.js 'This <code>code</code> will be rendered in a code tag.'
|
||||
// @hasraw summaries/sidebar-items.js 'This `code` will be rendered in a code tag.'
|
||||
// @!hasraw - 'text should not be rendered'
|
||||
|
||||
/// ```text
|
||||
/// this block should not be rendered
|
||||
/// ```
|
||||
pub struct Sidebar2;
|
||||
|
||||
// @!has summaries/sidebar-items.js 'block should not be rendered'
|
||||
// @!hasraw summaries/sidebar-items.js 'block should not be rendered'
|
||||
|
@ -7,24 +7,24 @@
|
||||
#[doc(masked)]
|
||||
extern crate masked;
|
||||
|
||||
// @!has 'search-index.js' 'masked_method'
|
||||
// @!hasraw 'search-index.js' 'masked_method'
|
||||
|
||||
// @!has 'foo/struct.String.html' 'MaskedTrait'
|
||||
// @!has 'foo/struct.String.html' 'masked_method'
|
||||
// @!hasraw 'foo/struct.String.html' 'MaskedTrait'
|
||||
// @!hasraw 'foo/struct.String.html' 'masked_method'
|
||||
pub use std::string::String;
|
||||
|
||||
// @!has 'foo/trait.Clone.html' 'MaskedStruct'
|
||||
// @!hasraw 'foo/trait.Clone.html' 'MaskedStruct'
|
||||
pub use std::clone::Clone;
|
||||
|
||||
// @!has 'foo/struct.MyStruct.html' 'MaskedTrait'
|
||||
// @!has 'foo/struct.MyStruct.html' 'masked_method'
|
||||
// @!hasraw 'foo/struct.MyStruct.html' 'MaskedTrait'
|
||||
// @!hasraw 'foo/struct.MyStruct.html' 'masked_method'
|
||||
pub struct MyStruct;
|
||||
|
||||
impl masked::MaskedTrait for MyStruct {
|
||||
fn masked_method() {}
|
||||
}
|
||||
|
||||
// @!has 'foo/trait.MyTrait.html' 'MaskedStruct'
|
||||
// @!hasraw 'foo/trait.MyTrait.html' 'MaskedStruct'
|
||||
pub trait MyTrait {}
|
||||
|
||||
impl MyTrait for masked::MaskedStruct {}
|
||||
|
@ -2,4 +2,4 @@
|
||||
|
||||
pub use std::marker::Send;
|
||||
|
||||
// @!has foo/index.html 'Implementations'
|
||||
// @!hasraw foo/index.html 'Implementations'
|
||||
|
@ -7,22 +7,22 @@ mod a_module {
|
||||
|
||||
pub mod a_nested_module {
|
||||
// @has aCrate/a_nested_module/index.html '//a[@href="fn.a_nested_public_function.html"]' 'a_nested_public_function'
|
||||
// @has aCrate/a_nested_module/fn.a_nested_public_function.html 'pub fn a_nested_public_function()'
|
||||
// @hasraw aCrate/a_nested_module/fn.a_nested_public_function.html 'pub fn a_nested_public_function()'
|
||||
pub fn a_nested_public_function() {}
|
||||
|
||||
// @has aCrate/a_nested_module/index.html '//a[@href="fn.another_nested_public_function.html"]' 'another_nested_public_function'
|
||||
// @has aCrate/a_nested_module/fn.another_nested_public_function.html 'pub fn another_nested_public_function()'
|
||||
// @hasraw aCrate/a_nested_module/fn.another_nested_public_function.html 'pub fn another_nested_public_function()'
|
||||
pub use a_nested_module::a_nested_public_function as another_nested_public_function;
|
||||
}
|
||||
|
||||
// @!has aCrate/a_nested_module/index.html 'yet_another_nested_public_function'
|
||||
// @!hasraw aCrate/a_nested_module/index.html 'yet_another_nested_public_function'
|
||||
pub use a_nested_module::a_nested_public_function as yet_another_nested_public_function;
|
||||
|
||||
// @!has aCrate/a_nested_module/index.html 'one_last_nested_public_function'
|
||||
// @!hasraw aCrate/a_nested_module/index.html 'one_last_nested_public_function'
|
||||
pub use a_nested_module::another_nested_public_function as one_last_nested_public_function;
|
||||
}
|
||||
|
||||
// @!has aCrate/index.html 'a_module'
|
||||
// @!hasraw aCrate/index.html 'a_module'
|
||||
// @has aCrate/index.html '//a[@href="a_nested_module/index.html"]' 'a_nested_module'
|
||||
pub use a_module::a_nested_module;
|
||||
|
||||
@ -36,7 +36,7 @@ pub use a_module::{
|
||||
};
|
||||
|
||||
// @has aCrate/index.html '//a[@href="fn.private_function.html"]' 'private_function'
|
||||
// @!has aCrate/fn.private_function.html 'a_module'
|
||||
// @!hasraw aCrate/fn.private_function.html 'a_module'
|
||||
// @has aCrate/index.html '//a[@href="fn.other_private_function.html"]' 'other_private_function'
|
||||
// @!has aCrate/fn.other_private_function.html 'a_module'
|
||||
// @!hasraw aCrate/fn.other_private_function.html 'a_module'
|
||||
pub use a_module::{other_private_function, private_function};
|
||||
|
@ -2,5 +2,5 @@
|
||||
|
||||
// compile-flags: -Z unstable-options --disable-per-crate-search
|
||||
|
||||
// @!has 'foo/struct.Foo.html' '//*[id="crate-search"]'
|
||||
// @!has 'foo/struct.Foo.html' '//*[id="crate-search"]' ''
|
||||
pub struct Foo;
|
||||
|
@ -51,7 +51,7 @@ impl G {
|
||||
|
||||
// @has recursive_deref/struct.D.html '//h3[@class="code-header in-band"]' 'impl Deref for D'
|
||||
// We also check that `G::g` method isn't rendered because there is no `self` argument.
|
||||
// @!has '-' '//*[@id="deref-methods-G"]'
|
||||
// @!has '-' '//*[@id="deref-methods-G"]' ''
|
||||
impl Deref for D {
|
||||
type Target = E;
|
||||
|
||||
@ -62,7 +62,7 @@ impl Deref for D {
|
||||
|
||||
// @has recursive_deref/struct.E.html '//h3[@class="code-header in-band"]' 'impl Deref for E'
|
||||
// We also check that `G::g` method isn't rendered because there is no `self` argument.
|
||||
// @!has '-' '//*[@id="deref-methods-G"]'
|
||||
// @!has '-' '//*[@id="deref-methods-G"]' ''
|
||||
impl Deref for E {
|
||||
type Target = F;
|
||||
|
||||
@ -73,7 +73,7 @@ impl Deref for E {
|
||||
|
||||
// @has recursive_deref/struct.F.html '//h3[@class="code-header in-band"]' 'impl Deref for F'
|
||||
// We also check that `G::g` method isn't rendered because there is no `self` argument.
|
||||
// @!has '-' '//*[@id="deref-methods-G"]'
|
||||
// @!has '-' '//*[@id="deref-methods-G"]' ''
|
||||
impl Deref for F {
|
||||
type Target = G;
|
||||
|
||||
@ -101,7 +101,7 @@ impl I {
|
||||
}
|
||||
|
||||
// @has recursive_deref/struct.H.html '//h3[@class="code-header in-band"]' 'impl Deref for H'
|
||||
// @!has '-' '//*[@id="deref-methods-I"]'
|
||||
// @!has '-' '//*[@id="deref-methods-I"]' ''
|
||||
impl Deref for H {
|
||||
type Target = I;
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
#![crate_name = "foo"]
|
||||
|
||||
// @has foo/fn.foo.html
|
||||
// @!has - '//a[@href="http://a.a"]'
|
||||
// @!has - '//a[@href="http://a.a"]' ''
|
||||
// @has - '//a[@href="#implementing-stuff-somewhere"]' 'Implementing stuff somewhere'
|
||||
// @has - '//a[@href="#another-one-urg"]' 'Another one urg'
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
#![crate_name = "foo"]
|
||||
|
||||
// @has 'search-index.js' 'Foo short link.'
|
||||
// @!has - 'www.example.com'
|
||||
// @!has - 'More Foo.'
|
||||
// @hasraw 'search-index.js' 'Foo short link.'
|
||||
// @!hasraw - 'www.example.com'
|
||||
// @!hasraw - 'More Foo.'
|
||||
|
||||
/// Foo short [link](https://www.example.com/).
|
||||
///
|
||||
|
@ -2,25 +2,25 @@
|
||||
|
||||
use std::ops::Deref;
|
||||
|
||||
// @has search-index.js Foo
|
||||
// @hasraw search-index.js Foo
|
||||
pub use private::Foo;
|
||||
|
||||
mod private {
|
||||
pub struct Foo;
|
||||
impl Foo {
|
||||
pub fn test_method() {} // @has - test_method
|
||||
fn priv_method() {} // @!has - priv_method
|
||||
pub fn test_method() {} // @hasraw - test_method
|
||||
fn priv_method() {} // @!hasraw - priv_method
|
||||
}
|
||||
|
||||
pub trait PrivateTrait {
|
||||
fn trait_method(&self) {} // @!has - priv_method
|
||||
fn trait_method(&self) {} // @!hasraw - priv_method
|
||||
}
|
||||
}
|
||||
|
||||
pub struct Bar;
|
||||
|
||||
impl Deref for Bar {
|
||||
// @!has search-index.js Target
|
||||
// @!hasraw search-index.js Target
|
||||
type Target = Bar;
|
||||
fn deref(&self) -> &Bar { self }
|
||||
}
|
||||
|
@ -1,57 +1,57 @@
|
||||
// Test that the contents of constants are displayed as part of the
|
||||
// documentation.
|
||||
|
||||
// @has show_const_contents/constant.CONST_S.html 'show this'
|
||||
// @!has show_const_contents/constant.CONST_S.html '; //'
|
||||
// @hasraw show_const_contents/constant.CONST_S.html 'show this'
|
||||
// @!hasraw show_const_contents/constant.CONST_S.html '; //'
|
||||
pub const CONST_S: &'static str = "show this";
|
||||
|
||||
// @has show_const_contents/constant.CONST_I32.html '= 42;'
|
||||
// @!has show_const_contents/constant.CONST_I32.html '; //'
|
||||
// @hasraw show_const_contents/constant.CONST_I32.html '= 42;'
|
||||
// @!hasraw show_const_contents/constant.CONST_I32.html '; //'
|
||||
pub const CONST_I32: i32 = 42;
|
||||
|
||||
// @has show_const_contents/constant.CONST_I32_HEX.html '= 0x42;'
|
||||
// @!has show_const_contents/constant.CONST_I32_HEX.html '; //'
|
||||
// @hasraw show_const_contents/constant.CONST_I32_HEX.html '= 0x42;'
|
||||
// @!hasraw show_const_contents/constant.CONST_I32_HEX.html '; //'
|
||||
pub const CONST_I32_HEX: i32 = 0x42;
|
||||
|
||||
// @has show_const_contents/constant.CONST_NEG_I32.html '= -42;'
|
||||
// @!has show_const_contents/constant.CONST_NEG_I32.html '; //'
|
||||
// @hasraw show_const_contents/constant.CONST_NEG_I32.html '= -42;'
|
||||
// @!hasraw show_const_contents/constant.CONST_NEG_I32.html '; //'
|
||||
pub const CONST_NEG_I32: i32 = -42;
|
||||
|
||||
// @has show_const_contents/constant.CONST_EQ_TO_VALUE_I32.html '= 42i32;'
|
||||
// @!has show_const_contents/constant.CONST_EQ_TO_VALUE_I32.html '// 42i32'
|
||||
// @hasraw show_const_contents/constant.CONST_EQ_TO_VALUE_I32.html '= 42i32;'
|
||||
// @!hasraw show_const_contents/constant.CONST_EQ_TO_VALUE_I32.html '// 42i32'
|
||||
pub const CONST_EQ_TO_VALUE_I32: i32 = 42i32;
|
||||
|
||||
// @has show_const_contents/constant.CONST_CALC_I32.html '= _; // 43i32'
|
||||
// @hasraw show_const_contents/constant.CONST_CALC_I32.html '= _; // 43i32'
|
||||
pub const CONST_CALC_I32: i32 = 42 + 1;
|
||||
|
||||
// @!has show_const_contents/constant.CONST_REF_I32.html '= &42;'
|
||||
// @!has show_const_contents/constant.CONST_REF_I32.html '; //'
|
||||
// @!hasraw show_const_contents/constant.CONST_REF_I32.html '= &42;'
|
||||
// @!hasraw show_const_contents/constant.CONST_REF_I32.html '; //'
|
||||
pub const CONST_REF_I32: &'static i32 = &42;
|
||||
|
||||
// @has show_const_contents/constant.CONST_I32_MAX.html '= i32::MAX; // 2_147_483_647i32'
|
||||
// @hasraw show_const_contents/constant.CONST_I32_MAX.html '= i32::MAX; // 2_147_483_647i32'
|
||||
pub const CONST_I32_MAX: i32 = i32::MAX;
|
||||
|
||||
// @!has show_const_contents/constant.UNIT.html '= ();'
|
||||
// @!has show_const_contents/constant.UNIT.html '; //'
|
||||
// @!hasraw show_const_contents/constant.UNIT.html '= ();'
|
||||
// @!hasraw show_const_contents/constant.UNIT.html '; //'
|
||||
pub const UNIT: () = ();
|
||||
|
||||
pub struct MyType(i32);
|
||||
|
||||
// @!has show_const_contents/constant.MY_TYPE.html '= MyType(42);'
|
||||
// @!has show_const_contents/constant.MY_TYPE.html '; //'
|
||||
// @!hasraw show_const_contents/constant.MY_TYPE.html '= MyType(42);'
|
||||
// @!hasraw show_const_contents/constant.MY_TYPE.html '; //'
|
||||
pub const MY_TYPE: MyType = MyType(42);
|
||||
|
||||
pub struct MyTypeWithStr(&'static str);
|
||||
|
||||
// @!has show_const_contents/constant.MY_TYPE_WITH_STR.html '= MyTypeWithStr("show this");'
|
||||
// @!has show_const_contents/constant.MY_TYPE_WITH_STR.html '; //'
|
||||
// @!hasraw show_const_contents/constant.MY_TYPE_WITH_STR.html '= MyTypeWithStr("show this");'
|
||||
// @!hasraw show_const_contents/constant.MY_TYPE_WITH_STR.html '; //'
|
||||
pub const MY_TYPE_WITH_STR: MyTypeWithStr = MyTypeWithStr("show this");
|
||||
|
||||
// @has show_const_contents/constant.PI.html '= 3.14159265358979323846264338327950288f32;'
|
||||
// @has show_const_contents/constant.PI.html '; // 3.14159274f32'
|
||||
// @hasraw show_const_contents/constant.PI.html '= 3.14159265358979323846264338327950288f32;'
|
||||
// @hasraw show_const_contents/constant.PI.html '; // 3.14159274f32'
|
||||
pub use std::f32::consts::PI;
|
||||
|
||||
// @has show_const_contents/constant.MAX.html '= i32::MAX; // 2_147_483_647i32'
|
||||
// @hasraw show_const_contents/constant.MAX.html '= i32::MAX; // 2_147_483_647i32'
|
||||
#[allow(deprecated, deprecated_in_future)]
|
||||
pub use std::i32::MAX;
|
||||
|
||||
@ -61,7 +61,7 @@ macro_rules! int_module {
|
||||
)
|
||||
}
|
||||
|
||||
// @has show_const_contents/constant.MIN.html '= i16::MIN; // -32_768i16'
|
||||
// @hasraw show_const_contents/constant.MIN.html '= i16::MIN; // -32_768i16'
|
||||
int_module!(i16);
|
||||
|
||||
// @has show_const_contents/constant.ESCAPE.html //pre '= r#"<script>alert("ESCAPE");</script>"#;'
|
||||
|
@ -1,13 +1,13 @@
|
||||
#![crate_name = "foo"]
|
||||
|
||||
// @has foo/struct.Bar.html
|
||||
// @!has - '//*[@id="impl-Sized"]'
|
||||
// @!has - '//*[@id="impl-Sized"]' ''
|
||||
pub struct Bar {
|
||||
a: u16,
|
||||
}
|
||||
|
||||
// @has foo/struct.Foo.html
|
||||
// @!has - '//*[@id="impl-Sized"]'
|
||||
// @!has - '//*[@id="impl-Sized"]' ''
|
||||
pub struct Foo<T: ?Sized>(T);
|
||||
|
||||
// @has foo/struct.Unsized.html
|
||||
|
@ -9,5 +9,5 @@ pub mod module_c {}
|
||||
|
||||
pub mod module_a {}
|
||||
|
||||
// @matches 'sort_modules_by_appearance/index.html' '(?s)module_b.*module_c.*module_a'
|
||||
// @matches 'sort_modules_by_appearance/sidebar-items.js' '"module_b".*"module_c".*"module_a"'
|
||||
// @matchesraw 'sort_modules_by_appearance/index.html' '(?s)module_b.*module_c.*module_a'
|
||||
// @matchesraw 'sort_modules_by_appearance/sidebar-items.js' '"module_b".*"module_c".*"module_a"'
|
||||
|
@ -1,5 +1,5 @@
|
||||
#![crate_name = "foo"]
|
||||
|
||||
// @has source-files.js source-file.rs
|
||||
// @hasraw source-files.js source-file.rs
|
||||
|
||||
pub struct Foo;
|
||||
|
@ -1,18 +1,18 @@
|
||||
// compile-flags:-Z unstable-options --static-root-path /cache/
|
||||
|
||||
// @has static_root_path/struct.SomeStruct.html
|
||||
// @matches - '"/cache/main\.js"'
|
||||
// @!matches - '"\.\./main\.js"'
|
||||
// @matches - 'data-root-path="\.\./"'
|
||||
// @!matches - '"/cache/search-index\.js"'
|
||||
// @matchesraw - '"/cache/main\.js"'
|
||||
// @!matchesraw - '"\.\./main\.js"'
|
||||
// @matchesraw - 'data-root-path="\.\./"'
|
||||
// @!matchesraw - '"/cache/search-index\.js"'
|
||||
pub struct SomeStruct;
|
||||
|
||||
// @has src/static_root_path/static-root-path.rs.html
|
||||
// @matches - '"/cache/source-script\.js"'
|
||||
// @!matches - '"\.\./\.\./source-script\.js"'
|
||||
// @matches - '"\.\./\.\./source-files.js"'
|
||||
// @!matches - '"/cache/source-files\.js"'
|
||||
// @matchesraw - '"/cache/source-script\.js"'
|
||||
// @!matchesraw - '"\.\./\.\./source-script\.js"'
|
||||
// @matchesraw - '"\.\./\.\./source-files.js"'
|
||||
// @!matchesraw - '"/cache/source-files\.js"'
|
||||
|
||||
// @has settings.html
|
||||
// @matches - '/cache/settings\.js'
|
||||
// @!matches - '\./settings\.js'
|
||||
// @matchesraw - '/cache/settings\.js'
|
||||
// @!matchesraw - '\./settings\.js'
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
// @has foo/struct.Foo.html
|
||||
// @count - '//*[@class="docblock"]/div/table' 2
|
||||
// @!has - '//*[@class="docblock"]/table'
|
||||
// @!has - '//*[@class="docblock"]/table' ''
|
||||
/// | hello | hello2 |
|
||||
/// | ----- | ------ |
|
||||
/// | data | data2 |
|
||||
|
@ -62,7 +62,7 @@ pub struct PrivStruct {
|
||||
}
|
||||
|
||||
// @has 'toggle_item_contents/enum.Enum.html'
|
||||
// @!has - '//details[@class="rustdoc-toggle type-contents-toggle"]'
|
||||
// @!has - '//details[@class="rustdoc-toggle type-contents-toggle"]' ''
|
||||
pub enum Enum {
|
||||
A, B, C,
|
||||
D {
|
||||
@ -72,7 +72,7 @@ pub enum Enum {
|
||||
}
|
||||
|
||||
// @has 'toggle_item_contents/enum.EnumStructVariant.html'
|
||||
// @!has - '//details[@class="rustdoc-toggle type-contents-toggle"]'
|
||||
// @!has - '//details[@class="rustdoc-toggle type-contents-toggle"]' ''
|
||||
pub enum EnumStructVariant {
|
||||
A, B, C,
|
||||
D {
|
||||
|
@ -59,7 +59,7 @@ pub struct MyStruct;
|
||||
|
||||
// We check that associated items with default values aren't generated in the implementors list.
|
||||
impl MyTrait for (u8, u8) {
|
||||
// @!has trait_impl_items_links_and_anchors/trait.MyTrait.html '//div[@id="associatedconstant.VALUE-4"]'
|
||||
// @!has trait_impl_items_links_and_anchors/trait.MyTrait.html '//div[@id="associatedconstant.VALUE-4"]' ''
|
||||
type Assoc = bool;
|
||||
fn trait_function(&self) {}
|
||||
}
|
||||
|
@ -40,7 +40,7 @@ impl Trait for Struct {
|
||||
fn c() {}
|
||||
|
||||
// @has - '//*[@id="method.d"]/../../div[@class="docblock"]/p' 'Escaped formatting a*b*c* works'
|
||||
// @!has - '//*[@id="method.d"]/../../div[@class="docblock"]/p/em'
|
||||
// @!has - '//*[@id="method.d"]/../../div[@class="docblock"]/p/em' ''
|
||||
fn d() {}
|
||||
|
||||
// @has - '//*[@id="impl-Trait-for-Struct"]/h3//a/@href' 'trait.Trait.html'
|
||||
|
@ -5,7 +5,7 @@
|
||||
// @has - '//h3[@class="sidebar-title"]/a[@href="#fields"]' 'Tuple Fields'
|
||||
// @has - '//*[@id="structfield.0"]' '0: u32'
|
||||
// @has - '//*[@id="main-content"]/div[@class="docblock"]' 'hello'
|
||||
// @!has - '//*[@id="structfield.1"]'
|
||||
// @!has - '//*[@id="structfield.1"]' ''
|
||||
// @has - '//*[@id="structfield.2"]' '2: char'
|
||||
// @has - '//*[@id="structfield.3"]' '3: i8'
|
||||
// @has - '//*[@id="main-content"]/div[@class="docblock"]' 'not hello'
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Tests that `--show-type-layout` is required in order to show layout info.
|
||||
|
||||
// @!has type_layout_flag_required/struct.Foo.html 'Size: '
|
||||
// @!hasraw type_layout_flag_required/struct.Foo.html 'Size: '
|
||||
pub struct Foo(usize);
|
||||
|
@ -1,84 +1,84 @@
|
||||
// compile-flags: --show-type-layout -Z unstable-options
|
||||
|
||||
// @has type_layout/struct.Foo.html 'Size: '
|
||||
// @has - ' bytes'
|
||||
// @hasraw type_layout/struct.Foo.html 'Size: '
|
||||
// @hasraw - ' bytes'
|
||||
// @has - '//*[@id="layout"]/a[@href="#layout"]' ''
|
||||
pub struct Foo {
|
||||
pub a: usize,
|
||||
b: Vec<String>,
|
||||
}
|
||||
|
||||
// @has type_layout/enum.Bar.html 'Size: '
|
||||
// @has - ' bytes'
|
||||
// @hasraw type_layout/enum.Bar.html 'Size: '
|
||||
// @hasraw - ' bytes'
|
||||
pub enum Bar<'a> {
|
||||
A(String),
|
||||
B(&'a str, (std::collections::HashMap<String, usize>, Foo)),
|
||||
}
|
||||
|
||||
// @has type_layout/union.Baz.html 'Size: '
|
||||
// @has - ' bytes'
|
||||
// @hasraw type_layout/union.Baz.html 'Size: '
|
||||
// @hasraw - ' bytes'
|
||||
pub union Baz {
|
||||
a: &'static str,
|
||||
b: usize,
|
||||
c: &'static [u8],
|
||||
}
|
||||
|
||||
// @has type_layout/struct.X.html 'Size: '
|
||||
// @has - ' bytes'
|
||||
// @hasraw type_layout/struct.X.html 'Size: '
|
||||
// @hasraw - ' bytes'
|
||||
pub struct X(usize);
|
||||
|
||||
// @has type_layout/struct.Y.html 'Size: '
|
||||
// @has - '1 byte'
|
||||
// @!has - ' bytes'
|
||||
// @hasraw type_layout/struct.Y.html 'Size: '
|
||||
// @hasraw - '1 byte'
|
||||
// @!hasraw - ' bytes'
|
||||
pub struct Y(u8);
|
||||
|
||||
// @has type_layout/struct.Z.html 'Size: '
|
||||
// @has - '0 bytes'
|
||||
// @hasraw type_layout/struct.Z.html 'Size: '
|
||||
// @hasraw - '0 bytes'
|
||||
pub struct Z;
|
||||
|
||||
// We can't compute layout for generic types.
|
||||
// @has type_layout/struct.Generic.html 'Unable to compute type layout, possibly due to this type having generic parameters'
|
||||
// @!has - 'Size: '
|
||||
// @hasraw type_layout/struct.Generic.html 'Unable to compute type layout, possibly due to this type having generic parameters'
|
||||
// @!hasraw - 'Size: '
|
||||
pub struct Generic<T>(T);
|
||||
|
||||
// We *can*, however, compute layout for types that are only generic over lifetimes,
|
||||
// because lifetimes are a type-system construct.
|
||||
// @has type_layout/struct.GenericLifetimes.html 'Size: '
|
||||
// @has - ' bytes'
|
||||
// @hasraw type_layout/struct.GenericLifetimes.html 'Size: '
|
||||
// @hasraw - ' bytes'
|
||||
pub struct GenericLifetimes<'a>(&'a str);
|
||||
|
||||
// @has type_layout/struct.Unsized.html 'Size: '
|
||||
// @has - '(unsized)'
|
||||
// @hasraw type_layout/struct.Unsized.html 'Size: '
|
||||
// @hasraw - '(unsized)'
|
||||
pub struct Unsized([u8]);
|
||||
|
||||
// @has type_layout/type.TypeAlias.html 'Size: '
|
||||
// @has - ' bytes'
|
||||
// @hasraw type_layout/type.TypeAlias.html 'Size: '
|
||||
// @hasraw - ' bytes'
|
||||
pub type TypeAlias = X;
|
||||
|
||||
// @has type_layout/type.GenericTypeAlias.html 'Size: '
|
||||
// @has - '8 bytes'
|
||||
// @hasraw type_layout/type.GenericTypeAlias.html 'Size: '
|
||||
// @hasraw - '8 bytes'
|
||||
pub type GenericTypeAlias = (Generic<(u32, ())>, Generic<u32>);
|
||||
|
||||
// Regression test for the rustdoc equivalent of #85103.
|
||||
// @has type_layout/type.Edges.html 'Encountered an error during type layout; the type failed to be normalized.'
|
||||
// @hasraw type_layout/type.Edges.html 'Encountered an error during type layout; the type failed to be normalized.'
|
||||
pub type Edges<'a, E> = std::borrow::Cow<'a, [E]>;
|
||||
|
||||
// @!has type_layout/trait.MyTrait.html 'Size: '
|
||||
// @!hasraw type_layout/trait.MyTrait.html 'Size: '
|
||||
pub trait MyTrait {}
|
||||
|
||||
// @has type_layout/enum.Variants.html 'Size: '
|
||||
// @has - '2 bytes'
|
||||
// @has - '<code>A</code>: 0 bytes'
|
||||
// @has - '<code>B</code>: 1 byte'
|
||||
// @hasraw type_layout/enum.Variants.html 'Size: '
|
||||
// @hasraw - '2 bytes'
|
||||
// @hasraw - '<code>A</code>: 0 bytes'
|
||||
// @hasraw - '<code>B</code>: 1 byte'
|
||||
pub enum Variants {
|
||||
A,
|
||||
B(u8),
|
||||
}
|
||||
|
||||
// @has type_layout/enum.WithNiche.html 'Size: '
|
||||
// @hasraw type_layout/enum.WithNiche.html 'Size: '
|
||||
// @has - //p '4 bytes'
|
||||
// @has - '<code>None</code>: 0 bytes'
|
||||
// @has - '<code>Some</code>: 4 bytes'
|
||||
// @hasraw - '<code>None</code>: 0 bytes'
|
||||
// @hasraw - '<code>Some</code>: 4 bytes'
|
||||
pub enum WithNiche {
|
||||
None,
|
||||
Some(std::num::NonZeroU32),
|
||||
|
@ -11,7 +11,7 @@ impl MyStruct {
|
||||
// @has typedef/type.MyAlias.html
|
||||
// @has - '//*[@class="impl has-srclink"]//h3[@class="code-header in-band"]' 'impl MyAlias'
|
||||
// @has - '//*[@class="impl has-srclink"]//h3[@class="code-header in-band"]' 'impl MyTrait for MyAlias'
|
||||
// @has - 'Alias docstring'
|
||||
// @hasraw - 'Alias docstring'
|
||||
// @has - '//*[@class="sidebar"]//*[@class="location"]' 'MyAlias'
|
||||
// @has - '//*[@class="sidebar"]//a[@href="#implementations"]' 'Methods'
|
||||
// @has - '//*[@class="sidebar"]//a[@href="#trait-implementations"]' 'Trait Implementations'
|
||||
|
@ -5,15 +5,15 @@ use std::borrow::Borrow;
|
||||
|
||||
// @has foo/fn.foo.html
|
||||
// @has - //pre 'foo('
|
||||
// @matches - '_x: impl <a class="trait" href="[^"]+/trait\.Clone\.html"'
|
||||
// @matches - '_z: .+impl.+trait\.Copy\.html.+, impl.+trait\.Clone\.html'
|
||||
// @matchesraw - '_x: impl <a class="trait" href="[^"]+/trait\.Clone\.html"'
|
||||
// @matchesraw - '_z: .+impl.+trait\.Copy\.html.+, impl.+trait\.Clone\.html'
|
||||
pub fn foo(_x: impl Clone, _y: i32, _z: (impl Copy, impl Clone)) {
|
||||
}
|
||||
|
||||
pub trait Trait {
|
||||
// @has foo/trait.Trait.html
|
||||
// @has - 'method</a>('
|
||||
// @matches - '_x: impl <a class="trait" href="[^"]+/trait\.Debug\.html"'
|
||||
// @hasraw - 'method</a>('
|
||||
// @matchesraw - '_x: impl <a class="trait" href="[^"]+/trait\.Debug\.html"'
|
||||
fn method(&self, _x: impl std::fmt::Debug) {
|
||||
}
|
||||
}
|
||||
@ -22,30 +22,30 @@ pub struct S<T>(T);
|
||||
|
||||
impl<T> S<T> {
|
||||
// @has foo/struct.S.html
|
||||
// @has - 'bar</a>('
|
||||
// @matches - '_bar: impl <a class="trait" href="[^"]+/trait\.Copy\.html"'
|
||||
// @hasraw - 'bar</a>('
|
||||
// @matchesraw - '_bar: impl <a class="trait" href="[^"]+/trait\.Copy\.html"'
|
||||
pub fn bar(_bar: impl Copy) {
|
||||
}
|
||||
|
||||
// @has - 'baz</a>('
|
||||
// @matches - '_baz:.+struct\.S\.html.+impl .+trait\.Clone\.html'
|
||||
// @hasraw - 'baz</a>('
|
||||
// @matchesraw - '_baz:.+struct\.S\.html.+impl .+trait\.Clone\.html'
|
||||
pub fn baz(_baz: S<impl Clone>) {
|
||||
}
|
||||
|
||||
// @has - 'qux</a>('
|
||||
// @matches - 'trait\.Read\.html'
|
||||
// @hasraw - 'qux</a>('
|
||||
// @matchesraw - 'trait\.Read\.html'
|
||||
pub fn qux(_qux: impl IntoIterator<Item = S<impl Read>>) {
|
||||
}
|
||||
}
|
||||
|
||||
// @has - 'method</a>('
|
||||
// @matches - '_x: impl <a class="trait" href="[^"]+/trait\.Debug\.html"'
|
||||
// @hasraw - 'method</a>('
|
||||
// @matchesraw - '_x: impl <a class="trait" href="[^"]+/trait\.Debug\.html"'
|
||||
impl<T> Trait for S<T> {}
|
||||
|
||||
// @has foo/fn.much_universe.html
|
||||
// @matches - 'T:.+Borrow.+impl .+trait\.Trait\.html'
|
||||
// @matches - 'U:.+IntoIterator.+= impl.+Iterator\.html.+= impl.+Clone\.html'
|
||||
// @matches - '_: impl .+trait\.Read\.html.+ \+ .+trait\.Clone\.html'
|
||||
// @matchesraw - 'T:.+Borrow.+impl .+trait\.Trait\.html'
|
||||
// @matchesraw - 'U:.+IntoIterator.+= impl.+Iterator\.html.+= impl.+Clone\.html'
|
||||
// @matchesraw - '_: impl .+trait\.Read\.html.+ \+ .+trait\.Clone\.html'
|
||||
pub fn much_universe<
|
||||
T: Borrow<impl Trait>,
|
||||
U: IntoIterator<Item = impl Iterator<Item = impl Clone>>,
|
||||
|
@ -0,0 +1,13 @@
|
||||
// check-pass
|
||||
// (this requires debug assertions)
|
||||
|
||||
#![feature(adt_const_params)]
|
||||
#![allow(incomplete_features)]
|
||||
|
||||
fn foo<const B: &'static bool>(arg: &'static bool) -> bool {
|
||||
B == arg
|
||||
}
|
||||
|
||||
fn main() {
|
||||
foo::<{ &true }>(&false);
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
// check-pass
|
||||
// (this requires debug assertions)
|
||||
|
||||
#![feature(adt_const_params)]
|
||||
#![allow(incomplete_features)]
|
||||
|
||||
pub const BAR: () = ice::<"">();
|
||||
pub const fn ice<const N: &'static str>() {
|
||||
&10;
|
||||
}
|
||||
|
||||
fn main() {}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user