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,10 @@ 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 and returns the value of a given expression for quick and dirty
214
+ /// debugging.
215
+ ///
216
+ /// An example:
215
217
///
216
218
/// ```rust
217
219
/// let a = 2;
@@ -328,7 +330,7 @@ macro_rules! dbg {
328
330
}
329
331
}
330
332
331
- /// A macro to await on an async call.
333
+ /// Awaits the completion of an async call.
332
334
#[ macro_export]
333
335
#[ unstable( feature = "await_macro" , issue = "50547" ) ]
334
336
#[ allow_internal_unstable( gen_future, generators) ]
@@ -351,7 +353,7 @@ macro_rules! r#await {
351
353
} }
352
354
}
353
355
354
- /// A macro to select an event from a number of receivers.
356
+ /// Selects the first successful receive event from a number of receivers.
355
357
///
356
358
/// This macro is used to wait for the first event to occur on a number of
357
359
/// receivers. It places no restrictions on the types of receivers given to
@@ -423,7 +425,7 @@ macro_rules! assert_approx_eq {
423
425
#[ cfg( rustdoc) ]
424
426
mod builtin {
425
427
426
- /// Unconditionally causes compilation to fail with the given error message when encountered.
428
+ /// Causes compilation to fail with the given error message when encountered.
427
429
///
428
430
/// This macro should be used when a crate uses a conditional compilation strategy to provide
429
431
/// better error messages for erroneous conditions. It's the compiler-level form of [`panic!`],
@@ -465,7 +467,7 @@ mod builtin {
465
467
( $msg: expr, ) => ( { /* compiler built-in */ } ) ;
466
468
}
467
469
468
- /// The core macro for formatted string creation & output .
470
+ /// Constructs parameters for the other string-formatting macros .
469
471
///
470
472
/// This macro functions by taking a formatting string literal containing
471
473
/// `{}` for each additional argument passed. `format_args!` prepares the
@@ -517,7 +519,7 @@ mod builtin {
517
519
( $fmt: expr, $( $args: tt) * ) => ( { /* compiler built-in */ } ) ;
518
520
}
519
521
520
- /// Inspect an environment variable at compile time.
522
+ /// Inspects an environment variable at compile time.
521
523
///
522
524
/// This macro will expand to the value of the named environment variable at
523
525
/// compile time, yielding an expression of type `&'static str`.
@@ -555,7 +557,7 @@ mod builtin {
555
557
( $name: expr, ) => ( { /* compiler built-in */ } ) ;
556
558
}
557
559
558
- /// Optionally inspect an environment variable at compile time.
560
+ /// Optionally inspects an environment variable at compile time.
559
561
///
560
562
/// If the named environment variable is present at compile time, this will
561
563
/// expand into an expression of type `Option<&'static str>` whose value is
@@ -581,7 +583,7 @@ mod builtin {
581
583
( $name: expr, ) => ( { /* compiler built-in */ } ) ;
582
584
}
583
585
584
- /// Concatenate identifiers into one identifier.
586
+ /// Concatenates identifiers into one identifier.
585
587
///
586
588
/// This macro takes any number of comma-separated identifiers, and
587
589
/// concatenates them all into one, yielding an expression which is a new
@@ -634,7 +636,7 @@ mod builtin {
634
636
( $( $e: expr, ) * ) => ( { /* compiler built-in */ } ) ;
635
637
}
636
638
637
- /// A macro which expands to the line number on which it was invoked.
639
+ /// Expands to the line number on which it was invoked.
638
640
///
639
641
/// With [`column!`] and [`file!`], these macros provide debugging information for
640
642
/// developers about the location within the source.
@@ -659,7 +661,7 @@ mod builtin {
659
661
#[ rustc_doc_only_macro]
660
662
macro_rules! line { ( ) => ( { /* compiler built-in */ } ) }
661
663
662
- /// A macro which expands to the column number on which it was invoked.
664
+ /// Expands to the column number at which it was invoked.
663
665
///
664
666
/// With [`line!`] and [`file!`], these macros provide debugging information for
665
667
/// developers about the location within the source.
@@ -684,7 +686,7 @@ mod builtin {
684
686
#[ rustc_doc_only_macro]
685
687
macro_rules! column { ( ) => ( { /* compiler built-in */ } ) }
686
688
687
- /// A macro which expands to the file name from which it was invoked.
689
+ /// Expands to the file name in which it was invoked.
688
690
///
689
691
/// With [`line!`] and [`column!`], these macros provide debugging information for
690
692
/// developers about the location within the source.
@@ -708,7 +710,7 @@ mod builtin {
708
710
#[ rustc_doc_only_macro]
709
711
macro_rules! file { ( ) => ( { /* compiler built-in */ } ) }
710
712
711
- /// A macro which stringifies its arguments.
713
+ /// Stringifies its arguments.
712
714
///
713
715
/// This macro will yield an expression of type `&'static str` which is the
714
716
/// stringification of all the tokens passed to the macro. No restrictions
@@ -822,7 +824,7 @@ mod builtin {
822
824
#[ rustc_doc_only_macro]
823
825
macro_rules! module_path { ( ) => ( { /* compiler built-in */ } ) }
824
826
825
- /// Boolean evaluation of configuration flags, at compile-time.
827
+ /// Evaluates boolean combinations of configuration flags at compile-time.
826
828
///
827
829
/// In addition to the `#[cfg]` attribute, this macro is provided to allow
828
830
/// boolean expression evaluation of configuration flags. This frequently
@@ -844,7 +846,7 @@ mod builtin {
844
846
#[ rustc_doc_only_macro]
845
847
macro_rules! cfg { ( $( $cfg: tt) * ) => ( { /* compiler built-in */ } ) }
846
848
847
- /// Parse a file as an expression or an item according to the context.
849
+ /// Parses a file as an expression or an item according to the context.
848
850
///
849
851
/// The file is located relative to the current file (similarly to how
850
852
/// modules are found).
@@ -890,7 +892,7 @@ mod builtin {
890
892
( $file: expr, ) => ( { /* compiler built-in */ } ) ;
891
893
}
892
894
893
- /// Ensure that a boolean expression is `true` at runtime.
895
+ /// Asserts that a boolean expression is `true` at runtime.
894
896
///
895
897
/// This will invoke the [`panic!`] macro if the provided expression cannot be
896
898
/// evaluated to `true` at runtime.
@@ -944,7 +946,7 @@ mod builtin {
944
946
}
945
947
}
946
948
947
- /// A macro for defining `#[cfg]` if-else statements.
949
+ /// Defines `#[cfg]` if-else statements.
948
950
///
949
951
/// This is similar to the `if/elif` C preprocessor macro by allowing definition
950
952
/// of a cascade of `#[cfg]` cases, emitting the implementation which matches
0 commit comments