]> git.lizzy.rs Git - rust.git/log
rust.git
8 years agoreview comment: reduce the `is_adt_dtorck` method to just a check for the attribute.
Felix S. Klock II [Wed, 7 Oct 2015 11:17:12 +0000 (13:17 +0200)]
review comment: reduce the `is_adt_dtorck` method to just a check for the attribute.

8 years agoreview comment: use RFC example for compile-fail/issue28498-reject-ex1.rs
Felix S. Klock II [Tue, 6 Oct 2015 14:54:10 +0000 (16:54 +0200)]
review comment: use RFC example for compile-fail/issue28498-reject-ex1.rs

(It is not *exactly* the text from the RFC, but the only thing it adds
is a call to a no-op function that is just an attempt to make it clear
where the potential for impl specialization comes from.)

8 years agoshorten URLs to placate `make tidy`.
Felix S. Klock II [Tue, 6 Oct 2015 14:51:20 +0000 (16:51 +0200)]
shorten URLs to placate `make tidy`.

8 years agocompile-fail tests.
Felix S. Klock II [Tue, 6 Oct 2015 11:56:36 +0000 (13:56 +0200)]
compile-fail tests.

One just checks that we are feature-gating the UGEH attribute (as
usual for attributes associated with unstable features).

The other is adapted from the RFC 1238 text, except that it has been
extended somewhat to actually *illustrate* the scenario that we are
trying to prevent, namely observing the state of data, from safe code,
after the destructor for that data has been executed.

8 years agorun-pass tests for RFC 1238.
Felix S. Klock II [Tue, 6 Oct 2015 11:48:55 +0000 (13:48 +0200)]
run-pass tests for RFC 1238.

Illustrates cases that worked before and must continue to work, and a
case that shows how to use the `unsafe_destructor_blind_to_params`
attribute (aka "the UGEH attribute") to work around
cannot-assume-parametricity.

8 years agoAdd RFC 1238's `unsafe_destructor_blind_to_params` (UGEH) where needed.
Felix S. Klock II [Fri, 17 Jul 2015 14:12:35 +0000 (16:12 +0200)]
Add RFC 1238's `unsafe_destructor_blind_to_params` (UGEH) where needed.

I needed it in `RawVec`, `Vec`, and `TypedArena` for `rustc` to
bootstrap; but of course that alone was not sufficient for `make
check`.

Later I added `unsafe_destructor_blind_to_params` to collections, in
particular `LinkedList` and `RawTable` (the backing representation for
`HashMap` and `HashSet`), to get the regression tests exercising
cyclic structure from PR #27185 building.

----

