Skip to content

Commit 910d4f4

Browse files
authored
Rollup merge of #152206 - tshepang:misc, r=davidtwco
misc doc improvements These are things I collected as I was looking at code and docs
2 parents e28a33a + 3be2843 commit 910d4f4

7 files changed

Lines changed: 52 additions & 29 deletions

File tree

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
The requested ABI is unsupported by the current target.
22

3-
The rust compiler maintains for each target a list of unsupported ABIs on
4-
that target. If an ABI is present in such a list this usually means that the
3+
The Rust compiler maintains a list of unsupported ABIs for each target.
4+
If an ABI is present in such a list, this usually means that the
55
target / ABI combination is currently unsupported by llvm.
66

77
If necessary, you can circumvent this check using custom target specifications.

compiler/rustc_expand/src/config.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,7 @@ pub fn features(sess: &Session, krate_attrs: &[Attribute], crate_name: Symbol) -
8686
if let Some(f) = REMOVED_LANG_FEATURES.iter().find(|f| name == f.feature.name) {
8787
let pull_note = if let Some(pull) = f.pull {
8888
format!(
89-
"; see <https://github.com/rust-lang/rust/pull/{}> for more information",
90-
pull
89+
"; see <https://github.com/rust-lang/rust/pull/{pull}> for more information",
9190
)
9291
} else {
9392
"".to_owned()
@@ -123,7 +122,7 @@ pub fn features(sess: &Session, krate_attrs: &[Attribute], crate_name: Symbol) -
123122

124123
// If the enabled feature is unstable, record it.
125124
if UNSTABLE_LANG_FEATURES.iter().find(|f| name == f.name).is_some() {
126-
// When the ICE comes a standard library crate, there's a chance that the person
125+
// When the ICE comes from a standard library crate, there's a chance that the person
127126
// hitting the ICE may be using -Zbuild-std or similar with an untested target.
128127
// The bug is probably in the standard library and not the compiler in that case,
129128
// but that doesn't really matter - we want a bug report.

compiler/rustc_feature/src/unstable.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,6 @@ pub struct EnabledLibFeature {
6464
}
6565

6666
impl Features {
67-
/// `since` should be set for stable features that are nevertheless enabled with a `#[feature]`
68-
/// attribute, indicating since when they are stable.
6967
pub fn set_enabled_lang_feature(&mut self, lang_feat: EnabledLangFeature) {
7068
self.enabled_lang_features.push(lang_feat);
7169
self.enabled_features.insert(lang_feat.gate_name);
@@ -781,8 +779,9 @@ impl Features {
781779
}
782780
}
783781

784-
/// Some features are not allowed to be used together at the same time, if
785-
/// the two are present, produce an error.
782+
/// Some features are not allowed to be used together at the same time.
783+
///
784+
/// If the two are present, produce an error.
786785
pub const INCOMPATIBLE_FEATURES: &[(Symbol, Symbol)] = &[
787786
// Experimental match ergonomics rulesets are incompatible with each other, to simplify the
788787
// boolean logic required to tell which typing rules to use.

compiler/rustc_lint_defs/src/builtin.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3659,10 +3659,10 @@ declare_lint! {
36593659
/// `stdcall`, `fastcall`, and `cdecl` calling conventions (or their unwind
36603660
/// variants) on targets that cannot meaningfully be supported for the requested target.
36613661
///
3662-
/// For example `stdcall` does not make much sense for a x86_64 or, more apparently, powerpc
3662+
/// For example, `stdcall` does not make much sense for a x86_64 or, more apparently, powerpc
36633663
/// code, because this calling convention was never specified for those targets.
36643664
///
3665-
/// Historically MSVC toolchains have fallen back to the regular C calling convention for
3665+
/// Historically, MSVC toolchains have fallen back to the regular C calling convention for
36663666
/// targets other than x86, but Rust doesn't really see a similar need to introduce a similar
36673667
/// hack across many more targets.
36683668
///
@@ -3689,7 +3689,7 @@ declare_lint! {
36893689
///
36903690
/// ### Explanation
36913691
///
3692-
/// On most of the targets the behaviour of `stdcall` and similar calling conventions is not
3692+
/// On most of the targets, the behaviour of `stdcall` and similar calling conventions is not
36933693
/// defined at all, but was previously accepted due to a bug in the implementation of the
36943694
/// compiler.
36953695
pub UNSUPPORTED_CALLING_CONVENTIONS,

compiler/rustc_type_ir/src/predicate.rs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ where
4242
}
4343
}
4444

45-
/// A complete reference to a trait. These take numerous guises in syntax,
45+
/// A complete reference to a trait.
46+
///
47+
/// These take numerous guises in syntax,
4648
/// but perhaps the most recognizable form is in a where-clause:
4749
/// ```ignore (illustrative)
4850
/// T: Foo<U>
@@ -241,7 +243,9 @@ impl ImplPolarity {
241243
}
242244
}
243245

244-
/// Polarity for a trait predicate. May either be negative or positive.
246+
/// Polarity for a trait predicate.
247+
///
248+
/// May either be negative or positive.
245249
/// Distinguished from [`ImplPolarity`] since we never compute goals with
246250
/// "reservation" level.
247251
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Debug)]
@@ -327,6 +331,7 @@ impl<I: Interner> ty::Binder<I, ExistentialPredicate<I>> {
327331
}
328332

329333
/// An existential reference to a trait, where `Self` is erased.
334+
///
330335
/// For example, the trait object `Trait<'a, 'b, X, Y>` is:
331336
/// ```ignore (illustrative)
332337
/// exists T. T: Trait<'a, 'b, X, Y>
@@ -442,6 +447,7 @@ impl<I: Interner> ExistentialProjection<I> {
442447
}
443448

444449
/// Extracts the underlying existential trait reference from this projection.
450+
///
445451
/// For example, if this is a projection of `exists T. <T as Iterator>::Item == X`,
446452
/// then this function would return an `exists T. T: Iterator` existential trait
447453
/// reference.
@@ -493,14 +499,17 @@ impl<I: Interner> ty::Binder<I, ExistentialProjection<I>> {
493499
#[cfg_attr(feature = "nightly", derive(Encodable, Decodable, HashStable_NoContext))]
494500
pub enum AliasTermKind {
495501
/// A projection `<Type as Trait>::AssocType`.
502+
///
496503
/// Can get normalized away if monomorphic enough.
497504
ProjectionTy,
498505
/// An associated type in an inherent `impl`
499506
InherentTy,
500507
/// An opaque type (usually from `impl Trait` in type aliases or function return types)
508+
///
501509
/// Can only be normalized away in PostAnalysis mode or its defining scope.
502510
OpaqueTy,
503511
/// A free type alias that actually checks its trait bounds.
512+
///
504513
/// Currently only used if the type alias references opaque types.
505514
/// Can always be normalized away.
506515
FreeTy,

compiler/rustc_type_ir/src/ty_kind.rs

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,17 @@ mod closure;
2929
)]
3030
pub enum AliasTyKind {
3131
/// A projection `<Type as Trait>::AssocType`.
32+
///
3233
/// Can get normalized away if monomorphic enough.
3334
Projection,
3435
/// An associated type in an inherent `impl`
3536
Inherent,
3637
/// An opaque type (usually from `impl Trait` in type aliases or function return types)
38+
///
3739
/// Can only be normalized away in PostAnalysis mode or its defining scope.
3840
Opaque,
3941
/// A type alias that actually checks its trait bounds.
42+
///
4043
/// Currently only used if the type alias references opaque types.
4144
/// Can always be normalized away.
4245
Free,
@@ -99,7 +102,9 @@ pub enum TyKind<I: Interner> {
99102
/// An array with the given length. Written as `[T; N]`.
100103
Array(I::Ty, I::Const),
101104

102-
/// A pattern newtype. Takes any type and restricts its valid values to its pattern.
105+
/// A pattern newtype.
106+
///
107+
/// Takes any type and restricts its valid values to its pattern.
103108
/// This will also change the layout to take advantage of this restriction.
104109
/// Only `Copy` and `Clone` will automatically get implemented for pattern types.
105110
/// Auto-traits treat this as if it were an aggregate with a single nested type.
@@ -116,8 +121,9 @@ pub enum TyKind<I: Interner> {
116121
/// `&'a mut T` or `&'a T`.
117122
Ref(I::Region, I::Ty, Mutability),
118123

119-
/// The anonymous type of a function declaration/definition. Each
120-
/// function has a unique type.
124+
/// The anonymous type of a function declaration/definition.
125+
///
126+
/// Each function has a unique type.
121127
///
122128
/// For the function `fn foo() -> i32 { 3 }` this type would be
123129
/// shown to the user as `fn() -> i32 {foo}`.
@@ -129,7 +135,9 @@ pub enum TyKind<I: Interner> {
129135
/// ```
130136
FnDef(I::FunctionId, I::GenericArgs),
131137

132-
/// A pointer to a function. Written as `fn() -> i32`.
138+
/// A pointer to a function.
139+
///
140+
/// Written as `fn() -> i32`.
133141
///
134142
/// Note that both functions and closures start out as either
135143
/// [FnDef] or [Closure] which can be then be coerced to this variant.
@@ -179,6 +187,7 @@ pub enum TyKind<I: Interner> {
179187
Coroutine(I::CoroutineId, I::GenericArgs),
180188

181189
/// A type representing the types stored inside a coroutine.
190+
///
182191
/// This should only appear as part of the `CoroutineArgs`.
183192
///
184193
/// Unlike upvars, the witness can reference lifetimes from
@@ -210,6 +219,7 @@ pub enum TyKind<I: Interner> {
210219
Tuple(I::Tys),
211220

212221
/// A projection, opaque type, free type alias, or inherent associated type.
222+
///
213223
/// All of these types are represented as pairs of def-id and args, and can
214224
/// be normalized, so they are grouped conceptually.
215225
Alias(AliasTyKind, AliasTy<I>),
@@ -253,8 +263,9 @@ pub enum TyKind<I: Interner> {
253263
/// inside of the type.
254264
Infer(InferTy),
255265

256-
/// A placeholder for a type which could not be computed; this is
257-
/// propagated to avoid useless error messages.
266+
/// A placeholder for a type which could not be computed.
267+
///
268+
/// This is propagated to avoid useless error messages.
258269
Error(I::ErrorGuaranteed),
259270
}
260271

@@ -282,7 +293,9 @@ impl<I: Interner> TyKind<I> {
282293
}
283294

284295
/// Returns `true` when the outermost type cannot be further normalized,
285-
/// resolved, or instantiated. This includes all primitive types, but also
296+
/// resolved, or instantiated.
297+
///
298+
/// This includes all primitive types, but also
286299
/// things like ADTs and trait objects, since even if their arguments or
287300
/// nested types may be further simplified, the outermost [`ty::TyKind`] or
288301
/// type constructor remains the same.
@@ -481,6 +494,7 @@ impl<I: Interner> AliasTy<I> {
481494
}
482495

483496
/// Extracts the underlying trait reference and own args from this projection.
497+
///
484498
/// For example, if this is a projection of `<T as StreamingIterator>::Item<'a>`,
485499
/// then this function would return a `T: StreamingIterator` trait reference and
486500
/// `['a]` as the own args.
@@ -490,6 +504,7 @@ impl<I: Interner> AliasTy<I> {
490504
}
491505

492506
/// Extracts the underlying trait reference from this projection.
507+
///
493508
/// For example, if this is a projection of `<T as Iterator>::Item`,
494509
/// then this function would return a `T: Iterator` trait reference.
495510
///
@@ -593,8 +608,9 @@ pub enum InferTy {
593608
FloatVar(FloatVid),
594609

595610
/// A [`FreshTy`][Self::FreshTy] is one that is generated as a replacement
596-
/// for an unbound type variable. This is convenient for caching etc. See
597-
/// `TypeFreshener` for more details.
611+
/// for an unbound type variable.
612+
///
613+
/// This is convenient for caching etc. See `TypeFreshener` for more details.
598614
///
599615
/// Compare with [`TyVar`][Self::TyVar].
600616
FreshTy(u32),

rust-bors.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ labels_blocking_approval = [
2525
"S-waiting-on-t-rustdoc-frontend",
2626
"S-waiting-on-t-clippy",
2727
# PR manually set to blocked
28-
"S-blocked"
28+
"S-blocked",
2929
]
3030

3131
# If CI runs quicker than this duration, consider it to be a failure
@@ -41,30 +41,30 @@ approved = [
4141
"-S-waiting-on-author",
4242
"-S-waiting-on-crater",
4343
"-S-waiting-on-review",
44-
"-S-waiting-on-team"
44+
"-S-waiting-on-team",
4545
]
4646
unapproved = [
4747
"+S-waiting-on-author",
4848
"-S-blocked",
4949
"-S-waiting-on-bors",
5050
"-S-waiting-on-crater",
5151
"-S-waiting-on-review",
52-
"-S-waiting-on-team"
52+
"-S-waiting-on-team",
5353
]
5454
try_failed = [
5555
"+S-waiting-on-author",
5656
"-S-waiting-on-review",
57-
"-S-waiting-on-crater"
57+
"-S-waiting-on-crater",
5858
]
5959
auto_build_succeeded = [
6060
"+merged-by-bors",
61-
"-S-waiting-on-bors"
61+
"-S-waiting-on-bors",
6262
]
6363
auto_build_failed = [
6464
"+S-waiting-on-review",
6565
"-S-blocked",
6666
"-S-waiting-on-bors",
6767
"-S-waiting-on-author",
6868
"-S-waiting-on-crater",
69-
"-S-waiting-on-team"
69+
"-S-waiting-on-team",
7070
]

0 commit comments

Comments
 (0)