Commit Graph

64634 Commits

Author SHA1 Message Date
Venkata Giri Reddy
95436c6d89 regression test for #37665
regression test for #37550
2017-05-25 21:33:58 -04:00
bors
4f9c9ed1a5 Auto merge of #40847 - jseyfried:decl_macro, r=nrc
Initial implementation of declarative macros 2.0

Implement declarative macros 2.0 (rust-lang/rfcs#1584) behind `#![feature(decl_macro)]`.
Differences from `macro_rules!` include:
 - new syntax: `macro m(..) { .. }` instead of `macro_rules! m { (..) => { .. } }`
 - declarative macros are items:
```rust
// crate A:
pub mod foo {
    m!(); // use before definition; declaration order is irrelevant
    pub macro m() {} // `pub`, `pub(super)`, etc. work
}
fn main() {
    foo::m!(); // named like other items
    { use foo::m as n; n!(); } // imported like other items
}
pub use foo::m; // re-exported like other items

// crate B:
extern crate A; // no need for `#[macro_use]`
A::foo::m!(); A::m!();
```
 - Racket-like hygiene for items, imports, methods, fields, type parameters, privacy, etc.
   - Intuitively, names in a macro definition are resolved in the macro definition's scope, not the scope in which the macro is used.
   - This [explaination](http://beautifulracket.com/explainer/hygiene.html) of hygiene for Racket applies here (except for the "Breaking Hygiene" section). I wrote a similar [explanation](https://github.com/jseyfried/rfcs/blob/hygiene/text/0000-hygiene.md) for Rust.
   - Generally speaking, if `fn f() { <body> }` resolves, `pub macro m() { <body> } ... m!()` also resolves, even if `m!()` is in a separate crate.
   - `::foo::bar` in a `macro` behaves like `$crate::foo::bar` in a `macro_rules!`, except it can access everything visible from the `macro` (thus more permissive).
   - See [`src/test/{run-pass, compile-fail}/hygiene`](afe7d89858) for examples. Small example:
```rust
mod foo {
    fn f() { println!("hello world"); }
    pub macro m() { f(); }
}
fn main() { foo::m!(); }
```

Limitations:
 - This does not address planned changes to matchers (`expr`,`ty`, etc.), c.f. #26361.
 - Lints (including stability and deprecation) and `unsafe` are not hygienic.
   - adding hygiene here will be mostly or entirely backwards compatible
 - Nested macro definitions (a `macro` inside another `macro`) don't always work correctly when invoked from external crates.
   - pending improvements in how we encode macro definitions in crate metadata
 - There is no way to "escape" hygiene without using a procedural macro.

r? @nrc
2017-05-25 22:31:34 +00:00
Venkata Giri Reddy
9ee9abcdbd regression test for #38160 2017-05-25 17:43:25 -04:00
Venkata Giri Reddy
04ac7c3345 regression test for #39362 2017-05-25 17:36:59 -04:00
Jeffrey Seyfried
dc34ea0929 Fix merge conflicts. 2017-05-25 21:07:45 +00:00
Venkata Giri Reddy
6b151ef841 regression test for #38954 2017-05-25 16:55:25 -04:00
Venkata Giri Reddy
0530339dc3 regression test for #36379 2017-05-25 16:50:26 -04:00
bors
5f39668642 Auto merge of #42220 - alexcrichton:update, r=brson
Update OpenSSL download location

In rustbuild itself we download from our mirror but in the containers we don't
do this yet. The OpenSSL download url changes from time to time (it breaks when
they release a new version) so let's download from our mirror instead.
2017-05-25 19:48:14 +00:00
Brian Anderson
435e1cec9e Remove stray lockfile 2017-05-25 18:48:21 +00:00
Venkata Giri Reddy
c87f6d854b regression test for #39974
closes #39974

r? @Mark-Simulacrum
2017-05-25 13:10:02 -04:00
Alex Crichton
357133b362 Update OpenSSL download location
In rustbuild itself we download from our mirror but in the containers we don't
do this yet. The OpenSSL download url changes from time to time (it breaks when
they release a new version) so let's download from our mirror instead.
2017-05-25 10:08:35 -07:00
bors
deb90c33cc Auto merge of #42052 - kennytm:fix-42007-ice-on-decode-lint-id, r=nikomatsakis
Refactor: Move the mutable parts out of LintStore. Fix #42007.

* #42007 happens because the `Session` `LintStore` is emptied when linting.
* The `Session` `LintStore` is emptied because the checker (`Early`/`LateContext`) wants ownership.
* The checker wants ownership because it wants to mutate the pass objects and lint levels.

The ownership of the whole store is not essential, only the lint levels and pass objects need to be owned. Therefore, these parts are extracted out of the `LintStore` into a separate structure `LintSession`. The "check crates" methods can operate on `&mut LintSession` instead of `&mut LintStore`.

This is a minor *breaking change* for lint writers since the `LintContext` trait is changed: the `mut_lints` and `level_stack` methods are removed. But no one outside of `librustc/lint/context.rs` is using these functions, so it should be safe.
2017-05-25 14:10:10 +00:00
Paul Faria
a563f350b0 Remove irrelevant tests and unused testing attribute 2017-05-25 07:59:13 -04:00
bors
d86d134c38 Auto merge of #41932 - wesleywiser:py-to-rust, r=alexcrichton
Rewrite make-win-dist.py in Rust

Fixes #41568
2017-05-25 10:35:04 +00:00
est31
87950b79de Stabilize non capturing closure to fn coercion 2017-05-25 11:57:55 +02:00
Scott McMurray
ecde1e1d3b Lower ? to Try instead of Carrier
The easy parts of RFC 1859.  (Just the trait and the lowering, none of
the error message improvements nor the insta-stable impl for Option.)
2017-05-25 00:47:30 -07:00
Vadim Petrochenkov
fa13cd3489 Use parameter environment associated with field use, not field definition 2017-05-25 10:46:47 +03:00
bors
d0811c9148 Auto merge of #41145 - matthewjasper:stabilize-relaxed-adts, r=petrochenkov
Stabilize rfc 1506 - Clarified ADT Kinds

Closes #35626

Documentation:

- [ ] Reference rust-lang-nursery/reference#37
- [ ] Book?
- [ ] Rust by example?
2017-05-25 07:24:18 +00:00
Venkata Giri Reddy
5ce2eb1bd8 use shared scripts for init and sccache in cross image 2017-05-25 00:43:21 -06:00
Vadim Petrochenkov
4386f97a93 Make assignments to Copy union fields safe 2017-05-25 09:36:45 +03:00
Jeffrey Seyfried
d940d543df Ignore pretty. 2017-05-25 05:52:15 +00:00
Jeffrey Seyfried
b13392f771 Improve Self. 2017-05-25 05:52:13 +00:00
Jeffrey Seyfried
754fdad4a8 Add tests. 2017-05-25 05:52:12 +00:00
Jeffrey Seyfried
3eb235b45e Improve intercrate hygiene. 2017-05-25 05:52:11 +00:00
Jeffrey Seyfried
dde8dc61dd Improve efficiency. 2017-05-25 05:52:10 +00:00
Jeffrey Seyfried
7fdc1fb2e4 Hygienize lifetimes. 2017-05-25 05:52:09 +00:00
Jeffrey Seyfried
8497061a49 Hygienize librustc_privacy. 2017-05-25 05:52:08 +00:00
Jeffrey Seyfried
bfa2ef62a1 Hygienize librustc_typeck. 2017-05-25 05:52:05 +00:00
Jeffrey Seyfried
1f175fa35d Hygienize librustc_resolve. 2017-05-25 05:51:50 +00:00
Jeffrey Seyfried
1cded8472e Remove trait_item_map, clean up resolver.with_type_parameter_rib(). 2017-05-25 05:51:12 +00:00
Jeffrey Seyfried
2a1d2edb82 Declarative macros 2.0 without hygiene. 2017-05-25 05:51:06 +00:00
Jeffrey Seyfried
9c6430b325 Refactor out ast::MacroDef. 2017-05-25 05:47:25 +00:00
Tatsuyuki Ishi
15c26c92cc bootstrap.py: support verbose for submodules 2017-05-25 14:00:05 +09:00
Tatsuyuki Ishi
46ebd832e3 bootstrap.py: decode to str
Also, improve the split mechanism to address space in paths.
2017-05-25 13:58:10 +09:00
Tatsuyuki Ishi
5bcf06aa18 bootstrap.py: Filter instead of iteration 2017-05-25 13:57:51 +09:00
Tatsuyuki Ishi
1fea55ba51 Format bootstrap.py using autopep8 2017-05-25 13:57:23 +09:00
Tatsuyuki Ishi
d552e34e20 Use the improved submodule handling 2017-05-25 13:57:05 +09:00
bors
ffb0e2dba3 Auto merge of #41700 - GuillaumeGomez:extend-css-stable, r=killercup
Set --extend-css stable

I think it's now time to set this option stable.

r? @rust-lang/docs
2017-05-25 04:38:53 +00:00
Charlie Somerville
8019430b53 Fix 'associate type' typo 2017-05-25 13:36:59 +10:00
Dan Callahan
94b074f581
Remove superfluous ;; sequences 2017-05-24 21:43:46 -05:00
bors
cf747fcbf7 Auto merge of #42212 - Mark-Simulacrum:rollup, r=Mark-Simulacrum
Rollup of 15 pull requests

- Successful merges: #41980, #42071, #42120, #42134, #42141, #42142, #42149, #42150, #42159, #42177, #42186, #42191, #42195, #42198, #42211
- Failed merges:
2017-05-25 01:51:35 +00:00
Mark Simulacrum
d429b495a4 Rollup merge of #42211 - aidanhs:aphs-llvm-clone-hacks, r=Mark-Simulacrum
Hack around abysmally slow llvm clones

r? @Mark-Simulacrum

(don't r+ yet, let's see what travis says)
2017-05-24 19:50:11 -06:00
Mark Simulacrum
2bca4fa47d Rollup merge of #42198 - GuillaumeGomez:os-str-doc, r=QuietMisdreavus
Add missing urls for OsStr docs

r? @rust-lang/docs
2017-05-24 19:50:10 -06:00
Mark Simulacrum
a78a0dbe5f Rollup merge of #42195 - SamWhited:fix_broken_link, r=steveklabnik
fix broken link to nomicon in Unsize docs

Add a missing link that is currently broken in the docs (see the last sentence of https://doc.rust-lang.org/std/marker/trait.Unsize.html)
2017-05-24 19:50:09 -06:00
Mark Simulacrum
793fd4111c Rollup merge of #42191 - alexcrichton:update-cargo, r=Mark-Simulacrum
Update Cargo submodule

Contains a fix for rust-lang/cargo#4081
2017-05-24 19:50:09 -06:00
Mark Simulacrum
96328fcb8f Rollup merge of #42186 - devurandom:fix/bootstrap-verbose, r=alexcrichton
bootstrap: Make bootstrap verbose if requested

Fixes: #42099
2017-05-24 19:50:08 -06:00
Mark Simulacrum
84302717ae Rollup merge of #42177 - est31:master, r=Mark-Simulacrum
Remove some needless // gate-test- comments

Also, add detection to treat such comments as tidy errors.
We also remove the found_lib_feature code because it
was just repeating the found_feature code. Originally it
was intended to allow for gate-test lines for
lib features, but apparently nobody missed it.
2017-05-24 19:50:07 -06:00
Mark Simulacrum
ca0860df66 Rollup merge of #42159 - Havvy:doc-drop, r=steveklabnik
Document drop more.

Adds two examples to Drop and describes the recursive drop on types that contain fields.
2017-05-24 19:50:06 -06:00
Mark Simulacrum
d64dddbeaf Rollup merge of #42150 - citizen428:feature/error-count-messages, r=Mark-Simulacrum
Change error count messages

See #33525 for details. r? @Mark-Simulacrum
2017-05-24 19:50:05 -06:00
Mark Simulacrum
73d4b19565 Rollup merge of #42149 - dvyukov:license, r=brson
libstd/sync/mpsc: relicense under rust license

These files are licensed under a different license
than the rest of the codebase. This causes potential
issues and inconveniences.
Relicense these files under the standard license.
I hold original copyright on that code.

Fixes #36556
2017-05-24 19:50:04 -06:00