Note that the feature is `dropck_parametricity` (which is not the same
as the attribute's name). We will almost certainly vary our strategy
here in the future, so it makes some sense to have a not-as-ugly name
for the feature gate. (The attribute name was deliberately selected to
be ugly looking.)

8 years agoNon-parametric dropck; instead trust an unsafe attribute (RFC 1238).
Felix S. Klock II [Thu, 16 Jul 2015 12:56:03 +0000 (14:56 +0200)]
Non-parametric dropck; instead trust an unsafe attribute (RFC 1238).

Implement cannot-assume-parametricity (CAP) from RFC 1238, and add the
UGEH attribute.

----

Note that we check for the attribute attached to the dtor method, not
the Drop impl.

(This is just to match the specification of RFC and the tests; I am
not wedded to this approach.)

8 years agoAuto merge of #28748 - nikomatsakis:universal-mir, r=pnkfelix
bors [Mon, 5 Oct 2015 03:06:33 +0000 (03:06 +0000)]
Auto merge of #28748 - nikomatsakis:universal-mir, r=pnkfelix

I had to fix a few things. Notable changes:

1. I removed the MIR support for constants, instead falling back to the existing `ConstVal`. I still think we ought to reform how we handle constants, but it's not clear to me that the approach I was taking is correct, and anyway I think we ought to do it separately.
2. I adjusted how we handle bindings in matches: we now *declare* all the bindings up front, rather than doing it as we encounter them. This is not only simpler, since we don't have to check if a binding has already been declared, it avoids ICEs if any of the arms turn out to be unreachable.
3. I do MIR construction *after* `check_match`, because it detects various broken cases. I'd like for `check_match` to be subsumed by MIR construction, but we can do that as a separate PR (if indeed it makes sense).

I did a crater run and found no regressions in the wild: https://gist.github.com/nikomatsakis/0038f90e10c8ad00f2f8

8 years agochange PartialEq impl for ConstVal so that two constants are `==`
Niko Matsakis [Tue, 29 Sep 2015 21:08:05 +0000 (17:08 -0400)]
change PartialEq impl for ConstVal so that two constants are `==`
if they represent the same constant; otherwise the match algorithm
goes into infinite recursion when a pattern contains `NaN`

8 years agochange how we declare bindings so that unreachable arms don't
Niko Matsakis [Tue, 29 Sep 2015 20:17:40 +0000 (16:17 -0400)]
change how we declare bindings so that unreachable arms don't
cause panics

8 years agorather than just passing the block around, track the candidate's index,
Niko Matsakis [Tue, 29 Sep 2015 14:49:24 +0000 (10:49 -0400)]
rather than just passing the block around, track the candidate's index,
and track which arms are reached (though in fact we don't make use of
this right now -- we might later if we absorb the checking of patterns
into MIR, as I would like)

8 years agoAuto merge of #28840 - rust-lang:brson-patch-1, r=steveklabnik
bors [Mon, 5 Oct 2015 01:16:34 +0000 (01:16 +0000)]
Auto merge of #28840 - rust-lang:brson-patch-1, r=steveklabnik

Add the Tock paper.

8 years agoswitch to using constvals for constants, instead of having constant
Niko Matsakis [Thu, 10 Sep 2015 19:44:44 +0000 (15:44 -0400)]
switch to using constvals for constants, instead of having constant
trees in MIR

8 years agodo MIR construction after pattern evaluation for now to sidestep
Niko Matsakis [Tue, 29 Sep 2015 20:17:50 +0000 (16:17 -0400)]
do MIR construction after pattern evaluation for now to sidestep
various annoying edge cases

8 years agoalways build MIR
Niko Matsakis [Thu, 10 Sep 2015 19:44:34 +0000 (15:44 -0400)]
always build MIR

8 years agoAuto merge of #28573 - ruud-v-a:rustdoc-license, r=brson
bors [Sun, 4 Oct 2015 23:30:40 +0000 (23:30 +0000)]
Auto merge of #28573 - ruud-v-a:rustdoc-license, r=brson

The output of rustdoc includes resources licensed under the SIL Open
Font License, the MIT license, and the Apache License 2.0. All of these
licenses permit redistribution provided that the license text is also
redistributed. Previously this was not the case, making rustdoc output
unsuitable for distribution by default. This resolves that problem by
including the license texts in rustdoc output.

See also: https://users.rust-lang.org/t/licensing-rustdoc-output/2880

8 years agoUpdate bibliography.md
Brian Anderson [Sun, 4 Oct 2015 22:55:19 +0000 (15:55 -0700)]
Update bibliography.md

8 years agoAuto merge of #28825 - iwillspeak:master, r=alexcrichton
bors [Sun, 4 Oct 2015 21:43:36 +0000 (21:43 +0000)]
Auto merge of #28825 - iwillspeak:master, r=alexcrichton

`--explain` support for E0163 and E0164.

Part of rust-lang/rust#24407

8 years agoAuto merge of #28806 - wthrowe:bare-outfile-fix, r=alexcrichton
bors [Sun, 4 Oct 2015 19:50:50 +0000 (19:50 +0000)]
Auto merge of #28806 - wthrowe:bare-outfile-fix, r=alexcrichton

The reason this was not failing is fascinating.  The variable $(rustc)
is empty, so the make recipe was expanded as " -o foo foo.rs".  make
interpreted this as an instruction to run the command "o foo foo.rs"
and ignore any failure that occurred, because it uses a leading '-' on
a command to signal that behavior.

8 years agoAuto merge of #28831 - Seeker14491:patch-1, r=steveklabnik
bors [Sun, 4 Oct 2015 17:36:49 +0000 (17:36 +0000)]
Auto merge of #28831 - Seeker14491:patch-1, r=steveklabnik

8 years agoAuto merge of #28832 - sarcas:docs-uneeded-done-in-library-example, r=steveklabnik
bors [Sun, 4 Oct 2015 14:18:28 +0000 (14:18 +0000)]
Auto merge of #28832 - sarcas:docs-uneeded-done-in-library-example, r=steveklabnik

"Rust Inside Other Languages" in the Rust book includes a library example. The reference specifies printing "done!" when the code finishes running, and the language examples (Ruby, Python, JS) all do this in their code.

However, the Rust library example code *also* does this, so that the examples as written would output "done!" twice.

This commit removes the "done!" from the Rust example code to tidy up the output to match expectations.

8 years agoDocs: Removes duplicate output from FFI example
James Bell [Sun, 4 Oct 2015 09:44:00 +0000 (10:44 +0100)]
Docs: Removes duplicate output from FFI example

The "Rust Inside Other Languages" page includes a library example. The
reference specifies printing "done!" when the code finishes running, and
the language examples (Ruby, Python, JS) all do this in their code.
However, the Rust library example code *also* does this, so that the
examples as written would output "done!" twice.

This removes the "done!" from the Rust example code to clarify the docs.

8 years agofix another typo
Seeker14491 [Sun, 4 Oct 2015 05:34:21 +0000 (00:34 -0500)]
fix another typo

8 years agofix a few typos
Seeker14491 [Sat, 3 Oct 2015 23:01:42 +0000 (18:01 -0500)]
fix a few typos

8 years agoAuto merge of #28669 - arielb1:well-formed-methods, r=nikomatsakis
bors [Sat, 3 Oct 2015 22:07:37 +0000 (22:07 +0000)]
Auto merge of #28669 - arielb1:well-formed-methods, r=nikomatsakis

By RFC1214:
>    Before calling a fn, we check that its argument and return types are WF.

The previous code only checked the trait-ref, which was not enough
in several cases.

As this is a soundness fix, it is a [breaking-change]. Some new annotations are needed, which I think are because of #18653 and the imperfection of `projection_must_outlive` (that can probably be worked around by moving the wf obligation later).

Fixes #28609

r? @nikomatsakis

8 years agoFix run-make/bare-outfile test
William Throwe [Fri, 2 Oct 2015 03:05:25 +0000 (23:05 -0400)]
Fix run-make/bare-outfile test

The reason this was not failing is fascinating.  The variable $(rustc)
is empty, so the make recipe was expanded as " -o foo foo.rs".  make
interpreted this as an instruction to run the command "o foo foo.rs"
and ignore any failure that occurred, because it uses a leading '-' on
a command to signal that behavior.

8 years agoAuto merge of #28829 - GuillaumeGomez:patch-1, r=steveklabnik
bors [Sat, 3 Oct 2015 20:18:38 +0000 (20:18 +0000)]
Auto merge of #28829 - GuillaumeGomez:patch-1, r=steveklabnik

r? @steveklabnik

8 years agoAdd missing dot
Guillaume Gomez [Sat, 3 Oct 2015 18:21:39 +0000 (20:21 +0200)]
Add missing dot

8 years agoAuto merge of #28521 - arielb1:metadiet, r=eddyb
bors [Sat, 3 Oct 2015 17:33:10 +0000 (17:33 +0000)]
Auto merge of #28521 - arielb1:metadiet, r=eddyb

libcore.rlib reduced from 19121 kiB to 15934 kiB - 20% win.

The librustc encoded AST is 9013500 bytes long - for the record, librustc consists of about 2254126 characters. Might be worth looking at.

r? @eddyb

8 years agoAdd Error Explanations for E0163 & E0164
Will Speak [Sat, 3 Oct 2015 14:42:38 +0000 (15:42 +0100)]
Add Error Explanations for E0163 & E0164

Addds `--explain` support for E0163 and E0164.

8 years agoAuto merge of #28821 - dagnir:formatting-fix, r=steveklabnik
bors [Sat, 3 Oct 2015 09:37:49 +0000 (09:37 +0000)]
Auto merge of #28821 - dagnir:formatting-fix, r=steveklabnik

8 years agouse the correct subtyping order in a test
Ariel Ben-Yehuda [Fri, 2 Oct 2015 20:52:18 +0000 (23:52 +0300)]
use the correct subtyping order in a test

also, ensure that callers are checked.

8 years agoAuto merge of #28815 - matklad:contrib-doc, r=steveklabnik
bors [Sat, 3 Oct 2015 07:50:47 +0000 (07:50 +0000)]
Auto merge of #28815 - matklad:contrib-doc, r=steveklabnik

This adds a paragraph on how to generate documentation without sloooow `make doc`. I'm not a native English speaker, so there might be some language related bugs (I wish English was as hard to get wrong, as Rust)

This also includes whitespace cleanup of contributing.md in a separate commit. Whiltespace is not significant in github flavored markdown, and my Emacs just cleans ws automatically :)

