//! 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
//!
//! 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);
//! 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}
/// 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"]
/// 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)]
/// 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)]
"##,
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
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) { }
```
"##,
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
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##"
```
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 {
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>,
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