Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
91cf0e7
Don't requery the param_env of a union
matthewjasper Jan 30, 2020
570c161
Remove unnecessary features in rustc_ty
matthewjasper Jan 30, 2020
3973322
Add IS_MANUALLY_DROP to AdtFlags
matthewjasper Jan 30, 2020
d196521
Improve needs_drop query
matthewjasper Jan 30, 2020
d20646b
Address review comments
matthewjasper Jan 31, 2020
465b862
Use correct `ParamEnv` in `Instance::resolve`
matthewjasper Feb 1, 2020
6bf2cc2
Avoid instantiating many `Parser` structs in `generic_extension`.
nnethercote Feb 4, 2020
f840a95
Remove the `Cow` from `Directory`.
nnethercote Feb 5, 2020
2a13b24
Change condition ordering in `parse_tt`.
nnethercote Feb 5, 2020
3eb5241
Apply suggestions from code review
matthewjasper Feb 9, 2020
842938a
cache adt_drop_tys
matthewjasper Feb 9, 2020
9e78ce0
handle TerminatorKind::Yield by returning Err(Unpromotable)
chrissimpkins Feb 10, 2020
fc3ecb2
add issue 69017 test
chrissimpkins Feb 10, 2020
97d1f8d
Add missing `_zeroed` varants to `AllocRef`
TimDiekmann Feb 10, 2020
53b16fb
add main function to issue-69017 test
chrissimpkins Feb 10, 2020
e2b9d6e
Add a `contains` method to `ResultsCursor`
ecstatic-morse Jan 20, 2020
1ec9917
Add an `into_engine` method to `Analysis`
ecstatic-morse Jan 20, 2020
c64dfd7
Add a `Visitor` for dataflow results
ecstatic-morse Jan 20, 2020
702096d
Implement a `find_descendant` method for `MovePath`
ecstatic-morse Jan 20, 2020
ce3f37b
Use new dataflow interface for initialization/borrows analyses
ecstatic-morse Jan 20, 2020
76aa29f
Preparation for allocator aware `Box`
TimDiekmann Feb 11, 2020
3884311
Add self to .mailmap
Bassetts Feb 11, 2020
30a8353
Specify overflow checks behaviour in test
matthewjasper Feb 10, 2020
f639607
Use new dataflow framework for drop elaboration and borrow checking
ecstatic-morse Jan 20, 2020
42d19a4
Use new dataflow framework for `rustc_peek` tests
ecstatic-morse Jan 20, 2020
5860e78
Skip caching block transfer functions for acyclic MIR
ecstatic-morse Jan 20, 2020
168ca9a
Add note about `elaborate_drops::InitializationData`
ecstatic-morse Jan 21, 2020
3ac920f
Use exhaustive matching
ecstatic-morse Feb 11, 2020
5f40fe9
Clarify why you shouldn't override `Analysis::into_engine`
ecstatic-morse Feb 11, 2020
8e26ad0
Keyword docs
Feb 11, 2020
683ebc2
On mismatched argument count point at arguments
estebank Feb 6, 2020
c1ed84e
Fix outdated doc comment.
jumbatm Feb 11, 2020
c7addfb
Rollup merge of #67695 - gilescope:truth, r=centril
Dylan-DPC Feb 12, 2020
eb80eec
Rollup merge of #68241 - ecstatic-morse:unified-dataflow-impls, r=pnk…
Dylan-DPC Feb 12, 2020
410b326
Rollup merge of #68679 - matthewjasper:needs-type-op, r=varkor
Dylan-DPC Feb 12, 2020
8f813b7
Rollup merge of #68848 - nnethercote:hasten-macro-parsing, r=petroche…
Dylan-DPC Feb 12, 2020
c33d531
Rollup merge of #68877 - estebank:point-at-params, r=petrochenkov
Dylan-DPC Feb 12, 2020
4b556ce
Rollup merge of #69027 - TimDiekmann:zeroed-alloc, r=Amanieu
Dylan-DPC Feb 12, 2020
0d15165
Rollup merge of #69032 - chrissimpkins:ice-yield-println-#69017, r=pe…
Dylan-DPC Feb 12, 2020
6d7bbcb
Rollup merge of #69058 - TimDiekmann:box, r=Amanieu
Dylan-DPC Feb 12, 2020
440e5c7
Rollup merge of #69070 - Bassetts:master, r=alexcrichton
Dylan-DPC Feb 12, 2020
19bd8af
Rollup merge of #69077 - jumbatm:fix-comment, r=Dylan-DPC
Dylan-DPC Feb 12, 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
Apply suggestions from code review
Co-Authored-By: varkor <[email protected]>
  • Loading branch information
matthewjasper and varkor committed Feb 9, 2020
commit 3eb524188451fcec6cd5ed7e3cba2404021b75eb
2 changes: 1 addition & 1 deletion src/librustc/ty/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2286,7 +2286,7 @@ impl<'tcx> AdtDef {
self.flags.contains(AdtFlags::IS_BOX)
}

/// Returns `true` if this is ManuallyDrop<T>.
/// Returns `true` if this is `ManuallyDrop<T>`.
#[inline]
pub fn is_manually_drop(&self) -> bool {
self.flags.contains(AdtFlags::IS_MANUALLY_DROP)
Expand Down
4 changes: 2 additions & 2 deletions src/librustc/ty/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1013,12 +1013,12 @@ pub fn needs_drop_components(
| ty::Ref(..)
| ty::Str => Ok(SmallVec::new()),

// Foreign types can never have destructors
// Foreign types can never have destructors.
ty::Foreign(..) => Ok(SmallVec::new()),

// Pessimistically assume that all generators will require destructors
// as we don't know if a destructor is a noop or not until after the MIR
// state transformation pass
// state transformation pass.
ty::Generator(..) | ty::Dynamic(..) | ty::Error => Err(AlwaysRequiresDrop),

ty::Slice(ty) => needs_drop_components(ty, target_layout),
Expand Down
13 changes: 7 additions & 6 deletions src/librustc_ty/needs_drop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ type NeedsDropResult<T> = Result<T, AlwaysRequiresDrop>;
fn needs_drop_raw<'tcx>(tcx: TyCtxt<'tcx>, query: ty::ParamEnvAnd<'tcx, Ty<'tcx>>) -> bool {
let adt_fields =
move |adt_def: &ty::AdtDef| tcx.adt_drop_tys(adt_def.did).map(|tys| tys.iter().copied());
// If we don't know a type doesn't need drop, say it's a type parameter
// without a `Copy` bound, then we conservatively return that it needs
// drop.
// If we don't know a type doesn't need drop, for example if it's a type
// parameter without a `Copy` bound, then we conservatively return that it
// needs drop.
let res = NeedsDropTypes::new(tcx, query.param_env, query.value, adt_fields).next().is_some();
debug!("needs_drop_raw({:?}) = {:?}", query, res);
res
Expand All @@ -25,9 +25,10 @@ struct NeedsDropTypes<'tcx, F> {
param_env: ty::ParamEnv<'tcx>,
query_ty: Ty<'tcx>,
seen_tys: FxHashSet<Ty<'tcx>>,
/// A stack of types left to process. Each round, we pop something from the
/// stack and check if it needs drop. If the result depends on whether some
/// other types need drop we push them onto the stack.
/// A stack of types left to process, and the recursion depth when we
/// pushed that type. Each round, we pop something from the stack and check
/// if it needs drop. If the result depends on whether some other types
/// need drop we push them onto the stack.
unchecked_tys: Vec<(Ty<'tcx>, usize)>,
recursion_limit: usize,
adt_components: F,
Expand Down