r? @steveklabnik

8 years agoAuto merge of #28818 - Stebalien:fix-iter-chain-order, r=alexcrichton
bors [Sat, 3 Oct 2015 06:03:50 +0000 (06:03 +0000)]
Auto merge of #28818 - Stebalien:fix-iter-chain-order, r=alexcrichton

part of #28810

8 years agoAuto merge of #28813 - arielb1:well-formed-variables, r=nikomatsakis
bors [Sat, 3 Oct 2015 04:16:52 +0000 (04:16 +0000)]
Auto merge of #28813 - arielb1:well-formed-variables, r=nikomatsakis

it doesn't seem to be necessary and is potentially harmful.

r? @nikomatsakis

8 years agoAuto merge of #28820 - steveklabnik:rollup, r=steveklabnik
bors [Sat, 3 Oct 2015 02:23:03 +0000 (02:23 +0000)]
Auto merge of #28820 - steveklabnik:rollup, r=steveklabnik

- Successful merges: #28736, #28805, #28812, #28814, #28819
- Failed merges:

8 years agodocs: add rustdoc example to CONTRIBUTING.md
Aleksey Kladov [Fri, 2 Oct 2015 21:09:27 +0000 (00:09 +0300)]
docs: add rustdoc example to CONTRIBUTING.md

8 years agoRollup merge of #28819 - steveklabnik:doc_hr, r=brson
Steve Klabnik [Sat, 3 Oct 2015 00:38:23 +0000 (20:38 -0400)]
Rollup merge of #28819 - steveklabnik:doc_hr, r=brson

It's not really clear here, since the example is rendered, where it
starts and ends. So let's use <hr>s to split it up.

8 years agoRollup merge of #28814 - matklad:fix-md, r=alexcrichton
Steve Klabnik [Sat, 3 Oct 2015 00:38:23 +0000 (20:38 -0400)]
Rollup merge of #28814 - matklad:fix-md, r=alexcrichton

The list was grabled.

r? @steveklabnik

8 years agoRollup merge of #28812 - steveklabnik:improve_str_from_utf8_docs, r=brson
Steve Klabnik [Sat, 3 Oct 2015 00:38:23 +0000 (20:38 -0400)]
Rollup merge of #28812 - steveklabnik:improve_str_from_utf8_docs, r=brson

Our docs were very basic for the various versions of from_utf8, so
this commit beefs them up.

It also improves docs for the &str variant's error, Utf8Error.

8 years agoRollup merge of #28805 - wthrowe:compile-stdin, r=alexcrichton
Steve Klabnik [Sat, 3 Oct 2015 00:38:22 +0000 (20:38 -0400)]
Rollup merge of #28805 - wthrowe:compile-stdin, r=alexcrichton

8 years agoRollup merge of #28736 - nagisa:rustdocjsfix, r=alexcrichton
Steve Klabnik [Sat, 3 Oct 2015 00:38:22 +0000 (20:38 -0400)]
Rollup merge of #28736 - nagisa:rustdocjsfix, r=alexcrichton

8 years agoAuto merge of #28672 - sanxiyn:const-eval-span, r=alexcrichton
bors [Sat, 3 Oct 2015 00:36:50 +0000 (00:36 +0000)]
Auto merge of #28672 - sanxiyn:const-eval-span, r=alexcrichton

Fix #28402.

8 years agoImprove documentation for the from_utf8 family
Steve Klabnik [Fri, 2 Oct 2015 18:36:02 +0000 (14:36 -0400)]
Improve documentation for the from_utf8 family

Our docs were very basic for the various versions of from_utf8, so
this commit beefs them up.

It also improves docs for the &str variant's error, Utf8Error.

8 years agoAdd in some <hr>s for emphasis
Steve Klabnik [Fri, 2 Oct 2015 22:54:07 +0000 (18:54 -0400)]
Add in some <hr>s for emphasis

It's not really clear here, since the example is rendered, where it
starts and ends. So let's use <hr>s to split it up.

8 years agoAuto merge of #28662 - semmaz:fmt-debug, r=alexcrichton
bors [Fri, 2 Oct 2015 22:49:37 +0000 (22:49 +0000)]
Auto merge of #28662 - semmaz:fmt-debug, r=alexcrichton

fixes #26920

8 years agolibcore: Chain must exhaust a before b.
Steven Allen [Fri, 2 Oct 2015 22:41:06 +0000 (18:41 -0400)]
libcore: Chain must exhaust a before b.

part of #28810

