Skip to content

Commit

Permalink
Auto merge of rust-lang#78060 - JohnTitor:rollup-uou8vyu, r=JohnTitor
Browse files Browse the repository at this point in the history
Rollup of 7 pull requests

Successful merges:

 - rust-lang#75802 (resolve: Do not put nonexistent crate `meta` into prelude)
 - rust-lang#76607 (Modify executable checking to be more universal)
 - rust-lang#77851 (BTreeMap: refactor Entry out of map.rs into its own file)
 - rust-lang#78043 (Fix grammar in note for orphan-rule error [E0210])
 - rust-lang#78048 (Suggest correct place to add `self` parameter when inside closure)
 - rust-lang#78050 (Small CSS cleanup)
 - rust-lang#78059 (Set `MDBOOK_OUTPUT__HTML__INPUT_404` on linkchecker)

Failed merges:

r? `@ghost`
  • Loading branch information
bors committed Oct 17, 2020
2 parents ffeeb20 + ffed6af commit 043eca7
Show file tree
Hide file tree
Showing 37 changed files with 608 additions and 540 deletions.
8 changes: 5 additions & 3 deletions compiler/rustc_resolve/src/late.rs
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ struct DiagnosticMetadata<'ast> {
/// param.
currently_processing_generics: bool,

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

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

Expand Down
3 changes: 0 additions & 3 deletions compiler/rustc_resolve/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1240,9 +1240,6 @@ impl<'a> Resolver<'a> {
extern_prelude.insert(Ident::with_dummy_span(sym::core), Default::default());
if !session.contains_name(&krate.attrs, sym::no_std) {
extern_prelude.insert(Ident::with_dummy_span(sym::std), Default::default());
if session.rust_2018() {
extern_prelude.insert(Ident::with_dummy_span(sym::meta), Default::default());
}
}
}

Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_typeck/src/coherence/orphan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ impl ItemLikeVisitor<'v> for OrphanChecker<'tcx> {
)
.note(
"implementing a foreign trait is only possible if at \
least one of the types for which is it implemented is local, \
least one of the types for which it is implemented is local, \
and no uncovered type parameters appear before that first \
local type",
)
Expand All @@ -135,7 +135,7 @@ impl ItemLikeVisitor<'v> for OrphanChecker<'tcx> {
local type",
param_ty,
)).note("implementing a foreign trait is only possible if at \
least one of the types for which is it implemented is local"
least one of the types for which it is implemented is local"
).note("only traits defined in the current crate can be \
implemented for a type parameter"
).emit();
Expand Down
Loading

0 comments on commit 043eca7

Please sign in to comment.