Skip to content

Rollup of 5 pull requests #26811

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 266 commits into from
Jul 6, 2015
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
266 commits
Select commit Hold shift + click to select a range
1ec520a
mk: Move logic out of MSVC's 64-bit cfg makefile
alexcrichton Jun 19, 2015
91d799e
msvc: Implement runtime support for unwinding
alexcrichton Jun 19, 2015
9e3cb64
rustc_trans: Handle empty dlls on MSVC
alexcrichton Jun 25, 2015
759a7f1
test: Use liblibc in lang-item-public
alexcrichton Jun 25, 2015
3f178b8
Fix links in release notes.
brson Jun 25, 2015
74fbe3e
Correct typos and remove unused references from RELEASES.md
barosl Jun 25, 2015
8e3ea5d
Ignore KDevelop 4 (and 5 pre-release) project files
CruzBishop Jun 25, 2015
35abf86
Improve sentence flow.
adamheins Jun 25, 2015
44bccd8
Rename AsPredicate to ToPredicate in order to match naming conventions
jroesch Jun 23, 2015
b70d1c6
Auto merge of #26415 - jroesch:rename-as-predicate, r=nikomatsakis
bors Jun 26, 2015
fd9b2ca
Correct a missing reference in the release note.
omasanori Jun 26, 2015
378a370
Auto merge of #25646 - huonw:align, r=alexcrichton
bors Jun 26, 2015
aa03871
rustc: combine type-flag-checking traits and fns and into one trait.
eddyb Jun 23, 2015
59935f7
rustc: move some functions in middle::ty working on Ty to methods.
eddyb Jun 24, 2015
2332765
rustc: prefer unqualified `ctxt` to `ty::ctxt` in middle::ty.
eddyb Jun 24, 2015
6db5126
rustc: make ty::mk_* constructors into methods on ty::ctxt.
eddyb Jun 25, 2015
5cedd66
rustc: remove 3 dead functions in middle::ty.
eddyb Jun 25, 2015
ad66c21
rustc: switch most remaining middle::ty functions to methods.
eddyb Jun 25, 2015
6c88a28
Add E0091 error explanation
GuillaumeGomez Jun 26, 2015
2051b3e
Avoid storing fat pointers as first class aggregates
dotdash Jun 26, 2015
2cb8a31
Auto merge of #26595 - dotdash:fca_slice, r=eddyb
bors Jun 26, 2015
30cde07
std: clean up duplicated attrs and comment on panic
richo Jun 26, 2015
0d74311
Add E0088 error explanation
GuillaumeGomez Jun 26, 2015
c98e46c
accessing private fields is not safe, and io isn't scary
Gankra Jun 26, 2015
9001da6
make book match reference
Gankra Jun 26, 2015
1032384
Auto merge of #26568 - barosl:rel-notes-refs, r=alexcrichton
bors Jun 26, 2015
532235b
Use Box::into_raw rather than the deprecated boxed::into_raw in tests…
Ms2ger Jun 26, 2015
0f6d4aa
core: fix deprecation since version of align_of_min.
huonw Jun 26, 2015
cb7d062
Auto merge of #26605 - Ms2ger:raw-doc, r=alexcrichton
bors Jun 26, 2015
1aabbd0
Initial documentation for 1.2.0, uploading to test markdown
CruzBishop Jun 26, 2015
773052a
Auto merge of #26574 - brson:relnotes-fix, r=alexcrichton
bors Jun 27, 2015
d3c03d0
Auto merge of #26569 - alexcrichton:msvc-llvm-update, r=brson
bors Jun 27, 2015
650566e
Auto merge of #26575 - eddyb:tycx, r=nikomatsakis
bors Jun 27, 2015
ec232c8
Rollup merge of #26565 - Techern:ignore-kdevelop, r=brson
Manishearth Jun 27, 2015
1ce9b59
Rollup merge of #26584 - omasanori:fix-26537, r=alexcrichton
Manishearth Jun 27, 2015
0bf0ea3
Rollup merge of #26596 - richo:richo-cleanup-macros, r=alexcrichton
Manishearth Jun 27, 2015
6dd33b4
Rollup merge of #26603 - Gankro:ref, r=steveklabnik
Manishearth Jun 27, 2015
04daae7
Auto merge of #26579 - Techern:start-12-doc, r=brson
bors Jun 27, 2015
d73cc56
Add E0109 error explanation
GuillaumeGomez Jun 27, 2015
b36ae01
Auto merge of #26609 - huonw:align, r=alexcrichton
bors Jun 27, 2015
ca0601a
std: someone missed removing this doc and the annotations
tshepang Jun 27, 2015
7d0198d
test: fix some indents
tshepang Jun 27, 2015
2ba46f8
Auto merge of #26616 - Manishearth:rollup, r=Manishearth
bors Jun 27, 2015
d6159b7
Clarifying deallocation order of resources within same scope
saser Jun 27, 2015
8fa2185
Auto merge of #26621 - tshepang:missed-removal, r=steveklabnik
bors Jun 27, 2015
ae36d4f
mk: Add support for i686-pc-windows-msvc
alexcrichton Jun 25, 2015
5de665e
rustc_back: Learn about i686-pc-windows-msvc
alexcrichton Jun 25, 2015
8790958
std: Avoid missing fns on i686-pc-windows-msvc
alexcrichton Jun 25, 2015
79d0289
Begin refactor type checking state
jroesch Jun 24, 2015
480cd8f
Ground work for replacing the ClosureTyper trait
jroesch Jun 25, 2015
e5b3684
Remove ClosureTyper impl for FnCtxt
jroesch Jun 26, 2015
ba7b47e
rustc_driver: Fix incorrect comment
richo Jun 26, 2015
9e58fb8
rt: Update comment for new location of unwind
richo Jun 26, 2015
10b103a
std: Fix Windows XP compatibility
alexcrichton Jun 26, 2015
15bc4a3
Address nits
jroesch Jun 26, 2015
5da0d41
Auto merge of #26601 - alexcrichton:xp, r=brson
bors Jun 28, 2015
c1b8bd2
Auto merge of #26631 - richo:comment-updates, r=steveklabnik
bors Jun 28, 2015
5c3753f
Fix librustc_driver/test.rs
jroesch Jun 28, 2015
78ec055
Add `.write(true)` to append and truncate examples
remram44 Jun 28, 2015
2671e8c
Auto merge of #26642 - remram44:doc-openoptions-missing-write, r=alex…
bors Jun 28, 2015
a973e4c
Auto merge of #26582 - jroesch:infer-ctxt-refactor, r=nikomatsakis
bors Jun 29, 2015
9b6fe6c
Add tip to do partial compile.
pelmers Jun 29, 2015
f07b11d
mk: Fix a typo in the tips
richo Jun 29, 2015
14e3d26
Add E0110 error explanation
GuillaumeGomez Jun 27, 2015
b442530
Add more details in error explanation
GuillaumeGomez Jun 29, 2015
7f830a8
The come back of the "a" eaten by the void
GuillaumeGomez Jun 29, 2015
4adcc78
Rollup merge of #26593 - GuillaumeGomez:patch-2, r=Manishearth
Manishearth Jun 29, 2015
1659075
Rollup merge of #26644 - pelmers:make_stage_tip, r=sfackler
Manishearth Jun 29, 2015
08a8ee1
Rollup merge of #26645 - richo:makefile-typo, r=sfackler
Manishearth Jun 29, 2015
40db46c
Auto merge of #26649 - Manishearth:rollup, r=Manishearth
bors Jun 29, 2015
b4f3c58
Hide the Rand trait from docs
steveklabnik Jun 29, 2015
216f664
Auto merge of #26462 - brson:stdidx, r=steveklabnik
bors Jun 29, 2015
34f35a5
Auto merge of #26530 - steveklabnik:gh26471, r=alexcrichton
bors Jun 29, 2015
a1110bc
Fix off-by-one error in default-type-parameter checking
Jun 29, 2015
8d6b568
Change removal notice for pointer guide.
steveklabnik Jun 29, 2015
f9b6929
Auto merge of #26623 - Saser:master, r=steveklabnik
bors Jun 29, 2015
b676e99
Fix incorrect warning about unused repr attributes.
Jun 29, 2015
08b2166
Refine Atomic*::compare_and_swap documentation
nagisa Jun 29, 2015
58ff6cc
Add test for #26646.
Jun 29, 2015
e8fe55f
Add missing trailing newline.
Jun 29, 2015
fe283b4
Auto merge of #26659 - nagisa:cas-docs, r=alexcrichton
bors Jun 29, 2015
f758baa
Improve doc for std::mem::drop
steveklabnik Jun 29, 2015
b1907a0
Update link to Ousterhout
steveklabnik Jun 29, 2015
9a26e49
Auto merge of #26660 - steveklabnik:fix_up_pointers, r=alexcrichton
bors Jun 29, 2015
bf164bc
Fix lifetime elision region accounting
Jun 29, 2015
336f812
Remove type_needs_unwind_cleanup
Jun 29, 2015
b1931e4
lint: only consider actual calls as unconditional recursion.
huonw Jun 29, 2015
900af2c
lint: default methods must be called on Self to unconditionally recur.
huonw Jun 29, 2015
a5e21da
Kill count_late_bound_regions
Jun 29, 2015
fb5dd39
Remove now-useless code
Jun 29, 2015
d8680f6
Add regression test for #17756
frewsxcv Jun 30, 2015
faa04a8
Auto merge of #26666 - huonw:unc-rec, r=alexcrichton
bors Jun 30, 2015
e834c03
Link to docs from error explanations via HTTPS
frewsxcv Jun 30, 2015
6419ace
Add regression test for #13902
frewsxcv Jun 30, 2015
27975c4
Auto merge of #26667 - arielb1:audit-walk, r=eddyb
bors Jun 30, 2015
e6596d0
Auto merge of #26668 - frewsxcv:regression-test-17756, r=alexcrichton
bors Jun 30, 2015
bbf0daa
Add parent_node to ast_map
nrc Jun 16, 2015
b23ddc6
Implement get_enclosing_scope and use it in save-analysis
nrc Jun 16, 2015
15dcb5b
Alternate method
nrc Jun 25, 2015
080d5b7
Auto merge of #26670 - frewsxcv:regression-test-13902, r=alexcrichton
bors Jun 30, 2015
6947948
Move FufillmentContext into InferContext
jroesch Jun 26, 2015
64f1a59
Update all uses of FulfillmentContext
jroesch Jun 28, 2015
0f13a3f
Use fresh FulfillmentContexts in select locations
jroesch Jun 28, 2015
fb295a6
Remove NormalizingClosureTyper
jroesch Jun 28, 2015
e2d7e90
Remove Typer + ClosureTyper impls for ParameterEnv
jroesch Jun 29, 2015
05c57e0
Remove Typer + ClosureTyper impls for BlockS
jroesch Jun 30, 2015
9faae6a
Remove Typer and ClosureTyper
jroesch Jun 30, 2015
7a8f83a
Clean up patch
jroesch Jun 30, 2015
f39df49
Auto merge of #26662 - steveklabnik:gh26661, r=alexcrichton
bors Jun 30, 2015
516941b
fmt: Update docs and mention :#? pretty-printing
Jun 30, 2015
0b70378
Auto merge of #26664 - steveklabnik:gh26571, r=alexcrichton
bors Jun 30, 2015
8536152
Auto merge of #26669 - frewsxcv:diagnostics-https, r=huonw
bors Jun 30, 2015
c158be0
Add E0195 error explanation
GuillaumeGomez Jun 29, 2015
20f22b7
Add E0093 error explanation
GuillaumeGomez Jun 30, 2015
ed6940f
Add E0094 error explanation
GuillaumeGomez Jun 30, 2015
0ba2db5
Add E0211 error explanation
GuillaumeGomez Jun 30, 2015
758ea34
Add E0092 error explanation
GuillaumeGomez Jun 30, 2015
edf6132
Add E0101 error explanation
GuillaumeGomez Jun 30, 2015
a481c4e
Add E0117 error explanation
GuillaumeGomez Jun 30, 2015
2881e83
Add E0207 error explanation
GuillaumeGomez Jun 30, 2015
be38926
Add E0119 error explanation
GuillaumeGomez Jun 30, 2015
8b25086
Deprecate BitSet and BitVec in favour of bit-vec and bit-set crates i…
Gankra Jun 5, 2015
bc1b43c
doc: add example for Stdin::read_line
tshepang Jun 27, 2015
7fc0675
Auto merge of #26327 - bluss:two-way, r=aturon
bors Jun 30, 2015
cebb118
Actually encode default associated types
Jun 30, 2015
9d64131
Rollup merge of #26373 - tshepang:patch-2, r=steveklabnik
steveklabnik Jun 30, 2015
96dd82f
Rollup merge of #26506 - tshepang:doc-fix, r=steveklabnik
steveklabnik Jun 30, 2015
bac3615
Rollup merge of #26580 - adamheins:master, r=steveklabnik
steveklabnik Jun 30, 2015
cf1c5b2
Rollup merge of #26622 - tshepang:indents, r=sanxiyn
steveklabnik Jun 30, 2015
825e48f
Rollup merge of #26627 - tshepang:stdin-example, r=steveklabnik
steveklabnik Jun 30, 2015
65b5c15
Rollup merge of #26651 - GuillaumeGomez:patch-2, r=Manishearth
steveklabnik Jun 30, 2015
26ff471
Rollup merge of #26678 - bluss:doc-fmt, r=steveklabnik
steveklabnik Jun 30, 2015
fdf219d
Auto merge of #26663 - Eljay:fix-repr-attribute, r=sanxiyn
bors Jun 30, 2015
2f45294
Clean-up assignment checking in borrowck
arielb1 Jun 17, 2015
a18d984
Make the unused_mut lint smarter with respect to locals.
arielb1 Jun 17, 2015
dc309d7
Auto merge of #26686 - arielb1:associated-type-defaults-actually-work…
bors Jun 30, 2015
8b81f76
Make note of Ord's derive ordering
steveklabnik Jun 30, 2015
08f9b98
Rollup merge of #26692 - steveklabnik:gh26620, r=alexcrichton
steveklabnik Jun 30, 2015
bf3c979
Auto merge of #26696 - steveklabnik:rollup, r=steveklabnik
bors Jun 30, 2015
98566ea
std: Fix formatting flags for chars
alexcrichton Jul 1, 2015
1fc0f68
Auto merge of #26698 - alexcrichton:char-fmt, r=huonw
bors Jul 1, 2015
a1d40c8
save-analysis: skip generated content in patterns
nrc Jul 1, 2015
8890089
std: Avoid the WSA_FLAG_NO_HANDLE_INHERIT option
alexcrichton Jun 29, 2015
a5dec98
Auto merge of #26703 - nrc:dxr-servo-fix, r=huonw
bors Jul 1, 2015
49b73e4
In js from the docs, change keyboard eventlistener to be compatible w…
azerupi Jun 30, 2015
a9e26b5
Auto merge of #26540 - oli-obk:issue11715, r=nrc
bors Jul 1, 2015
7dc50b1
Hide SampleRange trait from docs
Jul 1, 2015
d2e6dda
Add E0124 error explanation
GuillaumeGomez Jul 1, 2015
d4fe2a0
Auto merge of #26711 - bluss:doc-hide-rand, r=steveklabnik
bors Jul 1, 2015
9d67b9f
Auto merge of #26675 - azerupi:doc-js-keyevent, r=alexcrichton
bors Jul 1, 2015
5564172
Expand docs for recv
steveklabnik Jul 1, 2015
0ca7699
Add examples in error explanation E0267 and E0268
GuillaumeGomez Jul 1, 2015
28d2b39
Add E0277 error explanation
GuillaumeGomez Jul 1, 2015
c9c5ea7
Add a regression test for #8640.
Jul 1, 2015
7850c8d
fallout of bitvec/bitset deprecation
Gankra Jun 30, 2015
8a599c8
Auto merge of #26034 - Gankro:deprecate-bits, r=alexcrichton
bors Jul 1, 2015
d2cf9f9
Auto merge of #26658 - alexcrichton:windows-net-no-inherit, r=aturon
bors Jul 1, 2015
8bf4651
Implement CoerceUnsized for rc::Weak
remram44 Jul 1, 2015
ce089e5
Address nits
jroesch Jul 1, 2015
2fc8571
Fix deadlocks with RUST_LOG=rustc::middle::ty
Jul 1, 2015
8261599
Refactoring
nrc Jun 30, 2015
5976355
doc: there is just one trait in here
tshepang Jul 1, 2015
b643a0b
doc: add missing space
tshepang Jul 1, 2015
7713e14
Report memory use in time-passes
nrc Jun 28, 2015
5042182
Add test to dst-coerce-rc.rs
remram44 Jul 1, 2015
3278e79
Implement CoerceUnsized for arc::Weak
remram44 Jul 1, 2015
1768b10
Auto merge of #26688 - nrc:map-parent-2, r=manishearth
bors Jul 2, 2015
0b7c4f5
Add netbsd amd64 support
posix4e Jul 1, 2015
c64bda3
Update librustc_driver/test.rs
jroesch Jul 2, 2015
560b1da
Auto merge of #26677 - jroesch:fulfillment-context-refactor, r=nrc
bors Jul 2, 2015
b51aea3
rustdoc: Update jQuery from 2.1.0 to 2.1.4
nhowell Jul 2, 2015
dd8fee0
Auto merge of #26691 - nrc:mem, r=alexcrichton
bors Jul 2, 2015
969d6ca
Auto merge of #26718 - nham:test-8640, r=alexcrichton
bors Jul 2, 2015
f635b2f
Auto merge of #26722 - arielb1:log-deadlock, r=eddyb
bors Jul 2, 2015
c4b4f07
Auto merge of #26727 - remram44:coerceunsized-weak, r=eddyb
bors Jul 2, 2015
99ca63f
Auto merge of #26712 - GuillaumeGomez:patch-2, r=Manishearth
bors Jul 2, 2015
71a6441
Auto merge of #26715 - steveklabnik:gh26497, r=huonw
bors Jul 2, 2015
50cb22f
Auto merge of #26713 - GuillaumeGomez:patch-3, r=Manishearth
bors Jul 2, 2015
6809481
Auto merge of #26724 - tshepang:patch-1, r=bluss
bors Jul 2, 2015
95c08e3
Skip the pointless tupling/untupling of argument types in trans_closure
dotdash Jul 2, 2015
6b5edd2
Avoid a needless vector copy in type_of_rust_fn
dotdash Jul 2, 2015
a04784f
Directly construct lvalue datums for function arguments
dotdash Jul 2, 2015
57eed53
Add more description for from_raw_parts's unsafety
steveklabnik Jul 2, 2015
fb379ef
Auto merge of #26682 - posix4e:netbsd, r=alexcrichton
bors Jul 2, 2015
b4abed6
Auto merge of #26738 - dotdash:trans_args, r=luqmana
bors Jul 2, 2015
d77c4b0
Fix race condition in Arc's get_mut and make_unqiue
aturon Jun 26, 2015
d1e31f3
Auto merge of #26725 - tshepang:patch-2, r=bluss
bors Jul 2, 2015
f234a6b
Auto merge of #26733 - nhowell:update-jquery, r=steveklabnik
bors Jul 2, 2015
4a21775
Auto merge of #26610 - aturon:fix_make_unique, r=alexcrichton
bors Jul 3, 2015
4c246ec
Auto merge of #26740 - steveklabnik:gh26737, r=gankro
bors Jul 3, 2015
e2b6b02
Fix 'Relaaxed' typo in code comment
frewsxcv Jul 3, 2015
f3b97a7
Auto merge of #26752 - frewsxcv:patch-25, r=alexcrichton
bors Jul 3, 2015
f24089c
MYSY2 -> MSYS2
saschanaz Jul 3, 2015
eaeede2
Fix ICE caused by Drop implementations for unsized types
dotdash Jul 3, 2015
320bd6f
Auto merge of #26759 - dotdash:drop_dst, r=pnkfelix
bors Jul 3, 2015
409fc2f
Update atomic.rs
rick68 Jul 3, 2015
66f757b
remove some feature gates from the docs
steveklabnik Jul 3, 2015
7b14838
Auto merge of #26762 - rick68:patch-9, r=alexcrichton
bors Jul 3, 2015
f027bdc
Auto merge of #26378 - arielb1:unused-mut, r=pnkfelix
bors Jul 3, 2015
ef85338
Code up the new lifetime default rules, but leave them disabled
nikomatsakis Jun 17, 2015
9099577
Add a boolean flag to ExistentialBounds tracking whether the
nikomatsakis Jun 17, 2015
1e7a6b8
After inferring regions, scan for any bounds that are due to a lifetime
nikomatsakis Jun 17, 2015
18e9007
Adjust tests to silence warnings (or record them, as appropriate).
nikomatsakis Jun 17, 2015
65a456d
Now that I made the warning smarter, these tests no longer require mo…
nikomatsakis Jun 17, 2015
db5f3bc
Fix some merge conflicts
nikomatsakis Jun 24, 2015
50c952b
Auto merge of #26370 - nikomatsakis:better-object-defaults-warn, r=ni…
bors Jul 4, 2015
f9274d6
Auto merge of #26754 - SaschaNaz:patch-1, r=steveklabnik
bors Jul 4, 2015
fe354e5
rustc: remove unused MethodStaticClosure variant of MethodOrigin.
eddyb Jun 30, 2015
70365ed
rustc: simplify ty::MethodOrigin and avoid trait item indices.
eddyb Jul 2, 2015
a2fe59a
rustc_trans: explicit impl population is unnecessary in fulfill_oblig…
eddyb Jul 2, 2015
5620a58
rustc_lint: use traits::select for methods in unconditional_recursion.
eddyb Jul 2, 2015
a5447e1
rustc_trans: remove some outdated and unused logic from callee.
eddyb Jul 2, 2015
96d24a5
rustc: remove MethodOrigin::Object and use traits::VtableObject instead.
eddyb Jul 3, 2015
0dc0824
Auto merge of #26763 - steveklabnik:fix_feature_gates, r=sfackler
bors Jul 4, 2015
ace8670
Clean-up check_impl_items_against_trait
Jun 30, 2015
6b27005
require reimplementations of all items when a defaulted associated ty…
Jun 30, 2015
638ffec
Auto merge of #26728 - arielb1:assoc-maybe, r=nrc
bors Jul 4, 2015
0da6996
core: Use memcmp in is_prefix_of / is_suffix_of
bluss Jul 4, 2015
90fcf26
Remove outdated errors for mutating strings
Jul 4, 2015
c5a0a73
str: Correct documentation on is_char_boundary
bluss Jul 4, 2015
c83f8f9
Auto merge of #26770 - arielb1:str-mut-idx, r=eddyb
bors Jul 4, 2015
536e71b
rustc: compute the vtable base of a supertrait during selection. Fixe…
eddyb Jul 4, 2015
d256eb1
rustc: remove MethodOrigin and use the container to distinguish inher…
eddyb Jul 4, 2015
b381449
Auto merge of #26771 - bluss:str-prefix, r=Gankro
bors Jul 4, 2015
42e545f
Auto merge of #26694 - eddyb:method-nan, r=arielb1
bors Jul 4, 2015
e689342
Add missing #[inline] to min_value/max_value on integers
bluss Jul 4, 2015
f9f5809
Auto merge of #26776 - bluss:num-inline, r=eddyb
bors Jul 4, 2015
8e2ce46
collections: vec_deque: rename "ringbuf" to "VecDeque" in doc comments
emberian Jul 5, 2015
4fc28c9
reference: improve readability of type inference explanations for flo…
tshepang Jul 5, 2015
72c0275
reference: make tuple usage examples more meaningful
tshepang Jul 5, 2015
f76187c
reference: that looks like exclamations marks for some fonts
tshepang Jul 5, 2015
f82276d
reference: improve examples of the different array types
tshepang Jul 5, 2015
08395a9
Rollup merge of #26785 - tshepang:inference, r=steveklabnik
steveklabnik Jul 5, 2015
ec37d45
Rollup merge of #26787 - tshepang:tuple-usage, r=steveklabnik
steveklabnik Jul 5, 2015
a5f9162
Rollup merge of #26788 - tshepang:not-exclamation-marks, r=steveklabnik
steveklabnik Jul 5, 2015
73c1f24
reference: tiny fixes
tshepang Jul 5, 2015
3b3cdb1
Rollup merge of #26791 - tshepang:misc-ref-fixes, r=steveklabnik
steveklabnik Jul 5, 2015
da90ddb
reference: improve lambda example
tshepang Jul 5, 2015
9d23df4
Rollup merge of #26792 - tshepang:follow-idiom, r=steveklabnik
steveklabnik Jul 5, 2015
a1dd2fb
reference: fix typo
tshepang Jul 5, 2015
89d7dd1
Rollup merge of #26795 - tshepang:typo, r=steveklabnik
steveklabnik Jul 5, 2015
e08bb7f
reference: remove stray comma
tshepang Jul 5, 2015
281cfb9
Auto merge of #26798 - steveklabnik:rollup, r=steveklabnik
bors Jul 5, 2015
7c1e339
Auto merge of #25754 - geofft:remove-compiletest-jit, r=alexcrichton
bors Jul 5, 2015
8b51b8f
Rollup merge of #26789 - tshepang:improve-array-examples, r=alexcrichton
steveklabnik Jul 5, 2015
4c7c7b7
Rollup merge of #26800 - tshepang:comma, r=Gankro
steveklabnik Jul 5, 2015
8c7fd35
Rollup merge of #26806 - cmr:stabilize-drain, r=Gankro
steveklabnik Jul 5, 2015
d1fcb2f
Rollup merge of #26808 - tshepang:closures, r=steveklabnik
steveklabnik Jul 5, 2015
5d3b0f1
Auto merge of #26473 - Eljay:missing_docs, r=alexcrichton
bors Jul 5, 2015
2e78d37
Rollup merge of #26464 - Gankro:send, r=alexcrichton
steveklabnik Jul 5, 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
Remove NormalizingClosureTyper
  • Loading branch information
