Commit Graph

88936 Commits

Author SHA1 Message Date
Alexander Ronald Altman
22251a87be Enhance Pin impl applicability for PartialEq and PartialOrd. 2019-01-16 20:10:18 -06:00
Nicholas Nethercote
afbd004d69 Remove hir::StmtKind::Decl.
It's a level of indirection that hurts far more than it helps. The code
is simpler without it. (This commit cuts more than 120 lines of code.)

In particular, this commit removes some unnecessary `Span`s within
`DeclKind` that were always identical to those in the enclosing `Stmt`,
and some unnecessary allocations via `P`.
2019-01-17 12:13:22 +11:00
Guillaume Gomez
d405606c3b End fixing search index minification 2019-01-17 01:41:01 +01:00
Guillaume Gomez
2e8fd44598 Minify search-index in one pass 2019-01-17 01:41:01 +01:00
Guillaume Gomez
f42407f114 Reduce search-index.js size 2019-01-17 01:41:01 +01:00
Konrad Borowski
e4e888534e
Document Unpin in std::prelude documentation 2019-01-17 00:39:15 +01:00
bors
c40b97796e Auto merge of #57392 - Xanewok:always-calc-glob-map, r=petrochenkov
Always calculate glob map but only for glob uses

Previously calculating glob map was *opt-in*, however it did record node id -> ident use for every use directive. This aims to see if we can unconditionally calculate the glob map and not regress performance.

Main motivation is to get rid of some of the moving pieces and simplify the compilation interface - this would allow us to entirely remove `CrateAnalysis`. Later, we could easily expose a relevant query, similar to the likes of `maybe_unused_trait_import` (so using precomputed data from the resolver, but which could be rewritten to be on-demand).

r? @nikomatsakis

Local perf run showed mostly noise (except `ctfe-stress-*`) but I'd appreciate if we could do a perf run run here and double-check that this won't regress performance.
2019-01-16 23:25:41 +00:00
AB1908
0edc5c9779 Fix error template 2019-01-16 23:08:42 +00:00
Nicholas Nethercote
b2ce5a9099 Make hir::Stmt a separate struct.
Benefits:

- It lets us move the `NodeId` field out of every `hir::StmtKind`
  variant `NodeId` to a more sensible spot.

- It eliminates sadness in `Stmt::fmt`.

- It makes `hir::Stmt` match `ast::Stmt`.
2019-01-17 09:52:34 +11:00
Josh Stone
9b8c3c4cff [rustbuild] Rebuild std after changes to codegen backends
Use `clear_if_dirty` on std for backend changes, just as we do for
changes to rustc itself, so new codegen is correctly applied to all
later compiler stages.

Fixes #48298.
2019-01-16 13:13:58 -08:00
Vadim Petrochenkov
01d0ae9618 Prioritize variants as inherent associated items during name resolution 2019-01-16 23:51:41 +03:00
Aaron Hill
9b68dcd32a
Don't explicitly increment the depth for new trait predicates 2019-01-16 12:55:22 -05:00
Pietro Albini
b54a00accd
allow unused warnings related to rustc_layout_scalar_valid_range_start 2019-01-16 18:20:08 +01:00
Pietro Albini
dc25c80571
prepare beta 1.33.0 2019-01-16 17:22:51 +01:00
bors
ceb2512144 Auto merge of #57321 - petrochenkov:atokens, r=nikomatsakis
Implement basic input validation for built-in attributes

Correct top-level shape (`#[attr]` vs `#[attr(...)]` vs `#[attr = ...]`) is enforced for built-in attributes, built-in attributes must also fit into the "meta-item" syntax (aka the "classic attribute syntax").

For some subset of attributes (found by crater run), errors are lowered to deprecation warnings.

NOTE: This PR previously included https://github.com/rust-lang/rust/pull/57367 as well.
2019-01-16 15:01:20 +00:00
Tatsuyuki Ishi
763392cb8c Fix memory leak in P::filter_map 2019-01-16 23:08:30 +09:00
Felix S. Klock II
7bddcbae51 With this change, I am able to build and test cross-platform rustc
In particular, I can use the following in my `config.toml`:

```
[build]
host = ["i686-unknown-linux-gnu", "x86_64-unknown-linux-gnu"]
target = ["i686-unknown-linux-gnu", "x86_64-unknown-linux-gnu"]
```

Before this change, my attempt to run the test suite would fail
because the error output differs depending on what your host and
targets are.

----

To be concrete, here are the actual messages one can observe:

