Mark Rousskov
2a663555dd
Remove licenses
2018-12-25 21:08:33 -07:00
Mazdak Farrokhzad
0c1ba07a77
Rollup merge of #57020 - estebank:return-span, r=zackmdavis
...
Point to cause of `fn` expected return type
Fix #48136 .
2018-12-23 23:09:09 +01:00
Esteban Küber
cdbccf50a7
Point at coercion source on type errors for fn returning impl Trait
2018-12-20 16:52:52 -08:00
Vadim Petrochenkov
69c66286a9
Reintroduce special pretty-printing for $crate when it's necessary for proc macros
2018-12-19 23:17:54 +03:00
Vadim Petrochenkov
4a38408940
Remove eliminate_crate_var and special pretty-printing for $crate
2018-12-19 23:17:53 +03:00
kennytm
dadf7fcc2d
Rollup merge of #56699 - nnethercote:SymbolIndex, r=oli-obk
...
Use a `newtype_index!` within `Symbol`.
This shrinks `Option<Symbol>` from 8 bytes to 4 bytes, which shrinks
`Token` from 24 bytes to 16 bytes. This reduces instruction counts by up
to 1% across a range of benchmarks.
r? @oli-obk
2018-12-14 22:10:09 +08:00
Alex Crichton
cf47a19305
Bump to 1.33.0
...
* Update bootstrap compiler
* Update version to 1.33.0
* Remove some `#[cfg(stage0)]` annotations
Actually updating the version number is blocked on updating Cargo
2018-12-12 08:09:26 -08:00
Nicholas Nethercote
0f68749260
Use a newtype_index! within Symbol.
...
This shrinks `Option<Symbol>` from 8 bytes to 4 bytes, which shrinks
`Token` from 24 bytes to 16 bytes. This reduces instruction counts by up
to 1% across a range of benchmarks.
2018-12-12 08:38:08 +11:00
Alex Crichton
b4110900bd
Update Cargo submodule and its dependencies
...
Hopefully just another routine update!
So far this starts to enable the `std::arch` in stage0 builds of rustc.
This means that we may need stage0/not(stage0) in stdsimd itself, but
more and more code is starting to use `std::arch` so I think it's time
to start shifting the balance of work here.
2018-12-10 13:45:22 -08:00
Alexander Regueiro
ee89c088b0
Various minor/cosmetic improvements to code
2018-12-07 23:53:34 +00:00
John Kåre Alsaker
813b484d1e
Fix printing of spans with no TyCtxt
2018-12-06 23:18:06 +01:00
bors
4bb5d35659
Auto merge of #56392 - petrochenkov:regensym, r=oli-obk
...
Delay gensym creation for "underscore items" (`use foo as _`/`const _`) until name resolution
So they cannot be cloned by macros. See https://github.com/rust-lang/rust/pull/56303 for the discussion.
Mostly fix cross-crate use of underscore items by inverting the "gensyms are lost in metadata" bug as described in https://github.com/rust-lang/rust/pull/56303#issuecomment-442464695 .
Fix unused import warnings for single-segment imports (first commit) and `use crate_name as _` imports (as specified in https://github.com/rust-lang/rust/pull/56303#issuecomment-442274118 ).
Prohibit accidentally implemented `static _: TYPE = EXPR;` (cc https://github.com/rust-lang/rust/pull/55983 ).
Add more tests for `use foo as _` imports.
2018-12-06 15:08:11 +00:00
Pietro Albini
e941e1a624
Rollup merge of #56500 - ljedrz:cleanup_rest_of_const_lifetimes, r=zackmdavis
...
cleanup: remove static lifetimes from consts
A follow-up to https://github.com/rust-lang/rust/pull/56497 .
2018-12-06 07:48:57 +01:00
Pietro Albini
0aa72ad55d
Rollup merge of #56426 - petrochenkov:syntweak, r=nikomatsakis
...
libsyntax_pos: A few tweaks
2018-12-06 07:48:53 +01:00
Matthew Russo
f0f8aa9e05
adds DocTest filename variant, refactors doctest_offset out of source_map, fixes remaining test failures
2018-12-04 19:52:42 -05:00
Matthew Russo
88130f1796
updates all Filename variants to take a fingerprint
2018-12-04 17:24:12 -05:00
ljedrz
d0c64bb296
cleanup: remove static lifetimes from consts
2018-12-04 12:46:10 +01:00
Vadim Petrochenkov
d08f7dcdca
Address review comments
2018-12-04 01:13:03 +03:00
Vadim Petrochenkov
d415844f5e
syntax: Remove #[non_exhaustive] from Edition
...
`Edition` is not a public API, we want users to break when a new edition is added
2018-12-04 00:30:27 +03:00
Vadim Petrochenkov
08f8faedd0
syntax: Rename some keywords
...
`CrateRoot` -> `PathRoot`, `::` doesn't necessarily mean crate root now
`SelfValue` -> `SelfLower`, `SelfType` -> `SelfUpper`, both `self` and `Self` can be used in type and value namespaces now
2018-12-04 00:30:27 +03:00
Vadim Petrochenkov
101467c152
syntax: dyn is a used keyword now
2018-12-04 00:30:27 +03:00
Vadim Petrochenkov
2d4b633be3
Delay gensym creation for "underscore items" until name resolution
...
Prohibit `static _`
Fis unused import warnings for `use foo as _`
Add more tests for `use foo as _`
2018-12-02 15:42:30 +03:00
kennytm
45aaaa70bb
Rollup merge of #56355 - Zoxc:inline-things, r=michaelwoerister
...
Add inline attributes and add unit to CommonTypes
2018-12-01 02:03:51 +08:00
kennytm
bdb901c865
Rollup merge of #56336 - nnethercote:clean-up-pp, r=nikomatsakis
...
Clean up and streamline the pretty-printer
Some minor improvements.
2018-12-01 02:03:43 +08:00
John Kåre Alsaker
4cce4ffdef
Add inline attributes and add unit to CommonTypes
2018-11-29 22:11:02 +01:00
Nicholas Nethercote
787959c20d
Use Cow in Token::String.
...
`Printer::word` takes a `&str` and converts it into a `String`, which
causes an allocation. But that allocation is rarely necessary, because
`&str` is almost always a `&'static str` or a `String` that won't be
used again.
This commit changes `Token::String` so it holds a `Cow<'static, str>`
instead of a `String`, which avoids a lot of allocations.
2018-11-29 17:12:18 +11:00
Vadim Petrochenkov
dae4c7b1ff
resolve: Implement edition hygiene for imports and absolute paths
...
Use per-span hygiene in a few other places in resolve
Prefer `rust_2015`/`rust_2018` helpers to comparing editions
2018-11-27 00:32:30 +03:00
David Lavati
6c9f6a1afd
Rename other occs of (Code/File)Map to Source(Map/File) #51574
2018-10-29 21:26:13 +01:00
Esteban Küber
8544db0faa
Add macro call span when lacking any other span in diagnostic
2018-10-23 10:07:11 -07:00
Oliver Scherer
3c9258e604
Prefer Default::default over FxHash*::default in struct constructors
2018-10-19 14:34:44 +02:00
Oliver Scherer
ee81739dc1
Deprecate the FxHashMap() and FxHashSet() constructor function hack
2018-10-19 14:34:44 +02:00
bors
6310be458f
Auto merge of #54601 - cuviper:prep-1.31, r=Mark-Simulacrum
...
Bump to 1.31.0 and bootstrap from 1.30 beta
Closes #54594 .
2018-09-30 01:45:50 +00:00
bors
bd8d030d01
Auto merge of #54338 - orium:fix-macro-inc-comp, r=nrc
...
Use full name to identify a macro in a `FileName`.
Before this two macros with same name would be indistinguishable inside a `FileName`. This caused a bug in incremental compilation (see #53097 ) since two different macros would map out to the same `StableFilemapId`.
Fixes #53097 .
r? @nrc
2018-09-28 06:40:32 +00:00
Josh Stone
ce034951fb
Bump to 1.31.0 and bootstrap from 1.30 beta
2018-09-27 20:52:53 -07:00
Pietro Albini
23636e3f99
Rollup merge of #54350 - Munksgaard:support-edition-in-doc-test, r=steveklabnik
...
Support specifying edition in doc test
Fixes #52623
r? @QuietMisdreavus
2018-09-22 09:56:30 +02:00
Philip Munksgaard
c996c4d316
Add support for running doc test in specific edition
2018-09-19 14:32:09 +02:00
Diogo Sousa
2d7edf908d
Use full name to identify a macro in a FileName.
...
Before this two macros with same name would be indistinguishable inside a
`FileName`. This caused a bug in incremental compilation (see #53097 ) since
two different macros would map out to the same `StableFilemapId`.
Fixes #53097 .
2018-09-19 01:12:13 +01:00
varkor
cb594cf373
Treat dyn as a keyword in the 2018 edition
2018-09-16 23:34:42 +01:00
toidiu
731f4efae5
stabalize infer outlives requirements (RFC 2093).
...
Co-authored-by: nikomatsakis
2018-09-11 11:40:04 -04:00
bors
2d4e34ca8b
Auto merge of #53778 - petrochenkov:shadrelax2, r=nikomatsakis
...
resolve: Relax shadowing restrictions on macro-expanded macros
Previously any macro-expanded macros weren't allowed to shadow macros from outer scopes.
Now only "more macro-expanded" macros cannot shadow "less macro-expanded" macros.
See comments to `fn may_appear_after` and added tests for more details and examples.
The functional changes are a21f6f588fc28c97533130ae44a6957b579ab58c and 46dd365ce9ca0a6b8653849b80267763c542842a, other commits are refactorings.
2018-09-09 21:00:55 +00:00
Mark Rousskov
4d1ec81811
Stabilize the 2018 edition
2018-09-09 02:28:13 +02:00
Vadim Petrochenkov
27235698f5
resolve: Introduce "may appear after" abstraction for macro path resolutions
2018-09-08 14:15:11 +03:00
Eduard-Mihai Burtescu
93f3f5b155
Use FxHash{Map,Set} instead of the default Hash{Map,Set} everywhere in rustc.
2018-08-28 17:04:04 +03:00
bors
70a21e89f1
Auto merge of #53441 - toidiu:ak-fix53419, r=nikomatsakis
...
fix for late-bound regions
Fix for https://github.com/rust-lang/rust/issues/53419
r? @nikomatsakis
2018-08-27 17:42:45 +00:00
Niko Matsakis
73fb1622b3
check that adding infer-outlives requirement to all crates works
2018-08-24 17:10:50 -04:00
Vadim Petrochenkov
6fdb400ff2
Revert "hygiene: Make sure expansion info is set at most once for a given Mark"
...
This reverts commit b15785b671 .
2018-08-24 02:21:52 +03:00
bors
35bf1ae257
Auto merge of #52602 - scottmcm:tryblock-expr, r=nikomatsakis
...
Implement try block expressions
I noticed that `try` wasn't a keyword yet in Rust 2018, so...
~~Fixes https://github.com/rust-lang/rust/issues/52604~~ That was fixed by PR https://github.com/rust-lang/rust/pull/53135
cc https://github.com/rust-lang/rust/issues/31436 https://github.com/rust-lang/rust/issues/50412
2018-08-23 11:46:24 +00:00
kennytm
b5519db323
Rollup merge of #53496 - matthiaskrgr:codespell_08_2018, r=varkor
...
Fix typos found by codespell.
2018-08-21 17:51:49 +08:00
Scott McMurray
91967a8f16
Put try in the reserved list, not the in-use list
2018-08-19 16:53:41 -07:00
Scott McMurray
9e64ce1799
Parse try blocks with the try keyword instead of do catch placeholder
2018-08-19 16:53:05 -07:00