Commit Graph

299 Commits

Author SHA1 Message Date
Alexey Shmalko
517fb1b06f
Promote rust comments to rustdoc 2019-04-22 21:38:28 +03:00
Mateusz Mikuła
87e4b43d51 Deny internal in stage0 2019-04-17 05:15:00 +02:00
John Kåre Alsaker
b82ab24bbf Preallocate BUILTIN_ATTRIBUTES symbols and use a hash map instead of looping 2019-04-15 15:20:05 +02:00
John Kåre Alsaker
f598091c05 Use colon for keyword defs 2019-04-15 07:23:04 +02:00
John Kåre Alsaker
baebf79057 Move modules outside the proc macro 2019-04-15 07:23:04 +02:00
John Kåre Alsaker
61a7a60d45 Make check_name generic 2019-04-15 07:23:02 +02:00
John Kåre Alsaker
10855a36b5 Use a proc macro to declare preallocated symbols 2019-04-15 07:23:01 +02:00
krk
8f3fd85da4 Add missing backtick to Symbol documentation. 2019-04-14 14:27:54 +02:00
bors
60076bb8f7 Auto merge of #59693 - nnethercote:64-bit-Spans, r=petrochenkov
Increase `Span` from 4 bytes to 8 bytes.

This increases the size of some important types, such as `ast::Expr` and
`mir::Statement`. However, it drastically reduces how much the interner
is used, and the fields are more natural sizes that don't require bit
operations to extract.

As a result, instruction counts drop across a range of workloads, by as
much as 10% for `script-servo` incremental builds.

Peak memory usage goes up a little for some cases, but down by more for
some other cases -- as much as 18% for non-incremental builds of
`packed-simd`.

The commit also:
- removes the `repr(packed)`, because it has negligible effect, but can
  cause undefined behaviour;
- replaces explicit impls of common traits (`Copy`, `PartialEq`, etc.)
  with derived ones.

r? @petrochenkov
2019-04-14 08:55:16 +00:00
Mazdak Farrokhzad
056c02ec2f
Rollup merge of #59735 - matklad:deadcode, r=sanxiyn
remove lookup_char_pos_adj

It is now exactly equivalent to lookup_char_pos.
2019-04-14 00:23:29 +02:00
bors
cd8b437362 Auto merge of #59227 - Zoxc:fix-get, r=eddyb
Fix lifetime on LocalInternedString::get function

cc @eddyb @nnethercote
2019-04-11 23:36:13 +00:00
Aleksey Kladov
63080b3c25 remove lookup_char_pos_adj
It is now exactly equivalent to lookup_char_pos.
2019-04-05 23:16:09 +03:00
Nicholas Nethercote
fd7f605365 Increase Span from 4 bytes to 8 bytes.
This increases the size of some important types, such as `ast::Expr` and
`mir::Statement`. However, it drastically reduces how much the interner
is used, and the fields are more natural sizes that don't require bit
operations to extract.

As a result, instruction counts drop across a range of workloads, by as
much as 12% for incremental "check" builds of `script-servo`.

Peak memory usage goes up a little for some cases, but down by more for
some other cases -- as much as 18% for non-incremental builds of
`packed-simd`.

The commit also:
- removes the `repr(packed)`, because it has negligible effect, but can
  cause undefined behaviour;
- replaces explicit impls of common traits (`Copy`, `PartialEq`, etc.)
  with derived ones.
