1
Fork 0

Auto merge of #104877 - matthiaskrgr:rollup-s7taiq8, r=matthiaskrgr

Rollup of 6 pull requests

Successful merges:

 - #103648 (Don't set `is_preview` for clippy and rustfmt)
 - #104654 (Add `#![deny(unsafe_op_in_unsafe_fn)]` in liballoc tests)
 - #104793 (unstable-book: Add page for the `abi_efiapi` feature)
 - #104841 (Assert that we don't capture escaping bound vars in `Fn` trait selection)
 - #104849 (Migrate source code elements style to CSS variables)
 - #104873 (RefCell::get_mut: fix typo)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
This commit is contained in:
bors 2022-11-25 13:01:45 +00:00
commit e704e95250
19 changed files with 144 additions and 69 deletions

View file

@ -605,8 +605,10 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
{ {
debug!(?obligation, "confirm_fn_pointer_candidate"); debug!(?obligation, "confirm_fn_pointer_candidate");
// Okay to skip binder; it is reintroduced below. let self_ty = self
let self_ty = self.infcx.shallow_resolve(obligation.self_ty().skip_binder()); .infcx
.shallow_resolve(obligation.self_ty().no_bound_vars())
.expect("fn pointer should not capture bound vars from predicate");
let sig = self_ty.fn_sig(self.tcx()); let sig = self_ty.fn_sig(self.tcx());
let trait_ref = closure_trait_ref_and_return_type( let trait_ref = closure_trait_ref_and_return_type(
self.tcx(), self.tcx(),
@ -621,15 +623,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
// Confirm the `type Output: Sized;` bound that is present on `FnOnce` // Confirm the `type Output: Sized;` bound that is present on `FnOnce`
let cause = obligation.derived_cause(BuiltinDerivedObligation); let cause = obligation.derived_cause(BuiltinDerivedObligation);
// The binder on the Fn obligation is "less" important than the one on let output_ty = self.infcx.replace_bound_vars_with_placeholders(sig.output());
// the signature, as evidenced by how we treat it during projection.
// The safe thing to do here is to liberate it, though, which should
// have no worse effect than skipping the binder here.
let liberated_fn_ty =
self.infcx.replace_bound_vars_with_placeholders(obligation.predicate.rebind(self_ty));
let output_ty = self
.infcx
.replace_bound_vars_with_placeholders(liberated_fn_ty.fn_sig(self.tcx()).output());
let output_ty = normalize_with_depth_to( let output_ty = normalize_with_depth_to(
self, self,
obligation.param_env, obligation.param_env,
@ -693,16 +687,19 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
let gen_sig = substs.as_generator().poly_sig(); let gen_sig = substs.as_generator().poly_sig();
// (1) Feels icky to skip the binder here, but OTOH we know // NOTE: The self-type is a generator type and hence is
// that the self-type is an generator type and hence is
// in fact unparameterized (or at least does not reference any // in fact unparameterized (or at least does not reference any
// regions bound in the obligation). Still probably some // regions bound in the obligation).
// refactoring could make this nicer. let self_ty = obligation
.predicate
.self_ty()
.no_bound_vars()
.expect("unboxed closure type should not capture bound vars from the predicate");
let trait_ref = super::util::generator_trait_ref_and_outputs( let trait_ref = super::util::generator_trait_ref_and_outputs(
self.tcx(), self.tcx(),
obligation.predicate.def_id(), obligation.predicate.def_id(),
obligation.predicate.skip_binder().self_ty(), // (1) self_ty,
gen_sig, gen_sig,
) )
.map_bound(|(trait_ref, ..)| trait_ref); .map_bound(|(trait_ref, ..)| trait_ref);

View file

@ -2271,15 +2271,19 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
debug!(?closure_sig); debug!(?closure_sig);
// (1) Feels icky to skip the binder here, but OTOH we know // NOTE: The self-type is an unboxed closure type and hence is
// that the self-type is an unboxed closure type and hence is
// in fact unparameterized (or at least does not reference any // in fact unparameterized (or at least does not reference any
// regions bound in the obligation). Still probably some // regions bound in the obligation).
// refactoring could make this nicer. let self_ty = obligation
.predicate
.self_ty()
.no_bound_vars()
.expect("unboxed closure type should not capture bound vars from the predicate");
closure_trait_ref_and_return_type( closure_trait_ref_and_return_type(
self.tcx(), self.tcx(),
obligation.predicate.def_id(), obligation.predicate.def_id(),
obligation.predicate.skip_binder().self_ty(), // (1) self_ty,
closure_sig, closure_sig,
util::TupleArgumentsFlag::No, util::TupleArgumentsFlag::No,
) )

View file

@ -298,11 +298,11 @@ pub fn closure_trait_ref_and_return_type<'tcx>(
sig: ty::PolyFnSig<'tcx>, sig: ty::PolyFnSig<'tcx>,
tuple_arguments: TupleArgumentsFlag, tuple_arguments: TupleArgumentsFlag,
) -> ty::Binder<'tcx, (ty::TraitRef<'tcx>, Ty<'tcx>)> { ) -> ty::Binder<'tcx, (ty::TraitRef<'tcx>, Ty<'tcx>)> {
assert!(!self_ty.has_escaping_bound_vars());
let arguments_tuple = match tuple_arguments { let arguments_tuple = match tuple_arguments {
TupleArgumentsFlag::No => sig.skip_binder().inputs()[0], TupleArgumentsFlag::No => sig.skip_binder().inputs()[0],
TupleArgumentsFlag::Yes => tcx.intern_tup(sig.skip_binder().inputs()), TupleArgumentsFlag::Yes => tcx.intern_tup(sig.skip_binder().inputs()),
}; };
debug_assert!(!self_ty.has_escaping_bound_vars());
let trait_ref = tcx.mk_trait_ref(fn_trait_def_id, [self_ty, arguments_tuple]); let trait_ref = tcx.mk_trait_ref(fn_trait_def_id, [self_ty, arguments_tuple]);
sig.map_bound(|sig| (trait_ref, sig.output())) sig.map_bound(|sig| (trait_ref, sig.output()))
} }
@ -313,7 +313,7 @@ pub fn generator_trait_ref_and_outputs<'tcx>(
self_ty: Ty<'tcx>, self_ty: Ty<'tcx>,
sig: ty::PolyGenSig<'tcx>, sig: ty::PolyGenSig<'tcx>,
) -> ty::Binder<'tcx, (ty::TraitRef<'tcx>, Ty<'tcx>, Ty<'tcx>)> { ) -> ty::Binder<'tcx, (ty::TraitRef<'tcx>, Ty<'tcx>, Ty<'tcx>)> {
debug_assert!(!self_ty.has_escaping_bound_vars()); assert!(!self_ty.has_escaping_bound_vars());
let trait_ref = tcx.mk_trait_ref(fn_trait_def_id, [self_ty, sig.skip_binder().resume_ty]); let trait_ref = tcx.mk_trait_ref(fn_trait_def_id, [self_ty, sig.skip_binder().resume_ty]);
sig.map_bound(|sig| (trait_ref, sig.yield_ty, sig.return_ty)) sig.map_bound(|sig| (trait_ref, sig.yield_ty, sig.return_ty))
} }
@ -324,7 +324,7 @@ pub fn future_trait_ref_and_outputs<'tcx>(
self_ty: Ty<'tcx>, self_ty: Ty<'tcx>,
sig: ty::PolyGenSig<'tcx>, sig: ty::PolyGenSig<'tcx>,
) -> ty::Binder<'tcx, (ty::TraitRef<'tcx>, Ty<'tcx>)> { ) -> ty::Binder<'tcx, (ty::TraitRef<'tcx>, Ty<'tcx>)> {
debug_assert!(!self_ty.has_escaping_bound_vars()); assert!(!self_ty.has_escaping_bound_vars());
let trait_ref = tcx.mk_trait_ref(fn_trait_def_id, [self_ty]); let trait_ref = tcx.mk_trait_ref(fn_trait_def_id, [self_ty]);
sig.map_bound(|sig| (trait_ref, sig.return_ty)) sig.map_bound(|sig| (trait_ref, sig.return_ty))
} }