```
% ./build/x86_64-unknown-linux-gnu/stage1/bin/rustc ../src/test/ui/huge-enum.rs -Aunused  --target=x86_64-unknown-linux-gnu
error: the type `std::option::Option<[u32; 35184372088831]>` is too big for the current architecture

error: aborting due to previous error

% ./build/x86_64-unknown-linux-gnu/stage1/bin/rustc ../src/test/ui/huge-enum.rs -Aunused  --target=i686-unknown-linux-gnu
error: the type `std::option::Option<[u32; 536870911]>` is too big for the current architecture

error: aborting due to previous error

% ./build/i686-unknown-linux-gnu/stage1/bin/rustc ../src/test/ui/huge-enum.rs -Aunused  --target=i686-unknown-linux-gnu
error: the type `std::option::Option<[u32; 536870911]>` is too big for the current architecture

error: aborting due to previous error

% ./build/i686-unknown-linux-gnu/stage1/bin/rustc ../src/test/ui/huge-enum.rs -Aunused  --target=x86_64-unknown-linux-gnu
error: the type `[u32; 35184372088831]` is too big for the current architecture

error: aborting due to previous error
```

To address these variations, I changed the test to be more aggressive
in its normalization strategy. We cannot (and IMO should not)
guarantee that `Option` will appear in the error output here. So I
normalized both types `Option<[u32; N]>` and `[u32; N]` to just `TYPE`
2019-01-16 14:37:22 +01:00
bors
cccaf9a8c6 Auto merge of #57416 - alexcrichton:remove-platform-intrinsics, r=nagisa
rustc: Remove platform intrinsics crate

This was originally attempted in #57048 but it was realized that we
could fully remove the crate via the `"unadjusted"` ABI on intrinsics.
This means that all intrinsics in stdsimd are implemented directly
against LLVM rather than using the abstraction layer provided here. That
ends up meaning that this crate is no longer used at all.