8 years agodocs: whitespace cleanup
Aleksey Kladov [Fri, 2 Oct 2015 21:08:14 +0000 (00:08 +0300)]
docs: whitespace cleanup

8 years agoAuto merge of #28626 - arielb1:closure-needs-infer, r=nikomatsakis
bors [Fri, 2 Oct 2015 21:02:49 +0000 (21:02 +0000)]
Auto merge of #28626 - arielb1:closure-needs-infer, r=nikomatsakis

Fixes #28550

8 years agoreference: fix markdown formatting
Aleksey Kladov [Fri, 2 Oct 2015 20:53:20 +0000 (23:53 +0300)]
reference: fix markdown formatting

8 years agofix fallout
Ariel Ben-Yehuda [Fri, 25 Sep 2015 23:52:46 +0000 (02:52 +0300)]
fix fallout

looks like some mix of #18653 and `projection_must_outlive`, but
that needs to be investigated further (crater run?)

8 years agoensure that the types of methods are well-formed
Ariel Ben-Yehuda [Fri, 25 Sep 2015 22:27:39 +0000 (01:27 +0300)]
ensure that the types of methods are well-formed

By RFC1214:
Before calling a fn, we check that its argument and return types are WF. This check takes place after all higher-ranked lifetimes have been instantiated. Checking the argument types ensures that the implied bounds due to argument types are correct. Checking the return type ensures that the resulting type of the call is WF.

The previous code only checked the trait-ref, which was not enough
in several cases.

As this is a soundness fix, it is a [breaking-change].

Fixes #28609

8 years agoremove the "don't add `_ WF` obligation" hack
Ariel Ben-Yehuda [Fri, 2 Oct 2015 20:36:07 +0000 (23:36 +0300)]
remove the "don't add `_ WF` obligation" hack

it doesn't seem to be necessary and is potentially harmful.

8 years agoAuto merge of #28650 - sanxiyn:attr-usage, r=nrc
bors [Fri, 2 Oct 2015 19:16:39 +0000 (19:16 +0000)]
Auto merge of #28650 - sanxiyn:attr-usage, r=nrc

This is technically a [breaking-change].

Fix #2809.
Fix #22746.

8 years agoAuto merge of #28768 - alexcrichton:dep-info++, r=brson
bors [Fri, 2 Oct 2015 16:33:26 +0000 (16:33 +0000)]
Auto merge of #28768 - alexcrichton:dep-info++, r=brson

This PR closes out #28716 and #28735 by making two changes to the compiler:

1. The `--emit` flag to the compiler now supports the ability to specify the output file name of a partuclar emit type. For example `--emit dep-info=bar.d,asm=foo.s,link` is now accepted.
2. The dep-info emission now emits a dummy target for all input file names to protect against deleted files.

8 years agorustc: Emit phony targets for inputs in dep-info
Alex Crichton [Wed, 30 Sep 2015 17:17:07 +0000 (10:17 -0700)]
rustc: Emit phony targets for inputs in dep-info

This helps protect against files being deleted to ensure that `make` won't emit
errors.

Closes #28735

8 years agoProvide the context for error in constant evaluation of enum discriminant
Seo Sanghyeon [Sat, 26 Sep 2015 02:52:34 +0000 (11:52 +0900)]
Provide the context for error in constant evaluation of enum discriminant

8 years agoAdd a method to test span containment
Seo Sanghyeon [Sat, 26 Sep 2015 01:44:37 +0000 (10:44 +0900)]
Add a method to test span containment

8 years agoCheck attribute usage
Seo Sanghyeon [Fri, 25 Sep 2015 06:25:59 +0000 (15:25 +0900)]
Check attribute usage

8 years agoChange tests per RFC 246 (const vs static)
Seo Sanghyeon [Fri, 25 Sep 2015 09:44:36 +0000 (18:44 +0900)]
Change tests per RFC 246 (const vs static)

8 years agoFix librustdoc search events
Simonas Kazlauskas [Tue, 29 Sep 2015 20:47:01 +0000 (23:47 +0300)]
Fix librustdoc search events

Previously only keyup event was looked at, which meant that pasting, cutting and
otherwise changing the input without typing would not catch any updates to the
search query.

8 years agoFix misnamed variable in rustdoc
Simonas Kazlauskas [Tue, 29 Sep 2015 20:37:36 +0000 (23:37 +0300)]
Fix misnamed variable in rustdoc

8 years agounify the 2 impl indexes
Ariel Ben-Yehuda [Fri, 2 Oct 2015 13:44:26 +0000 (16:44 +0300)]
unify the 2 impl indexes

8 years agoAuto merge of #28808 - AndiDog:patch-1, r=steveklabnik
bors [Fri, 2 Oct 2015 13:24:57 +0000 (13:24 +0000)]
Auto merge of #28808 - AndiDog:patch-1, r=steveklabnik

8 years agoMerge branch 'master' into metadiet
Ariel Ben-Yehuda [Fri, 2 Oct 2015 13:12:20 +0000 (16:12 +0300)]
Merge branch 'master' into metadiet

rlib sizes:
1445222 liballoc_jemalloc-bb943c5a.rlib
10664 liballoc_system-bb943c5a.rlib
143592 libarena-bb943c5a.rlib
3639102 libcollections-bb943c5a.rlib
16316910 libcore-bb943c5a.rlib
214154 libflate-bb943c5a.rlib
231440 libfmt_macros-bb943c5a.rlib
536976 libgetopts-bb943c5a.rlib
209672 libgraphviz-bb943c5a.rlib
408008 liblibc-bb943c5a.rlib
189610 liblog-bb943c5a.rlib
662184 librand-bb943c5a.rlib
605112 librbml-bb943c5a.rlib
1397820 librustc_back-bb943c5a.rlib
38383772 librustc-bb943c5a.rlib
12842 librustc_bitflags-bb943c5a.rlib
2297822 librustc_borrowck-bb943c5a.rlib
571064 librustc_data_structures-bb943c5a.rlib
9356542 librustc_driver-bb943c5a.rlib
9477226 librustc_front-bb943c5a.rlib
1605698 librustc_lint-bb943c5a.rlib
77111720 librustc_llvm-bb943c5a.rlib
4783848 librustc_mir-bb943c5a.rlib
3534256 librustc_platform_intrinsics-bb943c5a.rlib
593038 librustc_privacy-bb943c5a.rlib
3122202 librustc_resolve-bb943c5a.rlib
14185212 librustc_trans-bb943c5a.rlib
11940328 librustc_typeck-bb943c5a.rlib
1634264 librustc_unicode-bb943c5a.rlib
15564160 librustdoc-bb943c5a.rlib
8153964 libstd-bb943c5a.rlib
30589338 libsyntax-bb943c5a.rlib
897110 libterm-bb943c5a.rlib
1360662 libtest-bb943c5a.rlib

