Skip to content

Commit 043eca7

Browse files
committed
Auto merge of #78060 - JohnTitor:rollup-uou8vyu, r=JohnTitor
Rollup of 7 pull requests Successful merges: - #75802 (resolve: Do not put nonexistent crate `meta` into prelude) - #76607 (Modify executable checking to be more universal) - #77851 (BTreeMap: refactor Entry out of map.rs into its own file) - #78043 (Fix grammar in note for orphan-rule error [E0210]) - #78048 (Suggest correct place to add `self` parameter when inside closure) - #78050 (Small CSS cleanup) - #78059 (Set `MDBOOK_OUTPUT__HTML__INPUT_404` on linkchecker) Failed merges: r? `@ghost`
2 parents ffeeb20 + ffed6af commit 043eca7

37 files changed

+608
-540
lines changed

compiler/rustc_resolve/src/late.rs

+5-3
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ struct DiagnosticMetadata<'ast> {
369369
/// param.
370370
currently_processing_generics: bool,
371371

372-
/// The current enclosing function (used for better errors).
372+
/// The current enclosing (non-closure) function (used for better errors).
373373
current_function: Option<(FnKind<'ast>, Span)>,
374374

375375
/// A list of labels as of yet unused. Labels will be removed from this map when
@@ -515,8 +515,10 @@ impl<'a: 'ast, 'ast> Visitor<'ast> for LateResolutionVisitor<'a, '_, 'ast> {
515515
FnKind::Fn(FnCtxt::Assoc(_), ..) => NormalRibKind,
516516
FnKind::Closure(..) => ClosureOrAsyncRibKind,
517517
};
518-
let previous_value =
519-
replace(&mut self.diagnostic_metadata.current_function, Some((fn_kind, sp)));
518+
let previous_value = self.diagnostic_metadata.current_function;
519+
if matches!(fn_kind, FnKind::Fn(..)) {
520+
self.diagnostic_metadata.current_function = Some((fn_kind, sp));
521+
}
520522
debug!("(resolving function) entering function");
521523
let declaration = fn_kind.decl();
522524

compiler/rustc_resolve/src/lib.rs

-3
Original file line numberDiff line numberDiff line change
@@ -1240,9 +1240,6 @@ impl<'a> Resolver<'a> {
12401240
extern_prelude.insert(Ident::with_dummy_span(sym::core), Default::default());
12411241
if !session.contains_name(&krate.attrs, sym::no_std) {
12421242
extern_prelude.insert(Ident::with_dummy_span(sym::std), Default::default());
1243-
if session.rust_2018() {
1244-
extern_prelude.insert(Ident::with_dummy_span(sym::meta), Default::default());
1245-
}
12461243
}
12471244
}
12481245

compiler/rustc_typeck/src/coherence/orphan.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ impl ItemLikeVisitor<'v> for OrphanChecker<'tcx> {
110110
)
111111
.note(
112112
"implementing a foreign trait is only possible if at \
113-
least one of the types for which is it implemented is local, \
113+
least one of the types for which it is implemented is local, \
114114
and no uncovered type parameters appear before that first \
115115
local type",
116116
)
@@ -135,7 +135,7 @@ impl ItemLikeVisitor<'v> for OrphanChecker<'tcx> {
135135
local type",
136136
param_ty,
137137
)).note("implementing a foreign trait is only possible if at \
138-
least one of the types for which is it implemented is local"
138+
least one of the types for which it is implemented is local"
139139
).note("only traits defined in the current crate can be \
140140
implemented for a type parameter"
141141
).emit();

0 commit comments

Comments
 (0)