jroesch committed Jun 30, 2015
commit fb295a60b37fc2bc60fab29fad1863a174fa587c
164 changes: 160 additions & 4 deletions src/librustc/middle/infer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ pub use self::TypeOrigin::*;
pub use self::ValuePairs::*;
pub use self::fixup_err::*;
pub use middle::ty::IntVarValue;
use middle::ty::ClosureTyper;
pub use self::freshen::TypeFreshener;
pub use self::region_inference::GenericKind;

Expand All @@ -29,7 +30,8 @@ use middle::region::CodeExtent;
use middle::subst;
use middle::subst::Substs;
use middle::subst::Subst;
use middle::traits;
use middle::traits::{self, FulfillmentContext, Normalized, MiscObligation,
SelectionContext, ObligationCause};
use middle::ty::{TyVid, IntVid, FloatVid, RegionVid, UnconstrainedNumeric};
use middle::ty::{self, Ty, HasTypeFlags};
use middle::ty_fold::{self, TypeFolder, TypeFoldable};
Expand All @@ -39,7 +41,7 @@ use std::cell::{RefCell, Ref};
use std::fmt;
use syntax::ast;
use syntax::codemap;
use syntax::codemap::Span;
use syntax::codemap::{Span, DUMMY_SP};
use util::nodemap::{FnvHashMap, NodeMap};