View file

@ -102,8 +102,18 @@ unsafe impl const Allocator for ConstAllocator {
let new_ptr = self.allocate(new_layout)?; let new_ptr = self.allocate(new_layout)?;
if new_layout.size() > 0 { if new_layout.size() > 0 {
new_ptr.as_mut_ptr().copy_from_nonoverlapping(ptr.as_ptr(), old_layout.size()); // Safety: `new_ptr` is valid for writes and `ptr` for reads of
self.deallocate(ptr, old_layout); // `old_layout.size()`, because `new_layout.size() >=
// old_layout.size()` (which is an invariant that must be upheld by
// callers).
unsafe {
new_ptr.as_mut_ptr().copy_from_nonoverlapping(ptr.as_ptr(), old_layout.size());
}
// Safety: `ptr` is never used again is also an invariant which must
// be upheld by callers.
unsafe {
self.deallocate(ptr, old_layout);
}
} }
Ok(new_ptr) Ok(new_ptr)
} }
@ -114,12 +124,21 @@ unsafe impl const Allocator for ConstAllocator {
old_layout: Layout, old_layout: Layout,
new_layout: Layout, new_layout: Layout,
) -> Result<NonNull<[u8]>, AllocError> { ) -> Result<NonNull<[u8]>, AllocError> {
let new_ptr = self.grow(ptr, old_layout, new_layout)?; // Safety: Invariants of `grow_zeroed` and `grow` are the same, and must
// be enforced by callers.
let new_ptr = unsafe { self.grow(ptr, old_layout, new_layout)? };
if new_layout.size() > 0 { if new_layout.size() > 0 {
let old_size = old_layout.size(); let old_size = old_layout.size();
let new_size = new_layout.size(); let new_size = new_layout.size();
let raw_ptr = new_ptr.as_mut_ptr(); let raw_ptr = new_ptr.as_mut_ptr();
raw_ptr.add(old_size).write_bytes(0, new_size - old_size); // Safety:
// - `grow` returned Ok, so the returned pointer must be valid for
// `new_size` bytes
// - `new_size` must be larger than `old_size`, which is an
// invariant which must be upheld by callers.
unsafe {
raw_ptr.add(old_size).write_bytes(0, new_size - old_size);
}
} }
Ok(new_ptr) Ok(new_ptr)
} }
@ -137,8 +156,18 @@ unsafe impl const Allocator for ConstAllocator {
let new_ptr = self.allocate(new_layout)?; let new_ptr = self.allocate(new_layout)?;
if new_layout.size() > 0 { if new_layout.size() > 0 {
new_ptr.as_mut_ptr().copy_from_nonoverlapping(ptr.as_ptr(), new_layout.size()); // Safety: `new_ptr` and `ptr` are valid for reads/writes of
self.deallocate(ptr, old_layout); // `new_layout.size()` because of the invariants of shrink, which
// include `new_layout.size()` being smaller than (or equal to)
// `old_layout.size()`.
unsafe {
new_ptr.as_mut_ptr().copy_from_nonoverlapping(ptr.as_ptr(), new_layout.size());
}
// Safety: `ptr` is never used again is also an invariant which must
// be upheld by callers.
unsafe {
self.deallocate(ptr, old_layout);
}
} }
Ok(new_ptr) Ok(new_ptr)
} }

