Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit bf242bb

Browse files
committedFeb 9, 2022
Auto merge of rust-lang#93795 - JohnTitor:rollup-n0dmsoo, r=JohnTitor
Rollup of 7 pull requests Successful merges: - rust-lang#93445 (Add From<u8> for ExitCode) - rust-lang#93694 (rustdoc: tweak line spacing and paragraph spacing for accessibility) - rust-lang#93735 (Stabilize int_abs_diff in 1.60.0.) - rust-lang#93746 (Remove defaultness from ImplItem.) - rust-lang#93748 (rustc_query_impl: reduce visibility of some modules/fn's) - rust-lang#93751 (Drop tracking: track borrows of projections) - rust-lang#93781 (update `ty::TyKind` documentation) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2 parents e1f586c + 7f4486b commit bf242bb

File tree

31 files changed

+246
-173
lines changed

31 files changed

+246
-173
lines changed
 

‎compiler/rustc_ast_lowering/src/item.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -894,17 +894,13 @@ impl<'hir> LoweringContext<'_, 'hir> {
894894
AssocItemKind::MacCall(..) => panic!("`TyMac` should have been expanded by now"),
895895
};
896896

897-
// Since `default impl` is not yet implemented, this is always true in impls.
898-
let has_value = true;
899-
let (defaultness, _) = self.lower_defaultness(i.kind.defaultness(), has_value);
900897
let hir_id = self.lower_node_id(i.id);
901898
self.lower_attrs(hir_id, &i.attrs);
902899
let item = hir::ImplItem {
903900
def_id: hir_id.expect_owner(),
904901
ident: self.lower_ident(i.ident),
905902
generics,
906903
vis: self.lower_visibility(&i.vis),
907-
defaultness,
908904
kind,
909905
span: self.lower_span(i.span),
910906
};

