Commit Graph

140 Commits

Author SHA1 Message Date
bobtwinkles 73e0c1e968 Fix review nits 2018-04-26 18:28:34 -04:00
bobtwinkles 498dbe4453 Implement a least upper bound for marks.
This is useful when trying to compute when something is lexically before
something else, but they aren't necessarily in the same SyntaxContext
2018-04-23 23:59:59 -04:00
bobtwinkles 263b36b071 Implement parent() on syntax_pos::Span
... and reimplement proc_macro::Span::parent using it. This function turns out
to be useful in the compiler as well
2018-04-23 23:59:58 -04:00
bobtwinkles d2dc21df02 Add documentation for SyntaxContext::remove_mark 2018-04-23 23:59:58 -04:00
Guillaume Gomez 7a39e90afc Rollup merge of #49699 - zesterer:master, r=joshtriplett
Removed 'proc' from the reserved keywords list

Remove 'proc' from the reserved keywords list.

'proc' is a very useful identifier name for a lot of things. It's especially useful when dealing with processes, operating system internals, and kernel development.
2018-04-17 18:43:13 +02:00
Guillaume Gomez 05275dafaa Remove unwanted auto-linking and update 2018-04-16 23:37:11 +02:00
bors 252a459d37 Auto merge of #49371 - scottmcm:catch-wrapping, r=nikomatsakis
Add ok-wrapping to catch blocks, per RFC

Updates the `catch{}` lowering to wrap the result in `Try::from_ok`.

r? @nikomatsakis

Fixes #41414
Fixes #43818
2018-04-12 05:38:49 +00:00
Joshua Barretto 16e75e3566 Reenumerated symbols 2018-04-11 13:27:43 +01:00
Scott McMurray c4b6521327 Add ok-wrapping to catch blocks, per RFC 2018-04-10 20:03:40 -07:00
Mark Simulacrum c115cc655c Move deny(warnings) into rustbuild
This permits easier iteration without having to worry about warnings
being denied.

Fixes #49517
2018-04-08 16:59:14 -06:00
bors 8c2d7b2da3 Auto merge of #49661 - alexcrichton:bump-bootstrap, r=nikomatsakis
Bump the bootstrap compiler to 1.26.0 beta

Holy cow that's a lot of `cfg(stage0)` removed and a lot of new stable language
features!
2018-04-07 11:58:38 +00:00
Vadim Petrochenkov 3a30bad6de Use Ident instead of Name in MetaItem 2018-04-06 11:52:16 +03:00
Vadim Petrochenkov e2afefd80b Get rid of SpannedIdent 2018-04-06 11:48:19 +03:00
Vadim Petrochenkov baae274fb7 Use Span instead of SyntaxContext in Ident 2018-04-06 11:46:26 +03:00
Joshua Barretto 5e94d5498d Merge pull request #1 from rust-lang/master
Merge upstream changes
2018-04-05 20:59:32 +01:00
Joshua Barretto 446285e45c Removed 'proc' from the reserved keywords list 2018-04-05 18:12:01 +01:00
Alex Crichton 8958815916 Bump the bootstrap compiler to 1.26.0 beta
Holy cow that's a lot of `cfg(stage0)` removed and a lot of new stable language
features!
2018-04-05 07:13:45 -07:00
Aidan Hobson Sayers 9b5859aea1 Remove all unstable placement features
Closes #22181, #27779
2018-04-03 11:02:34 +02:00
Mark Mansi 7ce8191775 Stabilize i128_type 2018-03-26 08:36:50 -05:00
Alex Crichton 4b31b5bda7 Rollup merge of #49030 - Zoxc:misc, r=michaelwoerister
Misc changes from my parallel rustc branch

r? @michaelwoerister
2018-03-23 10:16:09 -07:00
bors 5e3ecdce4e Auto merge of #48917 - petrochenkov:import, r=oli-obk
syntax: Make imports in AST closer to the source and cleanup their parsing

This is a continuation of https://github.com/rust-lang/rust/pull/45846 in some sense.
2018-03-18 01:50:52 +00:00
John Kåre Alsaker 3fa69c935d Make Span and Symbol implement Send and Sync 2018-03-17 23:01:46 +01:00
Vadim Petrochenkov f88162654d Rename Span::empty to Span::shrink_to_lo, add Span::shrink_to_hi 2018-03-17 22:12:21 +03:00
Vadim Petrochenkov 5d06c890fe syntax: Make _ an identifier 2018-03-17 22:08:07 +03:00
John Kåre Alsaker 426c51d6ea Make FileMap thread-safe 2018-03-15 00:43:02 +01:00
John Kåre Alsaker cbdf4ec03e Remove syntax and syntax_pos thread locals 2018-03-14 11:56:01 +01:00
Oliver Schneider 52dec0e1c9 Don't derive traits on packed structs 2018-03-08 08:35:39 +01:00
leonardo.yvens 2e7e68b762 while let all the things 2018-03-05 15:58:54 -03:00
John Kåre Alsaker b74e97cf42 Replace Rc with Lrc for shared data 2018-03-02 10:48:52 +01:00
Manish Goregaokar fac7d7cfb2 Rollup merge of #48359 - jsgf:remap-path-prefix, r=sanxiyn
Fixes #47311.
r? @nrc
2018-02-28 15:09:24 -08:00
Jeremy Fitzhardinge 56a6828533 Implement --remap-path-prefix
Remove experimental -Zremap-path-prefix-from/to, and replace it with
the stabilized --remap-path-prefix=from=to variant.