8 years agoFix typo, add link to Google-search in documentation
Andreas Sommer [Fri, 2 Oct 2015 12:36:27 +0000 (14:36 +0200)]
Fix typo, add link to Google-search in documentation

8 years agoAuto merge of #28795 - marti1125:28696, r=alexcrichton
bors [Fri, 2 Oct 2015 11:04:13 +0000 (11:04 +0000)]
Auto merge of #28795 - marti1125:28696, r=alexcrichton

-Add a validation when input search is empty on top of 'startSearch()'

8 years agoAuto merge of #28807 - Manishearth:rollup, r=Manishearth
bors [Fri, 2 Oct 2015 09:11:34 +0000 (09:11 +0000)]
Auto merge of #28807 - Manishearth:rollup, r=Manishearth

- Successful merges: #28554, #28686, #28786, #28788, #28791, #28797
- Failed merges:

8 years agoRollup merge of #28797 - steveklabnik:rebase_for_gankro, r=alexcrichton
Manish Goregaokar [Fri, 2 Oct 2015 07:37:23 +0000 (13:07 +0530)]
Rollup merge of #28797 - steveklabnik:rebase_for_gankro, r=alexcrichton

This is a rebase of https://github.com/rust-lang/rust/pull/27902/, since @Gankro  is busy :heart:

8 years agoRollup merge of #28791 - apasel422:issue-25439, r=alexcrichton
Manish Goregaokar [Fri, 2 Oct 2015 07:37:23 +0000 (13:07 +0530)]
Rollup merge of #28791 - apasel422:issue-25439, r=alexcrichton

Closes #25439.

8 years agoRollup merge of #28788 - tsurai:master, r=bluss
Manish Goregaokar [Fri, 2 Oct 2015 07:37:22 +0000 (13:07 +0530)]
Rollup merge of #28788 - tsurai:master, r=bluss

Please correct me if I confused something but the documentation for ```into_ptr``` and ```into_raw``` of ```CString``` seem to be swapped as the docs for ```into_ptr``` mentions ```into_raw``` and vice versa.

Update: I actually meant ```into_ptr``` and ```into_raw``` NOT ```from_*```

8 years agoRollup merge of #28786 - fhahn:ba-link, r=alexcrichton
Manish Goregaokar [Fri, 2 Oct 2015 07:37:22 +0000 (13:07 +0530)]
Rollup merge of #28786 - fhahn:ba-link, r=alexcrichton

This tiny PR just adds a link to  Florian Wilkens's Bachelor's Thesis.

8 years agoRollup merge of #28686 - eefriedman:unresolved-path-error, r=nikomatsakis
Manish Goregaokar [Fri, 2 Oct 2015 07:37:22 +0000 (13:07 +0530)]
Rollup merge of #28686 - eefriedman:unresolved-path-error, r=nikomatsakis

The behavior here isn't really ideal, but we can't really do much better
given the current state of constant evaluation.

The changes to ExprUseVisitor are to avoid a compile error; apparently
that bit of code is extremely sensitive to changes in other areas of the
compiler.

Fixes #28670, and probably a bunch of duplicates.

8 years agoRollup merge of #28554 - christopherdumas:E0422, r=arielb1
Manish Goregaokar [Fri, 2 Oct 2015 07:37:22 +0000 (13:07 +0530)]
Rollup merge of #28554 - christopherdumas:E0422, r=arielb1

8 years agoAuto merge of #28793 - Ms2ger:AttrStyle, r=alexcrichton
bors [Fri, 2 Oct 2015 07:10:43 +0000 (07:10 +0000)]
Auto merge of #28793 - Ms2ger:AttrStyle, r=alexcrichton

8 years agoAuto merge of #28792 - dotdash:cmp_indirection, r=alexcrichton
bors [Fri, 2 Oct 2015 05:19:50 +0000 (05:19 +0000)]
Auto merge of #28792 - dotdash:cmp_indirection, r=alexcrichton

Using the comparison operators already refs the operands, so doing it
ourselves as well just adds an unnecessary level of indirection.

8 years agoadd newline so list is parsed properly
Dongie Agnir [Fri, 2 Oct 2015 04:45:47 +0000 (18:45 -1000)]
add newline so list is parsed properly

8 years agoAuto merge of #28790 - arielb1:unsafe-coerce, r=eddyb
bors [Fri, 2 Oct 2015 03:28:57 +0000 (03:28 +0000)]
Auto merge of #28790 - arielb1:unsafe-coerce, r=eddyb

Fixes #28776

r? @eddyb

8 years agoAdd a test that rustc can compile standard input
William Throwe [Fri, 2 Oct 2015 03:25:48 +0000 (23:25 -0400)]
Add a test that rustc can compile standard input

8 years agoAuto merge of #28789 - rkruppe:rm-unused-probes, r=alexcrichton
bors [Fri, 2 Oct 2015 01:40:29 +0000 (01:40 +0000)]
Auto merge of #28789 - rkruppe:rm-unused-probes, r=alexcrichton

The code using them was removed in #27789.

