Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit eb2446a

Browse files
committedSep 13, 2023
Auto merge of rust-lang#115820 - matthiaskrgr:rollup-kyglvpu, r=matthiaskrgr
Rollup of 6 pull requests Successful merges: - rust-lang#115736 (Remove `verbose_generic_activity_with_arg`) - rust-lang#115771 (cleanup leftovers of const_err lint) - rust-lang#115798 (add helper method for finding the one non-1-ZST field) - rust-lang#115812 (Merge settings.css into rustdoc.css) - rust-lang#115815 (fix: return early when has tainted in mir pass) - rust-lang#115816 (Disabled socketpair for Vita) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 5adddad + 156f50b commit eb2446a

File tree

25 files changed

+232
-228
lines changed

25 files changed

+232
-228
lines changed
 

‎compiler/rustc_codegen_cranelift/src/driver/aot.rs

Lines changed: 15 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ fn module_codegen(
269269
),
270270
) -> OngoingModuleCodegen {
271271
let (cgu_name, mut cx, mut module, codegened_functions) =
272-
tcx.prof.verbose_generic_activity_with_arg("codegen cgu", cgu_name.as_str()).run(|| {
272+
tcx.prof.generic_activity_with_arg("codegen cgu", cgu_name.as_str()).run(|| {
273273
let cgu = tcx.codegen_unit(cgu_name);
274274
let mono_items = cgu.items_in_deterministic_order(tcx);
275275

@@ -322,35 +322,24 @@ fn module_codegen(
322322
});
323323

324324
OngoingModuleCodegen::Async(std::thread::spawn(move || {
325-
cx.profiler.clone().verbose_generic_activity_with_arg("compile functions", &*cgu_name).run(
326-
|| {
327-
cranelift_codegen::timing::set_thread_profiler(Box::new(super::MeasuremeProfiler(
328-
cx.profiler.clone(),
329-
)));
330-
331-
let mut cached_context = Context::new();
332-
for codegened_func in codegened_functions {
333-
crate::base::compile_fn(
334-
&mut cx,
335-
&mut cached_context,
336-
&mut module,
337-
codegened_func,
338-
);
339-
}
340-
},
341-
);
325+
cx.profiler.clone().generic_activity_with_arg("compile functions", &*cgu_name).run(|| {
326+
cranelift_codegen::timing::set_thread_profiler(Box::new(super::MeasuremeProfiler(
327+
cx.profiler.clone(),
328+
)));
329+
330+
let mut cached_context = Context::new();
331+
for codegened_func in codegened_functions {
332+
crate::base::compile_fn(&mut cx, &mut cached_context, &mut module, codegened_func);
333+
}
334+
});
342335

343-
let global_asm_object_file = cx
344-
.profiler
345-
.verbose_generic_activity_with_arg("compile assembly", &*cgu_name)
346-
.run(|| {
336+
let global_asm_object_file =
337+
cx.profiler.generic_activity_with_arg("compile assembly", &*cgu_name).run(|| {
347338
crate::global_asm::compile_global_asm(&global_asm_config, &cgu_name, &cx.global_asm)
348339
})?;
349340

350-
let codegen_result = cx
351-
.profiler
352-
.verbose_generic_activity_with_arg("write object file", &*cgu_name)
353-
.run(|| {
341+
let codegen_result =
342+
cx.profiler.generic_activity_with_arg("write object file", &*cgu_name).run(|| {
354343
emit_cgu(
355344
&global_asm_config.output_filenames,
356345
&cx.profiler,

‎compiler/rustc_codegen_cranelift/src/vtable.rs

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -48,19 +48,12 @@ pub(crate) fn get_ptr_and_method_ref<'tcx>(
4848
) -> (Pointer, Value) {
4949
let (ptr, vtable) = 'block: {
5050
if let Abi::Scalar(_) = arg.layout().abi {
51-
'descend_newtypes: while !arg.layout().ty.is_unsafe_ptr() && !arg.layout().ty.is_ref() {
52-
for i in 0..arg.layout().fields.count() {
53-
let field = arg.value_field(fx, FieldIdx::new(i));
54-
if !field.layout().is_1zst() {
55-
// we found the one non-1-ZST field that is allowed
56-
// now find *its* non-zero-sized field, or stop if it's a
57-
// pointer
58-
arg = field;
59-
continue 'descend_newtypes;
60-
}
61-
}
62-
63-
bug!("receiver has no non-zero-sized fields {:?}", arg);
51+
while !arg.layout().ty.is_unsafe_ptr() && !arg.layout().ty.is_ref() {
52+
let (idx, _) = arg
53+
.layout()
54+
.non_1zst_field(fx)
55+
.expect("not exactly one non-1-ZST field in a `DispatchFromDyn` type");
56+
arg = arg.value_field(fx, FieldIdx::new(idx));
6457
}
6558
}
6659

‎compiler/rustc_codegen_llvm/src/back/lto.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,7 @@ pub(crate) fn run_pass_manager(
605605
module: &mut ModuleCodegen<ModuleLlvm>,
606606
thin: bool,
607607
) -> Result<(), FatalError> {
608-
let _timer = cgcx.prof.verbose_generic_activity_with_arg("LLVM_lto_optimize", &*module.name);
608+
let _timer = cgcx.prof.generic_activity_with_arg("LLVM_lto_optimize", &*module.name);
609609
let config = cgcx.config(module.kind);
610610

611611
// Now we have one massive module inside of llmod. Time to run the

‎compiler/rustc_codegen_ssa/src/mir/block.rs

Lines changed: 10 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -928,21 +928,11 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
928928
// we get a value of a built-in pointer type.
929929
//
930930
// This is also relevant for `Pin<&mut Self>`, where we need to peel the `Pin`.
931-
'descend_newtypes: while !op.layout.ty.is_unsafe_ptr()
932-
&& !op.layout.ty.is_ref()
933-
{
934-
for i in 0..op.layout.fields.count() {
935-
let field = op.extract_field(bx, i);
936-
if !field.layout.is_1zst() {
937-
// we found the one non-1-ZST field that is allowed
938-
// now find *its* non-zero-sized field, or stop if it's a
939-
// pointer
940-
op = field;
941-
continue 'descend_newtypes;
942-
}
943-
}
944-
945-
span_bug!(span, "receiver has no non-zero-sized fields {:?}", op);
931+
while !op.layout.ty.is_unsafe_ptr() && !op.layout.ty.is_ref() {
932+
let (idx, _) = op.layout.non_1zst_field(bx).expect(
933+
"not exactly one non-1-ZST field in a `DispatchFromDyn` type",
934+
);
935+
op = op.extract_field(bx, idx);
946936
}
947937

948938
// now that we have `*dyn Trait` or `&dyn Trait`, split it up into its
@@ -970,22 +960,11 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
970960
}
971961
Immediate(_) => {
972962
// See comment above explaining why we peel these newtypes
973-
'descend_newtypes: while !op.layout.ty.is_unsafe_ptr()
974-
&& !op.layout.ty.is_ref()
975-
{
976-
for i in 0..op.layout.fields.count() {
977-
let field = op.extract_field(bx, i);
978-
if !field.layout.is_1zst() {
979-
// We found the one non-1-ZST field that is allowed. (The rules
980-
// for `DispatchFromDyn` ensure there's exactly one such field.)
981-
// Now find *its* non-zero-sized field, or stop if it's a
982-
// pointer.
983-
op = field;
984-
continue 'descend_newtypes;
985-
}
986-
}
987-
988-
span_bug!(span, "receiver has no non-zero-sized fields {:?}", op);
963+
while !op.layout.ty.is_unsafe_ptr() && !op.layout.ty.is_ref() {
964+
let (idx, _) = op.layout.non_1zst_field(bx).expect(
965+
"not exactly one non-1-ZST field in a `DispatchFromDyn` type",
966+
);
967+
op = op.extract_field(bx, idx);
989968
}
990969

991970
// Make sure that we've actually unwrapped the rcvr down

‎compiler/rustc_const_eval/src/const_eval/error.rs

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ use rustc_errors::{DiagnosticArgValue, DiagnosticMessage, IntoDiagnostic, IntoDi
44
use rustc_middle::mir::AssertKind;
55
use rustc_middle::ty::TyCtxt;
66
use rustc_middle::ty::{layout::LayoutError, ConstInt};
7-
use rustc_span::source_map::Spanned;
87
use rustc_span::{ErrorGuaranteed, Span, Symbol};
98

109
use super::InterpCx;
@@ -132,35 +131,17 @@ where
132131
{
133132
// Special handling for certain errors
134133
match error {
135-
// Don't emit a new diagnostic for these errors
134+
// Don't emit a new diagnostic for these errors, they are already reported elsewhere or
135+
// should remain silent.
136136
err_inval!(Layout(LayoutError::Unknown(_))) | err_inval!(TooGeneric) => {
137137
ErrorHandled::TooGeneric
138138
}
139139
err_inval!(AlreadyReported(guar)) => ErrorHandled::Reported(guar),
140140
err_inval!(Layout(LayoutError::ReferencesError(guar))) => {
141141
ErrorHandled::Reported(guar.into())
142142
}
143-
err_inval!(Layout(layout_error @ LayoutError::SizeOverflow(_))) => {
144-
// We must *always* hard error on these, even if the caller wants just a lint.
145-
// The `message` makes little sense here, this is a more serious error than the
146-
// caller thinks anyway.
147-
// See <https://github.com/rust-lang/rust/pull/63152>.
148-
let (our_span, frames) = get_span_and_frames();
149-
let span = span.unwrap_or(our_span);
150-
let mut err =
151-
tcx.sess.create_err(Spanned { span, node: layout_error.into_diagnostic() });
152-
err.code(rustc_errors::error_code!(E0080));
153-
let Some((mut err, handler)) = err.into_diagnostic() else {
154-
panic!("did not emit diag");
155-
};
156-
for frame in frames {
157-
err.eager_subdiagnostic(handler, frame);
158-
}
159-
160-
ErrorHandled::Reported(handler.emit_diagnostic(&mut err).unwrap().into())
161-
}
143+
// Report remaining errors.
162144
_ => {
163-
// Report as hard error.
164145
let (our_span, frames) = get_span_and_frames();
165146
let span = span.unwrap_or(our_span);
166147
let err = mk(span, frames);

‎compiler/rustc_const_eval/src/const_eval/eval_queries.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ pub fn eval_to_allocation_raw_provider<'tcx>(
372372
};
373373
let alloc_id = mplace.ptr().provenance.unwrap();
374374

375-
// Validation failed, report an error. This is always a hard error.
375+
// Validation failed, report an error.
376376
if let Err(error) = validation {
377377
let (error, backtrace) = error.into_parts();
378378
backtrace.print_backtrace();

‎compiler/rustc_const_eval/src/interpret/terminator.rs

Lines changed: 7 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -269,19 +269,9 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
269269
match layout.ty.kind() {
270270
ty::Adt(adt_def, _) if adt_def.repr().transparent() && may_unfold(*adt_def) => {
271271
assert!(!adt_def.is_enum());
272-
// Find the non-1-ZST field.
273-
let mut non_1zst_fields = (0..layout.fields.count()).filter_map(|idx| {
274-
let field = layout.field(self, idx);
275-
if field.is_1zst() { None } else { Some(field) }
276-
});
277-
let first = non_1zst_fields.next().expect("`unfold_transparent` called on 1-ZST");
278-
assert!(
279-
non_1zst_fields.next().is_none(),
280-
"more than one non-1-ZST field in a transparent type"
281-
);
282-
283-
// Found it!
284-
self.unfold_transparent(first, may_unfold)
272+
// Find the non-1-ZST field, and recurse.
273+
let (_, field) = layout.non_1zst_field(self).unwrap();
274+
self.unfold_transparent(field, may_unfold)
285275
}
286276
// Not a transparent type, no further unfolding.
287277
_ => layout,
@@ -797,25 +787,10 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
797787
_ => {
798788
// Not there yet, search for the only non-ZST field.
799789
// (The rules for `DispatchFromDyn` ensure there's exactly one such field.)
800-
let mut non_zst_field = None;
801-
for i in 0..receiver.layout.fields.count() {
802-
let field = self.project_field(&receiver, i)?;
803-
let zst = field.layout.is_1zst();
804-
if !zst {
805-
assert!(
806-
non_zst_field.is_none(),
807-
"multiple non-1-ZST fields in dyn receiver type {}",
808-
receiver.layout.ty
809-
);
810-
non_zst_field = Some(field);
811-
}
812-
}
813-
receiver = non_zst_field.unwrap_or_else(|| {
814-
panic!(
815-
"no non-1-ZST fields in dyn receiver type {}",
816-
receiver.layout.ty
817-
)
818-
});
790+
let (idx, _) = receiver.layout.non_1zst_field(self).expect(
791+
"not exactly one non-1-ZST field in a `DispatchFromDyn` type",
792+
);
793+
receiver = self.project_field(&receiver, idx)?;
819794
}
820795
}
821796
};

‎compiler/rustc_middle/src/mir/mod.rs

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ use rustc_target::abi::{FieldIdx, Size, VariantIdx};
2626

2727
use polonius_engine::Atom;
2828
pub use rustc_ast::Mutability;
29+
use rustc_data_structures::fx::FxHashMap;
2930
use rustc_data_structures::fx::FxHashSet;
3031
use rustc_data_structures::graph::dominators::Dominators;
3132
use rustc_index::{Idx, IndexSlice, IndexVec};
@@ -36,6 +37,8 @@ use rustc_span::{Span, DUMMY_SP};
3637
use either::Either;
3738

3839
use std::borrow::Cow;
40+
use std::cell::RefCell;
41+
use std::collections::hash_map::Entry;
3942
use std::fmt::{self, Debug, Display, Formatter, Write};
4043
use std::ops::{Index, IndexMut};
4144
use std::{iter, mem};
@@ -98,6 +101,36 @@ impl<'tcx> HasLocalDecls<'tcx> for Body<'tcx> {
98101
}
99102
}
100103

104+
thread_local! {
105+
static PASS_NAMES: RefCell<FxHashMap<&'static str, &'static str>> = {
106+
RefCell::new(FxHashMap::default())
107+
};
108+
}
109+
110+
/// Converts a MIR pass name into a snake case form to match the profiling naming style.
111+
fn to_profiler_name(type_name: &'static str) -> &'static str {
112+
PASS_NAMES.with(|names| match names.borrow_mut().entry(type_name) {
113+
Entry::Occupied(e) => *e.get(),
114+
Entry::Vacant(e) => {
115+
let snake_case: String = type_name
116+
.chars()
117+
.flat_map(|c| {
118+
if c.is_ascii_uppercase() {
119+
vec!['_', c.to_ascii_lowercase()]
120+
} else if c == '-' {
121+
vec!['_']
122+
} else {
123+
vec![c]
124+
}
125+
})
126+
.collect();
127+
let result = &*String::leak(format!("mir_pass{}", snake_case));
128+
e.insert(result);
129+
result
130+
}
131+
})
132+
}
133+
101134
/// A streamlined trait that you can implement to create a pass; the
102135
/// pass will be named after the type, and it will consist of a main
103136
/// loop that goes over each available MIR and applies `run_pass`.
@@ -107,6 +140,10 @@ pub trait MirPass<'tcx> {
107140
if let Some((_, tail)) = name.rsplit_once(':') { tail } else { name }
108141
}
109142

143+
fn profiler_name(&self) -> &'static str {
144+
to_profiler_name(self.name())
145+
}
146+
110147
/// Returns `true` if this pass is enabled with the current combination of compiler flags.
111148
fn is_enabled(&self, _sess: &Session) -> bool {
112149
true

‎compiler/rustc_mir_transform/src/lib.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -606,6 +606,11 @@ fn inner_optimized_mir(tcx: TyCtxt<'_>, did: LocalDefId) -> Body<'_> {
606606
let body = tcx.mir_drops_elaborated_and_const_checked(did).steal();
607607
let mut body = remap_mir_for_const_eval_select(tcx, body, hir::Constness::NotConst);
608608
debug!("body: {:#?}", body);
609+
610+
if body.tainted_by_errors.is_some() {
611+
return body;
612+
}
613+
609614
run_optimization_passes(tcx, &mut body);
610615

611616
body

‎compiler/rustc_mir_transform/src/pass_manager.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,8 @@ fn run_passes_inner<'tcx>(
9494
let overridden_passes = &tcx.sess.opts.unstable_opts.mir_enable_passes;
9595
trace!(?overridden_passes);
9696

97+
let prof_arg = tcx.sess.prof.enabled().then(|| format!("{:?}", body.source.def_id()));
98+
9799
if !body.should_skip() {
98100
for pass in passes {
99101
let name = pass.name();
@@ -121,7 +123,14 @@ fn run_passes_inner<'tcx>(
121123
validate_body(tcx, body, format!("before pass {name}"));
122124
}
123125

124-
tcx.sess.time(name, || pass.run_pass(tcx, body));
126+
if let Some(prof_arg) = &prof_arg {
127+
tcx.sess
128+
.prof
129+
.generic_activity_with_arg(pass.profiler_name(), &**prof_arg)
130+
.run(|| pass.run_pass(tcx, body));
131+
} else {
132+
pass.run_pass(tcx, body);
133+
}
125134

126135
if dump_enabled {
127136
dump_mir_for_pass(tcx, body, &name, true);

‎compiler/rustc_query_impl/src/plumbing.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -348,8 +348,7 @@ pub(crate) fn encode_query_results<'a, 'tcx, Q>(
348348
Q: super::QueryConfigRestored<'tcx>,
349349
Q::RestoredValue: Encodable<CacheEncoder<'a, 'tcx>>,
350350
{
351-
let _timer =
352-
qcx.profiler().verbose_generic_activity_with_arg("encode_query_results_for", query.name());
351+
let _timer = qcx.profiler().generic_activity_with_arg("encode_query_results_for", query.name());
353352

354353
assert!(query.query_state(qcx).all_inactive());
355354
let cache = query.query_cache(qcx);

‎compiler/rustc_target/src/abi/mod.rs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,4 +144,25 @@ impl<'a, Ty> TyAndLayout<'a, Ty> {
144144

145145
offset
146146
}
147+
148+
/// Finds the one field that is not a 1-ZST.
149+
/// Returns `None` if there are multiple non-1-ZST fields or only 1-ZST-fields.
150+
pub fn non_1zst_field<C>(&self, cx: &C) -> Option<(usize, Self)>
151+
where
152+
Ty: TyAbiInterface<'a, C> + Copy,
153+
{
154+
let mut found = None;
155+
for field_idx in 0..self.fields.count() {
156+
let field = self.field(cx, field_idx);
157+
if field.is_1zst() {
158+
continue;
159+
}
160+
if found.is_some() {
161+
// More than one non-1-ZST field.
162+
return None;
163+
}
164+
found = Some((field_idx, field));
165+
}
166+
found
167+
}
147168
}

‎compiler/rustc_ty_utils/src/abi.rs

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -588,19 +588,11 @@ fn make_thin_self_ptr<'tcx>(
588588
// To get the type `*mut RcBox<Self>`, we just keep unwrapping newtypes until we
589589
// get a built-in pointer type
590590
let mut fat_pointer_layout = layout;
591-
'descend_newtypes: while !fat_pointer_layout.ty.is_unsafe_ptr()
592-
&& !fat_pointer_layout.ty.is_ref()
593-
{
594-
for i in 0..fat_pointer_layout.fields.count() {
595-
let field_layout = fat_pointer_layout.field(cx, i);
596-
597-
if !field_layout.is_1zst() {
598-
fat_pointer_layout = field_layout;
599-
continue 'descend_newtypes;
600-
}
601-
}
602-
603-
bug!("receiver has no non-1-ZST fields {:?}", fat_pointer_layout);
591+
while !fat_pointer_layout.ty.is_unsafe_ptr() && !fat_pointer_layout.ty.is_ref() {
592+
fat_pointer_layout = fat_pointer_layout
593+
.non_1zst_field(cx)
594+
.expect("not exactly one non-1-ZST field in a `DispatchFromDyn` type")
595+
.1
604596
}
605597

606598
fat_pointer_layout.ty

‎library/std/src/sys/unix/net.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ impl Socket {
102102
}
103103
}
104104

105-
#[cfg(not(target_os = "vxworks"))]
105+
#[cfg(not(any(target_os = "vxworks", target_os = "vita")))]
106106
pub fn new_pair(fam: c_int, ty: c_int) -> io::Result<(Socket, Socket)> {
107107
unsafe {
108108
let mut fds = [0, 0];
@@ -133,7 +133,7 @@ impl Socket {
133133
}
134134
}
135135

136-
#[cfg(target_os = "vxworks")]
136+
#[cfg(any(target_os = "vxworks", target_os = "vita"))]
137137
pub fn new_pair(_fam: c_int, _ty: c_int) -> io::Result<(Socket, Socket)> {
138138
unimplemented!()
139139
}

‎src/librustdoc/html/render/context.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -714,8 +714,6 @@ impl<'tcx> FormatRenderer<'tcx> for Context<'tcx> {
714714
You need to enable JavaScript be able to update your settings.\
715715
</section>\
716716
</noscript>\
717-
<link rel=\"stylesheet\" \
718-
href=\"{static_root_path}{settings_css}\">\
719717
<script defer src=\"{static_root_path}{settings_js}\"></script>\
720718
<link rel=\"preload\" href=\"{static_root_path}{theme_light_css}\" \
721719
as=\"style\">\
@@ -724,7 +722,6 @@ impl<'tcx> FormatRenderer<'tcx> for Context<'tcx> {
724722
<link rel=\"preload\" href=\"{static_root_path}{theme_ayu_css}\" \
725723
as=\"style\">",
726724
static_root_path = page.get_static_root_path(),
727-
settings_css = static_files::STATIC_FILES.settings_css,
728725
settings_js = static_files::STATIC_FILES.settings_js,
729726
theme_light_css = static_files::STATIC_FILES.theme_light_css,
730727
theme_dark_css = static_files::STATIC_FILES.theme_dark_css,

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

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -925,6 +925,70 @@ so that we can apply CSS-filters to change the arrow color in themes */
925925
top: -5px;
926926
}
927927

928+
.setting-line {
929+
margin: 1.2em 0.6em;
930+
}
931+
932+
.setting-radio input, .setting-check input {
933+
margin-right: 0.3em;
934+
height: 1.2rem;
935+
width: 1.2rem;
936+
border: 2px solid var(--settings-input-border-color);
937+
outline: none;
938+
-webkit-appearance: none;
939+
cursor: pointer;
940+
}
941+
.setting-radio input {
942+
border-radius: 50%;
943+
}
944+
945+
.setting-radio span, .setting-check span {
946+
padding-bottom: 1px;
947+
}
948+
949+
.setting-radio {
950+
margin-top: 0.1em;
951+
margin-bottom: 0.1em;
952+
min-width: 3.8em;
953+
padding: 0.3em;
954+
display: inline-flex;
955+
align-items: center;
956+
cursor: pointer;
957+
}
958+
.setting-radio + .setting-radio {
959+
margin-left: 0.5em;
960+
}
961+
962+
.setting-check {
963+
margin-right: 20px;
964+
display: flex;
965+
align-items: center;
966+
cursor: pointer;
967+
}
968+
969+
.setting-radio input:checked {
970+
box-shadow: inset 0 0 0 3px var(--main-background-color);
971+
background-color: var(--settings-input-color);
972+
}
973+
.setting-check input:checked {
974+
background-color: var(--settings-input-color);
975+
border-width: 1px;
976+
content: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 40">\
977+
<path d="M7,25L17,32L33,12" fill="none" stroke="black" stroke-width="5"/>\
978+
<path d="M7,23L17,30L33,10" fill="none" stroke="white" stroke-width="5"/></svg>');
979+
}
980+
.setting-radio input:focus, .setting-check input:focus {
981+
box-shadow: 0 0 1px 1px var(--settings-input-color);
982+
}
983+
/* In here we combine both `:focus` and `:checked` properties. */
984+
.setting-radio input:checked:focus {
985+
box-shadow: inset 0 0 0 3px var(--main-background-color),
986+
0 0 2px 2px var(--settings-input-color);
987+
}
988+
.setting-radio input:hover, .setting-check input:hover {
989+
border-color: var(--settings-input-color) !important;
990+
}
991+
928992
/* use larger max-width for help popover, but not for help.html */
929993
#help.popover {
930994
max-width: 600px;

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

Lines changed: 0 additions & 63 deletions
This file was deleted.

‎src/librustdoc/html/static/js/main.js

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -176,13 +176,6 @@ function browserSupportsHistoryApi() {
176176
return window.history && typeof window.history.pushState === "function";
177177
}
178178

179-
function loadCss(cssUrl) {
180-
const link = document.createElement("link");
181-
link.href = cssUrl;
182-
link.rel = "stylesheet";
183-
document.getElementsByTagName("head")[0].appendChild(link);
184-
}
185-
186179
function preLoadCss(cssUrl) {
187180
// https://developer.mozilla.org/en-US/docs/Web/HTML/Link_types/preload
188181
const link = document.createElement("link");
@@ -210,7 +203,6 @@ function preLoadCss(cssUrl) {
210203
event.preventDefault();
211204
// Sending request for the CSS and the JS files at the same time so it will
212205
// hopefully be loaded when the JS will generate the settings content.
213-
loadCss(getVar("static-root-path") + getVar("settings-css"));
214206
loadScript(getVar("static-root-path") + getVar("settings-js"));
215207
preLoadCss(getVar("static-root-path") + getVar("theme-light-css"));
216208
preLoadCss(getVar("static-root-path") + getVar("theme-dark-css"));

‎src/librustdoc/html/static_files.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ macro_rules! static_files {
9191

9292
static_files! {
9393
rustdoc_css => "static/css/rustdoc.css",
94-
settings_css => "static/css/settings.css",
9594
noscript_css => "static/css/noscript.css",
9695
normalize_css => "static/css/normalize.css",
9796
main_js => "static/js/main.js",

‎src/librustdoc/html/templates/page.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
data-channel="{{rust_channel}}" {#+ #}
3434
data-search-js="{{files.search_js}}" {#+ #}
3535
data-settings-js="{{files.settings_js}}" {#+ #}
36-
data-settings-css="{{files.settings_css}}" {#+ #}
3736
data-theme-light-css="{{files.theme_light_css}}" {#+ #}
3837
data-theme-dark-css="{{files.theme_dark_css}}" {#+ #}
3938
data-theme-ayu-css="{{files.theme_ayu_css}}" {#+ #}

‎tests/ui/limits/issue-55878.stderr

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
error[E0080]: values of the type `[u8; usize::MAX]` are too big for the current architecture
1+
error[E0080]: evaluation of constant value failed
22
--> $SRC_DIR/core/src/mem/mod.rs:LL:COL
33
|
4+
= note: values of the type `[u8; usize::MAX]` are too big for the current architecture
5+
|
46
note: inside `std::mem::size_of::<[u8; usize::MAX]>`
57
--> $SRC_DIR/core/src/mem/mod.rs:LL:COL
68
note: inside `main`

‎tests/ui/limits/issue-56762.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@ impl TooBigArray {
1414
}
1515

1616
static MY_TOO_BIG_ARRAY_1: TooBigArray = TooBigArray::new();
17-
//~^ ERROR values of the type `[u8; 2305843009213693951]` are too big
17+
//~^ ERROR could not evaluate static initializer
18+
//~| too big
1819
static MY_TOO_BIG_ARRAY_2: [u8; HUGE_SIZE] = [0x00; HUGE_SIZE];
19-
//~^ ERROR values of the type `[u8; 2305843009213693951]` are too big
20+
//~^ ERROR could not evaluate static initializer
21+
//~| too big
2022

2123
fn main() { }

‎tests/ui/limits/issue-56762.stderr

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
error[E0080]: values of the type `[u8; 2305843009213693951]` are too big for the current architecture
1+
error[E0080]: could not evaluate static initializer
22
--> $DIR/issue-56762.rs:16:1
33
|
44
LL | static MY_TOO_BIG_ARRAY_1: TooBigArray = TooBigArray::new();
5-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ values of the type `[u8; 2305843009213693951]` are too big for the current architecture
66

7-
error[E0080]: values of the type `[u8; 2305843009213693951]` are too big for the current architecture
8-
--> $DIR/issue-56762.rs:18:1
7+
error[E0080]: could not evaluate static initializer
8+
--> $DIR/issue-56762.rs:19:1
99
|
1010
LL | static MY_TOO_BIG_ARRAY_2: [u8; HUGE_SIZE] = [0x00; HUGE_SIZE];
11-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
11+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ values of the type `[u8; 2305843009213693951]` are too big for the current architecture
1212

1313
error: aborting due to 2 previous errors
1414

‎tests/ui/unsized/issue-115809.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// compile-flags: --emit=link -Zmir-opt-level=2 -Zpolymorphize=on
2+
3+
fn foo<T>() {
4+
let a: [i32; 0] = [];
5+
match [a[..]] {
6+
//~^ ERROR cannot move a value of type `[i32]
7+
//~| ERROR cannot move out of type `[i32]`, a non-copy slice
8+
[[x]] => {}
9+
_ => (),
10+
}
11+
}
12+
13+
fn main() {}

‎tests/ui/unsized/issue-115809.stderr

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
error[E0161]: cannot move a value of type `[i32]`
2+
--> $DIR/issue-115809.rs:5:12
3+
|
4+
LL | match [a[..]] {
5+
| ^^^^^ the size of `[i32]` cannot be statically determined
6+
7+
error[E0508]: cannot move out of type `[i32]`, a non-copy slice
8+
--> $DIR/issue-115809.rs:5:12
9+
|
10+
LL | match [a[..]] {
11+
| ^^^^^
12+
| |
13+
| cannot move out of here
14+
| move occurs because value has type `[i32]`, which does not implement the `Copy` trait
15+
16+
error: aborting due to 2 previous errors
17+
18+
Some errors have detailed explanations: E0161, E0508.
19+
For more information about an error, try `rustc --explain E0161`.

0 commit comments

Comments
 (0)
This repository has been archived.