diff --git a/src/libcollections/fmt.rs b/src/libcollections/fmt.rs index 7df259e9b36a8..3f284235431d1 100644 --- a/src/libcollections/fmt.rs +++ b/src/libcollections/fmt.rs @@ -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} diff --git a/src/libcore/marker.rs b/src/libcore/marker.rs index dd60164a114db..ebd6ba544e460 100644 --- a/src/libcore/marker.rs +++ b/src/libcore/marker.rs @@ -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"] diff --git a/src/libcore/num/mod.rs b/src/libcore/num/mod.rs index bfbb2ded0782d..ad891bf8fa623 100644 --- a/src/libcore/num/mod.rs +++ b/src/libcore/num/mod.rs @@ -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)] diff --git a/src/librustc/diagnostics.rs b/src/librustc/diagnostics.rs index 879a2d740cb0b..ed447d06a50b6 100644 --- a/src/librustc/diagnostics.rs +++ b/src/librustc/diagnostics.rs @@ -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 diff --git a/src/librustc_resolve/diagnostics.rs b/src/librustc_resolve/diagnostics.rs index 9f8a5c90d4e1c..4c9a460d65aed 100644 --- a/src/librustc_resolve/diagnostics.rs +++ b/src/librustc_resolve/diagnostics.rs @@ -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##" diff --git a/src/librustc_typeck/diagnostics.rs b/src/librustc_typeck/diagnostics.rs index 73ee3bbbe5b01..eb3822db167e6 100644 --- a/src/librustc_typeck/diagnostics.rs +++ b/src/librustc_typeck/diagnostics.rs @@ -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, @@ -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