about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--tests/ui/auto-traits/auto-traits-type-parameter.rs (renamed from tests/ui/auto-traits/auto-traits-type-parameter)17
-rw-r--r--tests/ui/consts/const-eval-array-len-in-impl.rs4
-rw-r--r--tests/ui/consts/const-eval-array-len-in-impl.stderr2
-rw-r--r--tests/ui/destructuring-assignment/let-binding-tuple-destructuring.rs2
-rw-r--r--tests/ui/lifetimes/any-lifetime-escape-higher-rank.rs12
-rw-r--r--tests/ui/limits/type-length-limit-enforcement.rs16
-rw-r--r--tests/ui/limits/type-length-limit-enforcement.stderr4
-rw-r--r--tests/ui/macros/macro-fragment-ident-underscore-error.rs7
-rw-r--r--tests/ui/macros/macro-fragment-ident-underscore-error.stderr6
-rw-r--r--tests/ui/namespace/struct-type-and-function-name-coexistence.rs13
-rw-r--r--tests/ui/parser/integer-literal-method-call-underscore.rs6
-rw-r--r--tests/ui/ptr_ops/ptr-write-bool-representation.rs7
-rw-r--r--tests/ui/ptr_ops/raw-pointer-type-basic.rs15
-rw-r--r--tests/ui/try-trait/try-operator-expansion-hygiene.rs16
-rw-r--r--tests/ui/try-trait/try-operator-various-contexts.rs35
-rw-r--r--tests/ui/type-inference/type-inference-none-in-generic-ref.rs6
-rw-r--r--tests/ui/type-inference/type-inference-none-in-generic-ref.stderr2
-rw-r--r--tests/ui/type-inference/type-inference-unconstrained-none.rs2
-rw-r--r--tests/ui/type-inference/type-inference-unconstrained-none.stderr2
-rw-r--r--tests/ui/type/auxiliary/typeid-consistency-aux1.rs (renamed from tests/ui/auxiliary/typeid-intrinsic-aux1.rs)0
-rw-r--r--tests/ui/type/auxiliary/typeid-consistency-aux2.rs (renamed from tests/ui/auxiliary/typeid-intrinsic-aux2.rs)0
-rw-r--r--tests/ui/type/type-name-basic.rs7
-rw-r--r--tests/ui/type/typeid-consistency.rs (renamed from tests/ui/type/typeid-consistency-comprehensive.rs)27
-rw-r--r--tests/ui/underscore-lifetime/basic-underscore-lifetime-elision.rs8
24 files changed, 131 insertions, 85 deletions
diff --git a/tests/ui/auto-traits/auto-traits-type-parameter b/tests/ui/auto-traits/auto-traits-type-parameter.rs
index 83d81c0d833..0c448f58996 100644
--- a/tests/ui/auto-traits/auto-traits-type-parameter
+++ b/tests/ui/auto-traits/auto-traits-type-parameter.rs
@@ -1,24 +1,25 @@
+//! Checks how type parameters interact with auto-traits like `Send` and `Sync` with implicit
+//! bounds
+
 //@ run-pass
 
 #![allow(non_camel_case_types)]
 #![allow(dead_code)]
 
-fn p_foo<T>(_pinned: T) { }
-fn s_foo<T>(_shared: T) { }
-fn u_foo<T:Send>(_unique: T) { }
+fn p_foo<T>(_pinned: T) {}
+fn s_foo<T>(_shared: T) {}
+fn u_foo<T: Send>(_unique: T) {}
 
 struct r {
-  i: isize,
+    i: isize,
 }
 
 impl Drop for r {
     fn drop(&mut self) {}
 }
 