8 years agoAuto merge of #28787 - dotdash:no_more___fat_ptr, r=eddyb
bors [Thu, 1 Oct 2015 20:06:35 +0000 (20:06 +0000)]
Auto merge of #28787 - dotdash:no_more___fat_ptr, r=eddyb

A DST value and a fat pointer to it have the same representation, all we
have to do is to adjust the type of the datum holding the pointer.

8 years agofixup wording
Alexis Beingessner [Wed, 19 Aug 2015 19:36:14 +0000 (12:36 -0700)]
fixup wording

8 years agoflesh out what Vec actually guarantees
Alexis Beingessner [Wed, 19 Aug 2015 17:13:39 +0000 (10:13 -0700)]
flesh out what Vec actually guarantees

8 years agoremove the code that encodes type parameter defs
Ariel Ben-Yehuda [Tue, 29 Sep 2015 20:51:55 +0000 (23:51 +0300)]
remove the code that encodes type parameter defs

there are no type parameter defs in the relevant range

8 years agodon't store method_fty
Ariel Ben-Yehuda [Sun, 20 Sep 2015 11:15:21 +0000 (14:15 +0300)]
don't store method_fty

It is redundant with the item type. This is not much of a win,
as there are really not *that* many methods, but it makes the code
uglier.

8 years agodon't duplicate item types between encoder <-> astencode
Ariel Ben-Yehuda [Sat, 19 Sep 2015 20:28:21 +0000 (23:28 +0300)]
don't duplicate item types between encoder <-> astencode

a 5% win on libcore

512576 liballoc-bb943c5a.rlib
1425106 liballoc_jemalloc-bb943c5a.rlib
10070 liballoc_system-bb943c5a.rlib
141332 libarena-bb943c5a.rlib
3611586 libcollections-bb943c5a.rlib
16293400 libcore-bb943c5a.rlib
195018 libflate-bb943c5a.rlib
231940 libfmt_macros-bb943c5a.rlib
532704 libgetopts-bb943c5a.rlib
208094 libgraphviz-bb943c5a.rlib
383522 liblibc-bb943c5a.rlib
183786 liblog-bb943c5a.rlib
658332 librand-bb943c5a.rlib
567676 librbml-bb943c5a.rlib
1376114 librustc_back-bb943c5a.rlib
37134688 librustc-bb943c5a.rlib
12826 librustc_bitflags-bb943c5a.rlib
2241942 librustc_borrowck-bb943c5a.rlib
513598 librustc_data_structures-bb943c5a.rlib
9340348 librustc_driver-bb943c5a.rlib
8880472 librustc_front-bb943c5a.rlib
1590548 librustc_lint-bb943c5a.rlib
79149202 librustc_llvm-bb943c5a.rlib
4536740 librustc_mir-bb943c5a.rlib
3528866 librustc_platform_intrinsics-bb943c5a.rlib
588514 librustc_privacy-bb943c5a.rlib
3068562 librustc_resolve-bb943c5a.rlib
13982508 librustc_trans-bb943c5a.rlib
11799790 librustc_typeck-bb943c5a.rlib
1637532 librustc_unicode-bb943c5a.rlib
15611582 librustdoc-bb943c5a.rlib
2649520 libserialize-bb943c5a.rlib
8095050 libstd-bb943c5a.rlib
29391260 libsyntax-bb943c5a.rlib
891210 libterm-bb943c5a.rlib

8 years agoimprove the tyencode abbrev format
Ariel Ben-Yehuda [Thu, 17 Sep 2015 19:12:39 +0000 (22:12 +0300)]
improve the tyencode abbrev format

3% win on libcore

528828 liballoc-bb943c5a.rlib
1425126 liballoc_jemalloc-bb943c5a.rlib
10090 liballoc_system-bb943c5a.rlib
144904 libarena-bb943c5a.rlib
3773896 libcollections-bb943c5a.rlib
17075242 libcore-bb943c5a.rlib
195770 libflate-bb943c5a.rlib
234702 libfmt_macros-bb943c5a.rlib
536342 libgetopts-bb943c5a.rlib
212028 libgraphviz-bb943c5a.rlib
397068 liblibc-bb943c5a.rlib
185038 liblog-bb943c5a.rlib
680782 librand-bb943c5a.rlib
577574 librbml-bb943c5a.rlib
1381992 librustc_back-bb943c5a.rlib
37554736 librustc-bb943c5a.rlib
12826 librustc_bitflags-bb943c5a.rlib
2257392 librustc_borrowck-bb943c5a.rlib
533858 librustc_data_structures-bb943c5a.rlib
9338878 librustc_driver-bb943c5a.rlib
8960016 librustc_front-bb943c5a.rlib
1594212 librustc_lint-bb943c5a.rlib
79159342 librustc_llvm-bb943c5a.rlib
4590656 librustc_mir-bb943c5a.rlib
3529292 librustc_platform_intrinsics-bb943c5a.rlib
590688 librustc_privacy-bb943c5a.rlib
3084134 librustc_resolve-bb943c5a.rlib
14032890 librustc_trans-bb943c5a.rlib
11833852 librustc_typeck-bb943c5a.rlib
1641496 librustc_unicode-bb943c5a.rlib
15611582 librustdoc-bb943c5a.rlib
2693764 libserialize-bb943c5a.rlib
8266920 libstd-bb943c5a.rlib
29573790 libsyntax-bb943c5a.rlib
895484 libterm-bb943c5a.rlib

8 years agodon't mark_stable_position needlessly in tyencode
Ariel Ben-Yehuda [Thu, 17 Sep 2015 17:50:27 +0000 (20:50 +0300)]
don't mark_stable_position needlessly in tyencode

another 1% improvement in libcore size - also 1% in librustc