This is an implementation for issue of #41555.
2018-02-22 15:13:21 -08:00
Seiichi Uchida 291c51b9c8 Fix up tests and typos 2018-02-18 00:10:40 +09:00
Seiichi Uchida b5099a708d Replace dummy spans with empty spans 2018-02-18 00:10:40 +09:00
kennytm 9d995d2832 Rollup merge of #47942 - estebank:macro-spans, r=nikomatsakis Minimize weird spans involving macro context Sometimes the parser attempts to synthesize spans from within a macro context with the span for the captured argument, leading to non-sensical spans with very bad output. Given that an incorrect span is worse than a partially incomplete span, when detecting this situation return only one of the spans without merging them. Fix #32072, #47778. CC #23480. 2018-02-02 22:48:50 +08:00
Esteban Küber aaec608367 Minimize weird spans involving macro context
Sometimes the parser attempts to synthesize spans from within a macro
context with the span for the captured argument, leading to non-sensical
spans with very bad output. Given that an incorrect span is worse than
a partially incomplete span, when detecting this situation return only
one of the spans without mergin them.
2018-02-01 11:51:49 -08:00
David Wood c71cec8834 end_point handling multibyte characters correctly. 2018-01-27 11:46:27 +00:00
David Wood c6e6428d1a Moved overflow check into end_point function. 2018-01-27 11:46:26 +00:00
bors 0b90e4e8cd Auto merge of #46551 - jseyfried:improve_legacy_modern_macro_interaction, r=nrc
macros: improve 1.0/2.0 interaction

This PR supports using unhygienic macros from hygienic macros without breaking the latter's hygiene.
```rust
// crate A:
#[macro_export]
macro_rules! m1 { () => {
    f(); // unhygienic: this macro needs `f` in its environment
    fn g() {} // (1) unhygienic: `g` is usable outside the macro definition
} }

// crate B:
#![feature(decl_macro)]
extern crate A;
use A::m1;

macro m2() {
    fn f() {} // (2)
    m1!(); // After this PR, `f()` in the expansion resolves to (2), not (3)
    g(); // After this PR, this resolves to `fn g() {}` from the above expansion.
         // Today, it is a resolution error.
}

fn test() {
    fn f() {} // (3)
    m2!(); // Today, `m2!()` can see (3) even though it should be hygienic.
    fn g() {} // Today, this conflicts with `fn g() {}` from the expansion, even though it should be hygienic.
}
```

Once this PR lands, you can make an existing unhygienic macro hygienic by wrapping it in a hygienic macro. There is an [example](https://github.com/rust-lang/rust/pull/46551/commits/b766fa887dc0e4b923a38751fe4d570e35a75710) of this in the tests.

r? @nrc
2018-01-12 10:00:09 +00:00
Malo Jaffré cbb32a9418 Fix docs for future pulldown migration 2018-01-01 14:44:12 +01:00
Michael Woerister 0258c6daca incr.comp.: Precompute small hash for filenames to save some work. 2017-12-19 15:27:50 +01:00
Michael Woerister c7e5b703cd incr.comp.: Revert hashing optimization that caused regression. 2017-12-15 16:50:07 -06:00
Michael Woerister 0b4c2cccac incr.comp.: Do less hashing per Span. 2017-12-14 10:29:16 -06:00
Michael Woerister 9faa31612f incr.comp.: Speed up span hashing by caching expansion context hashes. 2017-12-14 10:15:10 -06:00
Oliver Schneider d732da813b Use PathBuf instead of String where applicable 2017-12-14 11:22:08 +01:00
Jeffrey Seyfried d052d28d70 Improve interaction between macros 2.0 and macro_rules!. 2017-12-13 13:33:03 -08:00
Jeffrey Seyfried f79c7e442d Refactor MarkData field modern: bool to kind: MarkKind. 2017-12-12 13:15:09 -08:00
bors c8ddf28527 Auto merge of #46497 - AgustinCB:issue-46311, r=petrochenkov
Modify message for keyword as identifier name

This is a temporary solution to #46311.

The message is generic enough to cover both cases and is probably a fine enough solution to the specific problem described in the task. However, the underlying reason for this to be wrong is that `next_token_inner` returns `Lifetime` even if the token is a label. That's not simple, as the syntax for both can be quite similar and it may need to take a look to the next token to make a decision. I'm not sure I have enough knowledge about the project to be able to solve that (yet!), so I thought I'll fix the immediate problem first.
2017-12-07 21:05:49 +00:00
Niko Matsakis 47b8ef51d4 don't print self symbol's internal index unless gensymed
It's just not useful. It also makes it hard to have tests that probe
internal state, since the interning number is very sensitive.

Dumping the number in the case of gensym is not ideal but will do for
now.
2017-12-07 05:28:01 -05:00
Agustin Chiappe Berrini dd41929509 remove unused test 2017-12-07 04:00:22 -05:00
Agustin Chiappe Berrini fb8ab18f50 remove unnecessary function 2017-12-07 03:56:31 -05:00