This crate developed long ago to implement the SIMD intrinsics, but we
didn't end up using it in the long run. In that case let's remove it!
2019-01-16 12:15:10 +00:00
AB1908
3f0a75d806 Remove trailing whitespace 2019-01-16 06:29:44 +00:00
Jethro Beekman
0772dbbb09 Fix release manifest generation 2019-01-16 11:36:38 +05:30
AB1908
193809ec3a Add regression test to close #53787 2019-01-16 05:34:40 +00:00
Nicholas Nethercote
dc45528620 Remove hir::Label.
It's identical to `ast::Label`.
2019-01-16 16:20:32 +11:00
Nicholas Nethercote
ae4b14e837 Use Lit rather than P<Lit> in hir::ExprKind.
It's simpler and makes some benchmark run up to 1% faster. It also makes
`hir::ExprKind` more like `ast::ExprKind` (which underwent the
equivalent change in #55777).
2019-01-16 15:36:08 +11:00
tyler
1a51bb8174 OSX: fix #57534 registering thread dtors while running thread dtors 2019-01-15 20:09:06 -08:00
Alexander Regueiro
4d1802308b Updated Book and Reference submodules. 2019-01-16 03:59:06 +00:00
Eric Huss
bd8ee511a5 Add some links in std::fs.
A few items were referenced, but did not have links.
2019-01-15 18:46:09 -08:00
Corey Farwell
32b28340b2
demonstrate symmetry 2019-01-15 21:21:24 -05:00
mark
48bee07768 make the contribution doc reference the guide more; deduplication 2019-01-15 20:02:28 -06:00
mark
228969c696 remove link to removed readme 2019-01-15 19:48:37 -06:00
mark
a6294b7628 update/remove some old readmes 2019-01-15 19:38:02 -06:00
Yuki Okushi
d33ee3fefa Fix tests 2019-01-16 09:28:26 +09:00
Yuki Okushi
ec8db2a944 Cancel process 2019-01-16 09:28:06 +09:00
Yuki Okushi
d19294feee Add new literal type Err 2019-01-16 09:27:43 +09:00
Josh Stone
9430423cab [rust-gdb] relax the GDB version regex
The pretty-printer script is checking `gdb.VERSION` to see if it's at
least 8.1 for some features. With `re.match`, it will only find the
version at the beginning of that string, but in Fedora the string is
something like "Fedora 8.2-5.fc29". Using `re.search` instead will find
the first location that matches anywhere, so it will find my 8.2.
2019-01-15 15:14:17 -08:00
mark
aa1ce32b10 update test output 2019-01-15 16:40:10 -06:00
Guillaume Gomez
feda6040fa Fixes text becoming invisible when element targetted 2019-01-15 23:21:36 +01:00
Clar Fon
24ca530526 Move spin_loop_hint to core::hint module 2019-01-15 16:44:28 -05:00
mark
dabe86db44 update/add tests 2019-01-15 12:48:44 -06:00
mark
6046be42ab fix nested matchers with ? 2019-01-15 12:48:44 -06:00
bors
e2f221c759 Auto merge of #57629 - matthiaskrgr:clippy_submodule_upd, r=oli-obk
submodules: update clippy from c63b6349 to 1b89724b

Changes:
````
Really fix issue number in `map_clone` test
Fix issue number in `map_clone` test
Remove `map_clone` fixed known problem
Fix `map_clone` bad suggestion
Add run-rustfix to unnecessary_fold
Add run-rustfix to unit_arg test
Add run-rustfix for types test
Add run-rustfix to starts_ends_with
Add run-rustfix to replace_const test
Add run-rustfix to redundant_field_names
Missing docs: don't require documenting Global Asm items.
Add run-rustfix for precedence test
Add run-rustfix to mem_replace test
Add run-rustfix to map_clone test
Add run-rustfix to large_digit_groups
Add run-rustfix to into_iter_on_ref
Add run-rustfix to infallible_destructuring_match
Add rustfix to inconsistent_digit_grouping test
Add run-rustfix to explicit_write test
Add run-rustfix to excessive_precision test
Add run-rustfix to duration_subsec test
Disable deprecated_cfg_attr lint for inner attributes
Add run-rustfix to collapsible_if test
Update Readme
Update Readme for (arguably) better readability
rustup: the features if_while_or_patterns has been stabilized
Fix comments in clippy_lints/src/len_zero.rs
readme: update travis badge to reflect migration from travis-ci.org to travis-ci.com
Remove all copyright license headers
Move cast_ref_to_mut list to correctness group
Rustftmt
Don't import ty::Ref in cast_ref_to_mut lint
Move a hint to an error message in cast_ref_to_mut lint
Add a note to cast_ref_to_mut lint
Use ty::Ref instead of ty::TyKind::Ref
cast_ref_to_mut lint
Add missing ` in default lint
Improve tests and exclude nested impls
Update `unwrap_get` code review suggestions
Update known problems
Restrict use_self on nested items
Improve `get_unwrap` suggestion
````
2019-01-15 18:41:42 +00:00
Guillaume Gomez
ed717f30ec Fix sources sidebar not showing up 2019-01-15 17:57:25 +01:00
Igor Matuszewski
b7cd24dd44 Make the query comment into a doc comment 2019-01-15 17:44:41 +01:00
Andy Russell
93b55365b5
use structured macro and path resolve suggestions 2019-01-15 11:27:58 -05:00
Oliver Scherer
096ca87333 Remove an unused function argument 2019-01-15 17:11:07 +01:00
bors
14ea6e50c1 Auto merge of #57630 - Centril:rollup, r=Centril
Rollup of 8 pull requests

Successful merges:

 - #56044 (Drop partially bound function parameters in the expected order)
 - #57352 (forbid manually impl'ing one of an object type's marker traits)
 - #57456 (RawVec doesn't always abort on allocation errors)
 - #57467 (Implement `check_attribute` to forbid `#[allow_internal_unsafe]`)
 - #57579 (Add core::iter::once_with())
 - #57587 (Add 'rustc-env:RUST_BACKTRACE=0' to const-pat-ice test)
 - #57608 (Simplify 'product' factorial example)
 - #57614 ([rustdoc] Fix crates filtering box not being filled)

Failed merges:

r? @ghost
2019-01-15 13:56:16 +00:00
Mazdak Farrokhzad
9947b3060c
Rollup merge of #57614 - GuillaumeGomez:fix-crate-filtering, r=QuietMisdreavus
[rustdoc] Fix crates filtering box not being filled

Currently, the filter crate box (at the left of the search input) is always empty. To get the number of keys of dictionary in JS, you need to call `Object.keys()` on it.

r? @QuietMisdreavus
2019-01-15 12:42:14 +01:00
Mazdak Farrokhzad
a52ec3c9ee
Rollup merge of #57608 - timvisee:master, r=frewsxcv
Simplify 'product' factorial example

This simplifies the [`factorial(n: 32)`](https://doc.rust-lang.org/std/iter/trait.Iterator.html#examples-46) implementation as example for the `Iterator::product()` function.
It currently uses unnecessary additional complexity.

Although very minimal, I do not want to include it in some other irrelevant PR.
2019-01-15 12:42:13 +01:00
Mazdak Farrokhzad
cf436832f8
Rollup merge of #57587 - Aaron1011:fix/const-pat-ice, r=alexcrichton
Add 'rustc-env:RUST_BACKTRACE=0' to const-pat-ice test

This ensures that the test passes, regardless of what the user has set
RUST_BACKTRACE to.
2019-01-15 12:42:12 +01:00
Mazdak Farrokhzad
ae1ab8afa9
Rollup merge of #57579 - stjepang:once-with, r=SimonSapin
Add core::iter::once_with()

Functions `iter::once()` and `iter::repeat()` construct iterators from values. The latter has the lazy variant `iter::repeat_with()`, but the former doesn't. This PR therefore adds `iter::once_with()`.

Another way to think of `iter::once_with()` is that it's a function that converts `FnOnce() -> T` into `Iterator<Item = T>`.

If this seems like a reasonable addition, I'll open a tracking issue and update the `#[feature(...)]` attributes.
2019-01-15 12:42:10 +01:00
Mazdak Farrokhzad
e8cfae4140
Rollup merge of #57467 - JohnTitor:implement-the-check-attribute-1, r=oli-obk
Implement `check_attribute` to forbid `#[allow_internal_unsafe]`

Fixes #56768.

r? @oli-obk
2019-01-15 12:42:08 +01:00