4
4
//! library. Each macro is available for use when linking against the standard
5
5
//! library.
6
6
7
- /// The entry point for panic of Rust threads .
7
+ /// Panics the current thread .
8
8
///
9
9
/// This allows a program to terminate immediately and provide feedback
10
10
/// to the caller of the program. `panic!` should be used when a program reaches
@@ -70,7 +70,7 @@ macro_rules! panic {
70
70
} ) ;
71
71
}
72
72
73
- /// Macro for printing to the standard output.
73
+ /// Prints to the standard output.
74
74
///
75
75
/// Equivalent to the [`println!`] macro except that a newline is not printed at
76
76
/// the end of the message.
@@ -116,7 +116,7 @@ macro_rules! print {
116
116
( $( $arg: tt) * ) => ( $crate:: io:: _print( format_args!( $( $arg) * ) ) ) ;
117
117
}
118
118
119
- /// Macro for printing to the standard output, with a newline.
119
+ /// Prints to the standard output, with a newline.
120
120
///
121
121
/// On all platforms, the newline is the LINE FEED character (`\n`/`U+000A`) alone
122
122
/// (no additional CARRIAGE RETURN (`\r`/`U+000D`).
@@ -151,7 +151,7 @@ macro_rules! println {
151
151
} )
152
152
}
153
153
154
- /// Macro for printing to the standard error.
154
+ /// Prints to the standard error.
155
155
///
156
156
/// Equivalent to the [`print!`] macro, except that output goes to
157
157
/// [`io::stderr`] instead of `io::stdout`. See [`print!`] for
@@ -179,7 +179,7 @@ macro_rules! eprint {
179
179
( $( $arg: tt) * ) => ( $crate:: io:: _eprint( format_args!( $( $arg) * ) ) ) ;
180
180
}
181
181
182
- /// Macro for printing to the standard error, with a newline.
182
+ /// Prints to the standard error, with a newline.
183
183
///
184
184
/// Equivalent to the [`println!`] macro, except that output goes to
185
185
/// [`io::stderr`] instead of `io::stdout`. See [`println!`] for
@@ -210,8 +210,9 @@ macro_rules! eprintln {
210
210
} )
211
211
}
212
212
213
- /// A macro for quick and dirty debugging with which you can inspect
214
- /// the value of a given expression. An example:
213
+ /// Prints the value of a given expression for quick and dirty debugging.
214
+ ///
215
+ /// An example:
215
216
///
216
217
/// ```rust
217
218
/// let a = 2;
@@ -328,7 +329,7 @@ macro_rules! dbg {
328
329
}
329
330
}
330
331
331
- /// A macro to await on an async call.
332
+ /// Awaits the completion of an async call.
332
333
#[ macro_export]
333
334
#[ unstable( feature = "await_macro" , issue = "50547" ) ]
334
335
#[ allow_internal_unstable( gen_future, generators) ]
@@ -351,7 +352,7 @@ macro_rules! r#await {
351
352
} }
352
353
}
353
354
354
- /// A macro to select an event from a number of receivers.
355
+ /// Selects the first successful receive event from a number of receivers.
355
356
///
356
357
/// This macro is used to wait for the first event to occur on a number of
357
358
/// receivers. It places no restrictions on the types of receivers given to
@@ -423,7 +424,7 @@ macro_rules! assert_approx_eq {
423
424
#[ cfg( rustdoc) ]
424
425
mod builtin {
425
426
426
- /// Unconditionally causes compilation to fail with the given error message when encountered.
427
+ /// Causes compilation to fail with the given error message when encountered.
427
428
///
428
429
/// This macro should be used when a crate uses a conditional compilation strategy to provide
429
430
/// better error messages for erroneous conditions. It's the compiler-level form of [`panic!`],
@@ -465,7 +466,7 @@ mod builtin {
465
466
( $msg: expr, ) => ( { /* compiler built-in */ } ) ;
466
467
}
467
468
468
- /// The core macro for formatted string creation & output .
469
+ /// Constructs parameters for the other string-formatting macros .
469
470
///
470
471
/// This macro functions by taking a formatting string literal containing
471
472
/// `{}` for each additional argument passed. `format_args!` prepares the
@@ -517,7 +518,7 @@ mod builtin {
517
518
( $fmt: expr, $( $args: tt) * ) => ( { /* compiler built-in */ } ) ;
518
519
}
519
520
520
- /// Inspect an environment variable at compile time.
521
+ /// Inspects an environment variable at compile time.
521
522
///
522
523
/// This macro will expand to the value of the named environment variable at
523
524
/// compile time, yielding an expression of type `&'static str`.
@@ -555,7 +556,7 @@ mod builtin {
555
556
( $name: expr, ) => ( { /* compiler built-in */ } ) ;
556
557
}
557
558
558
- /// Optionally inspect an environment variable at compile time.
559
+ /// Optionally inspects an environment variable at compile time.
559
560
///
560
561
/// If the named environment variable is present at compile time, this will
561
562
/// expand into an expression of type `Option<&'static str>` whose value is
@@ -581,7 +582,7 @@ mod builtin {
581
582
( $name: expr, ) => ( { /* compiler built-in */ } ) ;
582
583
}
583
584
584
- /// Concatenate identifiers into one identifier.
585
+ /// Concatenates identifiers into one identifier.
585
586
///
586
587
/// This macro takes any number of comma-separated identifiers, and
587
588
/// concatenates them all into one, yielding an expression which is a new
@@ -634,7 +635,7 @@ mod builtin {
634
635
( $( $e: expr, ) * ) => ( { /* compiler built-in */ } ) ;
635
636
}
636
637
637
- /// A macro which expands to the line number on which it was invoked.
638
+ /// Expands to the line number on which it was invoked.
638
639
///
639
640
/// With [`column!`] and [`file!`], these macros provide debugging information for
640
641
/// developers about the location within the source.
@@ -659,7 +660,7 @@ mod builtin {
659
660
#[ rustc_doc_only_macro]
660
661
macro_rules! line { ( ) => ( { /* compiler built-in */ } ) }
661
662
662
- /// A macro which expands to the column number on which it was invoked.
663
+ /// Expands to the column number at which it was invoked.
663
664
///
664
665
/// With [`line!`] and [`file!`], these macros provide debugging information for
665
666
/// developers about the location within the source.
@@ -684,7 +685,7 @@ mod builtin {
684
685
#[ rustc_doc_only_macro]
685
686
macro_rules! column { ( ) => ( { /* compiler built-in */ } ) }
686
687
687
- /// A macro which expands to the file name from which it was invoked.
688
+ /// Expands to the file name in which it was invoked.
688
689
///
689
690
/// With [`line!`] and [`column!`], these macros provide debugging information for
690
691
/// developers about the location within the source.
@@ -708,7 +709,7 @@ mod builtin {
708
709
#[ rustc_doc_only_macro]
709
710
macro_rules! file { ( ) => ( { /* compiler built-in */ } ) }
710
711
711
- /// A macro which stringifies its arguments.
712
+ /// Stringifies its arguments.
712
713
///
713
714
/// This macro will yield an expression of type `&'static str` which is the
714
715
/// stringification of all the tokens passed to the macro. No restrictions
@@ -822,7 +823,7 @@ mod builtin {
822
823
#[ rustc_doc_only_macro]
823
824
macro_rules! module_path { ( ) => ( { /* compiler built-in */ } ) }
824
825
825
- /// Boolean evaluation of configuration flags, at compile-time.
826
+ /// Evaluates boolean combinations of configuration flags at compile-time.
826
827
///
827
828
/// In addition to the `#[cfg]` attribute, this macro is provided to allow
828
829
/// boolean expression evaluation of configuration flags. This frequently
@@ -844,7 +845,7 @@ mod builtin {
844
845
#[ rustc_doc_only_macro]
845
846
macro_rules! cfg { ( $( $cfg: tt) * ) => ( { /* compiler built-in */ } ) }
846
847
847
- /// Parse a file as an expression or an item according to the context.
848
+ /// Parses a file as an expression or an item according to the context.
848
849
///
849
850
/// The file is located relative to the current file (similarly to how
850
851
/// modules are found).
@@ -890,7 +891,7 @@ mod builtin {
890
891
( $file: expr, ) => ( { /* compiler built-in */ } ) ;
891
892
}
892
893
893
- /// Ensure that a boolean expression is `true` at runtime.
894
+ /// Asserts that a boolean expression is `true` at runtime.
894
895
///
895
896
/// This will invoke the [`panic!`] macro if the provided expression cannot be
896
897
/// evaluated to `true` at runtime.
@@ -944,7 +945,7 @@ mod builtin {
944
945
}
945
946
}
946
947
947
- /// A macro for defining `#[cfg]` if-else statements.
948
+ /// Defines `#[cfg]` if-else statements.
948
949
///
949
950
/// This is similar to the `if/elif` C preprocessor macro by allowing definition
950
951
/// of a cascade of `#[cfg]` cases, emitting the implementation which matches
0 commit comments