Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
d36e3e23
R
Rust
项目概览
int
/
Rust
大约 1 年 前同步成功
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
Rust
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
d36e3e23
编写于
8月 24, 2020
作者:
L
LeSeulArtichaut
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Use intra-doc-links in `core::{char, macros, fmt}`
上级
9d606d93
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
30 addition
and
114 deletion
+30
-114
library/core/src/char/mod.rs
library/core/src/char/mod.rs
+5
-11
library/core/src/fmt/mod.rs
library/core/src/fmt/mod.rs
+14
-50
library/core/src/macros/mod.rs
library/core/src/macros/mod.rs
+11
-53
未找到文件。
library/core/src/char/mod.rs
浏览文件 @
d36e3e23
...
...
@@ -94,7 +94,6 @@
/// Point], but only ones within a certain range. `MAX` is the highest valid
/// code point that's a valid [Unicode Scalar Value].
///
/// [`char`]: ../../std/primitive.char.html
/// [Unicode Scalar Value]: http://www.unicode.org/glossary/#unicode_scalar_value
/// [Code Point]: http://www.unicode.org/glossary/#code_point
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
...
...
@@ -114,8 +113,7 @@
/// This `struct` is created by the [`escape_unicode`] method on [`char`]. See
/// its documentation for more.
///
/// [`escape_unicode`]: ../../std/primitive.char.html#method.escape_unicode
/// [`char`]: ../../std/primitive.char.html
/// [`escape_unicode`]: char::escape_unicode
#[derive(Clone,
Debug)]
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
pub
struct
EscapeUnicode
{
...
...
@@ -236,8 +234,7 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
/// This `struct` is created by the [`escape_default`] method on [`char`]. See
/// its documentation for more.
///
/// [`escape_default`]: ../../std/primitive.char.html#method.escape_default
/// [`char`]: ../../std/primitive.char.html
/// [`escape_default`]: char::escape_default
#[derive(Clone,
Debug)]
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
pub
struct
EscapeDefault
{
...
...
@@ -345,8 +342,7 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
/// This `struct` is created by the [`escape_debug`] method on [`char`]. See its
/// documentation for more.
///
/// [`escape_debug`]: ../../std/primitive.char.html#method.escape_debug
/// [`char`]: ../../std/primitive.char.html
/// [`escape_debug`]: char::escape_debug
#[stable(feature
=
"char_escape_debug"
,
since
=
"1.20.0"
)]
#[derive(Clone,
Debug)]
pub
struct
EscapeDebug
(
EscapeDefault
);
...
...
@@ -380,8 +376,7 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
/// This `struct` is created by the [`to_lowercase`] method on [`char`]. See
/// its documentation for more.
///
/// [`to_lowercase`]: ../../std/primitive.char.html#method.to_lowercase
/// [`char`]: ../../std/primitive.char.html
/// [`to_lowercase`]: char::to_lowercase
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
#[derive(Debug,
Clone)]
pub
struct
ToLowercase
(
CaseMappingIter
);
...
...
@@ -408,8 +403,7 @@ impl ExactSizeIterator for ToLowercase {}
/// This `struct` is created by the [`to_uppercase`] method on [`char`]. See
/// its documentation for more.
///
/// [`to_uppercase`]: ../../std/primitive.char.html#method.to_uppercase
/// [`char`]: ../../std/primitive.char.html
/// [`to_uppercase`]: char::to_uppercase
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
#[derive(Debug,
Clone)]
pub
struct
ToUppercase
(
CaseMappingIter
);
...
...
library/core/src/fmt/mod.rs
浏览文件 @
d36e3e23
...
...
@@ -117,8 +117,6 @@ pub trait Write {
///
/// This function will return an instance of [`Error`] on error.
///
/// [`Error`]: struct.Error.html
///
/// # Examples
///
/// ```
...
...
@@ -146,9 +144,6 @@ pub trait Write {
///
/// This function will return an instance of [`Error`] on error.
///
/// [`char`]: ../../std/primitive.char.html
/// [`Error`]: struct.Error.html
///
/// # Examples
///
/// ```
...
...
@@ -218,9 +213,6 @@ fn write_fmt(&mut self, args: Arguments<'_>) -> Result {
/// To interact with a `Formatter`, you'll call various methods to change the
/// various options related to formatting. For examples, please see the
/// documentation of the methods defined on `Formatter` below.
///
/// [`Debug`]: trait.Debug.html
/// [`Display`]: trait.Display.html
#[allow(missing_debug_implementations)]
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
pub
struct
Formatter
<
'a
>
{
...
...
@@ -378,7 +370,7 @@ pub fn estimated_capacity(&self) -> usize {
///
/// The [`format_args!`] macro will safely create an instance of this structure.
/// The macro validates the format string at compile-time so usage of the
/// [`write
`] and [`format
`] functions can be safely performed.
/// [`write
()`] and [`format()
`] functions can be safely performed.
///
/// You can use the `Arguments<'a>` that [`format_args!`] returns in `Debug`
/// and `Display` contexts as seen below. The example also shows that `Debug`
...
...
@@ -392,9 +384,7 @@ pub fn estimated_capacity(&self) -> usize {
/// assert_eq!(display, debug);
/// ```
///
/// [`format_args!`]: ../../std/macro.format_args.html
/// [`format`]: ../../std/fmt/fn.format.html
/// [`write`]: ../../std/fmt/fn.write.html
/// [`format()`]: ../../std/fmt/fn.format.html
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
#[derive(Copy,
Clone)]
pub
struct
Arguments
<
'a
>
{
...
...
@@ -472,9 +462,7 @@ fn fmt(&self, fmt: &mut Formatter<'_>) -> Result {
///
/// When used with the alternate format specifier `#?`, the output is pretty-printed.
///
/// For more information on formatters, see [the module-level documentation][module].
///
/// [module]: ../../std/fmt/index.html
/// For more information on formatters, see [the module-level documentation][self].
///
/// This trait can be used with `#[derive]` if all fields implement `Debug`. When
/// `derive`d for structs, it will use the name of the `struct`, then `{`, then a
...
...
@@ -535,8 +523,7 @@ fn fmt(&self, fmt: &mut Formatter<'_>) -> Result {
/// `Debug` implementations using either `derive` or the debug builder API
/// on [`Formatter`] support pretty-printing using the alternate flag: `{:#?}`.
///
/// [`debug_struct`]: ../../std/fmt/struct.Formatter.html#method.debug_struct
/// [`Formatter`]: ../../std/fmt/struct.Formatter.html
/// [`debug_struct`]: Formatter::debug_struct
///
/// Pretty-printing with `#?`:
///
...
...
@@ -618,14 +605,10 @@ pub(crate) mod macros {
/// Format trait for an empty format, `{}`.
///
/// `Display` is similar to [`Debug`]
[debug]
, but `Display` is for user-facing
/// `Display` is similar to [`Debug`], but `Display` is for user-facing
/// output, and so cannot be derived.
///
/// [debug]: trait.Debug.html
///
/// For more information on formatters, see [the module-level documentation][module].
///
/// [module]: ../../std/fmt/index.html
/// For more information on formatters, see [the module-level documentation][self].
///
/// # Examples
///
...
...
@@ -697,9 +680,7 @@ pub trait Display {
///
/// The alternate flag, `#`, adds a `0o` in front of the output.
///
/// For more information on formatters, see [the module-level documentation][module].
///
/// [module]: ../../std/fmt/index.html
/// For more information on formatters, see [the module-level documentation][self].
///
/// # Examples
///
...
...
@@ -751,7 +732,7 @@ pub trait Octal {
///
/// The alternate flag, `#`, adds a `0b` in front of the output.
///
/// For more information on formatters, see [the module-level documentation][
module
].
/// For more information on formatters, see [the module-level documentation][
self
].
///
/// # Examples
///
...
...
@@ -790,12 +771,6 @@ pub trait Octal {
/// "l as binary is: 0b000000000000000000000001101011"
/// );
/// ```
///
/// [module]: ../../std/fmt/index.html
/// [`i8`]: ../../std/primitive.i8.html
/// [`i128`]: ../../std/primitive.i128.html
/// [`isize`]: ../../std/primitive.isize.html
/// [`i32`]: ../../std/primitive.i32.html
#[stable(feature
=
"rust1"
,
since
=
"1.0.0"
)]
pub
trait
Binary
{
/// Formats the value using the given formatter.
...
...
@@ -813,9 +788,7 @@ pub trait Binary {
///
/// The alternate flag, `#`, adds a `0x` in front of the output.
///
/// For more information on formatters, see [the module-level documentation][module].
///
/// [module]: ../../std/fmt/index.html
/// For more information on formatters, see [the module-level documentation][self].
///
/// # Examples
///
...
...
@@ -868,9 +841,7 @@ pub trait LowerHex {
///
/// The alternate flag, `#`, adds a `0x` in front of the output.
///
/// For more information on formatters, see [the module-level documentation][module].
///
/// [module]: ../../std/fmt/index.html
/// For more information on formatters, see [the module-level documentation][self].
///
/// # Examples
///
...
...
@@ -918,9 +889,7 @@ pub trait UpperHex {
/// The `Pointer` trait should format its output as a memory location. This is commonly presented
/// as hexadecimal.
///
/// For more information on formatters, see [the module-level documentation][module].
///
/// [module]: ../../std/fmt/index.html
/// For more information on formatters, see [the module-level documentation][self].
///
/// # Examples
///
...
...
@@ -967,9 +936,7 @@ pub trait Pointer {
///
/// The `LowerExp` trait should format its output in scientific notation with a lower-case `e`.
///
/// For more information on formatters, see [the module-level documentation][module].
///
/// [module]: ../../std/fmt/index.html
/// For more information on formatters, see [the module-level documentation][self].
///
/// # Examples
///
...
...
@@ -1018,9 +985,7 @@ pub trait LowerExp {
///
/// The `UpperExp` trait should format its output in scientific notation with an upper-case `E`.
///
/// For more information on formatters, see [the module-level documentation][module].
///
/// [module]: ../../std/fmt/index.html
/// For more information on formatters, see [the module-level documentation][self].
///
/// # Examples
///
...
...
@@ -1812,8 +1777,7 @@ fn debug_upper_hex(&self) -> bool {
/// Creates a [`DebugStruct`] builder designed to assist with creation of
/// [`fmt::Debug`] implementations for structs.
///
/// [`DebugStruct`]: ../../std/fmt/struct.DebugStruct.html
/// [`fmt::Debug`]: ../../std/fmt/trait.Debug.html
/// [`fmt::Debug`]: self::Debug
///
/// # Examples
///
...
...
library/core/src/macros/mod.rs
浏览文件 @
d36e3e23
...
...
@@ -28,9 +28,6 @@
/// Like [`assert!`], this macro has a second form, where a custom
/// panic message can be provided.
///
/// [`PartialEq`]: cmp/trait.PartialEq.html
/// [`assert!`]: macro.assert.html
///
/// # Examples
///
/// ```
...
...
@@ -85,9 +82,6 @@
/// Like [`assert!`], this macro has a second form, where a custom
/// panic message can be provided.
///
/// [`PartialEq`]: cmp/trait.PartialEq.html
/// [`assert!`]: macro.assert.html
///
/// # Examples
///
/// ```
...
...
@@ -158,9 +152,6 @@
/// with `debug_assert!` is thus only encouraged after thorough profiling, and
/// more importantly, only in safe code!
///
/// [`panic!`]: macro.panic.html
/// [`assert!`]: macro.assert.html
///
/// # Examples
///
/// ```
...
...
@@ -196,8 +187,6 @@
/// expensive to be present in a release build but may be helpful during
/// development. The result of expanding `debug_assert_eq!` is always type checked.
///
/// [`assert_eq!`]: ../std/macro.assert_eq.html
///
/// # Examples
///
/// ```
...
...
@@ -223,8 +212,6 @@
/// expensive to be present in a release build but may be helpful during
/// development. The result of expanding `debug_assert_ne!` is always type checked.
///
/// [`assert_ne!`]: ../std/macro.assert_ne.html
///
/// # Examples
///
/// ```
...
...
@@ -282,8 +269,6 @@
/// Because of the early return, `try!` can only be used in functions that
/// return [`Result`].
///
/// [`Result`]: ../std/result/enum.Result.html
///
/// # Examples
///
/// ```
...
...
@@ -354,10 +339,10 @@
///
/// See [`std::fmt`] for more information on the format string syntax.
///
/// [`std::fmt`]:
../std/fmt/index.html
/// [`std::fmt::Write`]:
../std/fmt/trait.Write.html
/// [`std::fmt`]:
crate::fmt
/// [`std::fmt::Write`]:
crate::fmt::Write
/// [`std::io::Write`]: ../std/io/trait.Write.html
/// [`std::fmt::Result`]:
../std/fmt/type.Result.html
/// [`std::fmt::Result`]:
crate::fmt::Result
/// [`io::Result`]: ../std/io/type.Result.html
///
/// # Examples
...
...
@@ -426,9 +411,7 @@
/// For more information, see [`write!`]. For information on the format string syntax, see
/// [`std::fmt`].
///
/// [`write!`]: macro.write.html
/// [`std::fmt`]: ../std/fmt/index.html
///
/// [`std::fmt`]: crate::fmt
///
/// # Examples
///
...
...
@@ -494,16 +477,12 @@
/// The unsafe counterpart of this macro is the [`unreachable_unchecked`] function, which
/// will cause undefined behavior if the code is reached.
///
/// [`panic!`]: ../std/macro.panic.html
/// [`unreachable_unchecked`]: ../std/hint/fn.unreachable_unchecked.html
/// [`std::hint`]: ../std/hint/index.html
/// [`unreachable_unchecked`]: crate::hint::unreachable_unchecked
///
/// # Panics
///
/// This will always [`panic!`]
///
/// [`panic!`]: ../std/macro.panic.html
///
/// # Examples
///
/// Match arms:
...
...
@@ -637,8 +616,6 @@
/// implemented", `unimplemented!` makes no such claims. Its message is "not implemented".
/// Also some IDEs will mark `todo!`s.
///
/// [`unimplemented!`]: macro.unimplemented.html
///
/// # Panics
///
/// This will always [panic!](macro.panic.html)
...
...
@@ -730,8 +707,6 @@ pub(crate) mod builtin {
/// #[cfg(not(any(feature = "foo", feature = "bar")))]
/// compile_error!("Either feature \"foo\" or \"bar\" must be enabled for this crate.");
/// ```
///
/// [`panic!`]: ../std/macro.panic.html
#[stable(feature
=
"compile_error_macro"
,
since
=
"1.20.0"
)]
#[rustc_builtin_macro]
#[macro_export]
...
...
@@ -769,12 +744,11 @@ pub(crate) mod builtin {
///
/// For more information, see the documentation in [`std::fmt`].
///
/// [`Display`]:
../std/fmt/trait.Display.html
/// [`Debug`]:
../std/fmt/trait.Debug.html
/// [`fmt::Arguments`]:
../std/fmt/struct.Arguments.html
/// [`std::fmt`]:
../std/fmt/index.html
/// [`Display`]:
crate::fmt::Display
/// [`Debug`]:
crate::fmt::Debug
/// [`fmt::Arguments`]:
crate::fmt::Arguments
/// [`std::fmt`]:
crate::fmt
/// [`format!`]: ../std/macro.format.html
/// [`write!`]: ../std/macro.write.html
/// [`println!`]: ../std/macro.println.html
///
/// # Examples
...
...
@@ -818,8 +792,6 @@ pub(crate) mod builtin {
/// will be emitted. To not emit a compile error, use the [`option_env!`]
/// macro instead.
///
/// [`option_env!`]: ../std/macro.option_env.html
///
/// # Examples
///
/// ```
...
...
@@ -854,13 +826,11 @@ pub(crate) mod builtin {
/// expand into an expression of type `Option<&'static str>` whose value is
/// `Some` of the value of the environment variable. If the environment
/// variable is not present, then this will expand to `None`. See
/// [`Option<T>`][
o
ption] for more information on this type.
/// [`Option<T>`][
O
ption] for more information on this type.
///
/// A compile time error is never emitted when using this macro regardless
/// of whether the environment variable is present or not.
///
/// [option]: ../std/option/enum.Option.html
///
/// # Examples
///
/// ```
...
...
@@ -946,9 +916,6 @@ pub(crate) mod builtin {
/// but rather the first macro invocation leading up to the invocation
/// of the `line!` macro.
///
/// [`column!`]: macro.column.html
/// [`file!`]: macro.file.html
///
/// # Examples
///
/// ```
...
...
@@ -976,9 +943,6 @@ pub(crate) mod builtin {
/// but rather the first macro invocation leading up to the invocation
/// of the `column!` macro.
///
/// [`line!`]: macro.line.html
/// [`file!`]: macro.file.html
///
/// # Examples
///
/// ```
...
...
@@ -999,15 +963,11 @@ pub(crate) mod builtin {
/// With [`line!`] and [`column!`], these macros provide debugging information for
/// developers about the location within the source.
///
///
/// The expanded expression has type `&'static str`, and the returned file
/// is not the invocation of the `file!` macro itself, but rather the
/// first macro invocation leading up to the invocation of the `file!`
/// macro.
///
/// [`line!`]: macro.line.html
/// [`column!`]: macro.column.html
///
/// # Examples
///
/// ```
...
...
@@ -1258,9 +1218,7 @@ pub(crate) mod builtin {
/// be provided with or without arguments for formatting. See [`std::fmt`]
/// for syntax for this form.
///
/// [`panic!`]: macro.panic.html
/// [`debug_assert!`]: macro.debug_assert.html
/// [`std::fmt`]: ../std/fmt/index.html
/// [`std::fmt`]: crate::fmt
///
/// # Examples
///
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录