Rollup merge of #153319 - DanielEScherzer:ie-dots, r=jhpratt

Comments and docs: add missing periods to "ie."

"i.e." is short for the Latin "id est" and thus both letters should be followed by periods.
This commit is contained in:
Jonathan Brouwer
2026-03-03 13:08:45 +01:00
committed by GitHub
21 changed files with 33 additions and 33 deletions
+1 -1
View File
@@ -371,7 +371,7 @@ pub fn is_fn_like(self) -> bool {
)
}
/// Whether the corresponding item has generic parameters, ie. the `generics_of` query works.
/// Whether the corresponding item has generic parameters, i.e. the `generics_of` query works.
pub fn has_generics(self) -> bool {
match self {
DefKind::AnonConst
+1 -1
View File
@@ -59,7 +59,7 @@
declare_lint_pass!(PtrNullChecks => [USELESS_PTR_NULL_CHECKS, INVALID_NULL_ARGUMENTS]);
/// This function checks if the expression is from a series of consecutive casts,
/// ie. `(my_fn as *const _ as *mut _).cast_mut()` and whether the original expression is either
/// i.e. `(my_fn as *const _ as *mut _).cast_mut()` and whether the original expression is either
/// a fn ptr, a reference, or a function call whose definition is
/// annotated with `#![rustc_never_returns_null_ptr]`.
/// If this situation is present, the function returns the appropriate diagnostic.
@@ -175,7 +175,7 @@ pub struct LeafDef {
/// The node in the specialization graph containing the definition of `item`.
pub defining_node: Node,
/// The "top-most" (ie. least specialized) specialization graph node that finalized the
/// The "top-most" (i.e. least specialized) specialization graph node that finalized the
/// definition of `item`.
///
/// Example:
@@ -210,7 +210,7 @@ pub fn is_final(&self) -> bool {
}
impl<'tcx> Ancestors<'tcx> {
/// Finds the bottom-most (ie. most specialized) definition of an associated
/// Finds the bottom-most (i.e. most specialized) definition of an associated
/// item.
pub fn leaf_def(mut self, tcx: TyCtxt<'tcx>, trait_item_def_id: DefId) -> Option<LeafDef> {
let mut finalizing_node = None;
@@ -160,7 +160,7 @@ struct DropCtxt<'a, 'b, 'tcx, D>
///
/// The passed `elaborator` is used to determine what should happen at the drop terminator. It
/// decides whether the drop can be statically determined or whether it needs a dynamic drop flag,
/// and whether the drop is "open", ie. should be expanded to drop all subfields of the dropped
/// and whether the drop is "open", i.e. should be expanded to drop all subfields of the dropped
/// value.
///
/// When this returns, the MIR patch in the `elaborator` contains the necessary changes.
+1 -1
View File
@@ -245,7 +245,7 @@ fn compute_replacement<'tcx>(
debug!(?rvalue);
match rvalue {
// This is a copy, just use the value we have in store for the previous one.
// As we are visiting in `assignment_order`, ie. reverse postorder, `rhs` should
// As we are visiting in `assignment_order`, i.e. reverse postorder, `rhs` should
// have been visited before.
Rvalue::Use(Operand::Copy(place) | Operand::Move(place)) => {
if let Some(rhs) = place.as_local()
+2 -2
View File
@@ -25,7 +25,7 @@ pub(super) struct SsaLocals {
assignment_order: Vec<Local>,
/// Copy equivalence classes between locals. See `copy_classes` for documentation.
copy_classes: IndexVec<Local, Local>,
/// Number of "direct" uses of each local, ie. uses that are not dereferences.
/// Number of "direct" uses of each local, i.e. uses that are not dereferences.
/// We ignore non-uses (Storage statements, debuginfo).
direct_uses: IndexVec<Local, u32>,
/// Set of SSA locals that are immutably borrowed.
@@ -314,7 +314,7 @@ fn compute_copy_classes(ssa: &mut SsaLocals, body: &Body<'_>) {
continue;
}
// We visit in `assignment_order`, ie. reverse post-order, so `rhs` has been
// We visit in `assignment_order`, i.e. reverse post-order, so `rhs` has been
// visited before `local`, and we just have to copy the representing local.
let head = copies[rhs];
+9 -9
View File
@@ -2976,7 +2976,7 @@ pub(crate) fn check_for_module_export_macro(
corrections.push((import.span, format!("{module_name}::{import_snippet}")));
} else {
// Find the binding span (and any trailing commas and spaces).
// ie. `use a::b::{c, d, e};`
// i.e. `use a::b::{c, d, e};`
// ^^^
let (found_closing_brace, binding_span) = find_span_of_binding_until_next_binding(
self.tcx.sess,
@@ -2988,11 +2988,11 @@ pub(crate) fn check_for_module_export_macro(
let mut removal_span = binding_span;
// If the binding span ended with a closing brace, as in the below example:
// ie. `use a::b::{c, d};`
// i.e. `use a::b::{c, d};`
// ^
// Then expand the span of characters to remove to include the previous
// binding's trailing comma.
// ie. `use a::b::{c, d};`
// i.e. `use a::b::{c, d};`
// ^^^
if found_closing_brace
&& let Some(previous_span) =
@@ -3008,7 +3008,7 @@ pub(crate) fn check_for_module_export_macro(
// Find the span after the crate name and if it has nested imports immediately
// after the crate name already.
// ie. `use a::b::{c, d};`
// i.e. `use a::b::{c, d};`
// ^^^^^^^^^
// or `use a::{b, c, d}};`
// ^^^^^^^^^^^
@@ -3172,16 +3172,16 @@ fn find_span_of_binding_until_next_binding(
let source_map = sess.source_map();
// Find the span of everything after the binding.
// ie. `a, e};` or `a};`
// i.e. `a, e};` or `a};`
let binding_until_end = binding_span.with_hi(use_span.hi());
// Find everything after the binding but not including the binding.
// ie. `, e};` or `};`
// i.e. `, e};` or `};`
let after_binding_until_end = binding_until_end.with_lo(binding_span.hi());
// Keep characters in the span until we encounter something that isn't a comma or
// whitespace.
// ie. `, ` or ``.
// i.e. `, ` or ``.
//
// Also note whether a closing brace character was encountered. If there
// was, then later go backwards to remove any trailing commas that are left.
@@ -3195,7 +3195,7 @@ fn find_span_of_binding_until_next_binding(
});
// Combine the two spans.
// ie. `a, ` or `a`.
// i.e. `a, ` or `a`.
//
// Removing these would leave `issue_52891::{d, e};` or `issue_52891::{d, e, };`
let span = binding_span.with_hi(after_binding_until_next_binding.hi());
@@ -3219,7 +3219,7 @@ fn extend_span_to_previous_binding(sess: &Session, binding_span: Span) -> Option
let source_map = sess.source_map();
// `prev_source` will contain all of the source that came before the span.
// Then split based on a command and take the first (ie. closest to our span)
// Then split based on a command and take the first (i.e. closest to our span)
// snippet. In the example, this is a space.
let prev_source = source_map.span_to_prev_source(binding_span).ok()?;
+1 -1
View File
@@ -70,7 +70,7 @@ pub(crate) enum ImportKind<'ra> {
decls: PerNS<CmCell<PendingDecl<'ra>>>,
/// `true` for `...::{self [as target]}` imports, `false` otherwise.
type_ns_only: bool,
/// Did this import result from a nested import? ie. `use foo::{bar, baz};`
/// Did this import result from a nested import? i.e. `use foo::{bar, baz};`
nested: bool,
/// The ID of the `UseTree` that imported this `Import`.
///
+1 -1
View File
@@ -328,7 +328,7 @@ pub fn fill_well_known(&mut self, current_target: &Target) {
return;
}
// for `#[cfg(foo)]` (ie. cfg value is none)
// for `#[cfg(foo)]` (i.e. cfg value is none)
let no_values = || {
let mut values = FxHashSet::default();
values.insert(None);
@@ -160,7 +160,7 @@ fn visit_ty(&mut self, arg: &'tcx hir::Ty<'tcx, AmbigArg>) -> Self::Result {
}
// The visitor captures the corresponding `hir::Ty` of the anonymous region
// in the case of structs ie. `hir::TyKind::Path`.
// in the case of structs i.e. `hir::TyKind::Path`.
// This visitor would be invoked for each lifetime corresponding to a struct,
// and would walk the types like Vec<Ref> in the above example and Ref looking for the HIR
// where that lifetime appears. This allows us to highlight the
+2 -2
View File
@@ -2680,7 +2680,7 @@ fn as_inner(&self) -> &fs_imp::DirEntry {
///
/// This function will only ever return an error of kind `NotFound` if the given
/// path does not exist. Note that the inverse is not true,
/// ie. if a path does not exist, its removal may fail for a number of reasons,
/// i.e. if a path does not exist, its removal may fail for a number of reasons,
/// such as insufficient permissions.
///
/// # Examples
@@ -3150,7 +3150,7 @@ pub fn create_dir_all<P: AsRef<Path>>(path: P) -> io::Result<()> {
///
/// This function will only ever return an error of kind `NotFound` if the given
/// path does not exist. Note that the inverse is not true,
/// ie. if a path does not exist, its removal may fail for a number of reasons,
/// i.e. if a path does not exist, its removal may fail for a number of reasons,
/// such as insufficient permissions.
///
/// # Examples
+1 -1
View File
@@ -53,7 +53,7 @@ To check for the _none_ value (ie `#[cfg(foo)]`) one can use the `none()` predic
`values()`: `values(none())`. It can be followed or preceded by any number of `"value"`.
To enable checking of values, but to provide an *none*/empty set of expected values
(ie. expect `#[cfg(name)]`), use these forms:
(i.e. expect `#[cfg(name)]`), use these forms:
```bash
rustc --check-cfg 'cfg(name)'
@@ -110,7 +110,7 @@ fn check_generics(&mut self, cx: &LateContext<'tcx>, generics: &'tcx Generics<'_
fn check_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx Item<'tcx>) {
// special handling for self trait bounds as these are not considered generics
// ie. trait Foo: Display {}
// i.e. trait Foo: Display {}
if let Item {
kind: ItemKind::Trait(_, _, _, _, _, bounds, ..),
..
@@ -1,6 +1,6 @@
fn main() {
extern "C" {
// Use the wrong type (ie. not `i32`) for the `c` argument.
// Use the wrong type (i.e. not `i32`) for the `c` argument.
fn memchr(s: *const std::ffi::c_void, c: u8, n: usize) -> *mut std::ffi::c_void;
}
@@ -742,7 +742,7 @@ pub fn transitive_deps(&self, of: CrateBuilderId) -> impl Iterator<Item = CrateB
deps.into_iter()
}
/// Returns all crates in the graph, sorted in topological order (ie. dependencies of a crate
/// Returns all crates in the graph, sorted in topological order (i.e. dependencies of a crate
/// come before the crate itself).
fn crates_in_topological_order(&self) -> Vec<CrateBuilderId> {
let mut res = Vec::new();
@@ -146,7 +146,7 @@ fn is_visible_from_def_map_(
/// Returns the most permissive visibility of `self` and `other`.
///
/// If there is no subset relation between `self` and `other`, returns `None` (ie. they're only
/// If there is no subset relation between `self` and `other`, returns `None` (i.e. they're only
/// visible in unrelated modules).
pub(crate) fn max(
self,
@@ -212,7 +212,7 @@ pub(crate) fn max(
/// Returns the least permissive visibility of `self` and `other`.
///
/// If there is no subset relation between `self` and `other`, returns `None` (ie. they're only
/// If there is no subset relation between `self` and `other`, returns `None` (i.e. they're only
/// visible in unrelated modules).
pub(crate) fn min(
self,
+1 -1
View File
@@ -1,7 +1,7 @@
//! This checks the output of `--print=cfg`
//!
//! Specifically it checks that output is correctly formatted
//! (ie. no duplicated cfgs, values are between "", names are not).
//! (i.e. no duplicated cfgs, values are between "", names are not).
//!
//! It also checks that some targets have the correct set cfgs.
@@ -1,5 +1,5 @@
// This test makes sure that we do not leak paths to the checkout
// (ie. /checkout in CI) in the distributed `libstd` debuginfo.
// (i.e. /checkout in CI) in the distributed `libstd` debuginfo.
//
// This test only runs on Linux and dist builder (or with `rust.remap-debuginfo = true`
// set in your `bootstrap.toml`).
@@ -1,7 +1,7 @@
#![feature(associated_type_defaults)]
// Associated type defaults may not be assumed inside the trait defining them.
// ie. they only resolve to `<Self as Tr>::A`, not the actual type `()`
// i.e. they only resolve to `<Self as Tr>::A`, not the actual type `()`
trait Tr {
type A = (); //~ NOTE associated type defaults can't be assumed inside the trait defining them
+1 -1
View File
@@ -3,7 +3,7 @@
// Tests that the return type of trait methods is correctly normalized when
// checking that a method in an impl matches the trait definition when the
// return type involves a defaulted associated type.
// ie. the trait has a method with return type `-> Self::R`, and `type R = ()`,
// i.e. the trait has a method with return type `-> Self::R`, and `type R = ()`,
// but the impl leaves out the return type (resulting in `()`).
// Note that specialization is not involved in this test; no items in
// implementations may be overridden. If they were, the normalization wouldn't
@@ -39,7 +39,7 @@ fn main() {
// Everything below this is expected to compile successfully.
// We only test matching here as we cannot create non-exhaustive
// structs from another crate. ie. they'll never pass in run-pass tests.
// structs from another crate. i.e. they'll never pass in run-pass tests.
fn match_structs(ns: NormalStruct, ts: TupleStruct, us: UnitStruct) {
let NormalStruct { first_field, second_field, .. } = ns;