Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 15 pull requests #78766

Closed
wants to merge 44 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
4af560e
Move zero-sized-vec-push test
poliorcetics Sep 14, 2020
85afbd8
Rebase conflicts
poliorcetics Oct 17, 2020
4fd06b9
Move vec-macro-repeat test
poliorcetics Oct 3, 2020
42271a5
Move vec swap test
poliorcetics Oct 3, 2020
1bdee96
Move subslice pattern tests to alloc/tests/slice.rs
poliorcetics Oct 3, 2020
251f6da
(rustdoc) fix test for trait impl display
liketechnik Oct 25, 2020
e4d1096
Change as_str → to_string in proc_macro::Ident::span() docs
est31 Oct 28, 2020
300362e
Close the theme picker when Escape is pressed
notriddle Oct 30, 2020
ac3a434
Allow the theme picker to work with arrow keys
notriddle Oct 30, 2020
6918a17
Add aria roles for theme picker menu
notriddle Oct 30, 2020
90c7c63
Add comment describing the Escape key weirdness
notriddle Oct 30, 2020
17b8ca9
Pull theme picker keyboard code into main.js
notriddle Oct 30, 2020
5801109
Move Copy and Clone into the list of traits implemented for all sizes
est31 Nov 4, 2020
93fa023
Fix outdated comment next to array_impl_default
est31 Nov 4, 2020
bcd2f2d
fix a couple of clippy warnings:
matthiaskrgr Nov 4, 2020
69e5729
Simplify the implementation of `get_mut` (no unsafe)
danielhenrymantilla Nov 4, 2020
232b9ba
Move range in ui test to ops test in library/core
sasurau4 Nov 4, 2020
a70e0c2
Fix issue 78654.
hameerabbasi Nov 4, 2020
bd7229d
make intern_const_alloc_recursive return error fix #78655
vn-ki Nov 4, 2020
5855fb7
Move f64::NAN ui tests into `library`
Oct 27, 2020
97d5a1b
Fix format
Nov 4, 2020
d8afe98
Clean up docs for 'as' keyword
camelid Oct 19, 2020
bdbcaf0
Update cargo
ehuss Nov 5, 2020
3084a55
Don't use `crate` in link text
camelid Nov 5, 2020
bbdb1f0
Clean up some intra-doc links
camelid Nov 5, 2020
677b2ac
Add missing comma
camelid Nov 5, 2020
873ebcb
Fixed typo in comment
eltociear Nov 5, 2020
f9b139f
Add `mod nan` for test
Nov 5, 2020
a15ee4d
update dangling-alloc-id-ice test
vn-ki Nov 5, 2020
7a14022
Rollup merge of #76718 - poliorcetics:vec-ui-to-unit-test, r=jyn514
m-ou-se Nov 5, 2020
c25ac7e
Rollup merge of #78093 - camelid:as-cleanup, r=jyn514
m-ou-se Nov 5, 2020
1960f39
Rollup merge of #78425 - chansuke:move_nan, r=jyn514
m-ou-se Nov 5, 2020
c6db8a1
Rollup merge of #78465 - est31:proc_macro_to_string, r=jyn514
m-ou-se Nov 5, 2020
560f977
Rollup merge of #78584 - notriddle:master, r=GuillaumeGomez
m-ou-se Nov 5, 2020
4fadb9e
Rollup merge of #78716 - est31:array_traits, r=Dylan-DPC
m-ou-se Nov 5, 2020
47cfe95
Rollup merge of #78727 - liketechnik:issue-55201, r=GuillaumeGomez
m-ou-se Nov 5, 2020
ea6bdf3
Rollup merge of #78733 - matthiaskrgr:cl11ppy, r=jyn514
m-ou-se Nov 5, 2020
7e84ad0
Rollup merge of #78735 - danielhenrymantilla:simplify-unsafecell-getm…
m-ou-se Nov 5, 2020
9e750f1
Rollup merge of #78738 - sasurau4:test/move-range-test-to-library-cor…
m-ou-se Nov 5, 2020
7e51236
Rollup merge of #78739 - hameerabbasi:issue-78654, r=nikomatsakis
m-ou-se Nov 5, 2020
a7984a9
Rollup merge of #78742 - vn-ki:fix-issue-78655, r=oli-obk
m-ou-se Nov 5, 2020
e32141a
Rollup merge of #78756 - ehuss:update-cargo, r=ehuss
m-ou-se Nov 5, 2020
6e336d1
Rollup merge of #78757 - camelid:crate-link-text, r=jyn514
m-ou-se Nov 5, 2020
184c1ca
Rollup merge of #78758 - eltociear:patch-1, r=jyn514
m-ou-se Nov 5, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix a couple of clippy warnings:
filter_next
manual_strip
redundant_static_lifetimes
single_char_pattern
unnecessary_cast
unused_unit
op_ref
redundant_closure
useless_conversion
matthiaskrgr committed Nov 4, 2020
commit bcd2f2df67ac755b23f540a0657572eade281f12
2 changes: 1 addition & 1 deletion compiler/rustc_ast/src/attr/mod.rs
Original file line number Diff line number Diff line change
@@ -360,7 +360,7 @@ pub fn list_contains_name(items: &[NestedMetaItem], name: Symbol) -> bool {
impl MetaItem {
fn token_trees_and_spacings(&self) -> Vec<TreeAndSpacing> {
let mut idents = vec![];
let mut last_pos = BytePos(0 as u32);
let mut last_pos = BytePos(0_u32);
for (i, segment) in self.path.segments.iter().enumerate() {
let is_first = i == 0;
if !is_first {
Original file line number Diff line number Diff line change
@@ -739,7 +739,6 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
"cannot infer {} {} {} `{}`{}",
kind_str, preposition, descr, type_name, parent_desc
)
.into()
}
}
}
9 changes: 4 additions & 5 deletions compiler/rustc_interface/src/util.rs
Original file line number Diff line number Diff line change
@@ -246,10 +246,10 @@ pub fn get_codegen_backend(sopts: &config::Options) -> Box<dyn CodegenBackend> {

INIT.call_once(|| {
#[cfg(feature = "llvm")]
const DEFAULT_CODEGEN_BACKEND: &'static str = "llvm";
const DEFAULT_CODEGEN_BACKEND: &str = "llvm";

#[cfg(not(feature = "llvm"))]
const DEFAULT_CODEGEN_BACKEND: &'static str = "cranelift";
const DEFAULT_CODEGEN_BACKEND: &str = "cranelift";

let codegen_name = sopts
.debugging_opts
@@ -414,11 +414,10 @@ pub fn get_codegen_sysroot(backend_name: &str) -> fn() -> Box<dyn CodegenBackend
let libdir = filesearch::relative_target_lib_path(&sysroot, &target);
sysroot.join(libdir).with_file_name("codegen-backends")
})
.filter(|f| {
.find(|f| {
info!("codegen backend candidate: {}", f.display());
f.exists()
})
.next();
});
let sysroot = sysroot.unwrap_or_else(|| {
let candidates = sysroot_candidates
.iter()
2 changes: 1 addition & 1 deletion compiler/rustc_middle/src/middle/stability.rs
Original file line number Diff line number Diff line change
@@ -399,7 +399,7 @@ impl<'tcx> TyCtxt<'tcx> {
def_id: DefId,
id: Option<HirId>,
span: Span,
unmarked: impl FnOnce(Span, DefId) -> (),
unmarked: impl FnOnce(Span, DefId),
) {
let soft_handler = |lint, span, msg: &_| {
self.struct_span_lint_hir(lint, id.unwrap_or(hir::CRATE_HIR_ID), span, |lint| {
2 changes: 1 addition & 1 deletion compiler/rustc_middle/src/mir/terminator.rs
Original file line number Diff line number Diff line change
@@ -46,7 +46,7 @@ impl SwitchTargets {
pub fn new(targets: impl Iterator<Item = (u128, BasicBlock)>, otherwise: BasicBlock) -> Self {
let (values, mut targets): (SmallVec<_>, SmallVec<_>) = targets.unzip();
targets.push(otherwise);
Self { values: values.into(), targets }
Self { values, targets }
}

/// Builds a switch targets definition that jumps to `then` if the tested value equals `value`,
Original file line number Diff line number Diff line change
@@ -120,7 +120,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
let move_out = self.move_data.moves[(*move_site).moi];
let moved_place = &self.move_data.move_paths[move_out.path].place;
// `*(_1)` where `_1` is a `Box` is actually a move out.
let is_box_move = moved_place.as_ref().projection == &[ProjectionElem::Deref]
let is_box_move = moved_place.as_ref().projection == [ProjectionElem::Deref]
&& self.body.local_decls[moved_place.local].ty.is_box();

!is_box_move
2 changes: 1 addition & 1 deletion compiler/rustc_mir/src/transform/match_branches.rs
Original file line number Diff line number Diff line change
@@ -63,7 +63,7 @@ impl<'tcx> MirPass<'tcx> for MatchBranchSimplification {
};

// Check that destinations are identical, and if not, then don't optimize this block
if &bbs[first].terminator().kind != &bbs[second].terminator().kind {
if bbs[first].terminator().kind != bbs[second].terminator().kind {
continue;
}

5 changes: 2 additions & 3 deletions compiler/rustc_resolve/src/late/diagnostics.rs
Original file line number Diff line number Diff line change
@@ -1886,9 +1886,8 @@ impl<'tcx> LifetimeContext<'_, 'tcx> {
if snippet.starts_with('&') && !snippet.starts_with("&'") {
introduce_suggestion
.push((param.span, format!("&'a {}", &snippet[1..])));
} else if snippet.starts_with("&'_ ") {
introduce_suggestion
.push((param.span, format!("&'a {}", &snippet[4..])));
} else if let Some(stripped) = snippet.strip_prefix("&'_ ") {
introduce_suggestion.push((param.span, format!("&'a {}", &stripped)));
}
}
}
2 changes: 1 addition & 1 deletion compiler/rustc_span/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1574,7 +1574,7 @@ fn normalize_src(src: &mut String, start_pos: BytePos) -> Vec<NormalizedPos> {

/// Removes UTF-8 BOM, if any.
fn remove_bom(src: &mut String, normalized_pos: &mut Vec<NormalizedPos>) {
if src.starts_with("\u{feff}") {
if src.starts_with('\u{feff}') {
src.drain(..3);
normalized_pos.push(NormalizedPos { pos: BytePos(0), diff: 3 });
}
Original file line number Diff line number Diff line change
@@ -1388,11 +1388,7 @@ impl<'a, 'tcx> InferCtxtPrivExt<'tcx> for InferCtxt<'a, 'tcx> {
trait_ref: &ty::PolyTraitRef<'tcx>,
) {
let get_trait_impl = |trait_def_id| {
self.tcx.find_map_relevant_impl(
trait_def_id,
trait_ref.skip_binder().self_ty(),
|impl_def_id| Some(impl_def_id),
)
self.tcx.find_map_relevant_impl(trait_def_id, trait_ref.skip_binder().self_ty(), Some)
};
let required_trait_path = self.tcx.def_path_str(trait_ref.def_id());
let all_traits = self.tcx.all_traits(LOCAL_CRATE);
2 changes: 1 addition & 1 deletion compiler/rustc_trait_selection/src/traits/fulfill.rs
Original file line number Diff line number Diff line change
@@ -499,7 +499,7 @@ impl<'a, 'b, 'tcx> FulfillProcessor<'a, 'b, 'tcx> {
Err(ErrorHandled::TooGeneric) => {
pending_obligation.stalled_on = substs
.iter()
.filter_map(|ty| TyOrConstInferVar::maybe_from_generic_arg(ty))
.filter_map(TyOrConstInferVar::maybe_from_generic_arg)
.collect();
ProcessResult::Unchanged
}