Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
c7db40f
Rename expected_types_for_fn_args to expected_inputs_for_expected_out…
eddyb Mar 9, 2017
50aee36
Propagate expected type hints through struct literals.
eddyb Mar 9, 2017
5fab9bf
travis: Ensure cargo links libcurl statically
alexcrichton Mar 14, 2017
61d9387
Target builds for older macOS
wagenet Mar 13, 2017
e58f9f5
rustbuild: Update bootstrap compiler
alexcrichton Mar 14, 2017
cc23d17
make shift builtins panic-free with new unchecked_sh* intrinsics
TimNN Mar 14, 2017
2561dcd
Rename TryFrom's associated type and implement str::parse using TryFrom.
jimmycuadra Mar 5, 2017
a457d67
Specialize Vec::from_elem<u8> to use calloc or memset
mbrubeck Mar 10, 2017
4961f6c
Specialize Vec::from_elem for other integer types
mbrubeck Mar 10, 2017
ce616a7
Improve the `TokenStream` quoter.
jseyfried Mar 14, 2017
910532e
Add a test for issue 34571
topecongiro Mar 16, 2017
284ece3
Fix regression when `include!()`ing a `macro_rules!` containing a `$c…
jseyfried Mar 16, 2017
a4bd5e9
Remove internal liblog
alexcrichton Feb 15, 2017
50cede0
documented order of conversion between u32 an ipv4addr
Mar 17, 2017
c96491f
Update libc to 0.2.21
malbarbo Mar 7, 2017
5798817
Fix c_char (u8 -> i8) definition for i686-linux-android
malbarbo Mar 16, 2017
3435c60
Fix libc::bind call on aarch64-linux-android
malbarbo Mar 17, 2017
963d4df
minor wording tweak to slice::{as_ptr, as_mut_ptr}
QuietMisdreavus Mar 17, 2017
ec8ecf4
Fix typo in mutex.rs docs
ScottAbbey Mar 17, 2017
70bbbce
Rollup merge of #40281 - jimmycuadra:try-from-from-str, r=aturon
frewsxcv Mar 17, 2017
b449fda
Rollup merge of #40317 - malbarbo:update-libc, r=alexcrichton
frewsxcv Mar 17, 2017
a6cebc0
Rollup merge of #40347 - alexcrichton:rm-liblog, r=brson
frewsxcv Mar 17, 2017
935a905
Rollup merge of #40398 - eddyb:struct-hint, r=nikomatsakis
frewsxcv Mar 17, 2017
496d185
Rollup merge of #40409 - mbrubeck:calloc, r=sfackler
frewsxcv Mar 17, 2017
0644fae
Rollup merge of #40482 - wagenet:fix-old-macos, r=alexcrichton
frewsxcv Mar 17, 2017
3c4b859
Rollup merge of #40507 - alexcrichton:static-libcurl, r=brson
frewsxcv Mar 17, 2017
be924b1
Rollup merge of #40521 - TimNN:panic-free-shift, r=nagisa
frewsxcv Mar 17, 2017
50bf60e
Rollup merge of #40524 - alexcrichton:update-bootstrap, r=brson
frewsxcv Mar 17, 2017
8db0914
Rollup merge of #40532 - jseyfried:improve_tokenstream_quoter, r=nrc
frewsxcv Mar 17, 2017
55eacfe
Rollup merge of #40583 - jseyfried:fix_include_macro_regression, r=nrc
frewsxcv Mar 17, 2017
7501349
Rollup merge of #40588 - topecongiro:add-missing-tests, r=alexcrichton
frewsxcv Mar 17, 2017
ac1d2e6
Rollup merge of #40590 - z1mvader:master, r=steveklabnik
frewsxcv Mar 17, 2017
02a688b
Rollup merge of #40603 - QuietMisdreavus:slice-ptr-docs, r=GuillaumeG…
frewsxcv Mar 17, 2017
60e7df4
Rollup merge of #40611 - ScottAbbey:patch-1, r=GuillaumeGomez
frewsxcv Mar 17, 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
Next Next commit
Rename expected_types_for_fn_args to expected_inputs_for_expected_out…
…put.
  • Loading branch information
eddyb committed Mar 9, 2017
commit c7db40f23256c14f2ef6d43e3091135791e5e153
4 changes: 2 additions & 2 deletions src/librustc_typeck/check/callee.rs
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {

// Call the generic checker.
let expected_arg_tys =
self.expected_types_for_fn_args(call_expr.span,
self.expected_inputs_for_expected_output(call_expr.span,
expected,
fn_sig.output(),
fn_sig.inputs());
Expand All @@ -280,7 +280,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
// do know the types expected for each argument and the return
// type.

let expected_arg_tys = self.expected_types_for_fn_args(call_expr.span,
let expected_arg_tys = self.expected_inputs_for_expected_output(call_expr.span,
expected,
fn_sig.output().clone(),
fn_sig.inputs());
Expand Down
20 changes: 10 additions & 10 deletions src/librustc_typeck/check/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2321,7 +2321,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
match method_fn_ty.sty {
ty::TyFnDef(def_id, .., ref fty) => {
// HACK(eddyb) ignore self in the definition (see above).
let expected_arg_tys = self.expected_types_for_fn_args(
let expected_arg_tys = self.expected_inputs_for_expected_output(
sp,
expected,
fty.0.output(),
Expand Down Expand Up @@ -2674,14 +2674,14 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
TypeAndSubsts { substs: substs, ty: substd_ty }
}

/// Unifies the return type with the expected type early, for more coercions
/// and forward type information on the argument expressions.
fn expected_types_for_fn_args(&self,
call_span: Span,
expected_ret: Expectation<'tcx>,
formal_ret: Ty<'tcx>,
formal_args: &[Ty<'tcx>])
-> Vec<Ty<'tcx>> {
/// Unifies the output type with the expected type early, for more coercions
/// and forward type information on the input expressions.
fn expected_inputs_for_expected_output(&self,
call_span: Span,
expected_ret: Expectation<'tcx>,
formal_ret: Ty<'tcx>,
formal_args: &[Ty<'tcx>])
-> Vec<Ty<'tcx>> {
let expected_args = expected_ret.only_has_type(self).and_then(|ret_ty| {
self.fudge_regions_if_ok(&RegionVariableOrigin::Coercion(call_span), || {
// Attempt to apply a subtyping relationship between the formal
Expand All @@ -2704,7 +2704,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
}).collect())
}).ok()
}).unwrap_or(vec![]);
debug!("expected_types_for_fn_args(formal={:?} -> {:?}, expected={:?} -> {:?})",
debug!("expected_inputs_for_expected_output(formal={:?} -> {:?}, expected={:?} -> {:?})",
formal_args, formal_ret,
expected_args, expected_ret);
expected_args
Expand Down