Skip to content

Commit

Permalink
Replace occurences of illegal in user facing docs
Browse files Browse the repository at this point in the history
  • Loading branch information
nagisa committed Jul 28, 2015
1 parent cf7e825 commit 91397a6
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 21 deletions.
20 changes: 11 additions & 9 deletions src/libcollections/fmt.rs
Expand Up @@ -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
//!
Expand All @@ -103,19 +103,21 @@
//! 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}
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/marker.rs
Expand Up @@ -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"]
Expand Down
8 changes: 4 additions & 4 deletions src/libcore/num/mod.rs
Expand Up @@ -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)]
Expand Down Expand Up @@ -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)]
Expand Down
6 changes: 3 additions & 3 deletions src/librustc/diagnostics.rs
Expand Up @@ -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
Expand Down Expand Up @@ -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) { }
```
"##,
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_resolve/diagnostics.rs
Expand Up @@ -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##"
Expand Down
6 changes: 3 additions & 3 deletions src/librustc_typeck/diagnostics.rs
Expand Up @@ -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 {
Expand Down Expand Up @@ -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>,
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 91397a6

Please sign in to comment.