rustfmt tests/rustdoc-json/.

This commit is contained in:
Nicholas Nethercote 2024-06-04 10:03:40 +10:00
parent c6fb703c05
commit 9f16362ab4
7 changed files with 18 additions and 13 deletions

View File

@ -19,7 +19,6 @@ ignore = [
"/tests/run-make/translation/test.rs", # This test contains syntax errors.
"/tests/rustdoc/", # Some have syntax errors, some are whitespace-sensitive.
"/tests/rustdoc-gui/", # Some tests are sensitive to source code layout.
"/tests/rustdoc-json/",
"/tests/rustdoc-js-std/",
"/tests/rustdoc-ui/",
"/tests/ui/",

View File

@ -23,9 +23,5 @@
// @is "$.index[*][?(@.name=='longest')].inner.function.decl.output.borrowed_ref.type.primitive" \"str\"
pub fn longest<'a>(l: &'a str, r: &'a str) -> &'a str {
if l.len() > r.len() {
l
} else {
r
}
if l.len() > r.len() { l } else { r }
}

View File

@ -12,4 +12,8 @@ pub struct Wrapper<T_>(std::marker::PhantomData<T_>);
// @is "$.index[*][?(@.name=='foo')].inner.function.generics.where_predicates[0].bound_predicate.generic_params[0].kind" '{ "lifetime": { "outlives": [] } }'
// @is "$.index[*][?(@.name=='foo')].inner.function.generics.where_predicates[0].bound_predicate.generic_params[1].name" \"T\"
// @is "$.index[*][?(@.name=='foo')].inner.function.generics.where_predicates[0].bound_predicate.generic_params[1].kind" '{ "type": { "bounds": [], "default": null, "synthetic": false } }'
pub fn foo() where for<'a, T> &'a Wrapper<T>: Trait {}
pub fn foo()
where
for<'a, T> &'a Wrapper<T>: Trait,
{
}

View File

@ -16,12 +16,19 @@ pub trait Trait<T> {
fn handle(value: T) -> Self;
}
impl<T, U> Trait<U> for T where T: From<U> {
fn handle(_: U) -> Self { unimplemented!() }
impl<T, U> Trait<U> for T
where
T: From<U>,
{
fn handle(_: U) -> Self {
unimplemented!()
}
}
impl<'a, R> Trait<&'a mut Events<R>> for Other {
fn handle(_: &'a mut Events<R>) -> Self { unimplemented!() }
fn handle(_: &'a mut Events<R>) -> Self {
unimplemented!()
}
}
fn this_compiles<'a, R>(value: &'a mut Events<R>) {

View File

@ -1,6 +1,6 @@
#![feature(extern_types)]
extern {
extern "C" {
/// No inner information
pub type Foo;
}

View File

@ -4,7 +4,7 @@
// @has "$.index[*][?(@.name=='Ux')].inner.union"
pub union Ux {
a: u32,
b: u64
b: u64,
}
// @is "$.index[*][?(@.name=='Num')].visibility" \"public\"

View File

@ -7,7 +7,6 @@ pub union Union {
float: f32,
}
// @has "$.index[*][?(@.name=='make_int_union')].inner.function.decl.output.resolved_path"
// @is "$.index[*][?(@.name=='make_int_union')].inner.function.decl.output.resolved_path.id" $Union
pub fn make_int_union(int: i32) -> Union {