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 7 pull requests #78060

Merged
merged 15 commits into from
Oct 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
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