Skip to content

Commit c9a34d2

Browse files
committed
Rollup merge of #27352 - nagisa:illegal-to-invalid-docs, r=steveklabnik
r? @steveklabnik
2 parents 6b564a6 + 91397a6 commit c9a34d2

File tree

6 files changed

+21
-19
lines changed

6 files changed

+21
-19
lines changed

src/libcollections/fmt.rs

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,9 @@
8585
//! format!("{a} {c} {b}", a="a", b='b', c=3); // => "a 3 b"
8686
//! ```
8787
//!
88-
//! It is illegal to put positional parameters (those without names) after
89-
//! arguments which have names. Like with positional parameters, it is illegal
90-
//! to provide named parameters that are unused by the format string.
88+
//! It is not valid to put positional parameters (those without names) after
89+
//! arguments which have names. Like with positional parameters, it is not
90+
//! valid to provide named parameters that are unused by the format string.
9191
//!
9292
//! ## Argument types
9393
//!
@@ -103,19 +103,21 @@
103103
//! hexadecimal as well as an
104104
//! octal.
105105
//!
106-
//! There are various parameters which do require a particular type, however. Namely, the `{:.*}`
107-
//! syntax, which sets the number of numbers after the decimal in floating-point types:
106+
//! There are various parameters which do require a particular type, however.
107+
//! Namely, the `{:.*}` syntax, which sets the number of numbers after the
108+
//! decimal in floating-point types:
108109
//!
109110
//! ```
110111
//! let formatted_number = format!("{:.*}", 2, 1.234567);
111112
//!
112113
//! assert_eq!("1.23", formatted_number)
113114
//! ```
114115
//!
115-
//! If this syntax is used, then the number of characters to print precedes the actual object being
116-
//! formatted, and the number of characters must have the type `usize`. Although a `usize` can be
117-
//! printed with `{}`, it is illegal to reference an argument as such. For example this is another
118-
//! invalid format string:
116+
//! If this syntax is used, then the number of characters to print precedes the
117+
//! actual object being formatted, and the number of characters must have the
118+
//! type `usize`. Although a `usize` can be printed with `{}`, it is invalid to
119+
//! reference an argument as such. For example this is another invalid format
120+
//! string:
119121
//!
120122
//! ```text
121123
//! {:.*} {0}

src/libcore/marker.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ pub trait Copy : Clone {
205205
/// Any types with interior mutability must also use the `std::cell::UnsafeCell`
206206
/// wrapper around the value(s) which can be mutated when behind a `&`
207207
/// reference; not doing this is undefined behaviour (for example,
208-
/// `transmute`-ing from `&T` to `&mut T` is illegal).
208+
/// `transmute`-ing from `&T` to `&mut T` is invalid).
209209
#[stable(feature = "rust1", since = "1.0.0")]
210210
#[lang = "sync"]
211211
#[rustc_on_unimplemented = "`{Self}` cannot be shared between threads safely"]

src/libcore/num/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -479,8 +479,8 @@ macro_rules! int_impl {
479479
/// wrapping around at the boundary of the type.
480480
///
481481
/// Such wrap-around never actually occurs mathematically;
482-
/// implementation artifacts make `x % y` illegal for `MIN /
483-
/// -1` on a signed type illegal (where `MIN` is the negative
482+
/// implementation artifacts make `x % y` invalid for `MIN /
483+
/// -1` on a signed type (where `MIN` is the negative
484484
/// minimal value). In such a case, this function returns `0`.
485485
#[stable(feature = "num_wrapping", since = "1.2.0")]
486486
#[inline(always)]
@@ -1051,8 +1051,8 @@ macro_rules! uint_impl {
10511051
/// wrapping around at the boundary of the type.
10521052
///
10531053
/// Such wrap-around never actually occurs mathematically;
1054-
/// implementation artifacts make `x % y` illegal for `MIN /
1055-
/// -1` on a signed type illegal (where `MIN` is the negative
1054+
/// implementation artifacts make `x % y` invalid for `MIN /
1055+
/// -1` on a signed type (where `MIN` is the negative
10561056
/// minimal value). In such a case, this function returns `0`.
10571057
#[stable(feature = "num_wrapping", since = "1.2.0")]
10581058
#[inline(always)]

src/librustc/diagnostics.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ arms.
4141
"##,
4242

4343
E0002: r##"
44-
This error indicates that an empty match expression is illegal because the type
44+
This error indicates that an empty match expression is invalid because the type
4545
it is matching on is non-empty (there exist values of this type). In safe code
4646
it is impossible to create an instance of an empty type, so empty match
4747
expressions are almost never desired. This error is typically fixed by adding
@@ -1055,7 +1055,7 @@ because the `'static` lifetime is a special built-in lifetime name denoting
10551055
the lifetime of the entire program, this is an error:
10561056
10571057
```
1058-
// error, illegal lifetime parameter name `'static`
1058+
// error, invalid lifetime parameter name `'static`
10591059
fn foo<'static>(x: &'static str) { }
10601060
```
10611061
"##,
@@ -1805,7 +1805,7 @@ For more information about `const fn`'s, see [RFC 911].
18051805
E0394: r##"
18061806
From [RFC 246]:
18071807
1808-
> It is illegal for a static to reference another static by value. It is
1808+
> It is invalid for a static to reference another static by value. It is
18091809
> required that all references be borrowed.
18101810
18111811
[RFC 246]: https://github.com/rust-lang/rfcs/pull/246

src/librustc_resolve/diagnostics.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ mod foo {
106106
use foo::MyTrait::do_something;
107107
```
108108
109-
It's illegal to directly import methods belonging to a trait or concrete type.
109+
It's invalid to directly import methods belonging to a trait or concrete type.
110110
"##,
111111

112112
E0255: r##"

src/librustc_typeck/diagnostics.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -584,7 +584,7 @@ extern "C" {
584584
```
585585
586586
Using this declaration, it must be called with at least one argument, so
587-
simply calling `printf()` is illegal. But the following uses are allowed:
587+
simply calling `printf()` is invalid. But the following uses are allowed:
588588
589589
```
590590
unsafe {

0 commit comments

Comments
 (0)