use self::combine::CombineFields;
Expand Down Expand Up @@ -354,6 +356,14 @@ pub fn new_infer_ctxt<'a, 'tcx>(tcx: &'a ty::ctxt<'tcx>,
}
}

pub fn normalizing_infer_ctxt<'a, 'tcx>(tcx: &'a ty::ctxt<'tcx>,
tables: &'a RefCell<ty::Tables<'tcx>>)
-> InferCtxt<'a, 'tcx> {
let mut infcx = new_infer_ctxt(tcx, tables, None, false);
infcx.normalize = true;
infcx
}

/// Computes the least upper-bound of `a` and `b`. If this is not possible, reports an error and
/// returns ty::err.
pub fn common_supertype<'a, 'tcx>(cx: &InferCtxt<'a, 'tcx>,
Expand Down Expand Up @@ -557,7 +567,8 @@ impl<'a, 'tcx> ty::ClosureTyper<'tcx> for InferCtxt<'a, 'tcx> {
// the substitutions in `substs` are already monomorphized,
// but we still must normalize associated types
// normalize_associated_type(self.param_env.tcx, &closure_ty)
panic!("see issue 26597: fufillment context refactor must occur")
normalize_associated_type(&self.tcx, &closure_ty)
// panic!("see issue 26597: fufillment context refactor must occur")
} else {
closure_ty
}
Expand All @@ -579,13 +590,158 @@ impl<'a, 'tcx> ty::ClosureTyper<'tcx> for InferCtxt<'a, 'tcx> {
// the substitutions in `substs` are already monomorphized,
// but we still must normalize associated types
// monomorphize::normalize_associated_type(self.param_env.tcx, &result)
panic!("see issue 26597: fufillment context refactor must occur")
// panic!("see issue 26597: fufillment context refactor must occur")
normalize_associated_type(&self.tcx, &result)
} else {
result
}
}
}