-fn r(i:isize) -> r {
-    r {
-        i: i
-    }
+fn r(i: isize) -> r {
+    r { i }
 }
 
 pub fn main() {
diff --git a/tests/ui/consts/const-eval-array-len-in-impl.rs b/tests/ui/consts/const-eval-array-len-in-impl.rs
index 6c545913dd9..0373274770d 100644
--- a/tests/ui/consts/const-eval-array-len-in-impl.rs
+++ b/tests/ui/consts/const-eval-array-len-in-impl.rs
@@ -1,4 +1,6 @@
-// https://github.com/rust-lang/rust/issues/49208
+//! This checks that compiler correctly evaluate constant array lengths within trait `impl` headers.
+//!
+//! Regression test for <https://github.com/rust-lang/rust/issues/49208>.
 
 trait Foo {
     fn foo();
diff --git a/tests/ui/consts/const-eval-array-len-in-impl.stderr b/tests/ui/consts/const-eval-array-len-in-impl.stderr
index 43cc377006e..faff7aa3ff7 100644
--- a/tests/ui/consts/const-eval-array-len-in-impl.stderr
+++ b/tests/ui/consts/const-eval-array-len-in-impl.stderr
@@ -1,5 +1,5 @@
 error[E0277]: the trait bound `[(); 0]: Foo` is not satisfied
-  --> $DIR/unevaluated_fixed_size_array_len.rs:12:6
+  --> $DIR/const-eval-array-len-in-impl.rs:14:6
    |
 LL |     <[(); 0] as Foo>::foo()
    |      ^^^^^^^ the trait `Foo` is not implemented for `[(); 0]`
diff --git a/tests/ui/destructuring-assignment/let-binding-tuple-destructuring.rs b/tests/ui/destructuring-assignment/let-binding-tuple-destructuring.rs
index 3d0e79632bb..f62fae86219 100644
--- a/tests/ui/destructuring-assignment/let-binding-tuple-destructuring.rs
+++ b/tests/ui/destructuring-assignment/let-binding-tuple-destructuring.rs
@@ -1,3 +1,5 @@
+//! Checks basic multiple variable declaration using tuple destructuring in a `let` binding.
+
 //@ run-pass
 
 pub fn main() {
diff --git a/tests/ui/lifetimes/any-lifetime-escape-higher-rank.rs b/tests/ui/lifetimes/any-lifetime-escape-higher-rank.rs
index 7b0c7b53940..f9f38ee532d 100644
--- a/tests/ui/lifetimes/any-lifetime-escape-higher-rank.rs
+++ b/tests/ui/lifetimes/any-lifetime-escape-higher-rank.rs
@@ -1,11 +1,15 @@
+//! Checks that `std::any::Any` cannot be used to circumvent lifetime rules
+//! with higher-rank types.
+
 //@ run-pass
-// Test that we can't ignore lifetimes by going through Any.
 
 use std::any::Any;
 
 struct Foo<'a>(&'a str);
 
-fn good(s: &String) -> Foo<'_> { Foo(s) }
+fn good(s: &String) -> Foo<'_> {
+    Foo(s)
+}
 
 fn bad1(s: String) -> Option<&'static str> {
     let a: Box<dyn Any> = Box::new(good as fn(&String) -> Foo);
@@ -17,7 +21,9 @@ trait AsStr<'a, 'b> {
 }
 
 impl<'a> AsStr<'a, 'a> for String {
-   fn get(&'a self) -> &'a str { self }
+    fn get(&'a self) -> &'a str {
+        self
+    }
 }
 
 fn bad2(s: String) -> Option<&'static str> {
diff --git a/tests/ui/limits/type-length-limit-enforcement.rs b/tests/ui/limits/type-length-limit-enforcement.rs
index 87f5ffd76d7..3b34d6eb5c8 100644
--- a/tests/ui/limits/type-length-limit-enforcement.rs
+++ b/tests/ui/limits/type-length-limit-enforcement.rs
@@ -1,17 +1,19 @@
-//@ build-fail
+//~ ERROR reached the type-length limit
+
+//! Checks the enforcement of the type-length limit
+//! and its configurability via `#![type_length_limit]`.
+
 //@ compile-flags: -Copt-level=0 -Zenforce-type-length-limit
-//~^^ ERROR reached the type-length limit
 
-// Test that the type length limit can be changed.
-// The exact type depends on optimizations, so disable them.
+//@ build-fail
 
 #![allow(dead_code)]
-#![type_length_limit="8"]
+#![type_length_limit = "8"]
 
 macro_rules! link {
     ($id:ident, $t:ty) => {
         pub type $id = ($t, $t, $t);
-    }
+    };
 }
 
 link! { A1, B1 }
@@ -26,7 +28,7 @@ link! { D, E }
 link! { E, F }
 link! { F, G<Option<i32>, Option<i32>> }
 
-pub struct G<T, K>(std::marker::PhantomData::<(T, K)>);
+pub struct G<T, K>(std::marker::PhantomData<(T, K)>);
 
 fn main() {
     drop::<Option<A>>(None);
diff --git a/tests/ui/limits/type-length-limit-enforcement.stderr b/tests/ui/limits/type-length-limit-enforcement.stderr
index 198d133c08c..516230ae832 100644
--- a/tests/ui/limits/type-length-limit-enforcement.stderr
+++ b/tests/ui/limits/type-length-limit-enforcement.stderr
@@ -1,11 +1,11 @@
 error: reached the type-length limit while instantiating `std::mem::drop::<Option<((((..., ..., ...), ..., ...), ..., ...), ..., ...)>>`
-  --> $DIR/type_length_limit.rs:32:5
+  --> $DIR/type-length-limit-enforcement.rs:34:5
    |
 LL |     drop::<Option<A>>(None);
    |     ^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: consider adding a `#![type_length_limit="4010"]` attribute to your crate
-   = note: the full type name has been written to '$TEST_BUILD_DIR/type_length_limit.long-type.txt'
+   = note: the full type name has been written to '$TEST_BUILD_DIR/type-length-limit-enforcement.long-type.txt'
 
 error: reached the type-length limit while instantiating `<{closure@rt::lang_start<()>::{closure#0}} as FnMut<()>>::call_mut`
    |
diff --git a/tests/ui/macros/macro-fragment-ident-underscore-error.rs b/tests/ui/macros/macro-fragment-ident-underscore-error.rs
index 77ec70d43d5..882dd167adc 100644
--- a/tests/ui/macros/macro-fragment-ident-underscore-error.rs
+++ b/tests/ui/macros/macro-fragment-ident-underscore-error.rs
@@ -1,7 +1,10 @@
+//! Verifies that the reserved underscore `_` cannot be used as an `ident` fragment specifier
+//! within a macro pattern, as it leads to a compilation error.
+
 macro_rules! identity {
-    ($i: ident) => (
+    ($i: ident) => {
         $i
-    )
+    };
 }
 
 fn main() {
diff --git a/tests/ui/macros/macro-fragment-ident-underscore-error.stderr b/tests/ui/macros/macro-fragment-ident-underscore-error.stderr
index 0c3f980cf6c..929e4624e4b 100644
--- a/tests/ui/macros/macro-fragment-ident-underscore-error.stderr
+++ b/tests/ui/macros/macro-fragment-ident-underscore-error.stderr
@@ -1,5 +1,5 @@
 error: no rules expected reserved identifier `_`
-  --> $DIR/underscore-ident-matcher.rs:8:19
+  --> $DIR/macro-fragment-ident-underscore-error.rs:11:19
    |
 LL | macro_rules! identity {
    | --------------------- when calling this macro
@@ -8,9 +8,9 @@ LL |     let identity!(_) = 10;
    |                   ^ no rules expected this token in macro call
    |
 note: while trying to match meta-variable `$i:ident`
-  --> $DIR/underscore-ident-matcher.rs:2:6
+  --> $DIR/macro-fragment-ident-underscore-error.rs:5:6
    |
-LL |     ($i: ident) => (
+LL |     ($i: ident) => {
    |      ^^^^^^^^^
 
 error: aborting due to 1 previous error
diff --git a/tests/ui/namespace/struct-type-and-function-name-coexistence.rs b/tests/ui/namespace/struct-type-and-function-name-coexistence.rs
index 31dc684a214..8d5ab3781b5 100644
--- a/tests/ui/namespace/struct-type-and-function-name-coexistence.rs
+++ b/tests/ui/namespace/struct-type-and-function-name-coexistence.rs
@@ -1,7 +1,14 @@
 //@ run-pass
 
-struct A { a: isize }
+struct A {
+    a: isize,
+}
 
-fn a(a: A) -> isize { return a.a; }
+fn a(a: A) -> isize {
+    return a.a;
+}
 
-pub fn main() { let x: A = A {a: 1}; assert_eq!(a(x), 1); }
+pub fn main() {
+    let x: A = A { a: 1 };
+    assert_eq!(a(x), 1);
+}
diff --git a/tests/ui/parser/integer-literal-method-call-underscore.rs b/tests/ui/parser/integer-literal-method-call-underscore.rs
index d9eb21894e8..9e4abf28cba 100644
--- a/tests/ui/parser/integer-literal-method-call-underscore.rs
+++ b/tests/ui/parser/integer-literal-method-call-underscore.rs
@@ -1,6 +1,10 @@
+//! Checks that methods with names starting with an underscore (`_`) can be
+//! successfully called directly on integer literals, confirming the correct
+//! parsing of such expressions where the underscore is part of the method identifier.
+
 //@ run-pass
 
-trait Tr : Sized {
+trait Tr: Sized {
     fn _method_on_numbers(self) {}
 }
 
diff --git a/tests/ui/ptr_ops/ptr-write-bool-representation.rs b/tests/ui/ptr_ops/ptr-write-bool-representation.rs
index 4eb25329223..3dfc3e51ab2 100644
--- a/tests/ui/ptr_ops/ptr-write-bool-representation.rs
+++ b/tests/ui/ptr_ops/ptr-write-bool-representation.rs
@@ -1,3 +1,10 @@
+//! Validates the correct behavior of writing a `bool` value using `std::ptr::write`.
+//!
+//! This test addresses historical concerns regarding the internal representation of `bool`
+//! (e.g., as `i1` in LLVM versus its byte-aligned memory layout) and checks that
+//! `ptr::write` correctly handles this type without issues, confirming its memory
+//! behavior is as expected.
+
 //@ run-pass
 
 use std::ptr;
diff --git a/tests/ui/ptr_ops/raw-pointer-type-basic.rs b/tests/ui/ptr_ops/raw-pointer-type-basic.rs
index 5c8ed344ab3..349e8e67909 100644
--- a/tests/ui/ptr_ops/raw-pointer-type-basic.rs
+++ b/tests/ui/ptr_ops/raw-pointer-type-basic.rs
@@ -1,9 +1,18 @@
+//! Checks the basic usage of raw pointers (`*const isize`) as function argument and return types.
+
 //@ run-pass
 
 #![allow(dead_code)]
 
-fn f(a: *const isize) -> *const isize { return a; }
+fn f(a: *const isize) -> *const isize {
+    return a;
+}
 
-fn g(a: *const isize) -> *const isize { let b = f(a); return b; }
+fn g(a: *const isize) -> *const isize {
+    let b = f(a);
+    return b;
+}
 
-pub fn main() { return; }
+pub fn main() {
+    return;
+}
diff --git a/tests/ui/try-trait/try-operator-expansion-hygiene.rs b/tests/ui/try-trait/try-operator-expansion-hygiene.rs
index 20538e094c6..b6f4e533d8d 100644
--- a/tests/ui/try-trait/try-operator-expansion-hygiene.rs
+++ b/tests/ui/try-trait/try-operator-expansion-hygiene.rs
@@ -1,16 +1,14 @@
+//! This test verifies that the `?` operator expansion is hygienic,
+//! i.e., it's not affected by other `val` and `err` bindings that may be in scope.
+//!
+//! Note: Prior to the Try trait stabilization, `expr?` expanded to a match
+//! with `val` and `err` bindings. The current implementation uses Try::branch()
+//! but this test remains relevant for hygiene verification.
+
 //@ run-pass
 
 #![allow(non_upper_case_globals)]
 #![allow(dead_code)]
-// `expr?` expands to:
-//
-// match expr {
-//     Ok(val) => val,
-//     Err(err) => return Err(From::from(err)),
-// }
-//
-// This test verifies that the expansion is hygienic, i.e., it's not affected by other `val` and
-// `err` bindings that may be in scope.
 
 use std::num::ParseIntError;
 
diff --git a/tests/ui/try-trait/try-operator-various-contexts.rs b/tests/ui/try-trait/try-operator-various-contexts.rs
index b9978204557..41c3679c96f 100644
--- a/tests/ui/try-trait/try-operator-various-contexts.rs
+++ b/tests/ui/try-trait/try-operator-various-contexts.rs
@@ -1,9 +1,11 @@
+//! Checks the functionality of the `?` operator in various syntactic contexts.
+
 //@ run-pass
 
 #![allow(dead_code)]
 
 use std::fs::File;
-use std::io::{Read, self};
+use std::io::{self, Read};
 use std::num::ParseIntError;
 use std::str::FromStr;
 
@@ -35,7 +37,9 @@ fn on_path() -> Result<i32, ParseIntError> {
 
 fn on_macro() -> Result<i32, ParseIntError> {
     macro_rules! id {
-        ($e:expr) => { $e }
+        ($e:expr) => {
+            $e
+        };
     }
 
     Ok(id!("7".parse::<i32>())?)
@@ -50,11 +54,14 @@ fn on_parens() -> Result<i32, ParseIntError> {
 fn on_block() -> Result<i32, ParseIntError> {
     let x = "9".parse::<i32>();
 
-    Ok({x}?)
+    Ok({ x }?)
 }
 
 fn on_field() -> Result<i32, ParseIntError> {
-    struct Pair<A, B> { a: A, b: B }
+    struct Pair<A, B> {
+        a: A,
+        b: B,
+    }
 
     let x = Pair { a: "10".parse::<i32>(), b: 0 };
 
@@ -89,7 +96,9 @@ fn on_index() -> Result<i32, ParseIntError> {
 }
 
 fn on_args() -> Result<i32, ParseIntError> {
-    fn sub(x: i32, y: i32) -> i32 { x - y }
+    fn sub(x: i32, y: i32) -> i32 {
+        x - y
+    }
 
     let x = "20".parse();
     let y = "21".parse();
@@ -98,19 +107,11 @@ fn on_args() -> Result<i32, ParseIntError> {
 }
 
 fn on_if() -> Result<i32, ParseIntError> {
-    Ok(if true {
-        "22".parse::<i32>()
-    } else {
-        "23".parse::<i32>()
-    }?)
+    Ok(if true { "22".parse::<i32>() } else { "23".parse::<i32>() }?)
 }
 
 fn on_if_let() -> Result<i32, ParseIntError> {
-    Ok(if let Ok(..) = "24".parse::<i32>() {
-        "25".parse::<i32>()
-    } else {
-        "26".parse::<i32>()
-    }?)
+    Ok(if let Ok(..) = "24".parse::<i32>() { "25".parse::<i32>() } else { "26".parse::<i32>() }?)
 }
 
 fn on_match() -> Result<i32, ParseIntError> {
@@ -121,7 +122,9 @@ fn on_match() -> Result<i32, ParseIntError> {
 }
 
 fn tight_binding() -> Result<bool, ()> {
-    fn ok<T>(x: T) -> Result<T, ()> { Ok(x) }
+    fn ok<T>(x: T) -> Result<T, ()> {
+        Ok(x)
+    }
 
     let x = ok(true);
     Ok(!x?)
diff --git a/tests/ui/type-inference/type-inference-none-in-generic-ref.rs b/tests/ui/type-inference/type-inference-none-in-generic-ref.rs
index 473ca954b23..9c1b7c19e3d 100644
--- a/tests/ui/type-inference/type-inference-none-in-generic-ref.rs
+++ b/tests/ui/type-inference/type-inference-none-in-generic-ref.rs
@@ -1,5 +1,7 @@
-struct S<'a, T:'a> {
-    o: &'a Option<T>
+//! Checks that unconstrained `None` is rejected through references and generics
+
+struct S<'a, T: 'a> {
+    o: &'a Option<T>,
 }
 
 fn main() {
diff --git a/tests/ui/type-inference/type-inference-none-in-generic-ref.stderr b/tests/ui/type-inference/type-inference-none-in-generic-ref.stderr
index 72fd0202f4e..d671c189b37 100644
--- a/tests/ui/type-inference/type-inference-none-in-generic-ref.stderr
+++ b/tests/ui/type-inference/type-inference-none-in-generic-ref.stderr
@@ -1,5 +1,5 @@
 error[E0282]: type annotations needed
-  --> $DIR/unconstrained-ref.rs:6:5
+  --> $DIR/type-inference-none-in-generic-ref.rs:8:5
    |
 LL |     S { o: &None };
    |     ^^^^^^^^^^^^^^ cannot infer type of the type parameter `T` declared on the struct `S`
diff --git a/tests/ui/type-inference/type-inference-unconstrained-none.rs b/tests/ui/type-inference/type-inference-unconstrained-none.rs
index e180b3163d4..38a506763c7 100644
--- a/tests/ui/type-inference/type-inference-unconstrained-none.rs
+++ b/tests/ui/type-inference/type-inference-unconstrained-none.rs
@@ -1,4 +1,4 @@
-// Issue #5062
+//! Regression test for <https://github.com/rust-lang/rust/issues/5062>.
 
 fn main() {
     None; //~ ERROR type annotations needed [E0282]
diff --git a/tests/ui/type-inference/type-inference-unconstrained-none.stderr b/tests/ui/type-inference/type-inference-unconstrained-none.stderr
index 4af6f412e5b..80572b845e8 100644
--- a/tests/ui/type-inference/type-inference-unconstrained-none.stderr
+++ b/tests/ui/type-inference/type-inference-unconstrained-none.stderr
@@ -1,5 +1,5 @@
 error[E0282]: type annotations needed
-  --> $DIR/unconstrained-none.rs:4:5
+  --> $DIR/type-inference-unconstrained-none.rs:4:5
    |
 LL |     None;
    |     ^^^^ cannot infer type of the type parameter `T` declared on the enum `Option`
diff --git a/tests/ui/auxiliary/typeid-intrinsic-aux1.rs b/tests/ui/type/auxiliary/typeid-consistency-aux1.rs
index a028008c6ae..a028008c6ae 100644
--- a/tests/ui/auxiliary/typeid-intrinsic-aux1.rs
+++ b/tests/ui/type/auxiliary/typeid-consistency-aux1.rs
diff --git a/tests/ui/auxiliary/typeid-intrinsic-aux2.rs b/tests/ui/type/auxiliary/typeid-consistency-aux2.rs
index a028008c6ae..a028008c6ae 100644
--- a/tests/ui/auxiliary/typeid-intrinsic-aux2.rs
+++ b/tests/ui/type/auxiliary/typeid-consistency-aux2.rs
diff --git a/tests/ui/type/type-name-basic.rs b/tests/ui/type/type-name-basic.rs
index 068a42606c2..9381cb82578 100644
--- a/tests/ui/type/type-name-basic.rs
+++ b/tests/ui/type/type-name-basic.rs
@@ -1,3 +1,6 @@
+//! Checks the basic functionality of `std::any::type_name` for primitive types
+//! and simple generic structs.
+
 //@ run-pass
 
 #![allow(dead_code)]
@@ -5,10 +8,10 @@
 use std::any::type_name;
 
 struct Foo<T> {
-    x: T
+    x: T,
 }
 
 pub fn main() {
     assert_eq!(type_name::<isize>(), "isize");
-    assert_eq!(type_name::<Foo<usize>>(), "tydesc_name::Foo<usize>");
+    assert_eq!(type_name::<Foo<usize>>(), "type_name_basic::Foo<usize>");
 }
diff --git a/tests/ui/type/typeid-consistency-comprehensive.rs b/tests/ui/type/typeid-consistency.rs
index 7c4fb3f95a9..67ee1b6d839 100644
--- a/tests/ui/type/typeid-consistency-comprehensive.rs
+++ b/tests/ui/type/typeid-consistency.rs
@@ -1,16 +1,18 @@
+//! Checks the correctness and consistency of `std::any::TypeId::of`.
+
 //@ run-pass
 
 #![allow(deprecated)]
-//@ aux-build:typeid-intrinsic-aux1.rs
-//@ aux-build:typeid-intrinsic-aux2.rs
-
 #![feature(core_intrinsics)]
 
-extern crate typeid_intrinsic_aux1 as other1;
-extern crate typeid_intrinsic_aux2 as other2;
+//@ aux-build:typeid-consistency-aux1.rs
+//@ aux-build:typeid-consistency-aux2.rs
+
+extern crate typeid_consistency_aux1 as other1;
+extern crate typeid_consistency_aux2 as other2;
 
-use std::hash::{SipHasher, Hasher, Hash};
 use std::any::TypeId;
+use std::hash::{Hash, Hasher, SipHasher};
 
 struct A;
 struct Test;
@@ -34,7 +36,7 @@ pub fn main() {
     assert_eq!(TypeId::of::<other2::F>(), other2::id_F());
     assert_eq!(TypeId::of::<other2::G>(), other2::id_G());
     assert_eq!(TypeId::of::<other2::H>(), other2::id_H());
-    assert_eq!(TypeId::of::<other1::I>(), other2::id_I());
+    assert_eq!(TypeId::of::<other2::I>(), other2::id_I());
 
     assert_eq!(other1::id_F(), other2::id_F());
     assert_eq!(other1::id_G(), other2::id_G());
@@ -49,10 +51,8 @@ pub fn main() {
     assert_eq!(other2::foo::<A>(), other1::foo::<A>());
 
     // sanity test of TypeId
-    let (a, b, c) = (TypeId::of::<usize>(), TypeId::of::<&'static str>(),
-                     TypeId::of::<Test>());
-    let (d, e, f) = (TypeId::of::<usize>(), TypeId::of::<&'static str>(),
-                     TypeId::of::<Test>());
+    let (a, b, c) = (TypeId::of::<usize>(), TypeId::of::<&'static str>(), TypeId::of::<Test>());
+    let (d, e, f) = (TypeId::of::<usize>(), TypeId::of::<&'static str>(), TypeId::of::<Test>());
 
     assert!(a != b);
     assert!(a != c);
@@ -82,10 +82,7 @@ pub fn main() {
     assert_ne!(TypeId::of::<other1::I32Iterator>(), TypeId::of::<other1::U32Iterator>());
 
     // Check fn pointer against collisions
-    assert_ne!(
-        TypeId::of::<fn(fn(A) -> A) -> A>(),
-        TypeId::of::<fn(fn() -> A, A) -> A>()
-    );
+    assert_ne!(TypeId::of::<fn(fn(A) -> A) -> A>(), TypeId::of::<fn(fn() -> A, A) -> A>());
     assert_ne!(
         TypeId::of::<for<'a> fn(&'a i32) -> &'a i32>(),
         TypeId::of::<for<'a> fn(&'a i32) -> &'static i32>()
diff --git a/tests/ui/underscore-lifetime/basic-underscore-lifetime-elision.rs b/tests/ui/underscore-lifetime/basic-underscore-lifetime-elision.rs
index a372851f9cf..a2e3c8e26d4 100644
--- a/tests/ui/underscore-lifetime/basic-underscore-lifetime-elision.rs
+++ b/tests/ui/underscore-lifetime/basic-underscore-lifetime-elision.rs
@@ -1,6 +1,9 @@
+//! Checks the correct usage and behavior of the anonymous lifetime `'_` (underscore lifetime)
+
 //@ run-pass
 
 #![allow(dead_code, mismatched_lifetime_syntaxes)]
+
 struct Foo<'a>(&'a u8);
 
 fn foo(x: &u8) -> Foo<'_> {
@@ -31,8 +34,5 @@ fn main() {
     let _ = foo2(x);
     let _ = foo3(x);
     foo4(Foo(x));
-    let _ = foo5(Foo2 {
-        a: x,
-        b: &6,
-    });
+    let _ = foo5(Foo2 { a: x, b: &6 });
 }