Replace occurences of illegal in user facing docs
This commit is contained in:
parent
cf7e825ecd
commit
91397a6aa3
@ -85,9 +85,9 @@
|
||||
//! format!("{a} {c} {b}", a="a", b='b', c=3); // => "a 3 b"
|
||||
//! ```
|
||||
//!
|
||||
//! It is illegal to put positional parameters (those without names) after
|
||||
//! arguments which have names. Like with positional parameters, it is illegal
|
||||
//! to provide named parameters that are unused by the format string.
|
||||
//! It is not valid to put positional parameters (those without names) after
|
||||
//! arguments which have names. Like with positional parameters, it is not
|
||||
//! valid to provide named parameters that are unused by the format string.
|
||||
//!
|
||||
//! ## Argument types
|
||||
//!
|
||||
@ -103,8 +103,9 @@
|
||||
//! hexadecimal as well as an
|
||||
//! octal.
|
||||
//!
|
||||
//! There are various parameters which do require a particular type, however. Namely, the `{:.*}`
|
||||
//! syntax, which sets the number of numbers after the decimal in floating-point types:
|
||||
//! There are various parameters which do require a particular type, however.
|
||||
//! Namely, the `{:.*}` syntax, which sets the number of numbers after the
|
||||
//! decimal in floating-point types:
|
||||
//!
|
||||
//! ```
|
||||
//! let formatted_number = format!("{:.*}", 2, 1.234567);
|
||||
@ -112,10 +113,11 @@
|
||||
//! assert_eq!("1.23", formatted_number)
|
||||
//! ```
|
||||
//!
|
||||
//! If this syntax is used, then the number of characters to print precedes the actual object being
|
||||
//! formatted, and the number of characters must have the type `usize`. Although a `usize` can be
|
||||
//! printed with `{}`, it is illegal to reference an argument as such. For example this is another
|
||||
//! invalid format string:
|
||||
//! If this syntax is used, then the number of characters to print precedes the
|
||||
//! actual object being formatted, and the number of characters must have the
|
||||
//! type `usize`. Although a `usize` can be printed with `{}`, it is invalid to
|
||||
//! reference an argument as such. For example this is another invalid format
|
||||
//! string:
|
||||
//!
|
||||
//! ```text
|
||||
//! {:.*} {0}
|
||||
|
@ -205,7 +205,7 @@ pub trait Copy : Clone {
|
||||
/// Any types with interior mutability must also use the `std::cell::UnsafeCell`
|
||||
/// wrapper around the value(s) which can be mutated when behind a `&`
|
||||
/// reference; not doing this is undefined behaviour (for example,
|
||||
/// `transmute`-ing from `&T` to `&mut T` is illegal).
|
||||
/// `transmute`-ing from `&T` to `&mut T` is invalid).
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
#[lang = "sync"]
|
||||
#[rustc_on_unimplemented = "`{Self}` cannot be shared between threads safely"]
|
||||
|
@ -479,8 +479,8 @@ macro_rules! int_impl {
|
||||
/// wrapping around at the boundary of the type.
|
||||
///
|
||||
/// Such wrap-around never actually occurs mathematically;
|
||||
/// implementation artifacts make `x % y` illegal for `MIN /
|
||||
/// -1` on a signed type illegal (where `MIN` is the negative
|
||||
/// implementation artifacts make `x % y` invalid for `MIN /
|
||||
/// -1` on a signed type (where `MIN` is the negative
|
||||
/// minimal value). In such a case, this function returns `0`.
|
||||
#[stable(feature = "num_wrapping", since = "1.2.0")]
|
||||
#[inline(always)]
|
||||
@ -1051,8 +1051,8 @@ macro_rules! uint_impl {
|
||||
/// wrapping around at the boundary of the type.
|
||||
///
|
||||
/// Such wrap-around never actually occurs mathematically;
|
||||
/// implementation artifacts make `x % y` illegal for `MIN /
|
||||
/// -1` on a signed type illegal (where `MIN` is the negative
|
||||
/// implementation artifacts make `x % y` invalid for `MIN /
|
||||
/// -1` on a signed type (where `MIN` is the negative
|
||||
/// minimal value). In such a case, this function returns `0`.
|
||||
#[stable(feature = "num_wrapping", since = "1.2.0")]
|
||||
#[inline(always)]
|
||||
|
@ -41,7 +41,7 @@ arms.
|
||||
"##,
|
||||
|
||||
E0002: r##"
|
||||
This error indicates that an empty match expression is illegal because the type
|
||||
This error indicates that an empty match expression is invalid because the type
|
||||
it is matching on is non-empty (there exist values of this type). In safe code
|
||||
it is impossible to create an instance of an empty type, so empty match
|
||||
expressions are almost never desired. This error is typically fixed by adding
|
||||
@ -1052,7 +1052,7 @@ because the `'static` lifetime is a special built-in lifetime name denoting
|
||||
the lifetime of the entire program, this is an error:
|
||||
|
||||
```
|
||||
// error, illegal lifetime parameter name `'static`
|
||||
// error, invalid lifetime parameter name `'static`
|
||||
fn foo<'static>(x: &'static str) { }
|
||||
```
|
||||
"##,
|
||||
@ -1802,7 +1802,7 @@ For more information about `const fn`'s, see [RFC 911].
|
||||
E0394: r##"
|
||||
From [RFC 246]:
|
||||
|
||||
> It is illegal for a static to reference another static by value. It is
|
||||
> It is invalid for a static to reference another static by value. It is
|
||||
> required that all references be borrowed.
|
||||
|
||||
[RFC 246]: https://github.com/rust-lang/rfcs/pull/246
|
||||
|
@ -106,7 +106,7 @@ mod foo {
|
||||
use foo::MyTrait::do_something;
|
||||
```
|
||||
|
||||
It's illegal to directly import methods belonging to a trait or concrete type.
|
||||
It's invalid to directly import methods belonging to a trait or concrete type.
|
||||
"##,
|
||||
|
||||
E0255: r##"
|
||||
|
@ -584,7 +584,7 @@ extern "C" {
|
||||
```
|
||||
|
||||
Using this declaration, it must be called with at least one argument, so
|
||||
simply calling `printf()` is illegal. But the following uses are allowed:
|
||||
simply calling `printf()` is invalid. But the following uses are allowed:
|
||||
|
||||
```
|
||||
unsafe {
|
||||
@ -778,7 +778,7 @@ the pointer the size of the type would need to be unbounded.
|
||||
Consider the following erroneous definition of a type for a list of bytes:
|
||||
|
||||
```
|
||||
// error, illegal recursive struct type
|
||||
// error, invalid recursive struct type
|
||||
struct ListNode {
|
||||
head: u8,
|
||||
tail: Option<ListNode>,
|
||||
@ -2345,7 +2345,7 @@ register_diagnostics! {
|
||||
E0241,
|
||||
E0242, // internal error looking up a definition
|
||||
E0245, // not a trait
|
||||
E0246, // illegal recursive type
|
||||
E0246, // invalid recursive type
|
||||
E0247, // found module name used as a type
|
||||
E0248, // found value name used as a type
|
||||
E0319, // trait impls for defaulted traits allowed just for structs/enums
|
||||
|
Loading…
x
Reference in New Issue
Block a user