Skip to content

Rollup of 5 pull requests #71566

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

Merged
merged 20 commits into from
Apr 26, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
2b25c0c
Don't load the same allocation twice when reading a scalar pair from it
oli-obk Apr 14, 2020
740f228
Remove `predecessors_for`
ecstatic-morse Apr 21, 2020
59c7460
Use a ref-counted pointer for ownership of the predecessor cache
ecstatic-morse Apr 21, 2020
34dfbc3
Add module docs and restrict visibility
ecstatic-morse Apr 23, 2020
af44cdf
Disallow statics initializing themselves
oli-obk Apr 23, 2020
e4ab4ee
Update src/librustc_mir/interpret/memory.rs
oli-obk Apr 23, 2020
cff5b99
add a few more DefKinds
mark-i-m Mar 16, 2020
d1db782
Split out the `Generator` case from `DefKind::Closure`.
eddyb Apr 17, 2020
95b3c42
Remove `Option` from the return type of `def_kind`.
eddyb Apr 17, 2020
18be5a0
Tweak `descr` for `AnonConst` and fix `article` for `Use` and `Extern…
eddyb Apr 17, 2020
d00f94f
Remove redundant `descr`/`descriptive_variant` methods from HIR.
eddyb Apr 17, 2020
087c0d7
fix a couple more uses of def_kind
mark-i-m Apr 24, 2020
258ebfe
tidy
mark-i-m Apr 24, 2020
1474fac
Add regression test for #26376
wesleywiser Apr 25, 2020
357f4ce
Replace thread_local with generator resume arguments in box_region.
gizmondo Mar 31, 2020
e51cbc8
Rollup merge of #70043 - mark-i-m:def-kind-more, r=eddyb
Dylan-DPC Apr 25, 2020
b964451
Rollup merge of #71140 - oli-obk:static_cycle, r=RalfJung
Dylan-DPC Apr 25, 2020
98a43ca
Rollup merge of #71392 - ecstatic-morse:body-predecessor-cache-arc, r…
Dylan-DPC Apr 25, 2020
fde4727
Rollup merge of #71541 - wesleywiser:issue_26376, r=Dylan-DPC
Dylan-DPC Apr 25, 2020
f70c9db
Rollup merge of #71554 - gizmondo:68922, r=jonas-schievink
Dylan-DPC Apr 25, 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
Split out the Generator case from DefKind::Closure.
  • Loading branch information
eddyb authored and mark-i-m committed Apr 24, 2020
commit d1db782dffc085cc24a9024b31d6b83862b02d8a
3 changes: 3 additions & 0 deletions src/librustc_hir/def.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ pub enum DefKind {
GlobalAsm,
Impl,
Closure,
Generator,
}

impl DefKind {
Expand Down Expand Up @@ -131,6 +132,7 @@ impl DefKind {
DefKind::Field => "field",
DefKind::Impl => "implementation",
DefKind::Closure => "closure",
DefKind::Generator => "generator",
DefKind::ExternCrate => "extern crate",
DefKind::GlobalAsm => "global assembly block",
}
Expand Down Expand Up @@ -184,6 +186,7 @@ impl DefKind {
| DefKind::LifetimeParam
| DefKind::ExternCrate
| DefKind::Closure
| DefKind::Generator
| DefKind::Use
| DefKind::ForeignMod
| DefKind::GlobalAsm
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_metadata/rmeta/decoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ impl EntryKind {
EntryKind::ForeignMod => DefKind::ForeignMod,
EntryKind::GlobalAsm => DefKind::GlobalAsm,
EntryKind::Field => DefKind::Field,
EntryKind::Generator(_) => DefKind::Closure,
EntryKind::Generator(_) => DefKind::Generator,
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/librustc_middle/hir/map/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,8 @@ impl<'hir> Map<'hir> {
Node::AnonConst(_) => DefKind::AnonConst,
Node::Field(_) => DefKind::Field,
Node::Expr(expr) => match expr.kind {
ExprKind::Closure { .. } => DefKind::Closure,
ExprKind::Closure(.., None) => DefKind::Closure,
ExprKind::Closure(.., Some(_)) => DefKind::Generator,
_ => bug!("def_kind: unsupported node: {}", self.node_to_string(hir_id)),
},
Node::MacroDef(_) => DefKind::Macro(MacroKind::Bang),
Expand Down
7 changes: 4 additions & 3 deletions src/librustc_privacy/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -613,8 +613,8 @@ impl EmbargoVisitor<'tcx> {
}
}

// These have type privacy or are not namespaced, so are not reachable unless they're
// public.
// These have type privacy, so are not reachable unless they're
// public, or are not namespaced at all.
DefKind::AssocConst
| DefKind::AssocTy
| DefKind::AssocOpaqueTy
Expand All @@ -636,7 +636,8 @@ impl EmbargoVisitor<'tcx> {
| DefKind::Field
| DefKind::GlobalAsm
| DefKind::Impl
| DefKind::Closure => (),
| DefKind::Closure
| DefKind::Generator => (),
}
}

Expand Down
3 changes: 2 additions & 1 deletion src/librustc_save_analysis/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -771,7 +771,8 @@ impl<'l, 'tcx> SaveContext<'l, 'tcx> {
| HirDefKind::Field
| HirDefKind::GlobalAsm
| HirDefKind::Impl
| HirDefKind::Closure,
| HirDefKind::Closure
| HirDefKind::Generator,
_,
)
| Res::PrimTy(..)
Expand Down