pub fn normalize_associated_type<'tcx,T>(tcx: &ty::ctxt<'tcx>, value: &T) -> T
where T : TypeFoldable<'tcx> + HasTypeFlags
{
debug!("normalize_associated_type(t={:?})", value);

let value = erase_regions(tcx, value);

if !value.has_projection_types() {
return value;
}

let infcx = new_infer_ctxt(tcx, &tcx.tables, None, true);
let mut selcx = traits::SelectionContext::new(&infcx, &infcx);
let cause = traits::ObligationCause::dummy();
let traits::Normalized { value: result, obligations } =
traits::normalize(&mut selcx, cause, &value);

debug!("normalize_associated_type: result={:?} obligations={:?}",
result,
obligations);

let mut fulfill_cx = infcx.fulfillment_cx.borrow_mut();

for obligation in obligations {
fulfill_cx.register_predicate_obligation(&infcx, obligation);
}

let result = drain_fulfillment_cx_or_panic(DUMMY_SP, &infcx, &mut fulfill_cx, &result);

result
}

pub fn drain_fulfillment_cx_or_panic<'a,'tcx,T>(span: Span,
infcx: &InferCtxt<'a,'tcx>,
fulfill_cx: &mut traits::FulfillmentContext<'tcx>,
result: &T)
-> T
where T : TypeFoldable<'tcx>
{
match drain_fulfillment_cx(infcx, fulfill_cx, result) {
Ok(v) => v,
Err(errors) => {
infcx.tcx.sess.span_bug(
span,
&format!("Encountered errors `{:?}` fulfilling during trans",
errors));
}
}
}

