Skip to content

Rollup of 9 pull requests #23946

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

Closed
wants to merge 37 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
e05c2f8
trans: Add early-out when translating unreachable controlflow express…
michaelwoerister Mar 5, 2015
45c10db
Clarified and simplified algorithm for increasing size of buffer in
Mar 29, 2015
2982fe3
80 character line limit
Mar 29, 2015
8d3e559
Clearer wording
Mar 29, 2015
240734c
Only zero at most 64k at a time. We still use the doubling
Mar 30, 2015
0939837
Rename the cryptic cres and ures types.
nikomatsakis Mar 9, 2015
4b0edb9
Combine `try` and `commit_if_ok` and make some details of inference
nikomatsakis Mar 10, 2015
7c62640
Refactor unification interface by moving the methods off of inferctxt…
nikomatsakis Feb 15, 2015
c581840
Make union-find helper fns private, change to u32.
nikomatsakis Feb 16, 2015
a6d9930
Extract more `ty` and `infer` dependencies from the unification engine
nikomatsakis Mar 10, 2015
e78550b
Switch to FnvHashMap
nikomatsakis Mar 18, 2015
e301d7c
Remove unused import
nikomatsakis Mar 18, 2015
8403b82
Port over type inference to using the new type relation stuff
nikomatsakis Mar 22, 2015
cead47c
Add a "match" relation that can be used to make recursion check during
nikomatsakis Mar 20, 2015
cdb10b8
A very simple hack to force an autoderef if the callee has type `&mut
nikomatsakis Mar 31, 2015
27b7841
Add blanket impls for references to the `Fn` traits.
nikomatsakis Mar 20, 2015
11111bb
Add tests for blanket impls.
nikomatsakis Mar 31, 2015
a547962
Pretty print ids for assoc items
nrc Mar 24, 2015
bfc2f5d
Improvements to PhantomData<T>'s docs 👻
steveklabnik Apr 1, 2015
0dd0925
Tidying up and reformatting
nrc Mar 29, 2015
39aa668
Added Arc::try_unique
kvark Mar 29, 2015
8ded156
Add examples + documentation for std::path
steveklabnik Apr 1, 2015
4b6248a
Simplify `match` branches in iter.rs example
frewsxcv Apr 1, 2015
03d3ba7
Implement the changes to coherence such that we consider a type to be
nikomatsakis Mar 30, 2015
35c261a
Add `#[fundamental]` annotations into libcore so that `Sized` and the
nikomatsakis Mar 30, 2015
b0af587
Update tests for new coherence rules, and add a swatch of new tests
nikomatsakis Mar 30, 2015
30b2d9e
Fallout in libstd: remove impls now considered to conflict.
nikomatsakis Mar 30, 2015
15b58fe
Fallout in libsyntax/librustc: use newtype'd options for linked lists,
nikomatsakis Mar 30, 2015
02b38a2
Rollup merge of #23066 - michaelwoerister:unreachable-if, r=pnkfelix
Manishearth Apr 1, 2015
1d17e6e
Rollup merge of #23844 - kvark:try_unique, r=alexcrichton
Manishearth Apr 1, 2015
abd747c
Rollup merge of #23847 - bcoopers:read_clarification, r=sfackler
Manishearth Apr 1, 2015
9eb0bab
Rollup merge of #23867 - nikomatsakis:issue-23086-take-3, r=pnkfelix
Manishearth Apr 1, 2015
debac97
Rollup merge of #23895 - nikomatsakis:fn-trait-inheritance-add-impls,…
Manishearth Apr 1, 2015
6a3e844
Rollup merge of #23924 - nrc:unqual-assoc3, r=alexcrichton
Manishearth Apr 1, 2015
2159bbf
Rollup merge of #23925 - steveklabnik:gh22914, r=Gankro
Manishearth Apr 1, 2015
77112bb
Rollup merge of #23927 - frewsxcv:patch-7, r=Manishearth
Manishearth Apr 1, 2015
ec6c2c3
Rollup merge of #23932 - steveklabnik:doc_std_path, r=flaper87
Manishearth Apr 1, 2015
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
Add tests for blanket impls.
  • Loading branch information
nikomatsakis committed Mar 31, 2015
commit 11111bb6b7889ce45770a6ffe46c75a2690c387f
37 changes: 37 additions & 0 deletions src/test/run-pass/unboxed-closures-blanket-fn-mut.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

// Test that you can supply `&F` where `F: FnMut()`.

// pretty-expanded FIXME #23616

#![feature(lang_items, unboxed_closures)]

fn a<F:FnMut() -> i32>(mut f: F) -> i32 {
f()
}

fn b(f: &mut FnMut() -> i32) -> i32 {
a(f)
}

fn c<F:FnMut() -> i32>(f: &mut F) -> i32 {
a(f)
}

fn main() {
let z: isize = 7;

let x = b(&mut || 22);
assert_eq!(x, 22);

let x = c(&mut || 22);
assert_eq!(x, 22);
}
37 changes: 37 additions & 0 deletions src/test/run-pass/unboxed-closures-blanket-fn.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

// Test that you can supply `&F` where `F: Fn()`.

// pretty-expanded FIXME #23616

#![feature(lang_items, unboxed_closures)]

fn a<F:Fn() -> i32>(f: F) -> i32 {
f()
}

fn b(f: &Fn() -> i32) -> i32 {
a(f)
}

fn c<F:Fn() -> i32>(f: &F) -> i32 {
a(f)
}

fn main() {
let z: isize = 7;

let x = b(&|| 22);
assert_eq!(x, 22);

let x = c(&|| 22);
assert_eq!(x, 22);
}