]> git.lizzy.rs Git - rust.git/log
rust.git
9 years agoRemove two green threading tests
Brian Anderson [Fri, 6 Mar 2015 18:10:47 +0000 (10:10 -0800)]
Remove two green threading tests

9 years agoAuto merge of #22899 - huonw:macro-stability, r=alexcrichton
bors [Fri, 6 Mar 2015 05:20:11 +0000 (05:20 +0000)]
Auto merge of #22899 - huonw:macro-stability, r=alexcrichton

Unstable items used in a macro expansion will now always trigger
stability warnings, *unless* the unstable items are directly inside a
macro marked with `#[allow_internal_unstable]`. IOW, the compiler warns
unless the span of the unstable item is a subspan of the definition of a
macro marked with that attribute.

E.g.

    #[allow_internal_unstable]
    macro_rules! foo {
        ($e: expr) => {{
            $e;
            unstable(); // no warning
            only_called_by_foo!();
        }}
    }

    macro_rules! only_called_by_foo {
        () => { unstable() } // warning
    }

    foo!(unstable()) // warning

The unstable inside `foo` is fine, due to the attribute. But the
`unstable` inside `only_called_by_foo` is not, since that macro doesn't
have the attribute, and the `unstable` passed into `foo` is also not
fine since it isn't contained in the macro itself (that is, even though
it is only used directly in the macro).

In the process this makes the stability tracking much more precise,
e.g. previously `println!("{}", unstable())` got no warning, but now it
does. As such, this is a bug fix that may cause [breaking-change]s.

The attribute is definitely feature gated, since it explicitly allows
side-stepping the feature gating system.

---

This updates `thread_local!` macro to use the attribute, since it uses
unstable features internally (initialising a struct with unstable
fields).

9 years agoAuto merge of #23031 - Manishearth:rollup, r=Manishearth
bors [Thu, 5 Mar 2015 21:03:10 +0000 (21:03 +0000)]
Auto merge of #23031 - Manishearth:rollup, r=Manishearth

9 years agoAuto merge of #23026 - nikomatsakis:issue-20220-supertrait, r=nikomatsakis
bors [Thu, 5 Mar 2015 17:52:21 +0000 (17:52 +0000)]
Auto merge of #23026 - nikomatsakis:issue-20220-supertrait, r=nikomatsakis

The main gist of this PR is commit 1077efb which removes the list of supertraits from the `TraitDef` and pulls them into a separate table, which is accessed via `lookup_super_predicates`. This is analogous to `lookup_predicates`, which gets the complete where clause. This allows us to create the `TraitDef`, which contains the list generics and so forth, without fully knowing the list of supertraits. This in turn allows the *supertrait listing* to contain references to associated types like `<Self as Foo>::Item`, which were previously impossible because conversion required having the `TraitDef` for `Foo`.

We do not yet support `Self::Item` in a supertrait listing. This doesn't work because to convert that, it attempts to expand out the full set of supertraits, which are in the process of being created. This could potentially be worked out by having the expansion of supertraits proceed in a lazy fashion, but we'd have to define shadowing rules for associated types which we don't currently have.

Along the way (in 9de9ec5) I also removed the restriction against duplicate bounds and generalized the code so that it can handle having the same supertrait multiple times with different arguments, e.g. `Foo : Bar<i32> + Bar<u32>`. This restriction was serving no particular purpose, since the same trait could be extended multiple times indirectly, and in the era of multidispatch it is actively harmful.

This is technically a [breaking-change] because it affects the definition of a super-trait. Anything in a where clause that looks like `where Self : Foo` is now considered a supertrait. Because cycles are disallowed in supertraits, that could lead to some errors. This has not been observed in any existing code.

r? @nrc

9 years agoRun feature-gating on the final AST passed to the compiler.
Huon Wilson [Wed, 4 Mar 2015 07:05:38 +0000 (18:05 +1100)]
Run feature-gating on the final AST passed to the compiler.

This ensures we catch everything; previously, an unknown attribute
inserted by #[cfg_attr(...)] in a macro expansion would not be detected.

9 years agoAdd more debugging to syntax::feature_gate.
Huon Wilson [Wed, 4 Mar 2015 07:10:54 +0000 (18:10 +1100)]
Add more debugging to syntax::feature_gate.

9 years agoUse `#[allow_internal_unstable]` for `thread_local!`
Huon Wilson [Sun, 1 Mar 2015 03:09:42 +0000 (14:09 +1100)]
Use `#[allow_internal_unstable]` for `thread_local!`

This destabilises all the implementation details of `thread_local!`,
since they do not *need* to be stable with the new attribute.

9 years agoAdd #[allow_internal_unstable] to track stability for macros better.
Huon Wilson [Sun, 1 Mar 2015 03:09:28 +0000 (14:09 +1100)]
Add #[allow_internal_unstable] to track stability for macros better.

Unstable items used in a macro expansion will now always trigger
stability warnings, *unless* the unstable items are directly inside a
macro marked with `#[allow_internal_unstable]`. IOW, the compiler warns
unless the span of the unstable item is a subspan of the definition of a
macro marked with that attribute.