/// Finishes processes any obligations that remain in the fulfillment
/// context, and then "freshens" and returns `result`. This is
/// primarily used during normalization and other cases where
/// processing the obligations in `fulfill_cx` may cause type
/// inference variables that appear in `result` to be unified, and
/// hence we need to process those obligations to get the complete
/// picture of the type.
pub fn drain_fulfillment_cx<'a,'tcx,T>(infcx: &InferCtxt<'a,'tcx>,
fulfill_cx: &mut traits::FulfillmentContext<'tcx>,
result: &T)
-> Result<T,Vec<traits::FulfillmentError<'tcx>>>
where T : TypeFoldable<'tcx>
{
debug!("drain_fulfillment_cx(result={:?})",
result);
// this is stupid but temporary
let typer: &ClosureTyper<'tcx> = infcx;
// In principle, we only need to do this so long as `result`
// contains unbound type parameters. It could be a slight
// optimization to stop iterating early.
match fulfill_cx.select_all_or_error(infcx, typer) {
Ok(()) => { }
Err(errors) => {
return Err(errors);
}
}

// Use freshen to simultaneously replace all type variables with
// their bindings and replace all regions with 'static. This is
// sort of overkill because we do not expect there to be any
// unbound type variables, hence no `TyFresh` types should ever be
// inserted.
Ok(result.fold_with(&mut infcx.freshener()))
}