View file

@ -48,6 +48,7 @@
#![feature(once_cell)] #![feature(once_cell)]
#![feature(drain_keep_rest)] #![feature(drain_keep_rest)]
#![deny(fuzzy_provenance_casts)] #![deny(fuzzy_provenance_casts)]
#![deny(unsafe_op_in_unsafe_fn)]
use std::collections::hash_map::DefaultHasher; use std::collections::hash_map::DefaultHasher;
use std::hash::{Hash, Hasher}; use std::hash::{Hash, Hasher};

View file

@ -1089,7 +1089,8 @@ fn test_into_iter_drop_allocator() {
} }
unsafe fn deallocate(&self, ptr: NonNull<u8>, layout: Layout) { unsafe fn deallocate(&self, ptr: NonNull<u8>, layout: Layout) {
System.deallocate(ptr, layout) // Safety: Invariants passed to caller.
unsafe { System.deallocate(ptr, layout) }
} }
} }

View file

@ -1025,7 +1025,7 @@ impl<T: ?Sized> RefCell<T> {
/// ///
/// Since this method borrows `RefCell` mutably, it is statically guaranteed /// Since this method borrows `RefCell` mutably, it is statically guaranteed
/// that no borrows to the underlying data exist. The dynamic checks inherent /// that no borrows to the underlying data exist. The dynamic checks inherent
/// in [`borrow_mut`] and most other methods of `RefCell` are therefor /// in [`borrow_mut`] and most other methods of `RefCell` are therefore
/// unnecessary. /// unnecessary.
/// ///
/// This method can only be called if `RefCell` can be mutably borrowed, /// This method can only be called if `RefCell` can be mutably borrowed,

View file

@ -1191,7 +1191,6 @@ impl Step for Clippy {
let mut tarball = Tarball::new(builder, "clippy", &target.triple); let mut tarball = Tarball::new(builder, "clippy", &target.triple);
tarball.set_overlay(OverlayKind::Clippy); tarball.set_overlay(OverlayKind::Clippy);
tarball.is_preview(true);
tarball.add_file(clippy, "bin", 0o755); tarball.add_file(clippy, "bin", 0o755);
tarball.add_file(cargoclippy, "bin", 0o755); tarball.add_file(cargoclippy, "bin", 0o755);
tarball.add_legal_and_readme_to("share/doc/clippy"); tarball.add_legal_and_readme_to("share/doc/clippy");
@ -1289,7 +1288,6 @@ impl Step for Rustfmt {
.expect("cargo fmt expected to build - essential tool"); .expect("cargo fmt expected to build - essential tool");
let mut tarball = Tarball::new(builder, "rustfmt", &target.triple); let mut tarball = Tarball::new(builder, "rustfmt", &target.triple);
tarball.set_overlay(OverlayKind::Rustfmt); tarball.set_overlay(OverlayKind::Rustfmt);
tarball.is_preview(true);
tarball.add_file(rustfmt, "bin", 0o755); tarball.add_file(rustfmt, "bin", 0o755);
tarball.add_file(cargofmt, "bin", 0o755); tarball.add_file(cargofmt, "bin", 0o755);
tarball.add_legal_and_readme_to("share/doc/rustfmt"); tarball.add_legal_and_readme_to("share/doc/rustfmt");
@ -1550,8 +1548,6 @@ impl Step for Extended {
format!("{}-{}", name, target.triple) format!("{}-{}", name, target.triple)
} else if name == "rust-analyzer" { } else if name == "rust-analyzer" {
"rust-analyzer-preview".to_string() "rust-analyzer-preview".to_string()
} else if name == "clippy" {
"clippy-preview".to_string()
} else if name == "rust-demangler" { } else if name == "rust-demangler" {
"rust-demangler-preview".to_string() "rust-demangler-preview".to_string()
} else if name == "miri" { } else if name == "miri" {

View file

@ -326,6 +326,8 @@ impl Config {
} }
let filename = format!("rustfmt-{version}-{build}.tar.xz", build = host.triple); let filename = format!("rustfmt-{version}-{build}.tar.xz", build = host.triple);
// cfg(bootstrap): will need to be changed from `rustfmt-preview` to `rustfmt` the next time you run `bump-stage0`.
// See <https://github.com/rust-lang/rust/pull/103648>
self.download_component(DownloadSource::Dist, filename, "rustfmt-preview", &date, "stage0"); self.download_component(DownloadSource::Dist, filename, "rustfmt-preview", &date, "stage0");
self.fix_bin_or_dylib(&bin_root.join("bin").join("rustfmt")); self.fix_bin_or_dylib(&bin_root.join("bin").join("rustfmt"));

View file

@ -0,0 +1,23 @@
# `abi_efiapi`
The tracking issue for this feature is: [#65815]
[#65815]: https://github.com/rust-lang/rust/issues/65815
------------------------
The `efiapi` calling convention can be used for defining a function with
an ABI compatible with the UEFI Interfaces as defined in the [UEFI
Specification].
Example:
```rust
#![feature(abi_efiapi)]
extern "efiapi" { fn f1(); }
extern "efiapi" fn f2() { todo!() }
```
[UEFI Specification]: https://uefi.org/specs/UEFI/2.10/

View file

@ -1343,6 +1343,13 @@ a.test-arrow:hover {
border-bottom: 1px solid var(--border-color); border-bottom: 1px solid var(--border-color);
margin-bottom: 6px; margin-bottom: 6px;
} }
#source-sidebar div.files > a:hover, details.dir-entry summary:hover,
#source-sidebar div.files > a:focus, details.dir-entry summary:focus {
background-color: var(--source-sidebar-background-hover);
}
#source-sidebar div.files > a.selected {
background-color: var(--source-sidebar-background-selected);
}
#sidebar-toggle > button { #sidebar-toggle > button {
font-size: inherit; font-size: inherit;
font-weight: bold; font-weight: bold;

View file

@ -84,6 +84,8 @@ Original by Dempfi (https://github.com/dempfi/ayu)
--crate-search-div-hover-filter: invert(98%) sepia(12%) saturate(81%) hue-rotate(343deg) --crate-search-div-hover-filter: invert(98%) sepia(12%) saturate(81%) hue-rotate(343deg)
brightness(113%) contrast(76%); brightness(113%) contrast(76%);
--crate-search-hover-border: #e0e0e0; --crate-search-hover-border: #e0e0e0;
--source-sidebar-background-selected: #14191f;
--source-sidebar-background-hover: #14191f;
} }
h1, h2, h3, h4 { h1, h2, h3, h4 {
@ -208,12 +210,8 @@ pre.rust .kw-2, pre.rust .prelude-ty {}
color: #fff; color: #fff;
} }
#source-sidebar div.files > a:hover, details.dir-entry summary:hover, #source-sidebar div.files > a:hover, details.dir-entry summary:hover,
#source-sidebar div.files > a:focus, details.dir-entry summary:focus { #source-sidebar div.files > a:focus, details.dir-entry summary:focus,
background-color: #14191f;
color: #ffb44c;
}
#source-sidebar div.files > a.selected { #source-sidebar div.files > a.selected {
background-color: #14191f;
color: #ffb44c; color: #ffb44c;
} }

