Skip to content

make MIR type checker handle a number of other cases #46582

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 22 commits into from
Dec 14, 2017
Merged
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
d6772cb
Check Repeat Rvalue
spastorino Nov 28, 2017
7f20b91
fix universal regions to handle constant expressions like `[T; 22]`
nikomatsakis Nov 27, 2017
c915926
Check NullaryOp Rvalue
spastorino Nov 20, 2017
5010496
Check Aggregate predicates
spastorino Nov 26, 2017
688ab5a
Check functions predicates
spastorino Nov 27, 2017
4449240
Add more debug logs
spastorino Nov 28, 2017
8635548
Restructure a bit check_aggregate_rvalue code
spastorino Nov 28, 2017
7d56131
Mir typeck Cast for ReifyFnPtr value
spastorino Nov 29, 2017
900d4d5
Mir typeck Cast for UnsafeFnPtr value
spastorino Nov 30, 2017
ae035cb
Extract coerce_closure_fn_ty function
spastorino Nov 30, 2017
14700e5
Mir typeck Cast for ClosureFnPtr value
spastorino Nov 30, 2017
0c26d8f
Mir typeck Cast for Unsize value
spastorino Nov 30, 2017
d5cff07
normalize fn sig as part of reification
nikomatsakis Dec 1, 2017
decbbb3
when reifying a safe fn as an unsafe fn ptr, insert two casts
nikomatsakis Dec 2, 2017
a30e225
fix closure tests now that MIR typeck works properly
nikomatsakis Dec 7, 2017
77663a6
refactor region value bitmatrix
nikomatsakis Dec 1, 2017
7a20a3f
change to use an O(1) data structure for looking up point indices
nikomatsakis Dec 1, 2017
f6723a9
improve comments on `safe_to_unsafe_fn_ty` and `coerce_closure_fn_ty`
nikomatsakis Dec 12, 2017
75ac071
document return value of `add_live_point`
nikomatsakis Dec 12, 2017
abd6d0d
comments for `defining_ty` and `compute_indices`
nikomatsakis Dec 13, 2017
51847a1
add FIXME related to constant well-formedness
nikomatsakis Dec 13, 2017
237dd41
correct comment in test
nikomatsakis Dec 13, 2017
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
Check NullaryOp Rvalue
  • Loading branch information
spastorino authored and nikomatsakis committed Dec 13, 2017
commit c9159262d161cd64d828f7821dca5e07926e34f2
12 changes: 10 additions & 2 deletions src/librustc_mir/transform/type_check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1137,6 +1137,15 @@ impl<'a, 'gcx, 'tcx> TypeChecker<'a, 'gcx, 'tcx> {
}
}

Rvalue::NullaryOp(_, ty) => {
let trait_ref = ty::TraitRef {
def_id: tcx.lang_items().sized_trait().unwrap(),
substs: tcx.mk_substs_trait(ty, &[]),
};

self.prove_trait_ref(trait_ref, location);
}

// FIXME: These other cases have to be implemented in future PRs
Rvalue::Use(..) |
Rvalue::Ref(..) |
Expand All @@ -1145,8 +1154,7 @@ impl<'a, 'gcx, 'tcx> TypeChecker<'a, 'gcx, 'tcx> {
Rvalue::BinaryOp(..) |
Rvalue::CheckedBinaryOp(..) |
Rvalue::UnaryOp(..) |
Rvalue::Discriminant(..) |
Rvalue::NullaryOp(..) => {}
Rvalue::Discriminant(..) => {}
}
}

Expand Down