]> git.lizzy.rs Git - rust.git/commitdiff
Replace occurences of illegal in user facing docs
authorSimonas Kazlauskas <git@kazlauskas.me>
Tue, 28 Jul 2015 14:53:50 +0000 (17:53 +0300)
committerSimonas Kazlauskas <git@kazlauskas.me>
Tue, 28 Jul 2015 14:55:44 +0000 (17:55 +0300)
src/libcollections/fmt.rs
src/libcore/marker.rs
src/libcore/num/mod.rs
src/librustc/diagnostics.rs
src/librustc_resolve/diagnostics.rs
src/librustc_typeck/diagnostics.rs

index 7df259e9b36a89036b758b6bb979323f8a8c314a..3f284235431d13051472f31747c6221a833df834 100644 (file)
@@ -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
 //!
 //! 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}
index dd60164a114db0f547ff61718a22f2d5222ad738..ebd6ba544e4604f028e0b8af3f676c380898c402 100644 (file)
@@ -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"]
index bfbb2ded0782dbf4e177d35b00cca42e70e581e2..ad891bf8fa6239e35b9359856e2e3cb42186abca 100644 (file)
@@ -479,8 +479,8 @@ pub fn wrapping_div(self, rhs: Self) -> Self {
         /// 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 @@ pub fn wrapping_div(self, rhs: Self) -> Self {
         /// 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)]
index 879a2d740cb0b2b5a928095c664531646a30d62b..ed447d06a50b6167372d6e2c95c285fec490c18f 100644 (file)
@@ -41,7 +41,7 @@
 "##,
 
 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 @@ struct Foo<'a> {
 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 @@ fn bar(&self) -> i32 { self.0 }
 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
index 9f8a5c90d4e1cb0c02c09a25d827497eb5316133..4c9a460d65aed90dd079be7b146237a05acd9133 100644 (file)
@@ -106,7 +106,7 @@ pub trait MyTrait {
 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##"
index 73ee3bbbe5b0132bee84908897f8add77eee573e..eb3822db167e641c7a4c7e1be79fb0a715079fac 100644 (file)
@@ -584,7 +584,7 @@ fn foo<F: Fn<(i32,)>>(f: F) -> F::Output { f(3) }
 ```
 
 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 @@ fn main() {
 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 @@ struct Foo<'a, T: 'a> {
     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