View file

@ -79,6 +79,8 @@
--crate-search-div-hover-filter: invert(69%) sepia(60%) saturate(6613%) hue-rotate(184deg) --crate-search-div-hover-filter: invert(69%) sepia(60%) saturate(6613%) hue-rotate(184deg)
brightness(100%) contrast(91%); brightness(100%) contrast(91%);
--crate-search-hover-border: #2196f3; --crate-search-hover-border: #2196f3;
--source-sidebar-background-selected: #333;
--source-sidebar-background-hover: #444;
} }
.content .item-info::before { color: #ccc; } .content .item-info::before { color: #ccc; }
@ -105,14 +107,6 @@ details.rustdoc-toggle > summary::before {
color: #888; color: #888;
} }
#source-sidebar div.files > a:hover, details.dir-entry summary:hover,
#source-sidebar div.files > a:focus, details.dir-entry summary:focus {
background-color: #444;
}
#source-sidebar div.files > a.selected {
background-color: #333;
}
.scraped-example-list .scrape-help { .scraped-example-list .scrape-help {
border-color: #aaa; border-color: #aaa;
color: #eee; color: #eee;

View file

@ -76,6 +76,8 @@
--crate-search-div-hover-filter: invert(44%) sepia(18%) saturate(23%) hue-rotate(317deg) --crate-search-div-hover-filter: invert(44%) sepia(18%) saturate(23%) hue-rotate(317deg)
brightness(96%) contrast(93%); brightness(96%) contrast(93%);
--crate-search-hover-border: #717171; --crate-search-hover-border: #717171;
--source-sidebar-background-selected: #fff;
--source-sidebar-background-hover: #e0e0e0;
} }
.content .item-info::before { color: #ccc; } .content .item-info::before { color: #ccc; }
@ -98,13 +100,6 @@ body.source .example-wrap pre.rust a {
color: #888; color: #888;
} }
#source-sidebar div.files > a:hover, details.dir-entry summary:hover,
#source-sidebar div.files > a:focus, details.dir-entry summary:focus {
background-color: #E0E0E0;
}
#source-sidebar div.files > a.selected {
background-color: #fff;
}
.scraped-example-list .scrape-help { .scraped-example-list .scrape-help {
border-color: #555; border-color: #555;
color: #333; color: #333;

View file

@ -43,16 +43,24 @@ define-function: (
"#source-sidebar details[open] > .files a.selected", "#source-sidebar details[open] > .files a.selected",
{"color": |color_hover|, "background-color": |background|}, {"color": |color_hover|, "background-color": |background|},
)), )),
// Without hover or focus. // Without hover or focus.
("assert-css", ("#sidebar-toggle > button", {"background-color": |background_toggle|})), ("assert-css", ("#sidebar-toggle > button", {"background-color": |background_toggle|})),
// With focus. // With focus.
("focus", "#sidebar-toggle > button"), ("focus", "#sidebar-toggle > button"),
("assert-css", ("#sidebar-toggle > button", {"background-color": |background_toggle_hover|})), ("assert-css", (
"#sidebar-toggle > button:focus",
{"background-color": |background_toggle_hover|},
)),
("focus", ".search-input"), ("focus", ".search-input"),
// With hover. // With hover.
("move-cursor-to", "#sidebar-toggle > button"), ("move-cursor-to", "#sidebar-toggle > button"),
("assert-css", ("#sidebar-toggle > button", {"background-color": |background_toggle_hover|})), ("assert-css", (
// Without hover. "#sidebar-toggle > button:hover",
{"background-color": |background_toggle_hover|},
)),
// Without hover or focus.
("assert-css", ( ("assert-css", (
"#source-sidebar details[open] > .files a:not(.selected)", "#source-sidebar details[open] > .files a:not(.selected)",
{"color": |color|, "background-color": |background_toggle|}, {"color": |color|, "background-color": |background_toggle|},
@ -60,17 +68,37 @@ define-function: (
// With focus. // With focus.
("focus", "#source-sidebar details[open] > .files a:not(.selected)"), ("focus", "#source-sidebar details[open] > .files a:not(.selected)"),
("wait-for-css", ( ("wait-for-css", (
"#source-sidebar details[open] > .files a:not(.selected)", "#source-sidebar details[open] > .files a:not(.selected):focus",
{"color": |color_hover|, "background-color": |background_hover|}, {"color": |color_hover|, "background-color": |background_hover|},
)), )),
("focus", ".search-input"), ("focus", ".search-input"),
// With hover. // With hover.
("move-cursor-to", "#source-sidebar details[open] > .files a:not(.selected)"), ("move-cursor-to", "#source-sidebar details[open] > .files a:not(.selected)"),
("assert-css", ( ("assert-css", (
"#source-sidebar details[open] > .files a:not(.selected)", "#source-sidebar details[open] > .files a:not(.selected):hover",
{"color": |color_hover|, "background-color": |background_hover|}, {"color": |color_hover|, "background-color": |background_hover|},
)), )),
// Without hover.
// Without hover or focus.
("assert-css", (
"#source-sidebar .dir-entry summary",
{"color": |color|, "background-color": |background_toggle|},
)),
// With focus.
("focus", "#source-sidebar .dir-entry summary"),
("wait-for-css", (
"#source-sidebar .dir-entry summary:focus",
{"color": |color_hover|, "background-color": |background_hover|},
)),
("focus", ".search-input"),
// With hover.
("move-cursor-to", "#source-sidebar .dir-entry summary"),
("assert-css", (
"#source-sidebar .dir-entry summary:hover",
{"color": |color_hover|, "background-color": |background_hover|},
)),
// Without hover or focus.
("assert-css", ( ("assert-css", (
"#source-sidebar details[open] > .folders > details > summary", "#source-sidebar details[open] > .folders > details > summary",
{"color": |color|, "background-color": |background_toggle|}, {"color": |color|, "background-color": |background_toggle|},
@ -78,14 +106,14 @@ define-function: (
// With focus. // With focus.
("focus", "#source-sidebar details[open] > .folders > details > summary"), ("focus", "#source-sidebar details[open] > .folders > details > summary"),
("wait-for-css", ( ("wait-for-css", (
"#source-sidebar details[open] > .folders > details > summary", "#source-sidebar details[open] > .folders > details > summary:focus",
{"color": |color_hover|, "background-color": |background_hover|}, {"color": |color_hover|, "background-color": |background_hover|},
)), )),
("focus", ".search-input"), ("focus", ".search-input"),
// With hover. // With hover.
("move-cursor-to", "#source-sidebar details[open] > .folders > details > summary"), ("move-cursor-to", "#source-sidebar details[open] > .folders > details > summary"),
("assert-css", ( ("assert-css", (
"#source-sidebar details[open] > .folders > details > summary", "#source-sidebar details[open] > .folders > details > summary:hover",
{"color": |color_hover|, "background-color": |background_hover|}, {"color": |color_hover|, "background-color": |background_hover|},
)), )),
], ],

View file

@ -49,10 +49,10 @@ pkg_type! {
Cargo = "cargo", Cargo = "cargo",
HtmlDocs = "rust-docs", HtmlDocs = "rust-docs",
RustAnalysis = "rust-analysis", RustAnalysis = "rust-analysis",
Clippy = "clippy",
Rustfmt = "rustfmt",
Rls = "rls"; preview = true, Rls = "rls"; preview = true,
RustAnalyzer = "rust-analyzer"; preview = true, RustAnalyzer = "rust-analyzer"; preview = true,
Clippy = "clippy"; preview = true,
Rustfmt = "rustfmt"; preview = true,
LlvmTools = "llvm-tools"; preview = true, LlvmTools = "llvm-tools"; preview = true,
Miri = "miri"; preview = true, Miri = "miri"; preview = true,
JsonDocs = "rust-docs-json"; preview = true, JsonDocs = "rust-docs-json"; preview = true,

View file

@ -6,7 +6,7 @@ use std::convert::TryInto;
const PATH: &str = "src/stage0.json"; const PATH: &str = "src/stage0.json";
const COMPILER_COMPONENTS: &[&str] = &["rustc", "rust-std", "cargo"]; const COMPILER_COMPONENTS: &[&str] = &["rustc", "rust-std", "cargo"];
const RUSTFMT_COMPONENTS: &[&str] = &["rustfmt-preview"]; const RUSTFMT_COMPONENTS: &[&str] = &["rustfmt"];
struct Tool { struct Tool {
config: Config, config: Config,

View file

@ -6,7 +6,7 @@ use super::verify_inside_clippy_dir;
/// Rusts setup uses `git rev-parse --git-common-dir` to get the root directory of the repo. /// Rusts setup uses `git rev-parse --git-common-dir` to get the root directory of the repo.
/// I've decided against this for the sake of simplicity and to make sure that it doesn't install /// I've decided against this for the sake of simplicity and to make sure that it doesn't install
/// the hook if `clippy_dev` would be used in the rust tree. The hook also references this tool /// the hook if `clippy_dev` would be used in the rust tree. The hook also references this tool
/// for formatting and should therefor only be used in a normal clone of clippy /// for formatting and should therefore only be used in a normal clone of clippy
const REPO_GIT_DIR: &str = ".git"; const REPO_GIT_DIR: &str = ".git";
const HOOK_SOURCE_FILE: &str = "util/etc/pre-commit.sh"; const HOOK_SOURCE_FILE: &str = "util/etc/pre-commit.sh";
const HOOK_TARGET_FILE: &str = ".git/hooks/pre-commit"; const HOOK_TARGET_FILE: &str = ".git/hooks/pre-commit";

View file

@ -113,7 +113,7 @@ impl HirEqInterExpr<'_, '_, '_> {
} }
} }
// eq_pat adds the HirIds to the locals map. We therefor call it last to make sure that // eq_pat adds the HirIds to the locals map. We therefore call it last to make sure that
// these only get added if the init and type is equal. // these only get added if the init and type is equal.
both(&l.init, &r.init, |l, r| self.eq_expr(l, r)) both(&l.init, &r.init, |l, r| self.eq_expr(l, r))
&& both(&l.ty, &r.ty, |l, r| self.eq_ty(l, r)) && both(&l.ty, &r.ty, |l, r| self.eq_ty(l, r))