Mazdak Farrokhzad
ac15b4f4bd
Rollup merge of #56248 - estebank:suggest-bare-pub, r=petrochenkov
...
Suggest an appropriate token when encountering `pub Ident<'a>`
Fix #55403 . Follow up to #45997 .
2018-12-08 08:43:43 +01:00
bors
059e6a6f57
Auto merge of #56578 - alexreg:cosmetic-1, r=alexreg
...
Various minor/cosmetic improvements to code
r? @Centril 😄
2018-12-08 03:50:16 +00:00
Alexander Regueiro
ce9850b953
Fixed incorrect reference to issue #23121 .
2018-12-07 23:53:34 +00:00
Alexander Regueiro
ee89c088b0
Various minor/cosmetic improvements to code
2018-12-07 23:53:34 +00:00
Andy Russell
2f6226518b
use top level fs functions where appropriate
...
This commit replaces many usages of `File::open` and reading or writing
with `fs::read_to_string`, `fs::read` and `fs::write`. This reduces code
complexity, and will improve performance for most reads, since the
functions allocate the buffer to be the size of the file.
I believe that this commit will not impact behavior in any way, so some
matches will check the error kind in case the file was not valid UTF-8.
Some of these cases may not actually care about the error.
2018-12-07 12:54:11 -05:00
kennytm
0e41ef13aa
Rollup merge of #56516 - frewsxcv:frewsxcv-eq, r=Mark-Simulacrum
...
Replace usages of `..i + 1` ranges with `..=i`.
Before this change we were using old computer code techniques. After this change we use the new and improved computer code techniques.
2018-12-07 12:42:32 +08:00
Vadim Petrochenkov
8ab115c21d
Unsupport #[derive(Trait)] sugar for #[derive_Trait] legacy plugin attributes
2018-12-07 03:30:01 +03: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
bors
367e783e6f
Auto merge of #56557 - pietroalbini:rollup, r=pietroalbini
...
Rollup of 11 pull requests
Successful merges:
- #56315 (Rustdoc inline macro reexport)
- #56332 ([rustdoc] Specific crate search)
- #56362 (Stabilise exhaustive integer patterns)
- #56426 (libsyntax_pos: A few tweaks)
- #56441 (rustbuild: Fix issues with compiler docs)
- #56446 (pass the parameter environment to `traits::find_associated_item`)
- #56500 (cleanup: remove static lifetimes from consts)
- #56525 (Avoid extra copy and syscall in std::env::current_exe)
- #56528 (Remove unused dependency (rustc_lint -> rustc_mir))
- #56548 (Optimized string FromIterator + Extend impls)
- #56553 (Don't print the profiling summary to stdout when -Zprofile-json is set)
Failed merges:
r? @ghost
2018-12-06 12:41:30 +00:00
bors
128a1fa4e1
Auto merge of #55635 - oli-obk:min_const_unsafe_fn, r=nikomatsakis
...
Allow calling `const unsafe fn` in `const fn` behind a feature gate
cc #55607
r? @Centril
2018-12-06 10:18:17 +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
Pietro Albini
e57ed0ddab
Rollup merge of #56362 - varkor:stabilise-exhaustive-integer-patterns, r=nikomatsakis
...
Stabilise exhaustive integer patterns
This is dependent on the FCP for https://github.com/rust-lang/rfcs/pull/2591 being completed, but that should happen tomorrow, so there's little harm in opening this PR early.
Closes #50907 .
2018-12-06 07:48:52 +01:00
bors
1839c144bc
Auto merge of #54517 - mcr431:53956-panic-on-include_bytes-of-own-file, r=michaelwoerister
...
53956 panic on include bytes of own file
fix #53956
When using `include_bytes!` on a source file in the project, compiler would panic on subsequent compilations because `expand_include_bytes` would overwrite files in the source_map with no source. This PR changes `expand_include_bytes` to check source_map and use the already existing src, if any.
2018-12-06 01:36:51 +00:00
Pietro Albini
4ff4fc1bc9
Rollup merge of #56452 - sinkuu:redundant_clone, r=nikic
...
Remove redundant clones
2018-12-05 23:54:30 +01:00
bors
93ac09c3b5
Auto merge of #55466 - sinkuu:cleanup, r=petrochenkov
...
syntax: Use iterator and pattern APIs instead of `char_at`
Iterating over chars with the `char_at(str, i)` `i += ch.len_utf8()` loop seems unidiomatic.
2018-12-05 13:56:07 +00:00
Shotaro Yamada
f423ff7be8
Fix pretty test
2018-12-05 12:15:28 +09: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
Matthew Russo
6ee4d3cafc
new_source_file no longer enters duplicate files, expand_include_bytes includes the source if it can convert bytes to string
2018-12-04 17:19:55 -05:00
Corey Farwell
c025d61409
Replace usages of ..i + 1 ranges with ..=i.
2018-12-04 12:05:19 -08:00
ljedrz
d0c64bb296
cleanup: remove static lifetimes from consts
2018-12-04 12:46:10 +01:00
Oliver Scherer
cb71752f91
Tidy fixup
2018-12-04 11:04:54 +01:00
Oliver Scherer
f2ae7b78d6
Allow calling const unsafe fn in const fn behind a feature gate
2018-12-04 10:17:36 +01:00
Shotaro Yamada
65aa0a6249
Remove redundant clone
2018-12-04 15:38:40 +09:00
Shotaro Yamada
4e3128223b
Fix test
2018-12-04 09:28:14 +09:00
Shotaro Yamada
11af6f66cb
Use iterator and pattern APIs instead of char_at
2018-12-04 09:27:24 +09: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
kennytm
ac363d8793
Rollup merge of #56438 - yui-knk:remove_not_used_DotEq_token, r=petrochenkov
...
Remove not used `DotEq` token
Currently libproc_macro does not use `DotEq` token.
https://github.com/rust-lang/rust/pull/49545 changed libproc_macro
to not generate `DotEq` token.
2018-12-03 18:07:20 +08:00
kennytm
a498a6d198
Rollup merge of #56433 - yui-knk:update_comment_of_parse_visibility, r=petrochenkov
...
Add description about `crate` for parse_visibility's comment
This rule was introduced by https://github.com/rust-lang/rust/pull/45401 .
2018-12-03 18:07:18 +08:00
kennytm
ca98bce303
Rollup merge of #56419 - mark-i-m:remove-try, r=Centril
...
Remove some uses of try!
2018-12-03 18:07:15 +08:00
kennytm
81752fd85d
Rollup merge of #56412 - petrochenkov:extself, r=Centril
...
Update tracking issue for `extern_crate_self`
2018-12-03 18:07:11 +08:00
kennytm
bf96a7bbed
Rollup merge of #56366 - alexreg:stabilise-self_in_typedefs, r=Centril
...
Stabilize self_in_typedefs feature
[**Tracking Issue**](https://github.com/rust-lang/rust/issues/49303 )
r? @centril
2018-12-03 18:07:07 +08:00
yui-knk
96bf06baf3
Remove not used DotEq token
...
Currently libproc_macro does not use `DotEq` token.
https://github.com/rust-lang/rust/pull/49545 changed libproc_macro
to not generate `DotEq` token.
2018-12-02 23:11:08 +09: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
yui-knk
172ec724af
Fix "line longer than 100 chars"
2018-12-02 18:33:12 +09:00
yui-knk
70371fde17
Add description about crate for parse_visibility's comment
...
This rule was introduced by https://github.com/rust-lang/rust/pull/45401 .
2018-12-02 17:01:44 +09:00
Mark Mansi
e7e96921c2
remove some uses of try!
2018-12-01 15:48:55 -06:00
Vadim Petrochenkov
df0ab06073
Update tracking issue for extern_crate_self
2018-12-01 18:58:43 +03:00
Vadim Petrochenkov
549bd45e9e
resolve: Support aliasing local crate root in extern prelude
2018-12-01 14:38:47 +03:00
Esteban Küber
2645871111
Use appropriate terminology based on heuristic
2018-11-30 15:09:39 -08:00
Alexander Regueiro
aa5a4ef59d
Removed feature gate.
2018-11-30 22:12:39 +00:00
Esteban Küber
0952856e6c
Suggest an appropriate token when encountering pub Ident<'a>
2018-11-30 11:48:08 -08:00
kennytm
440bda4dc8
Rollup merge of #56365 - alexreg:stabilise-self_struct_ctor, r=Centril
...
Stabilize self_struct_ctor feature.
[**Tracking Issue**](https://github.com/rust-lang/rust/issues/51994 )
2018-12-01 02:03:59 +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
kennytm
ce00a8dd4d
Rollup merge of #56268 - nnethercote:fold_opt_expr-recycle, r=petrochenkov
...
Reuse the `P` in `InvocationCollector::fold_{,opt_}expr`.
This requires adding a new method, `P::filter_map`.
This commit reduces instruction counts for various benchmarks by up to
0.7%.
2018-12-01 02:03:41 +08:00
Alexander Regueiro
d49a8d558f
Removed feature gate.
2018-11-30 15:42:43 +00:00
varkor
e018268ffa
Add precise_pointer_size_matching feature
2018-11-30 10:41:09 +00:00