‎compiler/rustc_hir/src/hir.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2112,7 +2112,6 @@ pub struct ImplItem<'hir> {
21122112
pub ident: Ident,
21132113
pub def_id: LocalDefId,
21142114
pub vis: Visibility<'hir>,
2115-
pub defaultness: Defaultness,
21162115
pub generics: Generics<'hir>,
21172116
pub kind: ImplItemKind<'hir>,
21182117
pub span: Span,
@@ -3310,6 +3309,6 @@ mod size_asserts {
33103309

33113310
rustc_data_structures::static_assert_size!(super::Item<'static>, 184);
33123311
rustc_data_structures::static_assert_size!(super::TraitItem<'static>, 128);
3313-
rustc_data_structures::static_assert_size!(super::ImplItem<'static>, 152);
3312+
rustc_data_structures::static_assert_size!(super::ImplItem<'static>, 144);
33143313
rustc_data_structures::static_assert_size!(super::ForeignItem<'static>, 136);
33153314
}

‎compiler/rustc_hir/src/intravisit.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1020,12 +1020,10 @@ pub fn walk_trait_item_ref<'v, V: Visitor<'v>>(visitor: &mut V, trait_item_ref:
10201020

10211021
pub fn walk_impl_item<'v, V: Visitor<'v>>(visitor: &mut V, impl_item: &'v ImplItem<'v>) {
10221022
// N.B., deliberately force a compilation error if/when new fields are added.
1023-
let ImplItem { def_id: _, ident, ref vis, ref defaultness, ref generics, ref kind, span: _ } =
1024-
*impl_item;
1023+
let ImplItem { def_id: _, ident, ref vis, ref generics, ref kind, span: _ } = *impl_item;
10251024

10261025
visitor.visit_ident(ident);
10271026
visitor.visit_vis(vis);
1028-
visitor.visit_defaultness(defaultness);
10291027
visitor.visit_generics(generics);
10301028
match *kind {
10311029
ImplItemKind::Const(ref ty, body) => {

‎compiler/rustc_hir/src/stable_hash_impls.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,13 +164,11 @@ impl<HirCtx: crate::HashStableContext> HashStable<HirCtx> for TraitItem<'_> {
164164

165165
impl<HirCtx: crate::HashStableContext> HashStable<HirCtx> for ImplItem<'_> {
166166
fn hash_stable(&self, hcx: &mut HirCtx, hasher: &mut StableHasher) {
167-
let ImplItem { def_id: _, ident, ref vis, defaultness, ref generics, ref kind, span } =
168-
*self;
167+
let ImplItem { def_id: _, ident, ref vis, ref generics, ref kind, span } = *self;
169168

170169
hcx.hash_hir_item_like(|hcx| {
171170
ident.name.hash_stable(hcx, hasher);
172171
vis.hash_stable(hcx, hasher);
173-
defaultness.hash_stable(hcx, hasher);
174172
generics.hash_stable(hcx, hasher);
175173
kind.hash_stable(hcx, hasher);
176174
span.hash_stable(hcx, hasher);

‎compiler/rustc_hir_pretty/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -923,7 +923,6 @@ impl<'a> State<'a> {
923923
self.hardbreak_if_not_bol();
924924
self.maybe_print_comment(ii.span.lo());
925925
self.print_outer_attributes(self.attrs(ii.hir_id()));
926-
self.print_defaultness(ii.defaultness);
927926

928927
match ii.kind {
929928
hir::ImplItemKind::Const(ref ty, expr) => {

‎compiler/rustc_interface/src/tests.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -730,6 +730,7 @@ fn test_debugging_options_tracking_hash() {
730730
tracked!(debug_info_for_profiling, true);
731731
tracked!(debug_macros, true);
732732
tracked!(dep_info_omit_d_target, true);
733+
tracked!(drop_tracking, true);
733734
tracked!(dual_proc_macros, true);
734735
tracked!(fewer_names, Some(true));
735736
tracked!(force_unstable_if_unmarked, true);

‎compiler/rustc_middle/src/ty/sty.rs

Lines changed: 69 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,10 @@ impl BoundRegionKind {
7474
}
7575
}
7676

77-
/// Defines the kinds of types.
77+
/// Defines the kinds of types used by the type system.
7878
///
79-
/// N.B., if you change this, you'll probably want to change the corresponding
80-
/// AST structure in `rustc_ast/src/ast.rs` as well.
79+
/// Types written by the user start out as [hir::TyKind](rustc_hir::TyKind) and get
80+
/// converted to this representation using `AstConv::ast_ty_to_ty`.
8181
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash, TyEncodable, TyDecodable, Debug)]
8282
#[derive(HashStable)]
8383
#[rustc_diagnostic_item = "TyKind"]
@@ -100,10 +100,11 @@ pub enum TyKind<'tcx> {
100100

101101
/// Algebraic data types (ADT). For example: structures, enumerations and unions.
102102
///
103-
/// InternalSubsts here, possibly against intuition, *may* contain `Param`s.
104-
/// That is, even after substitution it is possible that there are type
105-
/// variables. This happens when the `Adt` corresponds to an ADT
106-
/// definition and not a concrete use of it.
103+
/// For example, the type `List<i32>` would be represented using the `AdtDef`
104+
/// for `struct List<T>` and the substs `[i32]`.
105+
///
106+
/// Note that generic parameters in fields only get lazily substituted
107+
/// by using something like `adt_def.all_fields().map(|field| field.ty(tcx, substs))`.
107108
Adt(&'tcx AdtDef, SubstsRef<'tcx>),
108109

109110
/// An unsized FFI type that is opaque to Rust. Written as `extern type T`.
@@ -112,7 +113,7 @@ pub enum TyKind<'tcx> {
112113
/// The pointee of a string slice. Written as `str`.
113114
Str,
114115

115-
/// An array with the given length. Written as `[T; n]`.
116+
/// An array with the given length. Written as `[T; N]`.
116117
Array(Ty<'tcx>, &'tcx ty::Const<'tcx>),
117118

118119
/// The pointee of an array slice. Written as `[T]`.
@@ -126,11 +127,12 @@ pub enum TyKind<'tcx> {
126127
Ref(Region<'tcx>, Ty<'tcx>, hir::Mutability),
127128

128129
/// The anonymous type of a function declaration/definition. Each
129-
/// function has a unique type, which is output (for a function
130-
/// named `foo` returning an `i32`) as `fn() -> i32 {foo}`.
130+
/// function has a unique type.
131131
///
132-
/// For example the type of `bar` here:
132+
/// For the function `fn foo() -> i32 { 3 }` this type would be
133+
/// shown to the user as `fn() -> i32 {foo}`.
133134
///
135+
/// For example the type of `bar` here:
134136
/// ```rust
135137
/// fn foo() -> i32 { 1 }
136138
/// let bar = foo; // bar: fn() -> i32 {foo}
@@ -139,6 +141,9 @@ pub enum TyKind<'tcx> {
139141

140142
/// A pointer to a function. Written as `fn() -> i32`.
141143
///
144+
/// Note that both functions and closures start out as either
145+
/// [FnDef] or [Closure] which can be then be coerced to this variant.
146+
///
142147
/// For example the type of `bar` here:
143148
///
144149
/// ```rust
@@ -150,17 +155,41 @@ pub enum TyKind<'tcx> {
150155
/// A trait object. Written as `dyn for<'b> Trait<'b, Assoc = u32> + Send + 'a`.
151156
Dynamic(&'tcx List<Binder<'tcx, ExistentialPredicate<'tcx>>>, ty::Region<'tcx>),
152157

153-
/// The anonymous type of a closure. Used to represent the type of
154-
/// `|a| a`.
155-
/// For the order of the substs see the `ClosureSubsts` type's documentation.
158+
/// The anonymous type of a closure. Used to represent the type of `|a| a`.
159+
///
160+
/// Closure substs contain both the - potentially substituted - generic parameters
161+
/// of its parent and some synthetic parameters. See the documentation for
162+
/// [ClosureSubsts] for more details.
156163
Closure(DefId, SubstsRef<'tcx>),
157164

158165
/// The anonymous type of a generator. Used to represent the type of
159166
/// `|a| yield a`.
167+
///
168+
/// For more info about generator substs, visit the documentation for
169+
/// [GeneratorSubsts].
160170
Generator(DefId, SubstsRef<'tcx>, hir::Movability),
161171

162172
/// A type representing the types stored inside a generator.
163-
/// This should only appear in GeneratorInteriors.
173+
/// This should only appear as part of the [GeneratorSubsts].
174+
///
175+
/// Note that the captured variables for generators are stored separately
176+
/// using a tuple in the same way as for closures.
177+
///
178+
/// Unlike upvars, the witness can reference lifetimes from
179+
/// inside of the generator itself. To deal with them in
180+
/// the type of the generator, we convert them to higher ranked
181+
/// lifetimes bound by the witness itself.
182+
///
183+
/// Looking at the following example, the witness for this generator
184+
/// may end up as something like `for<'a> [Vec<i32>, &'a Vec<i32>]`:
185+
///
186+
/// ```rust
187+
/// |a| {
188+
/// let x = &vec![3];
189+
/// yield a;
190+
/// yield x[0];
191+
/// }
192+
/// ```
164193
GeneratorWitness(Binder<'tcx, &'tcx List<Ty<'tcx>>>),
165194

166195
/// The never type `!`.
@@ -175,23 +204,44 @@ pub enum TyKind<'tcx> {
175204
Projection(ProjectionTy<'tcx>),
176205

177206
/// Opaque (`impl Trait`) type found in a return type.
207+
///
178208
/// The `DefId` comes either from
179209
/// * the `impl Trait` ast::Ty node,
180210
/// * or the `type Foo = impl Trait` declaration
181-
/// The substitutions are for the generics of the function in question.
182-
/// After typeck, the concrete type can be found in the `types` map.
211+
///
212+
/// For RPIT the substitutions are for the generics of the function,
213+
/// while for TAIT it is used for the generic parameters of the alias.
214+
///
215+
/// During codegen, `tcx.type_of(def_id)` can be used to get the underlying type.
183216
Opaque(DefId, SubstsRef<'tcx>),
184217

185218
/// A type parameter; for example, `T` in `fn f<T>(x: T) {}`.
186219
Param(ParamTy),
187220

188-
/// Bound type variable, used only when preparing a trait query.
221+
/// Bound type variable, used to represent the `'a` in `for<'a> fn(&'a ())`.
222+
///
223+
/// For canonical queries, we replace inference variables with bound variables,
224+
/// so e.g. when checking whether `&'_ (): Trait<_>` holds, we canonicalize that to
225+
/// `for<'a, T> &'a (): Trait<T>` and then convert the introduced bound variables
226+
/// back to inference variables in a new inference context when inside of the query.
227+
///
228+
/// See the `rustc-dev-guide` for more details about
229+
/// [higher-ranked trait bounds][1] and [canonical queries][2].
230+
///
231+
/// [1]: https://rustc-dev-guide.rust-lang.org/traits/hrtb.html
232+
/// [2]: https://rustc-dev-guide.rust-lang.org/traits/canonical-queries.html
189233
Bound(ty::DebruijnIndex, BoundTy),
190234

191-
/// A placeholder type - universally quantified higher-ranked type.
235+
/// A placeholder type, used during higher ranked subtyping to instantiate
236+
/// bound variables.
192237
Placeholder(ty::PlaceholderType),
193238

194239
/// A type variable used during type checking.
240+
///
241+
/// Similar to placeholders, inference variables also live in a universe to
242+
/// correctly deal with higher ranked types. Though unlike placeholders,
243+
/// that universe is stored in the `InferCtxt` instead of directly
244+
/// inside of the type.
195245
Infer(InferTy),
196246

197247
/// A placeholder for a type which could not be computed; this is

‎compiler/rustc_query_impl/src/plumbing.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ macro_rules! define_queries {
299299
}
300300

301301
#[allow(nonstandard_style)]
302-
pub mod queries {
302+
mod queries {
303303
use std::marker::PhantomData;
304304

305305
$(pub struct $name<$tcx> {
@@ -353,7 +353,7 @@ macro_rules! define_queries {
353353
})*
354354

355355
#[allow(nonstandard_style)]
356-
pub mod query_callbacks {
356+
mod query_callbacks {
357357
use super::*;
358358
use rustc_middle::dep_graph::DepNode;
359359
use rustc_middle::ty::query::query_keys;
@@ -402,7 +402,7 @@ macro_rules! define_queries {
402402
}
403403
}
404404

405-
$(pub fn $name()-> DepKindStruct {
405+
$(pub(crate) fn $name()-> DepKindStruct {
406406
let is_anon = is_anon!([$($modifiers)*]);
407407
let is_eval_always = is_eval_always!([$($modifiers)*]);
408408

‎compiler/rustc_session/src/options.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1173,6 +1173,8 @@ options! {
11731173
dont_buffer_diagnostics: bool = (false, parse_bool, [UNTRACKED],
11741174
"emit diagnostics rather than buffering (breaks NLL error downgrading, sorting) \
11751175
(default: no)"),
1176+
drop_tracking: bool = (false, parse_bool, [TRACKED],
1177+
"enables drop tracking in generators (default: no)"),
11761178
dual_proc_macros: bool = (false, parse_bool, [TRACKED],
11771179
"load proc macros for both target and host, but only link to the target (default: no)"),
11781180
dump_dep_graph: bool = (false, parse_bool, [UNTRACKED],

‎compiler/rustc_typeck/src/check/generator_interior.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,6 @@ use tracing::debug;
2222

2323
mod drop_ranges;
2424

25-
// FIXME(eholk): This flag is here to give a quick way to disable drop tracking in case we find
26-
// unexpected breakages while it's still new. It should be removed before too long. For example,
27-
// see #93161.
28-
const ENABLE_DROP_TRACKING: bool = false;
29-
3025
struct InteriorVisitor<'a, 'tcx> {
3126
fcx: &'a FnCtxt<'a, 'tcx>,
3227
types: FxIndexSet<ty::GeneratorInteriorTypeCause<'tcx>>,
@@ -82,7 +77,7 @@ impl<'a, 'tcx> InteriorVisitor<'a, 'tcx> {
8277
yield_data.expr_and_pat_count, self.expr_count, source_span
8378
);
8479

85-
if ENABLE_DROP_TRACKING
80+
if self.fcx.sess().opts.debugging_opts.drop_tracking
8681
&& self
8782
.drop_ranges
8883
.is_dropped_at(hir_id, yield_data.expr_and_pat_count)
@@ -208,7 +203,7 @@ pub fn resolve_interior<'a, 'tcx>(
208203
};
209204
intravisit::walk_body(&mut visitor, body);
210205

211-
// Check that we visited the same amount of expressions and the RegionResolutionVisitor
206+
// Check that we visited the same amount of expressions as the RegionResolutionVisitor
212207
let region_expr_count = visitor.region_scope_tree.body_expr_count(body_id).unwrap();
213208
assert_eq!(region_expr_count, visitor.expr_count);
214209

‎compiler/rustc_typeck/src/check/generator_interior/drop_ranges.rs

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ pub fn compute_drop_ranges<'a, 'tcx>(
3737
def_id: DefId,
3838
body: &'tcx Body<'tcx>,
3939
) -> DropRanges {
40-
if super::ENABLE_DROP_TRACKING {
40+
if fcx.sess().opts.debugging_opts.drop_tracking {
4141
let consumed_borrowed_places = find_consumed_and_borrowed(fcx, def_id, body);
4242

4343
let num_exprs = fcx.tcx.region_scope_tree(def_id).body_expr_count(body.id()).unwrap_or(0);
@@ -116,6 +116,18 @@ impl TrackedValue {
116116
TrackedValue::Variable(hir_id) | TrackedValue::Temporary(hir_id) => *hir_id,
117117
}
118118
}
119+
120+
fn from_place_with_projections_allowed(place_with_id: &PlaceWithHirId<'_>) -> Self {
121+
match place_with_id.place.base {
122+
PlaceBase::Rvalue | PlaceBase::StaticItem => {
123+
TrackedValue::Temporary(place_with_id.hir_id)
124+
}
125+
PlaceBase::Local(hir_id)
126+
| PlaceBase::Upvar(ty::UpvarId { var_path: ty::UpvarPath { hir_id }, .. }) => {
127+
TrackedValue::Variable(hir_id)
128+
}
129+
}
130+
}
119131
}
120132

121133
/// Represents a reason why we might not be able to convert a HirId or Place
@@ -142,15 +154,7 @@ impl TryFrom<&PlaceWithHirId<'_>> for TrackedValue {
142154
return Err(TrackedValueConversionError::PlaceProjectionsNotSupported);
143155
}
144156

145-
match place_with_id.place.base {
146-
PlaceBase::Rvalue | PlaceBase::StaticItem => {
147-
Ok(TrackedValue::Temporary(place_with_id.hir_id))
148-
}
149-
PlaceBase::Local(hir_id)
150-
| PlaceBase::Upvar(ty::UpvarId { var_path: ty::UpvarPath { hir_id }, .. }) => {
151-
Ok(TrackedValue::Variable(hir_id))
152-
}
153-
}
157+
Ok(TrackedValue::from_place_with_projections_allowed(place_with_id))
154158
}
155159
}
156160

‎compiler/rustc_typeck/src/check/generator_interior/drop_ranges/record_consumed_borrow.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,9 @@ impl<'tcx> expr_use_visitor::Delegate<'tcx> for ExprUseDelegate<'tcx> {
9696
_diag_expr_id: HirId,
9797
_bk: rustc_middle::ty::BorrowKind,
9898
) {
99-
place_with_id
100-
.try_into()
101-
.map_or(false, |tracked_value| self.places.borrowed.insert(tracked_value));
99+
self.places
100+
.borrowed
101+
.insert(TrackedValue::from_place_with_projections_allowed(place_with_id));
102102
}
103103

104104
fn mutate(

‎library/core/src/num/int_macros.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2420,14 +2420,14 @@ macro_rules! int_impl {
24202420
/// Basic usage:
24212421
///
24222422
/// ```
2423-
/// #![feature(int_abs_diff)]
24242423
#[doc = concat!("assert_eq!(100", stringify!($SelfT), ".abs_diff(80), 20", stringify!($UnsignedT), ");")]
24252424
#[doc = concat!("assert_eq!(100", stringify!($SelfT), ".abs_diff(110), 10", stringify!($UnsignedT), ");")]
24262425
#[doc = concat!("assert_eq!((-100", stringify!($SelfT), ").abs_diff(80), 180", stringify!($UnsignedT), ");")]
24272426
#[doc = concat!("assert_eq!((-100", stringify!($SelfT), ").abs_diff(-120), 20", stringify!($UnsignedT), ");")]
24282427
#[doc = concat!("assert_eq!(", stringify!($SelfT), "::MIN.abs_diff(", stringify!($SelfT), "::MAX), ", stringify!($UnsignedT), "::MAX);")]
24292428
/// ```
2430-
#[unstable(feature = "int_abs_diff", issue = "89492")]
2429+
#[stable(feature = "int_abs_diff", since = "1.60.0")]
2430+
#[rustc_const_stable(feature = "int_abs_diff", since = "1.60.0")]
24312431
#[must_use = "this returns the result of the operation, \
24322432
without modifying the original"]
24332433
#[inline]

‎library/core/src/num/uint_macros.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1635,11 +1635,11 @@ macro_rules! uint_impl {
16351635
/// Basic usage:
16361636
///
16371637
/// ```
1638-
/// #![feature(int_abs_diff)]
16391638
#[doc = concat!("assert_eq!(100", stringify!($SelfT), ".abs_diff(80), 20", stringify!($SelfT), ");")]
16401639
#[doc = concat!("assert_eq!(100", stringify!($SelfT), ".abs_diff(110), 10", stringify!($SelfT), ");")]
16411640
/// ```
1642-
#[unstable(feature = "int_abs_diff", issue = "89492")]
1641+
#[stable(feature = "int_abs_diff", since = "1.60.0")]
1642+
#[rustc_const_stable(feature = "int_abs_diff", since = "1.60.0")]
16431643
#[must_use = "this returns the result of the operation, \
16441644
without modifying the original"]
16451645
#[inline]

‎library/std/src/process.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1691,6 +1691,14 @@ impl ExitCode {
16911691
}
16921692
}
16931693

1694+
#[unstable(feature = "process_exitcode_placeholder", issue = "48711")]
1695+
impl From<u8> for ExitCode {
1696+
/// Construct an exit code from an arbitrary u8 value.
1697+
fn from(code: u8) -> Self {
1698+
ExitCode(imp::ExitCode::from(code))
1699+
}
1700+
}
1701+
16941702
impl Child {
16951703
/// Forces the child process to exit. If the child has already exited, an [`InvalidInput`]
16961704
/// error is returned.

‎library/std/src/sys/unix/process/process_common.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -476,6 +476,12 @@ impl ExitCode {
476476
}
477477
}
478478

479+
impl From<u8> for ExitCode {
480+
fn from(code: u8) -> Self {
481+
Self(code)
482+
}
483+
}
484+
479485
pub struct CommandArgs<'a> {
480486
iter: crate::slice::Iter<'a, CString>,
481487
}

‎library/std/src/sys/unsupported/process.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,15 @@ impl ExitCode {
162162
}
163163
}
164164

165+
impl From<u8> for ExitCode {
166+
fn from(code: u8) -> Self {
167+
match code {
168+
0 => Self::SUCCESS,
169+
1..=255 => Self::FAILURE,
170+
}
171+
}
172+
}
173+
165174
pub struct Process(!);
166175

167176
impl Process {

‎library/std/src/sys/windows/process.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -666,6 +666,12 @@ impl ExitCode {
666666
}
667667
}
668668

669+
impl From<u8> for ExitCode {
670+
fn from(code: u8) -> Self {
671+
ExitCode(c::DWORD::from(code))
672+
}
673+
}
674+
669675
fn zeroed_startupinfo() -> c::STARTUPINFO {
670676
c::STARTUPINFO {
671677
cb: 0,

‎src/librustdoc/clean/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1015,7 +1015,8 @@ impl Clean<Item> for hir::ImplItem<'_> {
10151015
{
10161016
m.header.constness = hir::Constness::NotConst;
10171017
}
1018-
MethodItem(m, Some(self.defaultness))
1018+
let defaultness = cx.tcx.associated_item(self.def_id).defaultness;
1019+
MethodItem(m, Some(defaultness))
10191020
}
10201021
hir::ImplItemKind::TyAlias(ref hir_ty) => {
10211022
let type_ = hir_ty.clean(cx);

‎src/librustdoc/html/static/css/rustdoc.css

Lines changed: 52 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,9 @@ html {
108108
/* General structure and fonts */
109109

110110
body {
111-
font: 1rem/1.4 "Source Serif 4", NanumBarunGothic, serif;
111+
/* Line spacing at least 1.5 per Web Content Accessibility Guidelines
112+
https://www.w3.org/WAI/WCAG21/Understanding/visual-presentation.html */
113+
font: 1rem/1.5 "Source Serif 4", NanumBarunGothic, serif;
112114
margin: 0;
113115
position: relative;
114116
/* We use overflow-wrap: break-word for Safari, which doesn't recognize
@@ -124,13 +126,13 @@ body {
124126
}
125127

126128
h1 {
127-
font-size: 1.5rem;
129+
font-size: 1.5rem; /* 24px */
128130
}
129131
h2 {
130-
font-size: 1.4rem;
132+
font-size: 1.375rem; /* 22px */
131133
}
132134
h3 {
133-
font-size: 1.3rem;
135+
font-size: 1.25rem; /* 20px */
134136
}
135137
h1, h2, h3, h4, h5, h6 {
136138
font-weight: 500;
@@ -170,7 +172,7 @@ h2,
170172
border-bottom: 1px solid;
171173
}
172174
h3.code-header {
173-
font-size: 1.1rem;
175+
font-size: 1.125rem; /* 18px */
174176
}
175177
h4.code-header {
176178
font-size: 1rem;
@@ -221,19 +223,18 @@ a.srclink,
221223
font-family: "Fira Sans", Arial, NanumBarunGothic, sans-serif;
222224
}
223225

224-
.content ul.crate a.crate {
225-
font-size: 1rem/1.6;
226-
}
227-
228226
ol, ul {
229-
padding-left: 25px;
227+
padding-left: 24px;
230228
}
231229
ul ul, ol ul, ul ol, ol ol {
232-
margin-bottom: .6em;
230+
margin-bottom: .625em;
233231
}
234232

235233
p {
236-
margin: 0 0 .6em 0;
234+
/* Paragraph spacing at least 1.5 times line spacing per Web Content Accessibility Guidelines.
235+
Line-height is 1.5rem, so line spacing is .5rem; .75em is 1.5 times that.
236+
https://www.w3.org/WAI/WCAG21/Understanding/visual-presentation.html */
237+
margin: 0 0 .75em 0;
237238
}
238239

239240
summary {
@@ -303,7 +304,7 @@ code, pre, a.test-arrow, .code-header {
303304
}
304305
.docblock code, .docblock-short code {
305306
border-radius: 3px;
306-
padding: 0 0.1em;
307+
padding: 0 0.125em;
307308
}
308309
.docblock pre code, .docblock-short pre code {
309310
padding: 0;
@@ -364,7 +365,7 @@ nav.sub {
364365
}
365366

366367
.sidebar {
367-
font-size: 0.9rem;
368+
font-size: 0.875rem;
368369
width: 250px;
369370
min-width: 200px;
370371
overflow-y: scroll;
@@ -476,8 +477,8 @@ nav.sub {
476477
.block a,
477478
h2.location a {
478479
display: block;
479-
padding: 0.3rem;
480-
margin-left: -0.3rem;
480+
padding: 0.25rem;
481+
margin-left: -0.25rem;
481482

482483
text-overflow: ellipsis;
483484
overflow: hidden;
@@ -497,7 +498,7 @@ h2.location a {
497498
}
498499

499500
.sidebar h3 {
500-
font-size: 1.1rem;
501+
font-size: 1.125rem; /* 18px */
501502
font-weight: 500;
502503
padding: 0;
503504
margin: 0;
@@ -598,18 +599,18 @@ h2.location a {
598599
white-space: pre-wrap;
599600
}
600601

601-
.top-doc .docblock h2 { font-size: 1.3rem; }
602-
.top-doc .docblock h3 { font-size: 1.15rem; }
602+
.top-doc .docblock h2 { font-size: 1.375rem; }
603+
.top-doc .docblock h3 { font-size: 1.25; }
603604
.top-doc .docblock h4,
604605
.top-doc .docblock h5 {
605-
font-size: 1.1rem;
606+
font-size: 1.125rem;
606607
}
607608
.top-doc .docblock h6 {
608609
font-size: 1rem;
609610
}
610611

611612
.docblock h5 { font-size: 1rem; }
612-
.docblock h6 { font-size: 0.95rem; }
613+
.docblock h6 { font-size: 0.875rem; }
613614

614615
.docblock {
615616
margin-left: 24px;
@@ -623,12 +624,12 @@ h2.location a {
623624

624625
.content .out-of-band {
625626
flex-grow: 0;
626-
font-size: 1.15rem;
627+
font-size: 1.125rem;
627628
font-weight: normal;
628629
float: right;
629630
}
630631

631-
.method > .code-header, .trait-impl > .code-header, .invisible > .code-header {
632+
.method > .code-header, .trait-impl > .code-header {
632633
max-width: calc(100% - 41px);
633634
display: block;
634635
}
@@ -664,7 +665,7 @@ h2.location a {
664665
.content td { vertical-align: top; }
665666
.content td:first-child { padding-right: 20px; }
666667
.content td p:first-child { margin-top: 0; }
667-
.content td h1, .content td h2 { margin-left: 0; font-size: 1.1rem; }
668+
.content td h1, .content td h2 { margin-left: 0; font-size: 1.125rem; }
668669
.content tr:first-child td { border-top: 0; }
669670

670671
.docblock table {
@@ -713,7 +714,7 @@ h2.location a {
713714
.content .fn .where,
714715
.content .where.fmt-newline {
715716
display: block;
716-
font-size: 0.8rem;
717+
font-size: 0.875rem;
717718
}
718719

719720
.content .methods > div:not(.notable-traits):not(.method) {
@@ -736,7 +737,7 @@ h2.location a {
736737
}
737738

738739
.content .item-info code {
739-
font-size: 0.81rem;
740+
font-size: 0.875rem;
740741
}
741742

742743
.content .item-info {
@@ -839,15 +840,6 @@ h2.small-section-header > .anchor {
839840
text-decoration: underline;
840841
}
841842

842-
.invisible > .srclink,
843-
.method > .code-header + .srclink {
844-
position: absolute;
845-
top: 0;
846-
right: 0;
847-
font-size: 1.0625rem;
848-
font-weight: normal;
849-
}
850-
851843
.block a.current.crate { font-weight: 500; }
852844

853845
/* In most contexts we use `overflow-wrap: anywhere` to ensure that we can wrap
@@ -885,7 +877,7 @@ table,
885877
display: table-cell;
886878
}
887879
.item-left {
888-
padding-right: 1.2rem;
880+
padding-right: 1.25rem;
889881
}
890882

891883
.search-container {
@@ -907,8 +899,8 @@ table,
907899
#crate-search {
908900
min-width: 115px;
909901
margin-top: 5px;
910-
margin-left: 0.2em;
911-
padding-left: 0.3em;
902+
margin-left: 0.25em;
903+
padding-left: 0.3125em;
912904
padding-right: 23px;
913905
border: 0;
914906
border-radius: 4px;
@@ -942,7 +934,7 @@ table,
942934
border: 1px solid;
943935
border-radius: 2px;
944936
padding: 5px 8px;
945-
font-size: 1.0625rem;
937+
font-size: 1rem;
946938
transition: border-color 300ms ease;
947939
width: 100%;
948940
}
@@ -1054,15 +1046,15 @@ body.blur > :not(#help) {
10541046
.stab {
10551047
padding: 3px;
10561048
margin-bottom: 5px;
1057-
font-size: 0.9rem;
1049+
font-size: 0.875rem;
10581050
font-weight: normal;
10591051
}
10601052
.stab p {
10611053
display: inline;
10621054
}
10631055

10641056
.stab .emoji {
1065-
font-size: 1.2rem;
1057+
font-size: 1.25rem;
10661058
}
10671059

10681060
/* Black one-pixel outline around emoji shapes */
@@ -1078,10 +1070,10 @@ body.blur > :not(#help) {
10781070
.import-item .stab {
10791071
border-radius: 3px;
10801072
display: inline-block;
1081-
font-size: 0.8rem;
1073+
font-size: 0.875rem;
10821074
line-height: 1.2;
10831075
margin-bottom: 0;
1084-
margin-left: .3em;
1076+
margin-left: 0.3125em;
10851077
padding: 2px;
10861078
vertical-align: text-bottom;
10871079
}
@@ -1107,9 +1099,6 @@ body.blur > :not(#help) {
11071099
font-weight: normal;
11081100
font-size: 1rem;
11091101
}
1110-
.impl .srclink {
1111-
font-size: 1.0625rem;
1112-
}
11131102

11141103
.rightside {
11151104
float: right;
@@ -1141,7 +1130,7 @@ a.test-arrow {
11411130
position: absolute;
11421131
padding: 5px 10px 5px 10px;
11431132
border-radius: 5px;
1144-
font-size: 1.3rem;
1133+
font-size: 1.375rem;
11451134
top: 5px;
11461135
right: 5px;
11471136
z-index: 1;
@@ -1179,7 +1168,7 @@ a.test-arrow:hover{
11791168

11801169
h3.variant {
11811170
font-weight: 600;
1182-
font-size: 1.1rem;
1171+
font-size: 1.125rem;
11831172
margin-bottom: 10px;
11841173
border-bottom: none;
11851174
}
@@ -1391,7 +1380,7 @@ pre.rust {
13911380
left: 0;
13921381
cursor: pointer;
13931382
font-weight: bold;
1394-
font-size: 1.2rem;
1383+
font-size: 1.25rem;
13951384
border-bottom: 1px solid;
13961385
display: flex;
13971386
height: 40px;
@@ -1516,12 +1505,9 @@ kbd {
15161505
}
15171506
.table-display .out-of-band {
15181507
position: relative;
1519-
font-size: 1.1875rem;
1508+
font-size: 1.125rem;
15201509
display: block;
15211510
}
1522-
#implementors-list > .impl-items .table-display .out-of-band {
1523-
font-size: 1.0625rem;
1524-
}
15251511

15261512
.table-display td:hover .anchor {
15271513
display: block;
@@ -1562,7 +1548,7 @@ div.name.expand + .children {
15621548
div.name::before {
15631549
content: "\25B6";
15641550
padding-left: 4px;
1565-
font-size: 0.7rem;
1551+
font-size: 0.625rem;
15661552
position: absolute;
15671553
left: -16px;
15681554
top: 4px;
@@ -1595,8 +1581,8 @@ details.rustdoc-toggle > summary.hideme > span {
15951581
details.rustdoc-toggle > summary::before {
15961582
content: "";
15971583
cursor: pointer;
1598-
width: 17px;
1599-
height: max(17px, 1.1em);
1584+
width: 16px;
1585+
height: 16px;
16001586
background-repeat: no-repeat;
16011587
background-position: top left;
16021588
display: inline-block;
@@ -1643,7 +1629,7 @@ details.rustdoc-toggle > summary.hideme::before {
16431629
details.rustdoc-toggle > summary:not(.hideme)::before {
16441630
position: absolute;
16451631
left: -24px;
1646-
top: 3px;
1632+
top: 4px;
16471633
}
16481634

16491635
.impl-items > details.rustdoc-toggle > summary:not(.hideme)::before {
@@ -1680,8 +1666,8 @@ details.undocumented > summary::before, details.rustdoc-toggle > summary::before
16801666

16811667
details.rustdoc-toggle[open] > summary::before,
16821668
details.rustdoc-toggle[open] > summary.hideme::before {
1683-
width: 17px;
1684-
height: max(17px, 1.1em);
1669+
width: 16px;
1670+
height: 16px;
16851671
background-repeat: no-repeat;
16861672
background-position: top left;
16871673
display: inline-block;
@@ -1808,8 +1794,14 @@ details.rustdoc-toggle[open] > summary.hideme::after {
18081794
width: 0;
18091795
}
18101796

1797+
.mobile-topbar .location a {
1798+
padding: 0;
1799+
margin: 0;
1800+
}
1801+
18111802
.mobile-topbar .location {
18121803
border: none;
1804+
padding: 0;
18131805
margin: auto 0.5em auto auto;
18141806
text-overflow: ellipsis;
18151807
overflow: hidden;
@@ -1818,7 +1810,7 @@ details.rustdoc-toggle[open] > summary.hideme::after {
18181810
height is specified in pixels, this also has to be specified in
18191811
pixels to avoid overflowing the topbar when the user sets a bigger
18201812
font size. */
1821-
font-size: 22.4px;
1813+
font-size: 24px;
18221814
}
18231815

18241816
.mobile-topbar .logo-container {

‎src/test/incremental/hashes/trait_impls.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -358,9 +358,11 @@ pub trait AddDefaultTrait {
358358

359359
#[cfg(any(cfail1,cfail4))]
360360
impl AddDefaultTrait for Foo {
361-
// -------------------------------------------------------------------------------------------
361+
// ----------------------------------------------------
362362
// -------------------------
363-
fn method_name() { }
363+
// ----------------------------------------------------
364+
// -------------------------
365+
fn method_name() { }
364366
}
365367

366368
#[cfg(not(any(cfail1,cfail4)))]
@@ -369,9 +371,9 @@ impl AddDefaultTrait for Foo {
369371
#[rustc_clean(except="hir_owner,hir_owner_nodes", cfg="cfail5")]
370372
#[rustc_clean(cfg="cfail6")]
371373
impl AddDefaultTrait for Foo {
372-
#[rustc_clean(except="hir_owner,hir_owner_nodes,associated_item", cfg="cfail2")]
374+
#[rustc_clean(except="associated_item", cfg="cfail2")]
373375
#[rustc_clean(cfg="cfail3")]
374-
#[rustc_clean(except="hir_owner,hir_owner_nodes,associated_item,optimized_mir", cfg="cfail5")]
376+
#[rustc_clean(except="associated_item", cfg="cfail5")]
375377
#[rustc_clean(cfg="cfail6")]
376378
default fn method_name() { }
377379
}

‎src/test/rustdoc-gui/docblock-big-code-mobile.goml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ goto: file://|DOC_PATH|/test_docs/long_code_block/index.html
66
show-text: true // We need to enable text draw to be able to have the "real" size
77
// Little explanations for this test: if the text wasn't displayed on two lines, it would take
88
// around 20px (which is the font size).
9-
assert-property: (".docblock p > code", {"offsetHeight": "42"})
9+
assert-property: (".docblock p > code", {"offsetHeight": "44"})

‎src/test/rustdoc-gui/headings.goml

Lines changed: 35 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -6,34 +6,33 @@
66
// Most of these sizes are set in CSS in `em` units, so here's a conversion chart based on our
77
// default 16px font size:
88
// 24px 1.5em
9-
// 22.4px 1.4em
10-
// 20.8px 1.3em
11-
// 18.4px 1.15em
12-
// 17.6px 1.1em
13-
// 16px 1em
14-
// 15.2px 0.95em
9+
// 22px 1.375rem
10+
// 20px 1.25rem
11+
// 18px 1.125em
12+
// 16px 1rem
13+
// 14px 0.875rem
1514
goto: file://|DOC_PATH|/test_docs/struct.HeavilyDocumentedStruct.html
1615

1716
assert-css: ("h1.fqn", {"font-size": "24px"})
1817

19-
assert-css: ("h2#top-doc-prose-title", {"font-size": "20.8px"})
18+
assert-css: ("h2#top-doc-prose-title", {"font-size": "22px"})
2019
assert-css: ("h2#top-doc-prose-title", {"border-bottom-width": "1px"})
21-
assert-css: ("h3#top-doc-prose-sub-heading", {"font-size": "18.4px"})
20+
assert-css: ("h3#top-doc-prose-sub-heading", {"font-size": "20px"})
2221
assert-css: ("h3#top-doc-prose-sub-heading", {"border-bottom-width": "1px"})
23-
assert-css: ("h4#top-doc-prose-sub-sub-heading", {"font-size": "17.6px"})
22+
assert-css: ("h4#top-doc-prose-sub-sub-heading", {"font-size": "18px"})
2423
assert-css: ("h4#top-doc-prose-sub-sub-heading", {"border-bottom-width": "1px"})
2524

26-
assert-css: ("h2#fields", {"font-size": "22.4px"})
25+
assert-css: ("h2#fields", {"font-size": "22px"})
2726
assert-css: ("h2#fields", {"border-bottom-width": "1px"})
28-
assert-css: ("h3#title-for-field", {"font-size": "20.8px"})
27+
assert-css: ("h3#title-for-field", {"font-size": "20px"})
2928
assert-css: ("h3#title-for-field", {"border-bottom-width": "0px"})
3029
assert-css: ("h4#sub-heading-for-field", {"font-size": "16px"})
3130
assert-css: ("h4#sub-heading-for-field", {"border-bottom-width": "0px"})
3231

33-
assert-css: ("h2#implementations", {"font-size": "22.4px"})
32+
assert-css: ("h2#implementations", {"font-size": "22px"})
3433
assert-css: ("h2#implementations", {"border-bottom-width": "1px"})
3534

36-
assert-css: ("#impl > h3.code-header", {"font-size": "17.6px"})
35+
assert-css: ("#impl > h3.code-header", {"font-size": "18px"})
3736
assert-css: ("#impl > h3.code-header", {"border-bottom-width": "0px"})
3837
assert-css: ("#method\.do_nothing > h4.code-header", {"font-size": "16px"})
3938
assert-css: ("#method\.do_nothing > h4.code-header", {"border-bottom-width": "0px"})
@@ -42,27 +41,27 @@ assert-css: ("h4#title-for-struct-impl-doc", {"font-size": "16px"})
4241
assert-css: ("h4#title-for-struct-impl-doc", {"border-bottom-width": "0px"})
4342
assert-css: ("h5#sub-heading-for-struct-impl-doc", {"font-size": "16px"})
4443
assert-css: ("h5#sub-heading-for-struct-impl-doc", {"border-bottom-width": "0px"})
45-
assert-css: ("h6#sub-sub-heading-for-struct-impl-doc", {"font-size": "15.2px"})
44+
assert-css: ("h6#sub-sub-heading-for-struct-impl-doc", {"font-size": "14px"})
4645
assert-css: ("h6#sub-sub-heading-for-struct-impl-doc", {"border-bottom-width": "0px"})
4746

4847
assert-css: ("h5#title-for-struct-impl-item-doc", {"font-size": "16px"})
4948
assert-css: ("h5#title-for-struct-impl-item-doc", {"border-bottom-width": "0px"})
50-
assert-css: ("h6#sub-heading-for-struct-impl-item-doc", {"font-size": "15.2px"})
49+
assert-css: ("h6#sub-heading-for-struct-impl-item-doc", {"font-size": "14px"})
5150
assert-css: ("h6#sub-heading-for-struct-impl-item-doc", {"border-bottom-width": "0px"})
52-
assert-css: ("h6#sub-sub-heading-for-struct-impl-item-doc", {"font-size": "15.2px"})
51+
assert-css: ("h6#sub-sub-heading-for-struct-impl-item-doc", {"font-size": "14px"})
5352

5453
goto: file://|DOC_PATH|/test_docs/enum.HeavilyDocumentedEnum.html
5554

5655
assert-css: ("h1.fqn", {"font-size": "24px"})
5756

58-
assert-css: ("h2#top-doc-prose-title", {"font-size": "20.8px"})
57+
assert-css: ("h2#top-doc-prose-title", {"font-size": "22px"})
5958
assert-css: ("h2#top-doc-prose-title", {"border-bottom-width": "1px"})
60-
assert-css: ("h3#top-doc-prose-sub-heading", {"font-size": "18.4px"})
59+
assert-css: ("h3#top-doc-prose-sub-heading", {"font-size": "20px"})
6160
assert-css: ("h3#top-doc-prose-sub-heading", {"border-bottom-width": "1px"})
62-
assert-css: ("h4#top-doc-prose-sub-sub-heading", {"font-size": "17.6px"})
61+
assert-css: ("h4#top-doc-prose-sub-sub-heading", {"font-size": "18px"})
6362
assert-css: ("h4#top-doc-prose-sub-sub-heading", {"border-bottom-width": "1px"})
6463

65-
assert-css: ("h2#variants", {"font-size": "22.4px"})
64+
assert-css: ("h2#variants", {"font-size": "22px"})
6665
assert-css: ("h2#variants", {"border-bottom-width": "1px"})
6766

6867
assert-css: ("h4#none-prose-title", {"font-size": "16px"})
@@ -77,18 +76,18 @@ assert-css: ("h5#wrapped-prose-sub-heading", {"border-bottom-width": "0px"})
7776

7877
assert-css: ("h5#wrapped0-prose-title", {"font-size": "16px"})
7978
assert-css: ("h5#wrapped0-prose-title", {"border-bottom-width": "0px"})
80-
assert-css: ("h6#wrapped0-prose-sub-heading", {"font-size": "15.2px"})
79+
assert-css: ("h6#wrapped0-prose-sub-heading", {"font-size": "14px"})
8180
assert-css: ("h6#wrapped0-prose-sub-heading", {"border-bottom-width": "0px"})
8281

8382
assert-css: ("h5#structy-prose-title", {"font-size": "16px"})
8483
assert-css: ("h5#structy-prose-title", {"border-bottom-width": "0px"})
85-
assert-css: ("h6#structy-prose-sub-heading", {"font-size": "15.2px"})
84+
assert-css: ("h6#structy-prose-sub-heading", {"font-size": "14px"})
8685
assert-css: ("h6#structy-prose-sub-heading", {"border-bottom-width": "0px"})
8786

88-
assert-css: ("h2#implementations", {"font-size": "22.4px"})
87+
assert-css: ("h2#implementations", {"font-size": "22px"})
8988
assert-css: ("h2#implementations", {"border-bottom-width": "1px"})
9089

91-
assert-css: ("#impl > h3.code-header", {"font-size": "17.6px"})
90+
assert-css: ("#impl > h3.code-header", {"font-size": "18px"})
9291
assert-css: ("#impl > h3.code-header", {"border-bottom-width": "0px"})
9392
assert-css: ("#method\.do_nothing > h4.code-header", {"font-size": "16px"})
9493
assert-css: ("#method\.do_nothing > h4.code-header", {"border-bottom-width": "0px"})
@@ -97,14 +96,14 @@ assert-css: ("h4#title-for-enum-impl-doc", {"font-size": "16px"})
9796
assert-css: ("h4#title-for-enum-impl-doc", {"border-bottom-width": "0px"})
9897
assert-css: ("h5#sub-heading-for-enum-impl-doc", {"font-size": "16px"})
9998
assert-css: ("h5#sub-heading-for-enum-impl-doc", {"border-bottom-width": "0px"})
100-
assert-css: ("h6#sub-sub-heading-for-enum-impl-doc", {"font-size": "15.2px"})
99+
assert-css: ("h6#sub-sub-heading-for-enum-impl-doc", {"font-size": "14px"})
101100
assert-css: ("h6#sub-sub-heading-for-enum-impl-doc", {"border-bottom-width": "0px"})
102101

103102
assert-css: ("h5#title-for-enum-impl-item-doc", {"font-size": "16px"})
104103
assert-css: ("h5#title-for-enum-impl-item-doc", {"border-bottom-width": "0px"})
105-
assert-css: ("h6#sub-heading-for-enum-impl-item-doc", {"font-size": "15.2px"})
104+
assert-css: ("h6#sub-heading-for-enum-impl-item-doc", {"font-size": "14px"})
106105
assert-css: ("h6#sub-heading-for-enum-impl-item-doc", {"border-bottom-width": "0px"})
107-
assert-css: ("h6#sub-sub-heading-for-enum-impl-item-doc", {"font-size": "15.2px"})
106+
assert-css: ("h6#sub-sub-heading-for-enum-impl-item-doc", {"font-size": "14px"})
108107
assert-css: ("h6#sub-sub-heading-for-enum-impl-item-doc", {"border-bottom-width": "0px"})
109108

110109
assert-text: (".sidebar .others h3", "Modules")
@@ -114,23 +113,23 @@ goto: file://|DOC_PATH|/test_docs/union.HeavilyDocumentedUnion.html
114113

115114
assert-css: ("h1.fqn", {"font-size": "24px"})
116115

117-
assert-css: ("h2#top-doc-prose-title", {"font-size": "20.8px"})
116+
assert-css: ("h2#top-doc-prose-title", {"font-size": "22px"})
118117
assert-css: ("h2#top-doc-prose-title", {"border-bottom-width": "1px"})
119-
assert-css: ("h3#top-doc-prose-sub-heading", {"font-size": "18.4px"})
118+
assert-css: ("h3#top-doc-prose-sub-heading", {"font-size": "20px"})
120119
assert-css: ("h3#top-doc-prose-sub-heading", {"border-bottom-width": "1px"})
121120

122-
assert-css: ("h2#fields", {"font-size": "22.4px"})
121+
assert-css: ("h2#fields", {"font-size": "22px"})
123122
assert-css: ("h2#fields", {"border-bottom-width": "1px"})
124123

125-
assert-css: ("h3#title-for-union-variant", {"font-size": "20.8px"})
124+
assert-css: ("h3#title-for-union-variant", {"font-size": "20px"})
126125
assert-css: ("h3#title-for-union-variant", {"border-bottom-width": "0px"})
127126
assert-css: ("h4#sub-heading-for-union-variant", {"font-size": "16px"})
128127
assert-css: ("h4#sub-heading-for-union-variant", {"border-bottom-width": "0px"})
129128

130-
assert-css: ("h2#implementations", {"font-size": "22.4px"})
129+
assert-css: ("h2#implementations", {"font-size": "22px"})
131130
assert-css: ("h2#implementations", {"border-bottom-width": "1px"})
132131

133-
assert-css: ("#impl > h3.code-header", {"font-size": "17.6px"})
132+
assert-css: ("#impl > h3.code-header", {"font-size": "18px"})
134133
assert-css: ("#impl > h3.code-header", {"border-bottom-width": "0px"})
135134
assert-css: ("h4#title-for-union-impl-doc", {"font-size": "16px"})
136135
assert-css: ("h4#title-for-union-impl-doc", {"border-bottom-width": "0px"})
@@ -139,16 +138,16 @@ assert-css: ("h5#sub-heading-for-union-impl-doc", {"border-bottom-width": "0px"}
139138

140139
assert-css: ("h5#title-for-union-impl-item-doc", {"font-size": "16px"})
141140
assert-css: ("h5#title-for-union-impl-item-doc", {"border-bottom-width": "0px"})
142-
assert-css: ("h6#sub-heading-for-union-impl-item-doc", {"font-size": "15.2px"})
141+
assert-css: ("h6#sub-heading-for-union-impl-item-doc", {"font-size": "14px"})
143142
assert-css: ("h6#sub-heading-for-union-impl-item-doc", {"border-bottom-width": "0px"})
144143

145144
goto: file://|DOC_PATH|/test_docs/macro.heavily_documented_macro.html
146145

147146
assert-css: ("h1.fqn", {"font-size": "24px"})
148147

149-
assert-css: ("h2#top-doc-prose-title", {"font-size": "20.8px"})
148+
assert-css: ("h2#top-doc-prose-title", {"font-size": "22px"})
150149
assert-css: ("h2#top-doc-prose-title", {"border-bottom-width": "1px"})
151-
assert-css: ("h3#top-doc-prose-sub-heading", {"font-size": "18.4px"})
150+
assert-css: ("h3#top-doc-prose-sub-heading", {"font-size": "20px"})
152151
assert-css: ("h3#top-doc-prose-sub-heading", {"border-bottom-width": "1px"})
153152

154153
goto: file://|DOC_PATH|/staged_api/struct.Foo.html

‎src/test/rustdoc-gui/item-info-width.goml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ goto: file://|DOC_PATH|/lib2/struct.Foo.html
44
size: (1100, 800)
55
// We check that ".item-info" is bigger than its content.
66
assert-css: (".item-info", {"width": "790px"})
7-
assert-css: (".item-info .stab", {"width": "341px"})
7+
assert-css: (".item-info .stab", {"width": "340px"})
88
assert-position: (".item-info .stab", {"x": 295})

‎src/test/rustdoc-gui/mobile.goml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ assert-css: (".main-heading", {
1111
"flex-direction": "column"
1212
})
1313

14-
assert-property: (".mobile-topbar h2.location", {"offsetHeight": 48})
14+
assert-property: (".mobile-topbar h2.location", {"offsetHeight": 36})
1515

1616
// Note: We can't use assert-text here because the 'Since' is set by CSS and
1717
// is therefore not part of the DOM.

‎src/test/rustdoc-gui/sidebar-source-code.goml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ click: (10, 10)
1010
// We wait for the sidebar to be expanded (there is a 0.5s animation).
1111
wait-for: 600
1212
assert-css: ("nav.sidebar.expanded", {"width": "300px"})
13-
assert-css: ("nav.sidebar.expanded a", {"font-size": "14.4px"})
13+
assert-css: ("nav.sidebar.expanded a", {"font-size": "14px"})
1414
// We collapse the sidebar.
1515
click: (10, 10)
1616
// We wait for the sidebar to be collapsed (there is a 0.5s animation).

‎src/test/rustdoc-gui/sidebar.goml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ assert-text: ("#functions + .item-table .item-left > a", "foo")
7777

7878
// Links to trait implementations in the sidebar should not wrap even if they are long.
7979
goto: file://|DOC_PATH|/lib2/struct.HasALongTraitWithParams.html
80-
assert-property: (".sidebar-links a", {"offsetHeight": 30})
80+
assert-property: (".sidebar-links a", {"offsetHeight": 29})
8181

8282
// Test that clicking on of the "In <module>" headings in the sidebar links to the
8383
// appropriate anchor in index.html.

‎src/test/rustdoc-gui/src-font-size.goml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@
44
goto: file://|DOC_PATH|/test_docs/struct.Foo.html
55
show-text: true
66
// Check the impl headers.
7-
assert-css: (".impl.has-srclink .srclink", {"font-size": "17px"}, ALL)
8-
// The ".6" part is because the font-size is actually "1.1em".
9-
assert-css: (".impl.has-srclink .code-header.in-band", {"font-size": "17.6px"}, ALL)
7+
assert-css: (".impl.has-srclink .srclink", {"font-size": "16px"}, ALL)
8+
assert-css: (".impl.has-srclink .code-header.in-band", {"font-size": "18px"}, ALL)
109
// Check the impl items.
1110
assert-css: (".impl-items .has-srclink .srclink", {"font-size": "16px"}, ALL)
1211
assert-css: (".impl-items .has-srclink .code-header", {"font-size": "16px"}, ALL)

‎src/test/rustdoc-gui/type-declation-overflow.goml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,6 @@ assert-property: (".item-decl pre", {"scrollWidth": "950"})
3232
size: (600, 600)
3333
goto: file://|DOC_PATH|/lib2/too_long/struct.SuperIncrediblyLongLongLongLongLongLongLongGigaGigaGigaMegaLongLongLongStructName.html
3434
// It shouldn't have an overflow in the topbar either.
35-
assert-property: (".mobile-topbar .location", {"scrollWidth": "493"})
36-
assert-property: (".mobile-topbar .location", {"clientWidth": "493"})
35+
assert-property: (".mobile-topbar .location", {"scrollWidth": "492"})
36+
assert-property: (".mobile-topbar .location", {"clientWidth": "492"})
3737
assert-css: (".mobile-topbar .location", {"overflow-x": "hidden"})
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// edition:2021
2+
// build-pass
3+
// compile-flags: -Zdrop-tracking
4+
5+
fn main() {
6+
let _ = async {
7+
let mut s = (String::new(),);
8+
s.0.push_str("abc");
9+
std::mem::drop(s);
10+
async {}.await;
11+
};
12+
}

‎src/tools/clippy/clippy_lints/src/utils/inspector.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,6 @@ impl<'tcx> LateLintPass<'tcx> for DeepCodeInspector {
5454
),
5555
hir::VisibilityKind::Inherited => println!("visibility inherited from outer item"),
5656
}
57-
if item.defaultness.is_default() {
58-
println!("default");
59-
}
6057
match item.kind {
6158
hir::ImplItemKind::Const(_, body_id) => {
6259
println!("associated constant");

0 commit comments

Comments
 (0)
Please sign in to comment.