Skip to content

Switch to gender neutral terms #95508

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion compiler/rustc_error_codes/src/error_codes/E0118.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ trait LiveLongAndProsper {
// and now you can implement it on fn(u8)
impl LiveLongAndProsper for fn(u8) {
fn get_state(&self) -> String {
"He's dead, Jim!".to_owned()
"They's dead, Jim!".to_owned()
}
}
```
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_error_codes/src/error_codes/E0393.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Erroneous code example:
```compile_fail,E0393
trait A<T=Self> {}

fn together_we_will_rule_the_galaxy(son: &A) {}
fn together_we_will_rule_the_galaxy(child: &A) {}
// error: the type parameter `T` must be explicitly specified in an
// object type because its default value `Self` references the
// type `Self`
Expand All @@ -25,5 +25,5 @@ defaulted parameter will fix this issue. Fixed example:
```
trait A<T=Self> {}

fn together_we_will_rule_the_galaxy(son: &A<i32>) {} // Ok!
fn together_we_will_rule_the_galaxy(child: &A<i32>) {} // Ok!
```
12 changes: 6 additions & 6 deletions compiler/rustc_error_codes/src/error_codes/E0560.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@ Erroneous code example:

```compile_fail,E0560
struct Simba {
mother: u32,
parent: u32,
}

let s = Simba { mother: 1, father: 0 };
// error: structure `Simba` has no field named `father`
let s = Simba { parent: 1, parent: 0 };
// error: structure `Simba` has no field named `parent`
```

Verify you didn't misspell the field's name or that the field exists. Example:

```
struct Simba {
mother: u32,
father: u32,
parent: u32,
parent: u32,
}
Comment on lines 16 to 20
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔 I don't think this will compile


let s = Simba { mother: 1, father: 0 }; // ok!
let s = Simba { parent: 1, parent: 0 }; // ok!
```
2 changes: 1 addition & 1 deletion compiler/rustc_expand/src/mbe/macro_parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ pub(super) fn count_metavar_decls(matcher: &[TokenTree]) -> usize {
/// only on the nesting depth of repetitions in the originating token tree it
/// was derived from.
///
/// In layman's terms: `NamedMatch` will form a tree representing nested matches of a particular
/// In layperson's terms: `NamedMatch` will form a tree representing nested matches of a particular
/// meta variable. For example, if we are matching the following macro against the following
/// invocation...
///
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_typeck/src/check/wfcheck.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1654,7 +1654,7 @@ fn receiver_is_valid<'fcx, 'tcx>(
}
} else {
debug!("receiver_is_valid: type `{:?}` does not deref to `{:?}`", receiver_ty, self_ty);
// If he receiver already has errors reported due to it, consider it valid to avoid
// If they receiver already has errors reported due to it, consider it valid to avoid
// unnecessary errors (#58712).
return receiver_ty.references_error();
}
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_typeck/src/collect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2703,7 +2703,7 @@ fn linkage_by_name(tcx: TyCtxt<'_>, def_id: DefId, name: &str) -> Linkage {
// Use the names from src/llvm/docs/LangRef.rst here. Most types are only
// applicable to variable declarations and may not really make sense for
// Rust code in the first place but allow them anyway and trust that the
// user knows what s/he's doing. Who knows, unanticipated use cases may pop
// user knows what s/they's doing. Who knows, unanticipated use cases may pop
// up in the future.
//
// ghost, dllimport, dllexport and linkonce_odr_autohide are not supported
Expand Down
2 changes: 1 addition & 1 deletion library/alloc/src/rc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@
//! // At the end of the function, `gadget_owner`, `gadget1`, and `gadget2`
//! // are destroyed. There are now no strong (`Rc`) pointers to the
//! // gadgets, so they are destroyed. This zeroes the reference count on
//! // Gadget Man, so he gets destroyed as well.
//! // Gadget Man, so they gets destroyed as well.
//! }
//! ```
//!
Expand Down
2 changes: 1 addition & 1 deletion library/alloc/src/string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1193,7 +1193,7 @@ impl String {
///
/// s.truncate(2);
///
/// assert_eq!("he", s);
/// assert_eq!("they", s);
/// ```
#[inline]
#[stable(feature = "rust1", since = "1.0.0")]
Expand Down
2 changes: 1 addition & 1 deletion library/core/src/slice/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2244,7 +2244,7 @@ impl<T> [T] {
/// assert_eq!(v.strip_prefix(&[50]), None);
/// assert_eq!(v.strip_prefix(&[10, 50]), None);
///
/// let prefix : &str = "he";
/// let prefix : &str = "they";
/// assert_eq!(b"hello".strip_prefix(prefix.as_bytes()),
/// Some(b"llo".as_ref()));
/// ```
Expand Down
4 changes: 2 additions & 2 deletions library/core/src/str/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ impl str {
/// assert!(v.get_mut(0..5).is_some());
/// // out of bounds
/// assert!(v.get_mut(..42).is_none());
/// assert_eq!(Some("he"), v.get_mut(0..2).map(|v| &*v));
/// assert_eq!(Some("they"), v.get_mut(0..2).map(|v| &*v));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello, @jamiepinheiro Your bot is busted. "he" is used here not as a pronoun but as a random two-character string.

///
/// assert_eq!("hello", v);
/// {
Expand All @@ -463,7 +463,7 @@ impl str {
/// s.make_ascii_uppercase();
/// &*s
/// });
/// assert_eq!(Some("HE"), s);
/// assert_eq!(Some("THEY"), s);
/// }
/// assert_eq!("HEllo", v);
/// ```
Expand Down
2 changes: 1 addition & 1 deletion library/std/src/collections/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@
//! use std::collections::btree_map::BTreeMap;
//!
//! let mut count = BTreeMap::new();
//! let message = "she sells sea shells by the sea shore";
//! let message = "they sells sea shells by the sea shore";
//!
//! for c in message.chars() {
//! *count.entry(c).or_insert(0) += 1;
Expand Down
2 changes: 1 addition & 1 deletion library/std/src/ffi/c_str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1337,7 +1337,7 @@ impl CStr {
/// ```
/// use std::ffi::CStr;
///
/// let cstr = CStr::from_bytes_with_nul(b"he\0llo\0");
/// let cstr = CStr::from_bytes_with_nul(b"they\0llo\0");
/// assert!(cstr.is_err());
/// ```
#[stable(feature = "cstr_from_bytes", since = "1.10.0")]
Expand Down
6 changes: 3 additions & 3 deletions library/std/src/fs/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -644,9 +644,9 @@ fn recursive_rmdir_toctou() {
// Test for time-of-check to time-of-use issues.
//
// Scenario:
// The attacker wants to get directory contents deleted, to which he does not have access.
// He has a way to get a privileged Rust binary call `std::fs::remove_dir_all()` on a
// directory he controls, e.g. in his home directory.
// The attacker wants to get directory contents deleted, to which they does not have access.
// They has a way to get a privileged Rust binary call `std::fs::remove_dir_all()` on a
// directory they controls, e.g. in their home directory.
Comment on lines +647 to +649
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately, "contribution" via regex, without human oversight, is not a good strategy. Pronouns are not context-free. It is "they do not have". I think this is the only legitimate example of something we might want to change, and it is still wrong and thus cannot be merged.

//
// The POC sets up the `attack_dest/attack_file` which the attacker wants to have deleted.
// The attacker repeatedly creates a directory and replaces it with a symlink from
Expand Down
2 changes: 1 addition & 1 deletion library/std/src/thread/local.rs
Original file line number Diff line number Diff line change
Expand Up @@ -980,7 +980,7 @@ pub mod fast {
unsafe fn try_initialize<F: FnOnce() -> T>(&self, init: F) -> Option<&'static T> {
// SAFETY: See comment above (this function doc).
if !mem::needs_drop::<T>() || unsafe { self.try_register_dtor() } {
// SAFETY: See comment above (his function doc).
// SAFETY: See comment above (their function doc).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Many examples are just typos.

Some(unsafe { self.inner.initialize(init) })
} else {
None
Expand Down
2 changes: 1 addition & 1 deletion src/test/rustdoc-ui/doc-without-codeblock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ pub struct Foo;
/// And then, the princess died.
//~^ ERROR missing code example in this documentation
pub mod foo {
/// Or maybe not because she saved herself!
/// Or maybe not because they saved herself!
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Many examples would make it contextually incorrect e.g. when there is a discussion of a hypothetical entity who IS gendered. It would require a much more careful revision.

//~^ ERROR missing code example in this documentation
pub fn bar() {}
}
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/resolve/issue-2356.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ pub enum MaybeDog {

impl MaybeDog {
fn bark() {
// If this provides a suggestion, it's a bug as MaybeDog doesn't impl Groom
// If this provides a suggestion, it's a bug as MaybeDog doesn't impl Newlywed
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Groom" has other meanings, as it is also a verb, amongst other things.

shave();
//~^ ERROR cannot find function `shave`
}
Expand Down