550076 liballoc-bb943c5a.rlib
1425150 liballoc_jemalloc-bb943c5a.rlib
10100 liballoc_system-bb943c5a.rlib
149372 libarena-bb943c5a.rlib
3964144 libcollections-bb943c5a.rlib
17744342 libcore-bb943c5a.rlib
197420 libflate-bb943c5a.rlib
241582 libfmt_macros-bb943c5a.rlib
550560 libgetopts-bb943c5a.rlib
219444 libgraphviz-bb943c5a.rlib
402668 liblibc-bb943c5a.rlib
187158 liblog-bb943c5a.rlib
704588 librand-bb943c5a.rlib
594522 librbml-bb943c5a.rlib
1392516 librustc_back-bb943c5a.rlib
38196500 librustc-bb943c5a.rlib
12826 librustc_bitflags-bb943c5a.rlib
2286918 librustc_borrowck-bb943c5a.rlib
561714 librustc_data_structures-bb943c5a.rlib
9356400 librustc_driver-bb943c5a.rlib
9378650 librustc_front-bb943c5a.rlib
1603680 librustc_lint-bb943c5a.rlib
79184908 librustc_llvm-bb943c5a.rlib
4746824 librustc_mir-bb943c5a.rlib
3532474 librustc_platform_intrinsics-bb943c5a.rlib
592664 librustc_privacy-bb943c5a.rlib
3114986 librustc_resolve-bb943c5a.rlib
14153174 librustc_trans-bb943c5a.rlib
11918356 librustc_typeck-bb943c5a.rlib
1669986 librustc_unicode-bb943c5a.rlib
15611582 librustdoc-bb943c5a.rlib
2836912 libserialize-bb943c5a.rlib
8549994 libstd-bb943c5a.rlib
30399156 libsyntax-bb943c5a.rlib
907058 libterm-bb943c5a.rlib

8 years agofixes #28696 Return to the default content when .search-input is empty -Add a validat...
Willy Aguirre [Thu, 1 Oct 2015 18:30:35 +0000 (13:30 -0500)]
fixes #28696 Return to the default content when .search-input is empty -Add a validation when input search is empty on top of 'startSearch()'

8 years agoAuto merge of #28746 - aidanhs:aphs-musl-linking-no-cxxabi, r=alexcrichton
bors [Thu, 1 Oct 2015 18:16:08 +0000 (18:16 +0000)]
Auto merge of #28746 - aidanhs:aphs-musl-linking-no-cxxabi, r=alexcrichton

On reading https://github.com/alexcrichton/port-of-rust/blob/master/musl/Dockerfile I was surprised to see no libcxxabi. I experimented, and it does seem to be unnecessary.

I guess it's a remnant from the 3.6 build.

r? @alexcrichton

8 years agoImplement `size_hint` for `EscapeUnicode`
Simon Mazur [Wed, 30 Sep 2015 17:31:41 +0000 (20:31 +0300)]
Implement `size_hint` for `EscapeUnicode`

8 years agoAuto merge of #28742 - nikomatsakis:def-id-encapsulate, r=eddyb
bors [Thu, 1 Oct 2015 16:26:28 +0000 (16:26 +0000)]
Auto merge of #28742 - nikomatsakis:def-id-encapsulate, r=eddyb

As described in https://github.com/rust-lang/rfcs/pull/1298, the idea here is to make DefIds independent of changes to the content of other items. They are also *mostly* independent from ordering, so e.g. reordering two functions will change the defids, but it will not change the paths that they expand into (but this is not the case for some things, such as impls).

This is a major refactoring, so I did it in slices. The final commit is in some sense The Big One where most of the work is done. The earlier commits just pave the way by gradually refactoring accesses to the `node` field.

This is a [breaking-change] for plugin authors. The things you need to do to migrate your code are as follows:

1. For local def-ids, rather than do `def_id.node`, call `tcx.map.as_local_node_id(def_id)`.
2. To construct a local def-id, call `tcx.map.local_def_id(node_id)`.
3. Note that you cannot make def-ids for any node, but only for "definitions" -- which include all items, as well as a number of other things, but not e.g. arbitrary expressions.
4. You can get the path to a def-id by calling `tcx.def_path(def_id)`.

One thing that is NOT part of this PR, but which I plan do in a follow-up, is converting uses of the existing `with_path` API to use `def_path`, which is basically the same.

r? @eddyb (or @nrc)

8 years agoRemove one level of indirection for slice-based PartialEq impls
Björn Steinbrink [Thu, 1 Oct 2015 16:17:49 +0000 (18:17 +0200)]
Remove one level of indirection for slice-based PartialEq impls

Using the comparison operators already refs the operands, so doing it
ourselves as well just adds an unnecessary level of indirection.

8 years agoStop re-exporting AttrStyle's variants and rename them.
Ms2ger [Thu, 1 Oct 2015 16:03:34 +0000 (18:03 +0200)]
Stop re-exporting AttrStyle's variants and rename them.

8 years agoAdd test for #25439
Andrew Paseltiner [Thu, 1 Oct 2015 15:25:45 +0000 (11:25 -0400)]
Add test for #25439

Closes #25439.

8 years agodon't emit leading zeros in tagged integers
Ariel Ben-Yehuda [Thu, 17 Sep 2015 16:55:43 +0000 (19:55 +0300)]
don't emit leading zeros in tagged integers

we *already* need a length, so might as well use it

this saves 3% in libcore

