Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 2bc89ce

Browse files
Rollup merge of rust-lang#89453 - waywardmonkeys:consistent-supertrait-usage, r=nagisa
Consistently use 'supertrait'. A subset of places referred to 'super-trait', so this changes them to all use 'supertrait'. This matches 'supertype' and some other usages. An exception is 'auto-trait' which is consistently used in that manner.
2 parents 08dd414 + 058a21d commit 2bc89ce

File tree

25 files changed

+88
-88
lines changed

25 files changed

+88
-88
lines changed

compiler/rustc_driver/src/pretty.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ trait PrinterSupport: pprust::PpAnn {
8888
/// Produces the pretty-print annotation object.
8989
///
9090
/// (Rust does not yet support upcasting from a trait object to
91-
/// an object for one of its super-traits.)
91+
/// an object for one of its supertraits.)
9292
fn pp_ann(&self) -> &dyn pprust::PpAnn;
9393
}
9494

@@ -104,7 +104,7 @@ trait HirPrinterSupport<'hir>: pprust_hir::PpAnn {
104104
/// Produces the pretty-print annotation object.
105105
///
106106
/// (Rust does not yet support upcasting from a trait object to
107-
/// an object for one of its super-traits.)
107+
/// an object for one of its supertraits.)
108108
fn pp_ann(&self) -> &dyn pprust_hir::PpAnn;
109109
}
110110

compiler/rustc_error_codes/src/error_codes/E0222.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ pub trait BoxCar : Box + Vehicle {}
1616
fn dent_object<COLOR>(c: dyn BoxCar<Color=COLOR>) {} // Invalid constraint
1717
```
1818

19-
In this example, `BoxCar` has two super-traits: `Vehicle` and `Box`. Both of
19+
In this example, `BoxCar` has two supertraits: `Vehicle` and `Box`. Both of
2020
these traits define an associated type `Color`. `BoxCar` inherits two types
21-
with that name from both super-traits. Because of this, we need to use the
21+
with that name from both supertraits. Because of this, we need to use the
2222
fully qualified path syntax to refer to the appropriate `Color` associated
2323
type, either `<BoxCar as Vehicle>::Color` or `<BoxCar as Box>::Color`, but this
2424
syntax is not allowed to be used in a function signature.

compiler/rustc_middle/src/ty/context.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2117,7 +2117,7 @@ impl<'tcx> TyCtxt<'tcx> {
21172117
})
21182118
}
21192119

2120-
/// Computes the def-ids of the transitive super-traits of `trait_def_id`. This (intentionally)
2120+
/// Computes the def-ids of the transitive supertraits of `trait_def_id`. This (intentionally)
21212121
/// does not compute the full elaborated super-predicates but just the set of def-ids. It is used
21222122
/// to identify which traits may define a given associated type to help avoid cycle errors.
21232123
/// Returns a `DefId` iterator.

compiler/rustc_middle/src/ty/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -599,7 +599,7 @@ impl<'tcx> Predicate<'tcx> {
599599
// where both `'x` and `'b` would have a DB index of 1.
600600
// The substitution from the input trait-ref is therefore going to be
601601
// `'a => 'x` (where `'x` has a DB index of 1).
602-
// - The super-trait-ref is `for<'b> Bar1<'a,'b>`, where `'a` is an
602+
// - The supertrait-ref is `for<'b> Bar1<'a,'b>`, where `'a` is an
603603
// early-bound parameter and `'b' is a late-bound parameter with a
604604
// DB index of 1.
605605
// - If we replace `'a` with `'x` from the input, it too will have

compiler/rustc_save_analysis/src/dump_visitor.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -682,7 +682,7 @@ impl<'tcx> DumpVisitor<'tcx> {
682682
);
683683
}
684684

685-
// super-traits
685+
// supertraits
686686
for super_bound in trait_refs.iter() {
687687
let (def_id, sub_span) = match *super_bound {
688688
hir::GenericBound::Trait(ref trait_ref, _) => (

compiler/rustc_typeck/src/astconv/errors.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
199199

200200
/// When there are any missing associated types, emit an E0191 error and attempt to supply a
201201
/// reasonable suggestion on how to write it. For the case of multiple associated types in the
202-
/// same trait bound have the same name (as they come from different super-traits), we instead
202+
/// same trait bound have the same name (as they come from different supertraits), we instead
203203
/// emit a generic note suggesting using a `where` clause to constraint instead.
204204
pub(crate) fn complain_about_missing_associated_types(
205205
&self,
@@ -340,7 +340,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
340340
using the fully-qualified path to the associated types";
341341
if !where_constraints.is_empty() && suggestions.is_empty() {
342342
// If there are duplicates associated type names and a single trait bound do not
343-
// use structured suggestion, it means that there are multiple super-traits with
343+
// use structured suggestion, it means that there are multiple supertraits with
344344
// the same associated type name.
345345
err.help(where_msg);
346346
}

compiler/rustc_typeck/src/astconv/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1319,7 +1319,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
13191319
);
13201320
first_trait.label_with_exp_info(&mut err, "first non-auto trait", "first use");
13211321
err.help(&format!(
1322-
"consider creating a new trait with all of these as super-traits and using that \
1322+
"consider creating a new trait with all of these as supertraits and using that \
13231323
trait here instead: `trait NewTrait: {} {{}}`",
13241324
regular_traits
13251325
.iter()

compiler/rustc_typeck/src/check/method/probe.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -964,7 +964,7 @@ impl<'a, 'tcx> ProbeContext<'a, 'tcx> {
964964
let trait_ref = ty::TraitRef::new(trait_def_id, trait_substs);
965965

966966
if self.tcx.is_trait_alias(trait_def_id) {
967-
// For trait aliases, assume all super-traits are relevant.
967+
// For trait aliases, assume all supertraits are relevant.
968968
let bounds = iter::once(ty::Binder::dummy(trait_ref));
969969
self.elaborate_bounds(bounds, |this, new_trait_ref, item| {
970970
let new_trait_ref = this.erase_late_bound_regions(new_trait_ref);

0 commit comments

Comments
 (0)