Skip to content

Commit edefa41

Browse files
committed
Auto merge of rust-lang#106998 - matthiaskrgr:rollup-hmfisji, r=matthiaskrgr
Rollup of 7 pull requests Successful merges: - rust-lang#104505 (Remove double spaces after dots in comments) - rust-lang#106784 (prevent E0512 from emitting [type error] by checking the references_error) - rust-lang#106834 (new trait solver: only consider goal changed if response is not identity) - rust-lang#106889 (Mention the lack of `windows_mut` in `windows`) - rust-lang#106963 (Use `scope_expr_id` from `ProbeCtxt`) - rust-lang#106970 (Switch to `EarlyBinder` for `item_bounds` query) - rust-lang#106980 (Hide `_use_mk_alias_ty_instead` in `<AliasTy as Debug>::fmt`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2 parents 3984bc5 + 48bd3ab commit edefa41

File tree

173 files changed

+412
-366
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

173 files changed

+412
-366
lines changed

compiler/rustc_abi/src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1263,8 +1263,8 @@ pub enum Variants<V: Idx> {
12631263

12641264
/// Enum-likes with more than one inhabited variant: each variant comes with
12651265
/// a *discriminant* (usually the same as the variant index but the user can
1266-
/// assign explicit discriminant values). That discriminant is encoded
1267-
/// as a *tag* on the machine. The layout of each variant is
1266+
/// assign explicit discriminant values). That discriminant is encoded
1267+
/// as a *tag* on the machine. The layout of each variant is
12681268
/// a struct, and they all have space reserved for the tag.
12691269
/// For enums, the tag is the sole field of the layout.
12701270
Multiple {

compiler/rustc_ast/src/util/parser.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ impl ExprPrecedence {
304304
| ExprPrecedence::Yeet => PREC_JUMP,
305305

306306
// `Range` claims to have higher precedence than `Assign`, but `x .. x = x` fails to
307-
// parse, instead of parsing as `(x .. x) = x`. Giving `Range` a lower precedence
307+
// parse, instead of parsing as `(x .. x) = x`. Giving `Range` a lower precedence
308308
// ensures that `pprust` will add parentheses in the right places to get the desired
309309
// parse.
310310
ExprPrecedence::Range => PREC_RANGE,

compiler/rustc_ast_lowering/src/index.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ pub(super) fn index_hir<'hir>(
3838
) -> (IndexVec<ItemLocalId, Option<ParentedNode<'hir>>>, FxHashMap<LocalDefId, ItemLocalId>) {
3939
let mut nodes = IndexVec::new();
4040
// This node's parent should never be accessed: the owner's parent is computed by the
41-
// hir_owner_parent query. Make it invalid (= ItemLocalId::MAX) to force an ICE whenever it is
41+
// hir_owner_parent query. Make it invalid (= ItemLocalId::MAX) to force an ICE whenever it is
4242
// used.
4343
nodes.push(Some(ParentedNode { parent: ItemLocalId::INVALID, node: item.into() }));
4444
let mut collector = NodeCollector {

compiler/rustc_ast_lowering/src/item.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
523523
//
524524
// The first two are produced by recursively invoking
525525
// `lower_use_tree` (and indeed there may be things
526-
// like `use foo::{a::{b, c}}` and so forth). They
526+
// like `use foo::{a::{b, c}}` and so forth). They
527527
// wind up being directly added to
528528
// `self.items`. However, the structure of this
529529
// function also requires us to return one item, and

compiler/rustc_ast_lowering/src/lib.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -662,7 +662,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
662662
self.arena.alloc(hir::OwnerInfo { nodes, parenting, attrs, trait_map })
663663
}
664664

665-
/// Hash the HIR node twice, one deep and one shallow hash. This allows to differentiate
665+
/// Hash the HIR node twice, one deep and one shallow hash. This allows to differentiate
666666
/// queries which depend on the full HIR tree and those which only depend on the item signature.
667667
fn hash_owner(
668668
&mut self,
@@ -1193,7 +1193,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
11931193
itctx: &ImplTraitContext,
11941194
) -> hir::Ty<'hir> {
11951195
// Check whether we should interpret this as a bare trait object.
1196-
// This check mirrors the one in late resolution. We only introduce this special case in
1196+
// This check mirrors the one in late resolution. We only introduce this special case in
11971197
// the rare occurrence we need to lower `Fresh` anonymous lifetimes.
11981198
// The other cases when a qpath should be opportunistically made a trait object are handled
11991199
// by `ty_path`.
@@ -1918,7 +1918,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
19181918
this.with_remapping(new_remapping, |this| {
19191919
// We have to be careful to get elision right here. The
19201920
// idea is that we create a lifetime parameter for each
1921-
// lifetime in the return type. So, given a return type
1921+
// lifetime in the return type. So, given a return type
19221922
// like `async fn foo(..) -> &[&u32]`, we lower to `impl
19231923
// Future<Output = &'1 [ &'2 u32 ]>`.
19241924
//
@@ -2012,7 +2012,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
20122012

20132013
// Create the `Foo<...>` reference itself. Note that the `type
20142014
// Foo = impl Trait` is, internally, created as a child of the
2015-
// async fn, so the *type parameters* are inherited. It's
2015+
// async fn, so the *type parameters* are inherited. It's
20162016
// only the lifetime parameters that we must supply.
20172017
let opaque_ty_ref = hir::TyKind::OpaqueDef(
20182018
hir::ItemId { owner_id: hir::OwnerId { def_id: opaque_ty_def_id } },

compiler/rustc_ast_pretty/src/pprust/state/expr.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -473,10 +473,10 @@ impl<'a> State<'a> {
473473
self.word("]");
474474
}
475475
ast::ExprKind::Range(start, end, limits) => {
476-
// Special case for `Range`. `AssocOp` claims that `Range` has higher precedence
476+
// Special case for `Range`. `AssocOp` claims that `Range` has higher precedence
477477
// than `Assign`, but `x .. x = x` gives a parse error instead of `x .. (x = x)`.
478478
// Here we use a fake precedence value so that any child with lower precedence than
479-
// a "normal" binop gets parenthesized. (`LOr` is the lowest-precedence binop.)
479+
// a "normal" binop gets parenthesized. (`LOr` is the lowest-precedence binop.)
480480
let fake_prec = AssocOp::LOr.precedence() as i8;
481481
if let Some(e) = start {
482482
self.print_expr_maybe_paren(e, fake_prec);

compiler/rustc_borrowck/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2173,7 +2173,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
21732173
// `self.foo` -- we want to double
21742174
// check that the location `*self`
21752175
// is mutable (i.e., this is not a
2176-
// `Fn` closure). But if that
2176+
// `Fn` closure). But if that
21772177
// check succeeds, we want to
21782178
// *blame* the mutability on
21792179
// `place` (that is,

compiler/rustc_borrowck/src/member_constraints.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ where
109109
R1: Copy + Hash + Eq,
110110
{
111111
/// Remap the "member region" key using `map_fn`, producing a new
112-
/// member constraint set. This is used in the NLL code to map from
112+
/// member constraint set. This is used in the NLL code to map from
113113
/// the original `RegionVid` to an scc index. In some cases, we
114114
/// may have multiple `R1` values mapping to the same `R2` key -- that
115115
/// is ok, the two sets will be merged.
@@ -158,7 +158,7 @@ where
158158
}
159159

160160
/// Iterate down the constraint indices associated with a given
161-
/// peek-region. You can then use `choice_regions` and other
161+
/// peek-region. You can then use `choice_regions` and other
162162
/// methods to access data.
163163
pub(crate) fn indices(
164164
&self,

compiler/rustc_borrowck/src/nll.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ pub(super) fn dump_annotation<'tcx>(
385385

386386
// When the enclosing function is tagged with `#[rustc_regions]`,
387387
// we dump out various bits of state as warnings. This is useful
388-
// for verifying that the compiler is behaving as expected. These
388+
// for verifying that the compiler is behaving as expected. These
389389
// warnings focus on the closure region requirements -- for
390390
// viewing the intraprocedural state, the -Zdump-mir output is
391391
// better.

compiler/rustc_borrowck/src/place_ext.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ impl<'tcx> PlaceExt<'tcx> for Place<'tcx> {
6363
ty::RawPtr(..) | ty::Ref(_, _, hir::Mutability::Not) => {
6464
// For both derefs of raw pointers and `&T`
6565
// references, the original path is `Copy` and
66-
// therefore not significant. In particular,
66+
// therefore not significant. In particular,
6767
// there is nothing the user can do to the
6868
// original path that would invalidate the
6969
// newly created reference -- and if there

compiler/rustc_borrowck/src/region_infer/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -680,7 +680,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
680680
/// enforce the constraint).
681681
///
682682
/// The current value of `scc` at the time the method is invoked
683-
/// is considered a *lower bound*. If possible, we will modify
683+
/// is considered a *lower bound*. If possible, we will modify
684684
/// the constraint to set it equal to one of the option regions.
685685
/// If we make any changes, returns true, else false.
686686
#[instrument(skip(self, member_constraint_index), level = "debug")]
@@ -959,7 +959,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
959959
//
960960
// This is needed because -- particularly in the case
961961
// where `ur` is a local bound -- we are sometimes in a
962-
// position to prove things that our caller cannot. See
962+
// position to prove things that our caller cannot. See
963963
// #53570 for an example.
964964
if self.eval_verify_bound(infcx, param_env, generic_ty, ur, &type_test.verify_bound) {
965965
continue;
@@ -2035,7 +2035,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
20352035
// '5: '6 ('6 is the target)
20362036
//
20372037
// Some of those regions are unified with `'6` (in the same
2038-
// SCC). We want to screen those out. After that point, the
2038+
// SCC). We want to screen those out. After that point, the
20392039
// "closest" constraint we have to the end is going to be the
20402040
// most likely to be the point where the value escapes -- but
20412041
// we still want to screen for an "interesting" point to

compiler/rustc_borrowck/src/type_check/constraint_conversion.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ impl<'a, 'tcx> ConstraintConversion<'a, 'tcx> {
107107
closure_substs: ty::SubstsRef<'tcx>,
108108
) {
109109
// Extract the values of the free regions in `closure_substs`
110-
// into a vector. These are the regions that we will be
110+
// into a vector. These are the regions that we will be
111111
// relating to one another.
112112
let closure_mapping = &UniversalRegions::closure_mapping(
113113
self.tcx,

compiler/rustc_borrowck/src/type_check/free_region_relations.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ impl UniversalRegionRelations<'_> {
9898
let upper_bounds = self.non_local_upper_bounds(fr);
9999

100100
// In case we find more than one, reduce to one for
101-
// convenience. This is to prevent us from generating more
101+
// convenience. This is to prevent us from generating more
102102
// complex constraints, but it will cause spurious errors.
103103
let post_dom = self.inverse_outlives.mutual_immediate_postdominator(upper_bounds);
104104

@@ -128,7 +128,7 @@ impl UniversalRegionRelations<'_> {
128128
let lower_bounds = self.non_local_bounds(&self.outlives, fr);
129129

130130
// In case we find more than one, reduce to one for
131-
// convenience. This is to prevent us from generating more
131+
// convenience. This is to prevent us from generating more
132132
// complex constraints, but it will cause spurious errors.
133133
let post_dom = self.outlives.mutual_immediate_postdominator(lower_bounds);
134134

compiler/rustc_borrowck/src/type_check/liveness/trace.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ impl<'me, 'typeck, 'flow, 'tcx> LivenessResults<'me, 'typeck, 'flow, 'tcx> {
328328
debug_assert!(self.drop_live_at.contains(term_point));
329329

330330
// Otherwise, scan backwards through the statements in the
331-
// block. One of them may be either a definition or use
331+
// block. One of them may be either a definition or use
332332
// live point.
333333
let term_location = self.cx.elements.to_location(term_point);
334334
debug_assert_eq!(self.cx.body.terminator_loc(term_location.block), term_location,);

compiler/rustc_borrowck/src/type_check/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1665,7 +1665,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
16651665
fn ensure_place_sized(&mut self, ty: Ty<'tcx>, span: Span) {
16661666
let tcx = self.tcx();
16671667

1668-
// Erase the regions from `ty` to get a global type. The
1668+
// Erase the regions from `ty` to get a global type. The
16691669
// `Sized` bound in no way depends on precise regions, so this
16701670
// shouldn't affect `is_sized`.
16711671
let erased_ty = tcx.erase_regions(ty);

compiler/rustc_borrowck/src/universal_regions.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -637,7 +637,7 @@ impl<'cx, 'tcx> UniversalRegionsBuilder<'cx, 'tcx> {
637637
let closure_ty = tcx.closure_env_ty(def_id, substs, env_region).unwrap();
638638

639639
// The "inputs" of the closure in the
640-
// signature appear as a tuple. The MIR side
640+
// signature appear as a tuple. The MIR side
641641
// flattens this tuple.
642642
let (&output, tuplized_inputs) =
643643
inputs_and_output.skip_binder().split_last().unwrap();

compiler/rustc_builtin_macros/src/deriving/clone.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ pub fn expand_deriving_clone(
2020
// some additional `AssertParamIsClone` assertions.
2121
//
2222
// We can use the simple form if either of the following are true.
23-
// - The type derives Copy and there are no generic parameters. (If we
23+
// - The type derives Copy and there are no generic parameters. (If we
2424
// used the simple form with generics, we'd have to bound the generics
2525
// with Clone + Copy, and then there'd be no Clone impl at all if the
2626
// user fills in something that is Clone but not Copy. After

compiler/rustc_builtin_macros/src/env.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// The compiler code necessary to support the env! extension. Eventually this
1+
// The compiler code necessary to support the env! extension. Eventually this
22
// should all get sucked into either the compiler syntax extension plugin
33
// interface.
44
//

compiler/rustc_builtin_macros/src/format.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,7 @@ fn report_missing_placeholders(
583583
if detect_foreign_fmt {
584584
use super::format_foreign as foreign;
585585

586-
// The set of foreign substitutions we've explained. This prevents spamming the user
586+
// The set of foreign substitutions we've explained. This prevents spamming the user
587587
// with `%d should be written as {}` over and over again.
588588
let mut explained = FxHashSet::default();
589589

compiler/rustc_builtin_macros/src/format_foreign.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ pub(crate) mod printf {
253253
#[derive(Copy, Clone, PartialEq, Debug)]
254254
pub enum Num {
255255
// The range of these values is technically bounded by `NL_ARGMAX`... but, at least for GNU
256-
// libc, it apparently has no real fixed limit. A `u16` is used here on the basis that it
256+
// libc, it apparently has no real fixed limit. A `u16` is used here on the basis that it
257257
// is *vanishingly* unlikely that *anyone* is going to try formatting something wider, or
258258
// with more precision, than 32 thousand positions which is so wide it couldn't possibly fit
259259
// on a screen.

compiler/rustc_codegen_cranelift/src/constant.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ fn data_id_for_static(
304304

305305
// Comment copied from https://github.com/rust-lang/rust/blob/45060c2a66dfd667f88bd8b94261b28a58d85bd5/src/librustc_codegen_llvm/consts.rs#L141
306306
// Declare an internal global `extern_with_linkage_foo` which
307-
// is initialized with the address of `foo`. If `foo` is
307+
// is initialized with the address of `foo`. If `foo` is
308308
// discarded during linking (for example, if `foo` has weak
309309
// linkage and there are no definitions), then
310310
// `extern_with_linkage_foo` will instead be initialized to

compiler/rustc_codegen_llvm/src/abi.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ impl<'ll, 'tcx> ArgAbiExt<'ll, 'tcx> for ArgAbi<'tcx, Ty<'tcx>> {
221221
bx.store(val, cast_dst, self.layout.align.abi);
222222
} else {
223223
// The actual return type is a struct, but the ABI
224-
// adaptation code has cast it into some scalar type. The
224+
// adaptation code has cast it into some scalar type. The
225225
// code that follows is the only reliable way I have
226226
// found to do a transform like i64 -> {i32,i32}.
227227
// Basically we dump the data onto the stack then memcpy it.

compiler/rustc_codegen_llvm/src/asm.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ pub(crate) fn inline_asm_call<'ll>(
445445
};
446446

447447
// Store mark in a metadata node so we can map LLVM errors
448-
// back to source locations. See #17552.
448+
// back to source locations. See #17552.
449449
let key = "srcloc";
450450
let kind = llvm::LLVMGetMDKindIDInContext(
451451
bx.llcx,

compiler/rustc_codegen_llvm/src/back/archive.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ impl ArchiveBuilderBuilder for LlvmArchiveBuilderBuilder {
145145
// The binutils linker used on -windows-gnu targets cannot read the import
146146
// libraries generated by LLVM: in our attempts, the linker produced an .EXE
147147
// that loaded but crashed with an AV upon calling one of the imported
148-
// functions. Therefore, use binutils to create the import library instead,
148+
// functions. Therefore, use binutils to create the import library instead,
149149
// by writing a .DEF file to the temp dir and calling binutils's dlltool.
150150
let def_file_path =
151151
tmpdir.join(format!("{}{}", lib_name, name_suffix)).with_extension("def");
@@ -219,7 +219,7 @@ impl ArchiveBuilderBuilder for LlvmArchiveBuilderBuilder {
219219

220220
// All import names are Rust identifiers and therefore cannot contain \0 characters.
221221
// FIXME: when support for #[link_name] is implemented, ensure that the import names
222-
// still don't contain any \0 characters. Also need to check that the names don't
222+
// still don't contain any \0 characters. Also need to check that the names don't
223223
// contain substrings like " @" or "NONAME" that are keywords or otherwise reserved
224224
// in definition files.
225225
let cstring_import_name_and_ordinal_vector: Vec<(CString, Option<u16>)> =
@@ -433,7 +433,7 @@ fn find_binutils_dlltool(sess: &Session) -> OsString {
433433
}
434434

435435
// The user didn't specify the location of the dlltool binary, and we weren't able
436-
// to find the appropriate one on the PATH. Just return the name of the tool
436+
// to find the appropriate one on the PATH. Just return the name of the tool
437437
// and let the invocation fail with a hopefully useful error message.
438438
tool_name
439439
}

compiler/rustc_codegen_llvm/src/back/write.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -909,7 +909,7 @@ unsafe fn embed_bitcode(
909909

910910
// Create a `__imp_<symbol> = &symbol` global for every public static `symbol`.
911911
// This is required to satisfy `dllimport` references to static data in .rlibs
912-
// when using MSVC linker. We do this only for data, as linker can fix up
912+
// when using MSVC linker. We do this only for data, as linker can fix up
913913
// code references on its own.
914914
// See #26591, #27438
915915
fn create_msvc_imps(

compiler/rustc_codegen_llvm/src/callee.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ pub fn get_fn<'ll, 'tcx>(cx: &CodegenCx<'ll, 'tcx>, instance: Instance<'tcx>) ->
4949
let llptrty = fn_abi.ptr_to_llvm_type(cx);
5050

5151
// This is subtle and surprising, but sometimes we have to bitcast
52-
// the resulting fn pointer. The reason has to do with external
53-
// functions. If you have two crates that both bind the same C
52+
// the resulting fn pointer. The reason has to do with external
53+
// functions. If you have two crates that both bind the same C
5454
// library, they may not use precisely the same types: for
5555
// example, they will probably each declare their own structs,
5656
// which are distinct types from LLVM's point of view (nominal

compiler/rustc_codegen_llvm/src/consts.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ pub fn codegen_static_initializer<'ll, 'tcx>(
140140
fn set_global_alignment<'ll>(cx: &CodegenCx<'ll, '_>, gv: &'ll Value, mut align: Align) {
141141
// The target may require greater alignment for globals than the type does.
142142
// Note: GCC and Clang also allow `__attribute__((aligned))` on variables,
143-
// which can force it to be smaller. Rust doesn't support this yet.
143+
// which can force it to be smaller. Rust doesn't support this yet.
144144
if let Some(min) = cx.sess().target.min_global_align {
145145
match Align::from_bits(min) {
146146
Ok(min) => align = align.max(min),
@@ -171,7 +171,7 @@ fn check_and_apply_linkage<'ll, 'tcx>(
171171
llvm::LLVMRustSetLinkage(g1, base::linkage_to_llvm(linkage));
172172

173173
// Declare an internal global `extern_with_linkage_foo` which
174-
// is initialized with the address of `foo`. If `foo` is
174+
// is initialized with the address of `foo`. If `foo` is
175175
// discarded during linking (for example, if `foo` has weak
176176
// linkage and there are no definitions), then
177177
// `extern_with_linkage_foo` will instead be initialized to

0 commit comments

Comments
 (0)