559870 liballoc-bb943c5a.rlib
1425170 liballoc_jemalloc-bb943c5a.rlib
10120 liballoc_system-bb943c5a.rlib
152398 libarena-bb943c5a.rlib
4023670 libcollections-bb943c5a.rlib
18042746 libcore-bb943c5a.rlib
198202 libflate-bb943c5a.rlib
244412 libfmt_macros-bb943c5a.rlib
555750 libgetopts-bb943c5a.rlib
222462 libgraphviz-bb943c5a.rlib
417824 liblibc-bb943c5a.rlib
187804 liblog-bb943c5a.rlib
722742 librand-bb943c5a.rlib
604846 librbml-bb943c5a.rlib
1397814 librustc_back-bb943c5a.rlib
38382616 librustc-bb943c5a.rlib
12826 librustc_bitflags-bb943c5a.rlib
2298772 librustc_borrowck-bb943c5a.rlib
570822 librustc_data_structures-bb943c5a.rlib
9361826 librustc_driver-bb943c5a.rlib
9479914 librustc_front-bb943c5a.rlib
1604576 librustc_lint-bb943c5a.rlib
79190586 librustc_llvm-bb943c5a.rlib
4783104 librustc_mir-bb943c5a.rlib
3534332 librustc_platform_intrinsics-bb943c5a.rlib
592710 librustc_privacy-bb943c5a.rlib
3123792 librustc_resolve-bb943c5a.rlib
14183434 librustc_trans-bb943c5a.rlib
11937016 librustc_typeck-bb943c5a.rlib
1830988 librustc_unicode-bb943c5a.rlib
15611582 librustdoc-bb943c5a.rlib
2892482 libserialize-bb943c5a.rlib
8642922 libstd-bb943c5a.rlib
30590774 libsyntax-bb943c5a.rlib
912678 libterm-bb943c5a.rlib
1369754 libtest-bb943c5a.rlib

8 years agoremove support method for synthetic default method ids
Niko Matsakis [Thu, 1 Oct 2015 15:10:30 +0000 (11:10 -0400)]
remove support method for synthetic default method ids

8 years agoshare stored predicates
Ariel Ben-Yehuda [Thu, 17 Sep 2015 15:05:30 +0000 (18:05 +0300)]
share stored predicates

while most of the duplication in predicates was caused by stubs,
this is still a 5% win on libcore.

567924 liballoc-bb943c5a.rlib
1425564 liballoc_jemalloc-bb943c5a.rlib
10520 liballoc_system-bb943c5a.rlib
154842 libarena-bb943c5a.rlib
4113790 libcollections-bb943c5a.rlib
18513674 libcore-bb943c5a.rlib
199466 libflate-bb943c5a.rlib
249548 libfmt_macros-bb943c5a.rlib
560488 libgetopts-bb943c5a.rlib
226772 libgraphviz-bb943c5a.rlib
442966 liblibc-bb943c5a.rlib
189884 liblog-bb943c5a.rlib
736764 librand-bb943c5a.rlib
609874 librbml-bb943c5a.rlib
1411678 librustc_back-bb943c5a.rlib
38770354 librustc-bb943c5a.rlib
12868 librustc_bitflags-bb943c5a.rlib
2327196 librustc_borrowck-bb943c5a.rlib
582178 librustc_data_structures-bb943c5a.rlib
9379344 librustc_driver-bb943c5a.rlib
9540324 librustc_front-bb943c5a.rlib
1614996 librustc_lint-bb943c5a.rlib
79217876 librustc_llvm-bb943c5a.rlib
4833518 librustc_mir-bb943c5a.rlib
3535794 librustc_platform_intrinsics-bb943c5a.rlib
603190 librustc_privacy-bb943c5a.rlib
3158032 librustc_resolve-bb943c5a.rlib
14300126 librustc_trans-bb943c5a.rlib
12024054 librustc_typeck-bb943c5a.rlib
1834852 librustc_unicode-bb943c5a.rlib
15611582 librustdoc-bb943c5a.rlib
2926594 libserialize-bb943c5a.rlib
8780060 libstd-bb943c5a.rlib
30772000 libsyntax-bb943c5a.rlib
917984 libterm-bb943c5a.rlib
1369754 libtest-bb943c5a.rlib

8 years agoadd a cross-reference index
Ariel Ben-Yehuda [Thu, 17 Sep 2015 13:04:18 +0000 (16:04 +0300)]
add a cross-reference index

it still does not *do* anything

8 years agoremove unneeded tags from metadata
Ariel Ben-Yehuda [Thu, 17 Sep 2015 09:30:04 +0000 (12:30 +0300)]
remove unneeded tags from metadata

stage1 release rlib sizes:
580890 liballoc-bb943c5a.rlib
1425558 liballoc_jemalloc-bb943c5a.rlib
10514 liballoc_system-bb943c5a.rlib
157192 libarena-bb943c5a.rlib
4316234 libcollections-bb943c5a.rlib
19580128 libcore-bb943c5a.rlib
199498 libflate-bb943c5a.rlib
249328 libfmt_macros-bb943c5a.rlib
560406 libgetopts-bb943c5a.rlib
233620 libgraphviz-bb943c5a.rlib
442964 liblibc-bb943c5a.rlib
190178 liblog-bb943c5a.rlib
778488 librand-bb943c5a.rlib
621972 librbml-bb943c5a.rlib
1415040 librustc_back-bb943c5a.rlib
38849082 librustc-bb943c5a.rlib
12862 librustc_bitflags-bb943c5a.rlib
2331690 librustc_borrowck-bb943c5a.rlib
616880 librustc_data_structures-bb943c5a.rlib
9386582 librustc_driver-bb943c5a.rlib
9600440 librustc_front-bb943c5a.rlib
1615058 librustc_lint-bb943c5a.rlib
79218480 librustc_llvm-bb943c5a.rlib
5020974 librustc_mir-bb943c5a.rlib
3535448 librustc_platform_intrinsics-bb943c5a.rlib
603640 librustc_privacy-bb943c5a.rlib
3163628 librustc_resolve-bb943c5a.rlib
14326646 librustc_trans-bb943c5a.rlib
12033174 librustc_typeck-bb943c5a.rlib
1838202 librustc_unicode-bb943c5a.rlib
15611582 librustdoc-bb943c5a.rlib
3056280 libserialize-bb943c5a.rlib
8954312 libstd-bb943c5a.rlib
30906736 libsyntax-bb943c5a.rlib
925480 libterm-bb943c5a.rlib
1377952 libtest-bb943c5a.rlib