2019-04-05 12:26:09 +11:00
flip1995
d3f0cb9b62
Deny internal lints on non conflicting crates
- libarena
- librustc_allocator
- librustc_borrowck
- librustc_codegen_ssa
- librustc_codegen_utils
- librustc_driver
- librustc_errors
- librustc_incremental
- librustc_metadata
- librustc_passes
- librustc_privacy
- librustc_resolve
- librustc_save_analysis
- librustc_target
- librustc_traits
- libsyntax
- libsyntax_ext
- libsyntax_pos
2019-04-03 18:24:21 +02:00
Nicholas Nethercote
ff94feabc2 Tweak Span encoding.
Failing to fit `base` is more common than failing to fit `len`.
2019-04-03 10:03:34 +11:00
John Kåre Alsaker
438f6b04c6 Fix lifetime on LocalInternedString::get function 2019-03-31 03:11:55 +02:00
Mazdak Farrokhzad
d976dbe853 bump bootstrap; adjust stage0 uses in libsyntax_pos 2019-03-26 09:57:42 +01:00
Vadim Petrochenkov
30d5dc9a0a Do not encode gensymed imports in metadata 2019-03-19 22:50:46 +03:00
Vadim Petrochenkov
6ad55b3dec syntax: Introduce Ident::can_be_raw 2019-03-16 23:13:15 +03:00
Marcel Hellwig
5b975162e2 update scoped_tls to 1.0 2019-02-26 09:54:45 +01:00
bors
b244f61b77 Auto merge of #58341 - alexreg:cosmetic-2-doc-comments, r=steveklabnik
Cosmetic improvements to doc comments

This has been factored out from https://github.com/rust-lang/rust/pull/58036 to only include changes to documentation comments (throughout the rustc codebase).

r? @steveklabnik

Once you're happy with this, maybe we could get it through with r=1, so it doesn't constantly get invalidated? (I'm not sure this will be an issue, but just in case...) Anyway, thanks for your advice so far!
2019-02-12 19:09:24 +00:00
bors
c84e797642 Auto merge of #58098 - oli-obk:maybe_allow_internal_unstable, r=petrochenkov
Require a list of features in `#[allow_internal_unstable]`

The blanket-permission slip is not great and will likely give us trouble some point down the road.
2019-02-12 12:10:10 +00:00
Oliver Scherer
bbe524d7c1 Parallel rustc needs synchronizing smart pointer cloning 2019-02-11 15:09:05 +01:00
Oliver Scherer
b681433b9d Use Rc<[Symbol]> instead of Vec<Symbol> to reduce # of allocs 2019-02-11 15:08:17 +01:00
Oliver Scherer
33bf81eec0 Ease the transition to requiring features by just warning if there's no feature list
while we could make this change (it's all unstable after all), there are crates.io crates that use the feature and that the compiler depends upon. We can instead roll out this feature while still supporting the old way.
2019-02-11 15:08:17 +01:00
Oliver Scherer
d3c212c552 Require a list of features to allow in allow_internal_unstable 2019-02-11 15:08:16 +01:00
Alexander Regueiro
c3e182cf43 rustc: doc comments 2019-02-10 23:42:32 +00:00
Taiki Endo
2be0993c4e Revert removed #![feature(nll)] 2019-02-10 16:13:30 +09:00
Guillaume Gomez
8b886e07f5 Remove images' url to make it work even without internet connection 2019-02-07 11:06:19 +01:00
Taiki Endo
6413480adf libsyntax_pos => 2018 2019-02-04 03:42:27 +09:00
John Kåre Alsaker
975eb312ef Use multiple threads by default. Limits tests to one thread. Do some renaming. 2019-01-28 16:24:33 +01:00
varkor
f077990ed4
Fix typo
Co-Authored-By: estebank <estebank@users.noreply.github.com>
2019-01-21 15:53:56 -08:00
varkor
1d6e5e7108
Fix typo
Co-Authored-By: estebank <estebank@users.noreply.github.com>
2019-01-21 15:53:45 -08:00
Esteban Küber
8f4da0e7ee Use is_dummy instead of comparing against DUMMY_SP 2019-01-20 13:53:13 -08:00
Esteban Küber
c4b8df5df2 Remove unnecessary dummy span checks
The emitter already verifies wether a given span note or span label
can be emitted to the output. If it can't, because it is a dummy
span, it will be either elided for labels or emitted as an unspanned
note/help when applicable.
2019-01-20 13:29:03 -08:00
Mazdak Farrokhzad
c4f6ef25d2 remove extern_in_paths. 2019-01-13 14:18:00 +01:00
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