E.g.

    #[allow_internal_unstable]
    macro_rules! foo {
        ($e: expr) => {{
            $e;
            unstable(); // no warning
            only_called_by_foo!();
        }}
    }

    macro_rules! only_called_by_foo {
        () => { unstable() } // warning
    }

    foo!(unstable()) // warning

The unstable inside `foo` is fine, due to the attribute. But the
`unstable` inside `only_called_by_foo` is not, since that macro doesn't
have the attribute, and the `unstable` passed into `foo` is also not
fine since it isn't contained in the macro itself (that is, even though
it is only used directly in the macro).

In the process this makes the stability tracking much more precise,
e.g. previously `println!("{}", unstable())` got no warning, but now it
does. As such, this is a bug fix that may cause [breaking-change]s.

The attribute is definitely feature gated, since it explicitly allows
side-stepping the feature gating system.

9 years agoFix tag align tests for 32bit linux (fixes #7340)
Manish Goregaokar [Thu, 5 Mar 2015 11:39:12 +0000 (17:09 +0530)]
Fix tag align tests for 32bit linux (fixes #7340)

9 years agoAddress nits by @nrc.
Niko Matsakis [Thu, 5 Mar 2015 10:46:12 +0000 (05:46 -0500)]
Address nits by @nrc.

9 years agoRollup merge of #23033 - pelmers:patch-3, r=steveklabnik
Manish Goregaokar [Wed, 4 Mar 2015 20:51:03 +0000 (02:21 +0530)]
Rollup merge of #23033 - pelmers:patch-3, r=steveklabnik

 I came across a couple of grammar mistakes when refreshing myself on enums.

9 years agoRollup merge of #23029 - vhbit:ios-env-stab, r=alexcrichton
Manish Goregaokar [Wed, 4 Mar 2015 20:50:58 +0000 (02:20 +0530)]
Rollup merge of #23029 - vhbit:ios-env-stab, r=alexcrichton

   "body": null,

9 years agoRollup merge of #23027 - fenhl:patch-1, r=sfackler
Manish Goregaokar [Wed, 4 Mar 2015 20:50:53 +0000 (02:20 +0530)]
Rollup merge of #23027 - fenhl:patch-1, r=sfackler

 The docs for `std::time::duration::Duration::weeks` were formatted incorrectly.

9 years agoRollup merge of #23006 - dhuseby:master, r=alexcrichton
Manish Goregaokar [Wed, 4 Mar 2015 20:50:40 +0000 (02:20 +0530)]
Rollup merge of #23006 - dhuseby:master, r=alexcrichton

 as the subject says.

9 years agoRollup merge of #22947 - ic:master, r=steveklabnik
Manish Goregaokar [Wed, 4 Mar 2015 20:50:14 +0000 (02:20 +0530)]
Rollup merge of #22947 - ic:master, r=steveklabnik

 Changed guaranteed for \"quaranteed\", and
Made failing/working examples look alike.

r? @steveklabnik

9 years agoRollup merge of #22937 - MDCox:str-docs, r=steveklabnik
Manish Goregaokar [Wed, 4 Mar 2015 20:49:57 +0000 (02:19 +0530)]
Rollup merge of #22937 - MDCox:str-docs, r=steveklabnik

 Fixes #22902
r? @steveklabnik

9 years agoRollup merge of #22994 - eddyb:unsuffix-ints-good, r=alexcrichton
Manish Goregaokar [Wed, 4 Mar 2015 20:49:40 +0000 (02:19 +0530)]
Rollup merge of #22994 - eddyb:unsuffix-ints-good, r=alexcrichton

 Automatic has-same-types testing methodology can be found in #22501.
Because most of them don't work with `--pretty=typed`, compile-fail tests were manually audited.

r? @aturon

9 years agoMove span in error (fixup #22764)
Manish Goregaokar [Wed, 4 Mar 2015 20:02:48 +0000 (01:32 +0530)]
Move span in error (fixup #22764)

9 years agoRollup merge of #23006 - dhuseby:master, r=alexcrichton
Manish Goregaokar [Wed, 4 Mar 2015 16:34:21 +0000 (22:04 +0530)]
Rollup merge of #23006 - dhuseby:master, r=alexcrichton

 as the subject says.

9 years agoupdating llvm-auto-clean-trigger too
Dave Huseby [Wed, 4 Mar 2015 15:50:34 +0000 (07:50 -0800)]
updating llvm-auto-clean-trigger too

9 years agoadding bitrig snapshot to snapshots file
Dave Huseby [Wed, 4 Mar 2015 06:51:36 +0000 (22:51 -0800)]
adding bitrig snapshot to snapshots file

9 years agobumping again to get the updated configure
Dave Huseby [Wed, 4 Mar 2015 00:17:20 +0000 (16:17 -0800)]
bumping again to get the updated configure

9 years agobumping the jemalloc revision to include the bitrig changes
Dave Huseby [Wed, 4 Mar 2015 00:03:21 +0000 (16:03 -0800)]
bumping the jemalloc revision to include the bitrig changes

9 years agoRollup merge of #22973 - djmally:coll_docs, r=Gankro
Manish Goregaokar [Wed, 4 Mar 2015 16:33:47 +0000 (22:03 +0530)]
Rollup merge of #22973 - djmally:coll_docs, r=Gankro

9 years agoupdating llvm submodule to include bitrig support
Dave Huseby [Tue, 3 Mar 2015 22:04:13 +0000 (14:04 -0800)]
updating llvm submodule to include bitrig support

9 years agoRollup merge of #22994 - eddyb:unsuffix-ints-good, r=alexcrichton
Manish Goregaokar [Wed, 4 Mar 2015 16:33:15 +0000 (22:03 +0530)]
Rollup merge of #22994 - eddyb:unsuffix-ints-good, r=alexcrichton

 Automatic has-same-types testing methodology can be found in #22501.
Because most of them don't work with `--pretty=typed`, compile-fail tests were manually audited.

r? @aturon

9 years agoFix compile-fail error messages after integer suffix removal.
Eduard Burtescu [Wed, 4 Mar 2015 13:48:33 +0000 (15:48 +0200)]
Fix compile-fail error messages after integer suffix removal.

9 years agoRemove integer suffixes where the types in compiled code are identical.
Eduard Burtescu [Tue, 3 Mar 2015 08:42:26 +0000 (10:42 +0200)]
Remove integer suffixes where the types in compiled code are identical.

9 years agoRollup merge of #22764 - ivanradanov:fileline_help, r=huonw
Manish Goregaokar [Wed, 4 Mar 2015 12:19:26 +0000 (17:49 +0530)]
Rollup merge of #22764 - ivanradanov:fileline_help, r=huonw

 When warnings and errors occur, the associated help message should not print the same code snippet.
https://github.com/rust-lang/rust/issues/21938

9 years agoRollup merge of #23018 - sanxiyn:quote-question, r=huonw
Manish Goregaokar [Wed, 4 Mar 2015 10:17:12 +0000 (15:47 +0530)]
Rollup merge of #23018 - sanxiyn:quote-question, r=huonw

 Fix #22957.

9 years agoFix quoting of ?Sized
Seo Sanghyeon [Wed, 4 Mar 2015 05:58:35 +0000 (14:58 +0900)]
Fix quoting of ?Sized

9 years agoRollup merge of #23013 - nikomatsakis:syncbox, r=pnkfelix
Manish Goregaokar [Wed, 4 Mar 2015 10:17:02 +0000 (15:47 +0530)]
Rollup merge of #23013 - nikomatsakis:syncbox, r=pnkfelix

 When generating WF criteria, do not visit the same type more than once. Fixes an infinite stack overflow (#23003).

r? @aturon

9 years agoRollup merge of #23004 - alexcrichton:libc-stable, r=brson
Manish Goregaokar [Wed, 4 Mar 2015 10:16:51 +0000 (15:46 +0530)]
Rollup merge of #23004 - alexcrichton:libc-stable, r=brson

 This same source is being built in the Cargo ecosystem and hence needs to build
on stable Rust as well. This commit places the `no_std` attribute along with the
`no_std` feature behind a `cfg_attr` flag so they are not processed when
compiled on crates.io

9 years agoRollup merge of #23001 - alexcrichton:index-output-stable, r=nikomatsakis
Manish Goregaokar [Wed, 4 Mar 2015 10:16:35 +0000 (15:46 +0530)]
Rollup merge of #23001 - alexcrichton:index-output-stable, r=nikomatsakis

 This stability attribute was left out by accident and the stability pass has
since picked up the ability to check for this. As a result, crates are currently
getting warnings for implementations of `Index`.

9 years agoRollup merge of #23000 - Florob:unicode-FL, r=brson
Manish Goregaokar [Wed, 4 Mar 2015 10:16:17 +0000 (15:46 +0530)]
Rollup merge of #23000 - Florob:unicode-FL, r=brson

 This handles the ranges contained in UnicodeData.txt.
Counterintuitively this actually makes the tables shorter.

9 years agoRollup merge of #22939 - bleibig:grammar-updates, r=sanxiyn
Manish Goregaokar [Wed, 4 Mar 2015 10:16:07 +0000 (15:46 +0530)]
Rollup merge of #22939 - bleibig:grammar-updates, r=sanxiyn

 Updates to the bison grammar to account for recent grammar additions and new tests. In particular:

* Support parsing `impl MyTrait for .. { }`
* Support parsing ExprQualifiedPaths without \"as TRAIT_REF\" such as `<Foo>::bar(&Foo)`
* Support parsing \"for\" clauses at the beginning of where clauses such as `where for<'a, 'b> &'a T: Bar<'b>`

9 years agoRollup merge of #22029 - iKevinY:tidy-changes, r=brson
Manish Goregaokar [Wed, 4 Mar 2015 10:15:53 +0000 (15:45 +0530)]
Rollup merge of #22029 - iKevinY:tidy-changes, r=brson

 Currently, the list of files linted in `tidy.py` is unordered. It seems more appropriate for more frequently appearing files (like `.rs`) to appear at the top of the list and for \"other files\" to appear at the very end. This PR also changes the wildcard import of `check_license()` into an explicit one.

```
Before:                     After:
* linted 4 .sh files        * linted 5034 .rs files
* linted 4 .h files         * linted 29 .c files
* linted 29 .c files        * linted 28 .py files
* linted 2 .js files        * linted 4 .sh files
* linted 0 other files      * linted 4 .h files
* linted 28 .py files       * linted 2 .js files
* linted 5034 .rs files     * linted 0 other files
```

r? @brson

9 years agoAuto merge of #22061 - pczarn:quote_matcher_and_attr, r=kmcallister
bors [Thu, 5 Mar 2015 04:32:51 +0000 (04:32 +0000)]
Auto merge of #22061 - pczarn:quote_matcher_and_attr, r=kmcallister

Fixes #19674
Fixes #17396 (already closed, yeah)

cc @kmcallister , @cmr

9 years agoAuto merge of #22873 - alexcrichton:deprecate-fs, r=aturon
bors [Thu, 5 Mar 2015 01:19:15 +0000 (01:19 +0000)]
Auto merge of #22873 - alexcrichton:deprecate-fs, r=aturon

This commit deprecates the majority of std::old_io::fs in favor of std::fs and
its new functionality. Some functions remain non-deprecated but are now behind a
feature gate called `old_fs`. These functions will be deprecated once
suitable replacements have been implemented.

The compiler has been migrated to new `std::fs` and `std::path` APIs where
appropriate as part of this change.

[breaking-change]

9 years agostd: Deprecate std::old_io::fs
Alex Crichton [Fri, 27 Feb 2015 05:00:43 +0000 (21:00 -0800)]
std: Deprecate std::old_io::fs

This commit deprecates the majority of std::old_io::fs in favor of std::fs and
its new functionality. Some functions remain non-deprecated but are now behind a
feature gate called `old_fs`. These functions will be deprecated once
suitable replacements have been implemented.

The compiler has been migrated to new `std::fs` and `std::path` APIs where
appropriate as part of this change.

9 years agoAdd tests related to #20220. Fixes #20220.
Niko Matsakis [Tue, 3 Mar 2015 19:36:54 +0000 (14:36 -0500)]
Add tests related to #20220. Fixes #20220.

9 years agoGeneralize the code so we can handle multiple supertraits.
Niko Matsakis [Tue, 3 Mar 2015 13:01:13 +0000 (08:01 -0500)]
Generalize the code so we can handle multiple supertraits.
Fixes #10596. Fixes #22279.

9 years agoSeparate supertrait collection from processing a `TraitDef`. This allows
Niko Matsakis [Tue, 24 Feb 2015 14:24:42 +0000 (09:24 -0500)]
Separate supertrait collection from processing a `TraitDef`. This allows
us to construct trait-references and do other things without forcing a
full evaluation of the supertraits. One downside of this scheme is that
we must invoke `ensure_super_predicates` before using any construct that
might require knowing about the super-predicates.

9 years agoExtract out trait_defines_associated_type_named into the AstConv
Niko Matsakis [Wed, 4 Mar 2015 00:44:18 +0000 (19:44 -0500)]
Extract out trait_defines_associated_type_named into the AstConv
interface, so that we can perform this query without requiring a full
trait def or set of supertraits.

9 years agoExtend the "treat-err-as-bug" option to cover calls to fatal.
Niko Matsakis [Wed, 4 Mar 2015 00:43:31 +0000 (19:43 -0500)]
Extend the "treat-err-as-bug" option to cover calls to fatal.

9 years agoExtract out the `filter_to_traits` functionality
Niko Matsakis [Mon, 23 Feb 2015 20:30:14 +0000 (15:30 -0500)]
Extract out the `filter_to_traits` functionality

9 years agoSimplify impl of Elaborator now that we don't need stack traces anymore.
Niko Matsakis [Mon, 23 Feb 2015 20:00:49 +0000 (15:00 -0500)]
Simplify impl of Elaborator now that we don't need stack traces anymore.

9 years agoFix grammar nits in compound-data-types.md
Peter Elmers [Wed, 4 Mar 2015 17:02:31 +0000 (11:02 -0600)]
Fix grammar nits in compound-data-types.md

I came across a couple of grammar mistakes when refreshing myself on enums.

9 years agoReword str docs and include links to StrExt
Matt Cox [Wed, 4 Mar 2015 16:15:58 +0000 (08:15 -0800)]
Reword str docs and include links to StrExt

9 years agoupdating llvm-auto-clean-trigger too
Dave Huseby [Wed, 4 Mar 2015 15:50:34 +0000 (07:50 -0800)]
updating llvm-auto-clean-trigger too

9 years agoiOS: fallout of env stab
Valerii Hiora [Wed, 4 Mar 2015 12:18:40 +0000 (14:18 +0200)]
iOS: fallout of env stab

9 years agoAdd quasiquote for matchers and attributes
Piotr Czarnecki [Tue, 24 Feb 2015 18:56:01 +0000 (19:56 +0100)]
Add quasiquote for matchers and attributes

9 years agoAuto merge of #22235 - michaelwoerister:cross-crate-spans, r=michaelwoerister
bors [Wed, 4 Mar 2015 14:47:51 +0000 (14:47 +0000)]
Auto merge of #22235 - michaelwoerister:cross-crate-spans, r=michaelwoerister

This allows to create proper debuginfo line information for items inlined from other crates (e.g. instantiations of generics). Only the codemap's 'metadata' is stored in a crate's metadata. That is, just filename, positions of line-beginnings, etc. but not the actual source code itself.

Crate metadata size is increased by this change because spans in the encoded ASTs take up space now:
```
                BEFORE    AFTER
libcore         36 MiB    39.6 MiB    +10%
libsyntax       51.1 MiB  60.5 MiB    +18.4%
libcollections  11.2 MiB  12.8 MiB    +14.3%
```
This only affects binaries containing metadata (rlibs and dylibs), executables should not be affected in size.

Fixes #19228 and probably #22226.

9 years agoFix compile-fail error messages after integer suffix removal.
Eduard Burtescu [Wed, 4 Mar 2015 13:48:33 +0000 (15:48 +0200)]
Fix compile-fail error messages after integer suffix removal.

9 years agoAuto merge of #22920 - tshepang:remove-some-warnings, r=huonw
bors [Wed, 4 Mar 2015 12:16:51 +0000 (12:16 +0000)]
Auto merge of #22920 - tshepang:remove-some-warnings, r=huonw

9 years agoFix Duration::weeks docs
Fenhl [Wed, 4 Mar 2015 12:16:37 +0000 (12:16 +0000)]
Fix Duration::weeks docs

The docs for `std::duration::Duration::weeks` were formatted incorrectly.

9 years agoAuto merge of #22958 - laijs:option_map_for_iter_map, r=alexcrichton
bors [Wed, 4 Mar 2015 09:46:29 +0000 (09:46 +0000)]
Auto merge of #22958 - laijs:option_map_for_iter_map, r=alexcrichton

Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
9 years agoEncode codemap and span information in crate metadata.
Michael Woerister [Wed, 11 Feb 2015 17:29:49 +0000 (18:29 +0100)]
Encode codemap and span information in crate metadata.

This allows to create proper debuginfo line information for items inlined from other crates (e.g. instantiations of generics).
Only the codemap's 'metadata' is stored in a crate's metadata. That is, just filename, line-beginnings, etc. but not the actual source code itself. We are thus missing the opportunity of making Rust the first "open-source-only" programming language out there. Pity.

9 years agoadding bitrig snapshot to snapshots file
Dave Huseby [Wed, 4 Mar 2015 06:51:36 +0000 (22:51 -0800)]
adding bitrig snapshot to snapshots file

9 years agobumping again to get the updated configure
Dave Huseby [Wed, 4 Mar 2015 00:17:20 +0000 (16:17 -0800)]
bumping again to get the updated configure

9 years agobumping the jemalloc revision to include the bitrig changes
Dave Huseby [Wed, 4 Mar 2015 00:03:21 +0000 (16:03 -0800)]
bumping the jemalloc revision to include the bitrig changes

9 years agoupdating llvm submodule to include bitrig support
Dave Huseby [Tue, 3 Mar 2015 22:04:13 +0000 (14:04 -0800)]
updating llvm submodule to include bitrig support

9 years agoRemove integer suffixes where the types in compiled code are identical.
Eduard Burtescu [Tue, 3 Mar 2015 08:42:26 +0000 (10:42 +0200)]
Remove integer suffixes where the types in compiled code are identical.

9 years agoMade failing/working examples look alike.
Eric Platon [Mon, 2 Mar 2015 06:15:24 +0000 (15:15 +0900)]
Made failing/working examples look alike.

The failing concurrency example was doing something different from the
working example. This commit changes just enough of the failing example
to (1) still fail with the same error, (2) tries to do the same as the
working example (increment a vector value and print it).

r? @steveklabnik

9 years agoWhen generating WF criteria, do not visit the same type more than
Niko Matsakis [Wed, 4 Mar 2015 00:27:50 +0000 (19:27 -0500)]
When generating WF criteria, do not visit the same type more than
once. Fixes an infinite stack overflow (#23003).

9 years agolibc: Move features behind a cfg_attr gate
Alex Crichton [Tue, 3 Mar 2015 21:05:55 +0000 (13:05 -0800)]
libc: Move features behind a cfg_attr gate

This same source is being built in the Cargo ecosystem and hence needs to build
on stable Rust as well. This commit places the `no_std` attribute along with the
`no_std` feature behind a `cfg_attr` flag so they are not processed when
compiled on crates.io

9 years agoAuto merge of #23002 - pnkfelix:fsk-box-place-runway, r=nikomatsakis
bors [Tue, 3 Mar 2015 20:17:08 +0000 (20:17 +0000)]
Auto merge of #23002 - pnkfelix:fsk-box-place-runway, r=nikomatsakis

Runway for RFC 809 (overloaded box/placement-in) by adding type annotations or explicit calls to `Box::new` where I found it necessary on PR #22086.

I have broken this up into more than one PR because the entire commit chain (see PR #22086) is long, widespread and unwieldy to rebase frequently.

To my knowledge this is not a breaking change.  Also, there is in principle nothing stopping someone from reverting some/all of these annotations, since without the rest of the commit chain in #22086, the associated code would continue to compile.

All I can do is ask: Try to discourage others from removing seemingly "unnecessary" uses of the `Box` type or the `Box::new()` function, until the rest of RFC 809 lands.

9 years agoFix doc example to accommodate overloaded-box.
Felix S. Klock II [Thu, 26 Feb 2015 17:27:11 +0000 (18:27 +0100)]
Fix doc example to accommodate overloaded-box.

9 years agoSwitched to Box::new in many places.
Felix S. Klock II [Sun, 15 Feb 2015 08:52:21 +0000 (09:52 +0100)]
Switched to Box::new in many places.

Many of the modifications putting in `Box::new` calls also include a
pointer to Issue 22405, which tracks going back to `box <expr>` if
possible in the future.

(Still tried to use `Box<_>` where it sufficed; thus some tests still
have `box_syntax` enabled, as they use a mix of `box` and `Box::new`.)

Precursor for overloaded-`box` and placement-`in`; see Issue 22181.

9 years agoinline `Box::new` always.
Felix S. Klock II [Mon, 16 Feb 2015 10:53:29 +0000 (11:53 +0100)]
inline `Box::new` always.

(You shouldn't use it, but it is a semi-reasonable way to annotate
types when necessary.)

9 years agoAdd `: Box<_>` or `::Box<_>` type annotations to various places.
Felix S. Klock II [Tue, 17 Feb 2015 20:41:32 +0000 (21:41 +0100)]
Add `: Box<_>` or `::Box<_>` type annotations to various places.

This is the kind of change that one is expected to need to make to
accommodate overloaded-`box`.

----

Note that this is not *all* of the changes necessary to accommodate
Issue 22181.  It is merely the subset of those cases where there was
already a let-binding in place that made it easy to add the necesasry
type ascription.

(For unnamed intermediate `Box` values, one must go down a different
route; `Box::new` is the option that maximizes portability, but has
potential inefficiency depending on whether the call is inlined.)

----

There is one place worth note, `run-pass/coerce-match.rs`, where I
used an ugly form of `Box<_>` type ascription where I would have
preferred to use `Box::new` to accommodate overloaded-`box`.  I
deliberately did not use `Box::new` here, because that is already done
in coerce-match-calls.rs.

----

Precursor for overloaded-`box` and placement-`in`; see Issue 22181.

9 years agostd: Mark `Index::Output` as a stable associated type
Alex Crichton [Tue, 3 Mar 2015 19:28:57 +0000 (11:28 -0800)]
std: Mark `Index::Output` as a stable associated type

This stability attribute was left out by accident and the stability pass has
since picked up the ability to check for this. As a result, crates are currently
getting warnings for implementations of `Index`.

9 years agounicode: Properly parse ranges in UnicodeData.txt
Florian Zeitz [Tue, 3 Mar 2015 17:35:41 +0000 (18:35 +0100)]
unicode: Properly parse ranges in UnicodeData.txt

This handles the ranges contained in UnicodeData.txt.
Counterintuitively this actually makes the tables shorter.

9 years agoAuto merge of #22997 - pnkfelix:make-timestamps-robust-to-concurrent-edits, r=nikomat...
bors [Tue, 3 Mar 2015 17:07:57 +0000 (17:07 +0000)]
Auto merge of #22997 - pnkfelix:make-timestamps-robust-to-concurrent-edits, r=nikomatsakis

Make build timestamp files robust in face of concurrent source modification.

Strategy: If the end goal is to touch e.g. `stamp.std`, then we first touch `stamp.std.start_time` before doing anything else.  Then when the receipe finishes, we touch `stamp.std` using the timestamp from `stamp.std.start_time` as the reference time, and remove `stamp.std.start_time`.

Fix #6518.

9 years agoAuto merge of #22532 - pnkfelix:arith-overflow, r=pnkfelix,eddyb
bors [Tue, 3 Mar 2015 14:18:03 +0000 (14:18 +0000)]
Auto merge of #22532 - pnkfelix:arith-overflow, r=pnkfelix,eddyb

Rebase and follow-through on work done by @cmr and @aatch.

Implements most of rust-lang/rfcs#560. Errors encountered from the checks during building were fixed.

The checks for division, remainder and bit-shifting have not been implemented yet.

See also PR #20795

cc @Aatch ; cc @nikomatsakis

9 years agoMake build timestamp files robust in face of concurrent source modification.
Felix S. Klock II [Tue, 3 Mar 2015 14:11:01 +0000 (15:11 +0100)]
Make build timestamp files robust in face of concurrent source modification.

Strategy: If the end goal is to touch e.g. `stamp.std`, then we first
touch `stamp.std.start_time` before doing anything else.  Then when
the receipe finishes, we touch `stamp.std` using the timestamp from
`stamp.std.start_time` as the reference time, and remove
`stamp.std.start_time`.

Fix #6518.

9 years agoChange span_help calls to fileline_help where appropriate
Ivan Radanov Ivanov [Tue, 24 Feb 2015 14:07:54 +0000 (16:07 +0200)]
Change span_help calls to fileline_help where appropriate

9 years agosidestep potential over- and underflow in estimated stack bounds.
Felix S. Klock II [Tue, 3 Mar 2015 11:07:48 +0000 (12:07 +0100)]
sidestep potential over- and underflow in estimated stack bounds.

See buildlog here for evidence of such occurring:
  http://buildbot.rust-lang.org/builders/auto-linux-32-opt/builds/3910/steps/test/logs/stdio

9 years agoAuto merge of #22995 - Manishearth:rollup, r=Manishearth
bors [Tue, 3 Mar 2015 11:32:11 +0000 (11:32 +0000)]
Auto merge of #22995 - Manishearth:rollup, r=Manishearth

9 years agoRollup merge of #22988 - dcrewi:slice-swap-inline, r=alexcrichton
Manish Goregaokar [Tue, 3 Mar 2015 08:49:09 +0000 (14:19 +0530)]
Rollup merge of #22988 - dcrewi:slice-swap-inline, r=alexcrichton

9 years agoRollup merge of #22982 - tbu-:pr_fixup_22510, r=Manishearth
Manish Goregaokar [Tue, 3 Mar 2015 08:47:32 +0000 (14:17 +0530)]
Rollup merge of #22982 - tbu-:pr_fixup_22510, r=Manishearth

r? @Manishearth

9 years agoRollup merge of #22977 - kmcallister:issue-15778, r=sfackler
Manish Goregaokar [Tue, 3 Mar 2015 08:43:46 +0000 (14:13 +0530)]
Rollup merge of #22977 - kmcallister:issue-15778, r=sfackler

 Fixes #15778.

r? @sfackler

9 years agoRevert incorrect `usize` -> `u32` replacements from #22510
Tobias Bucher [Mon, 2 Mar 2015 22:56:13 +0000 (23:56 +0100)]
Revert incorrect `usize` -> `u32` replacements from #22510

Conflicts:
src/libstd/thread.rs

9 years agoRollup merge of #22974 - nagisa:reintuint-std, r=alexcrichton
Manish Goregaokar [Tue, 3 Mar 2015 08:43:35 +0000 (14:13 +0530)]
Rollup merge of #22974 - nagisa:reintuint-std, r=alexcrichton

 Reverts a small part of c74d49c804c3 because compilation pukes with warnings now.

9 years agoRollup merge of #22970 - pnkfelix:fsk-robust-backtrace-test-against-env, r=alexcrichton
Manish Goregaokar [Tue, 3 Mar 2015 08:43:25 +0000 (14:13 +0530)]
Rollup merge of #22970 - pnkfelix:fsk-robust-backtrace-test-against-env, r=alexcrichton

 Make `test/run-pass/backtrace.rs` more robust about own host environment

Namely, I have been annoyed in the past when I have done `RUST_BACKTRACE=1 make check` only to discover (again) that such a trick causes this test to fail, because it assumes that the `RUST_BACKTRACE` environment variable is not set.

Fix #22870

9 years agoRollup merge of #22956 - ejjeong:aarch64-linux-android, r=alexcrichton
Manish Goregaokar [Tue, 3 Mar 2015 08:43:17 +0000 (14:13 +0530)]
Rollup merge of #22956 - ejjeong:aarch64-linux-android, r=alexcrichton

 aarch64-linux-android build has been broken since #22839.
Aarch64 android has _Unwind_GetIPInfo, so re-define this only for arm32 android.
r? @alexcrichton

9 years agoRollup merge of #22952 - huonw:missing-stable, r=alexcrichton
Manish Goregaokar [Tue, 3 Mar 2015 08:43:09 +0000 (14:13 +0530)]
Rollup merge of #22952 - huonw:missing-stable, r=alexcrichton

 Unstable is the conservative choice.

cc #22950.

9 years agoRollup merge of #22951 - huonw:weak-chuck-slice, r=alexcrichton
Manish Goregaokar [Tue, 3 Mar 2015 08:43:01 +0000 (14:13 +0530)]
Rollup merge of #22951 - huonw:weak-chuck-slice, r=alexcrichton

 `#[derive(Clone)]` unnecessarily requires the element type to also be
`Clone`.

9 years agoRollup merge of #22876 - Florob:const, r=nikomatsakis
Manish Goregaokar [Tue, 3 Mar 2015 08:42:53 +0000 (14:12 +0530)]
Rollup merge of #22876 - Florob:const, r=nikomatsakis

 This changes the type of some public constants/statics in libunicode.
Notably some `&'static &'static [(char, char)]` have changed
to `&'static [(char, char)]`. The regexp crate seems to be the
sole user of these, yet this is technically a [breaking-change]

9 years agoRollup merge of #22990 - japaric:privATe, r=alexcrichton
Manish Goregaokar [Tue, 3 Mar 2015 08:42:44 +0000 (14:12 +0530)]
Rollup merge of #22990 - japaric:privATe, r=alexcrichton

 Associated types are now treated as part of the public API by the privacy checker.

If you were exposing a private type in your public API via an associated type, make that type public:

``` diff
  pub struct PublicType { .. }

- struct Struct { .. }
+ pub struct Struct { .. }

  pub trait PublicTrait {
      type Output;

      fn foo(&self) -> Self::Output;
  }

  impl PublicTrait for PublicType {
      type Output = Struct;

      fn foo(&self) -> Struct {  // `Struct` is part of the public API, it must be marked as `pub`lic
          ..
      }
  }
```

[breaking-change]

---

r? @nikomatsakis
closes #22912

9 years agoRollup merge of #22989 - laijs:fix_FromStr_bool_comment, r=alexcrichton
Manish Goregaokar [Tue, 3 Mar 2015 08:42:36 +0000 (14:12 +0530)]
Rollup merge of #22989 - laijs:fix_FromStr_bool_comment, r=alexcrichton

 Fix the return type in the comments.

An old commit 082bfde41217 (\"Fallout of std::str stabilization\") removed
the example of FromStr::from_str(), this commit adds it back. But
the example of StrExt::parse() is still kept with an additinal note.

Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
9 years agoRollup merge of #22969 - dotdash:no_alloca_zeroed, r=huonw
Manish Goregaokar [Tue, 3 Mar 2015 08:42:27 +0000 (14:12 +0530)]
Rollup merge of #22969 - dotdash:no_alloca_zeroed, r=huonw

 Its only user was lvalue_scratch_datum which is called with zero=true
anymore, so it's effectively unused.

9 years agoRollup merge of #22960 - huonw:static-assert, r=huonw
Manish Goregaokar [Tue, 3 Mar 2015 08:42:18 +0000 (14:12 +0530)]
Rollup merge of #22960 - huonw:static-assert, r=huonw

 The API this exposes is a little strange (being attached to `static`s),
so it makes sense to conservatively feature gate it. If it is highly
popular, it is possible to reverse this gating.

9 years agoRollup merge of #22943 - ipetkov:lint-recursion, r=alexcrichton
Manish Goregaokar [Tue, 3 Mar 2015 08:42:12 +0000 (14:12 +0530)]
Rollup merge of #22943 - ipetkov:lint-recursion, r=alexcrichton

 * The lint visitor's visit_ty method did not recurse, and had a
  reference to the now closed #10894
* The newly enabled recursion has only affected the `deprectated` lint
  which now detects uses of deprecated items in trait impls and
  function return types
* Renamed some references to `CowString` and `CowVec` to `Cow<str>` and
  `Cow<[T]>`, respectively, which appear outside of the crate which
  defines them
* Replaced a few instances of `InvariantType<T>` with
  `PhantomData<Cell<T>>`
* Disabled the `deprecated` lint in several places that
  reference/implement traits on deprecated items which will get cleaned
  up in the future
* Unfortunately, this means that if a library declares
  `#![deny(deprecated)]` and marks anything as deprecated, it will have
  to disable the lint for any uses of said item, e.g. any impl the now
  deprecated item

For any library that denies deprecated items but has deprecated items
of its own, this is a [breaking-change]

I had originally intended for the lint to ignore uses of deprecated items that are declared in the same crate, but this goes against some previous test cases that expect the lint to capture *all* uses of deprecated items, so I maintained the previous approach to avoid changing the expected behavior of the lint.

Tested locally on OS X, so hopefully there aren't any deprecated item uses behind a `cfg` that I may have missed.

9 years agoRollup merge of #22916 - rprichard:fmt-num-cleanup, r=alexcrichton
Manish Goregaokar [Tue, 3 Mar 2015 08:42:05 +0000 (14:12 +0530)]
Rollup merge of #22916 - rprichard:fmt-num-cleanup, r=alexcrichton

  * Make num::UpperHex private.  I was unable to determine why this struct
   is public.  The num module itself is not public, and the UpperHex struct
   is not referenced anywhere in the core::fmt module.  (Only the UpperHex
   trait is reference.)  num::LowerHex is not public.

 * Remove the suffix parameters from the macros that generate integral
   display traits.

   The code to print the Debug::fmt suffixes was removed when Show was
   renamed to Debug.  It was an intentional change.  From RFC 0565:

    * Focus on the *runtime* aspects of a type; repeating information such
      as suffixes for integer literals is not generally useful since that
      data is readily available from the type definition.

 * Because Show was renamed to Debug, rename show! to debug!.

9 years agoFix backtrace tests for Linux
Manish Goregaokar [Mon, 2 Mar 2015 10:41:01 +0000 (16:11 +0530)]
Fix backtrace tests for Linux

9 years agoIncorporated second review suggestion from eddyb.
Felix S. Klock II [Sun, 1 Mar 2015 11:29:46 +0000 (12:29 +0100)]
Incorporated second review suggestion from eddyb.

9 years agoIncorporated first review sugestion from eddyb.
Felix S. Klock II [Fri, 27 Feb 2015 17:16:30 +0000 (18:16 +0100)]
Incorporated first review sugestion from eddyb.

Suggestion was here:

  https://github.com/rust-lang/rust/pull/22532#discussion_r25505609

9 years agoFix span typo in the arithmetic overflow for array length reporting.
Felix S. Klock II [Fri, 27 Feb 2015 16:24:22 +0000 (17:24 +0100)]
Fix span typo in the arithmetic overflow for array length reporting.

Added pair of regression tests that I should have made when I thought
of doing this in the first place.

9 years agoUpdate tests for const-eval error handling changes.
Felix S. Klock II [Sun, 22 Feb 2015 15:38:22 +0000 (16:38 +0100)]
Update tests for const-eval error handling changes.