/// Returns an equivalent value with all free regions removed (note
/// that late-bound regions remain, because they are important for
/// subtyping, but they are anonymized and normalized as well). This
/// is a stronger, caching version of `ty_fold::erase_regions`.
pub fn erase_regions<'tcx,T>(cx: &ty::ctxt<'tcx>, value: &T) -> T
where T : TypeFoldable<'tcx>
{
let value1 = value.fold_with(&mut RegionEraser(cx));
debug!("erase_regions({:?}) = {:?}",
value, value1);
return value1;

struct RegionEraser<'a, 'tcx: 'a>(&'a ty::ctxt<'tcx>);

impl<'a, 'tcx> TypeFolder<'tcx> for RegionEraser<'a, 'tcx> {
fn tcx(&self) -> &ty::ctxt<'tcx> { self.0 }

fn fold_ty(&mut self, ty: Ty<'tcx>) -> Ty<'tcx> {
match self.tcx().normalized_cache.borrow().get(&ty).cloned() {
None => {}
Some(u) => return u
}

let t_norm = ty_fold::super_fold_ty(self, ty);
self.tcx().normalized_cache.borrow_mut().insert(ty, t_norm);
return t_norm;
}

fn fold_binder<T>(&mut self, t: &ty::Binder<T>) -> ty::Binder<T>
where T : TypeFoldable<'tcx>
{
let u = self.tcx().anonymize_late_bound_regions(t);
ty_fold::super_fold_binder(self, &u)
}

fn fold_region(&mut self, r: ty::Region) -> ty::Region {
// because late-bound regions affect subtyping, we can't
// erase the bound/free distinction, but we can replace
// all free regions with 'static.
//
// Note that we *CAN* replace early-bound regions -- the
// type system never "sees" those, they get substituted
// away. In trans, they will always be erased to 'static
// whenever a substitution occurs.
match r {
ty::ReLateBound(..) => r,
_ => ty::ReStatic
}
}

fn fold_substs(&mut self,
substs: &subst::Substs<'tcx>)
-> subst::Substs<'tcx> {
subst::Substs { regions: subst::ErasedRegions,
types: substs.types.fold_with(self) }
}
}
}

impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
pub fn freshen<T:TypeFoldable<'tcx>>(&self, t: T) -> T {
t.fold_with(&mut self.freshener())
Expand Down
9 changes: 5 additions & 4 deletions src/librustc_trans/trans/adt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ use std::rc::Rc;
use llvm::{ValueRef, True, IntEQ, IntNE};
use back::abi::FAT_PTR_ADDR;
use middle::subst;
use middle::infer;
use middle::ty::{self, Ty, ClosureTyper};
use middle::ty::Disr;
use syntax::ast;
Expand Down Expand Up @@ -223,8 +224,8 @@ fn represent_type_uncached<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>,
Univariant(mk_struct(cx, &ftys[..], packed, t), dtor_to_init_u8(dtor))
}
ty::TyClosure(def_id, substs) => {
let typer = NormalizingClosureTyper::new(cx.tcx());
let upvars = typer.closure_upvars(def_id, substs).unwrap();
let infcx = infer::normalizing_infer_ctxt(cx.tcx(), &cx.tcx().tables);
let upvars = infcx.closure_upvars(def_id, substs).unwrap();
let upvar_types = upvars.iter().map(|u| u.ty).collect::<Vec<_>>();
Univariant(mk_struct(cx, &upvar_types[..], false, t), 0)
}
Expand Down Expand Up @@ -443,8 +444,8 @@ fn find_discr_field_candidate<'tcx>(tcx: &ty::ctxt<'tcx>,
// Perhaps one of the upvars of this struct is non-zero
// Let's recurse and find out!
ty::TyClosure(def_id, substs) => {
let typer = NormalizingClosureTyper::new(tcx);
let upvars = typer.closure_upvars(def_id, substs).unwrap();
let infcx = infer::normalizing_infer_ctxt(tcx, &tcx.tables);
let upvars = infcx.closure_upvars(def_id, substs).unwrap();
let upvar_types = upvars.iter().map(|u| u.ty).collect::<Vec<_>>();

for (j, &ty) in upvar_types.iter().enumerate() {
Expand Down
5 changes: 3 additions & 2 deletions src/librustc_trans/trans/attributes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use libc::{c_uint, c_ulonglong};
use llvm::{self, ValueRef, AttrHelper};
use middle::ty::{self, ClosureTyper};
use middle::infer;
use session::config::NoDebugInfo;
use syntax::abi;
use syntax::ast;
Expand Down Expand Up @@ -145,8 +146,8 @@ pub fn from_fn_type<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, fn_type: ty::Ty<'tcx
let (fn_sig, abi, env_ty) = match fn_type.sty {
ty::TyBareFn(_, ref f) => (&f.sig, f.abi, None),
ty::TyClosure(closure_did, substs) => {
let typer = common::NormalizingClosureTyper::new(ccx.tcx());
function_type = typer.closure_type(closure_did, substs);
let infcx = infer::normalizing_infer_ctxt(ccx.tcx(), &ccx.tcx().tables);
function_type = infcx.closure_type(closure_did, substs);
let self_type = base::self_type_for_closure(ccx, closure_did, fn_type);
(&function_type.sig, abi::RustCall, Some(self_type))
}
Expand Down
5 changes: 3 additions & 2 deletions src/librustc_trans/trans/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ use llvm;
use metadata::{csearch, encoder, loader};
use middle::astencode;
use middle::cfg;
use middle::infer;
use middle::lang_items::{LangItem, ExchangeMallocFnLangItem, StartFnLangItem};
use middle::weak_lang_items;
use middle::subst::Substs;
Expand Down Expand Up @@ -434,8 +435,8 @@ pub fn iter_structural_ty<'blk, 'tcx, F>(cx: Block<'blk, 'tcx>,
}
ty::TyClosure(def_id, substs) => {
let repr = adt::represent_type(cx.ccx(), t);
let typer = common::NormalizingClosureTyper::new(cx.tcx());
let upvars = typer.closure_upvars(def_id, substs).unwrap();
let infcx = infer::normalizing_infer_ctxt(cx.tcx(), &cx.tcx().tables);
let upvars = infcx.closure_upvars(def_id, substs).unwrap();
for (i, upvar) in upvars.iter().enumerate() {
let llupvar = adt::trans_field_ptr(cx, &*repr, data_ptr, 0, i);
cx = f(cx, llupvar, upvar.ty);
Expand Down
10 changes: 6 additions & 4 deletions src/librustc_trans/trans/closure.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ use arena::TypedArena;
use back::link::{self, mangle_internal_name_by_path_and_seq};
use llvm::{ValueRef, get_params};
use middle::mem_categorization::Typer;
use middle::infer;
use trans::adt;
use trans::attributes;
use trans::base::*;
Expand Down Expand Up @@ -214,8 +215,9 @@ pub fn trans_closure_expr<'a, 'tcx>(dest: Dest<'a, 'tcx>,
// takes the same set of type arguments as the enclosing fn, and
// this function (`trans_closure`) is invoked at the point
// of the closure expression.
let typer = NormalizingClosureTyper::new(tcx);
let function_type = typer.closure_type(closure_id, param_substs);

let infcx = infer::normalizing_infer_ctxt(ccx.tcx(), &ccx.tcx().tables);
let function_type = infcx.closure_type(closure_id, param_substs);

let freevars: Vec<ty::Freevar> =
tcx.with_freevars(id, |fv| fv.iter().cloned().collect());
Expand Down Expand Up @@ -358,7 +360,7 @@ fn trans_fn_once_adapter_shim<'a, 'tcx>(
ccx.tn().val_to_string(llreffn));

let tcx = ccx.tcx();
let typer = NormalizingClosureTyper::new(tcx);
let infcx = infer::normalizing_infer_ctxt(ccx.tcx(), &ccx.tcx().tables);

// Find a version of the closure type. Substitute static for the
// region since it doesn't really matter.
Expand All @@ -367,7 +369,7 @@ fn trans_fn_once_adapter_shim<'a, 'tcx>(
let ref_closure_ty = tcx.mk_imm_ref(tcx.mk_region(ty::ReStatic), closure_ty);

// Make a version with the type of by-ref closure.
let ty::ClosureTy { unsafety, abi, mut sig } = typer.closure_type(closure_def_id, substs);
let ty::ClosureTy { unsafety, abi, mut sig } = infcx.closure_type(closure_def_id, substs);
sig.0.inputs.insert(0, ref_closure_ty); // sig has no self type as of yet
let llref_bare_fn_ty = tcx.mk_bare_fn(ty::BareFnTy { unsafety: unsafety,
abi: abi,
Expand Down
Loading