Commit graph

96824 commits

Author SHA1 Message Date
Matthias Krüger
79e612354e submodules: update clippy from 164310dd to dc69a5c0
Changes:
````
ci: temporarily disable rustfmt checks/tetss since it's broken for nightly
rustup https://github.com/rust-lang/rust/pull/62964
Bump version of clippy_dummy
update test stderr, not sure which rustc pull request caused this.
rustup https://github.com/rust-lang/rust/pull/62859
Fix tests for edition 2018 compatibility
Revert "Revert global fmt config and use `rustfmt::skip`"
Fix breakage due to rust-lang/rust#60913
Fix breakage due to rust-lang/rust#62705
Revert global fmt config and use `rustfmt::skip`
Fix fmt
rustup https://github.com/rust-lang/rust/pull/62679/
Update pulldown-cmark to 0.5.3
rustup https://github.com/rust-lang/rust/pull/62764
Add test
Format code
Decrease maximum length for stderr files
Improved imports
Fix "unkown clippy lint" error in UI test.
Corrections for PR review.
Implement lint for inherent to_string() method.
UI Test Cleanup: Extract match_ref_pats tests
Update UI tests
Allow no_effect lint
Remove comment
cargo fmt
UI Test Cleanup: Split up checked_unwrap tests
Removed lintining on never type.
UI Test Cleanup: Split out out_of_bounds_indexing
false positives fixes of `implicit_return`
Ignore generated fresh lifetimes in elision check.
````
2019-07-27 19:40:28 +02:00
Vadim Petrochenkov
f1c8673ae7 Fix issues with git converting CRLF to CR
UI tests now run on asmjs-unknown-emscripten, ignore tests with inline assembly which is not supported on emscripten targets
2019-07-27 19:22:45 +03:00
Vadim Petrochenkov
42a317a1cd Remove run-pass test suites 2019-07-27 18:56:17 +03:00
Vadim Petrochenkov
5486cc69bd tests: Move run-pass tests with naming conflicts to ui 2019-07-27 18:56:17 +03:00
Vadim Petrochenkov
9be35f82c1 tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
Vadim Petrochenkov
ca9faa52f5 tests: Add missing run-pass annotations 2019-07-27 18:56:13 +03:00
bors
a5e7bb3e2b Auto merge of #63043 - Centril:rollup-f4baee4, r=Centril
Rollup of 6 pull requests

Successful merges:

 - #62423 (Fix cycle error with existential types)
 - #62979 (Cleanup save-analysis JsonDumper)
 - #62982 (Don't access a static just for its size and alignment)
 - #63013 (add `repr(transparent)` to `IoSliceMut` where missing)
 - #63014 (Stop bare trait lint applying to macro call sites)
 - #63036 (Add lib section to rustc_lexer's Cargo.toml)

Failed merges:

r? @ghost
2019-07-27 15:41:45 +00:00
Mazdak Farrokhzad
51769b3012
Rollup merge of #63036 - topecongiro:add-lib-section, r=matklad
Add lib section to rustc_lexer's Cargo.toml

This is required to fix the rustc-ap-syntax build error in the recent version. The error could also be fixed on the [rustc-auto-publish](https://github.com/alexcrichton/rustc-auto-publish) side by manually adding `[lib]` section if one does not exist. The latter approach, however, may have a surprising side effect, so I am opting for a simpler solution for now.

r? @alexcrichton
2019-07-27 17:40:52 +02:00
Mazdak Farrokhzad
513ab54360
Rollup merge of #63014 - davidtwco:rustfix-incorrect-dyn-suggestion, r=estebank
Stop bare trait lint applying to macro call sites

Fixes #61963. Apologies for the delay with in fixing this. If anyone has a better idea how to detect this macro call site case, I'd be happy to fix this in a more robust, less hacky way.

r? @estebank
2019-07-27 17:40:51 +02:00
Mazdak Farrokhzad
4ad743c022
Rollup merge of #63013 - nivkner:ffi-safe-slice, r=sfackler
add `repr(transparent)` to `IoSliceMut` where missing

tried using `IoSliceMut` in FFI, got `improper_ctypes` warning.

according to the docs: `IoSliceMut` is  "guaranteed to be ABI compatible with the `iovec` type" so it should be usable in FFI.
`IoSlice` is also `repr(transparent)` for every platform where these types contain `iovec`-like types.
vxworks also has `IoSliceMut` as transparent so its not even consistently one or the other.

no comment about this next to the types or in the PR that introduced the types, so assuming this was just missed.

r? @sfackler
2019-07-27 17:40:49 +02:00
Mazdak Farrokhzad
b25d74fa49
Rollup merge of #62982 - oli-obk:static_cycle, r=RalfJung
Don't access a static just for its size and alignment

cc @RalfJung

fixes #62189
2019-07-27 17:40:48 +02:00
Mazdak Farrokhzad
a13f1f890b
Rollup merge of #62979 - Mark-Simulacrum:json-dumper-pretty, r=Xanewok
Cleanup save-analysis JsonDumper
2019-07-27 17:40:46 +02:00
Mazdak Farrokhzad
4b8031cf2c
Rollup merge of #62423 - Aaron1011:fix/existential-cycle, r=oli-obk
Fix cycle error with existential types

Fixes #61863

We now allow uses of `existential type`'s that aren't defining uses - that is, uses which don't constrain the underlying concrete type.

To make this work correctly, we also modify `eq_opaque_type_and_type` to not try to apply additional constraints to an opaque type. If we have code like this:

```rust
existential type Foo;
fn foo1() -> Foo { ... }
fn foo2() -> Foo { foo1() }
```

then `foo2` doesn't end up constraining `Foo`, which means that `foo2` will end up using the type `Foo` internally - that is, an actual `TyKind::Opaque`. We don't want to equate this to the underlying concrete type - we just need to enforce the basic equality constraint between the two types (here, the return type of `foo1` and the return type of `foo2`)
2019-07-27 17:40:45 +02:00
Vadim Petrochenkov
6a4def0c9d tidy: Fix a regression in #[test] detection in libcore
`contents` is the whole file rather than a single line.
2019-07-27 17:26:55 +03:00
Vadim Petrochenkov
c0df742de8 tidy: libcoretest.rs -> unit_tests.rs 2019-07-27 17:26:55 +03:00
topecongiro
98f29f5e38
Add comment 2019-07-27 22:10:09 +09:00
Evgenii P
693be441f4 Fix ui/parser/attr test 2019-07-27 19:37:03 +07:00
Evgenii P
2787cb23f0 Fix failing UI tests 2019-07-27 18:24:48 +07:00
Evgenii P
fc9bfd68b5 Treat doc comments separately 2019-07-27 18:24:17 +07:00
Vadim Petrochenkov
b5a0e6ea80 syntax_ext: proc_macro_decls -> proc_macro_harness
Few other minor renamings for consistency.
Remove one unused dependency from `rustc_passes`.
Fix libsyntax tests.
Fix rebase.
2019-07-27 14:16:16 +03:00
Vadim Petrochenkov
4d535bdf59 Move standard library injection into libsyntax_ext 2019-07-27 13:56:54 +03:00
Vadim Petrochenkov
f6eda99379 Move test harness generation into libsyntax_ext 2019-07-27 13:56:54 +03:00
Vadim Petrochenkov
4ad0daa220 Move proc macro server into libsyntax 2019-07-27 13:55:25 +03:00
Vadim Petrochenkov
3eeec1c5d2 Break dependencies between syntax_ext and some other crates
Move `source_uitil` macros into `syntax_ext`
Cleanup dependencies of `rustc_driver`
2019-07-27 13:52:37 +03:00
Caio
53fc7fbc96 Lint attributes on function arguments 2019-07-27 07:16:21 -03:00
Evgenii P
8b3f28cf0f Make more informative error on outer attr after inner 2019-07-27 16:45:45 +07:00
bors
0e9b465d72 Auto merge of #62748 - luca-barbieri:optimize-refcell-borrow, r=RalfJung
Optimize RefCell read borrowing

Instead of doing two comparisons we can do only one with a bit of cleverness.

LLVM currently can't do this optimization itself on x86-64.
2019-07-27 09:32:44 +00:00
topecongiro
13b41000ea
Add lib section to rustc_lexer's Cargo.toml 2019-07-27 17:21:42 +09:00
Taiki Endo
05f67a297a arbitrary_self_types lifetime elision: --bless --compare-mode=nll 2019-07-27 12:35:05 +09:00
Taiki Endo
34f59eb9c5 Fix typo 2019-07-27 12:28:07 +09:00
Taiki Endo
1e2905269b Add tests for self: (&)AssocType 2019-07-27 12:28:07 +09:00
Taiki Endo
8507b8e42f Add test for multiple ref-self 2019-07-27 12:28:06 +09:00
Taiki Endo
aab9edc68a Minor clean up 2019-07-27 12:28:06 +09:00
Taiki Endo
c1f22c018e Add main functions and check-pass annotations 2019-07-27 12:28:05 +09:00
Taiki Endo
258498af58 Update src/test/ui/self/elision/README.md
Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com>
2019-07-27 12:28:05 +09:00
Niko Matsakis
3096568904 add a bevy of new test cases 2019-07-27 12:28:04 +09:00
Taiki Endo
2f64404ba3 Use Set1<Region> instead of Option<Region> 2019-07-27 12:28:04 +09:00
Taiki Endo
7b9a65ea6a Make is_self_ty a method on SelfVisitor 2019-07-27 12:28:03 +09:00
Taiki Endo
a1fd4fa848 Remove query for .pin_type() 2019-07-27 12:28:03 +09:00
Taiki Endo
e2eb957be0 Allow lifetime elision in Pin<&(mut) Self> 2019-07-27 12:28:02 +09:00
Stargateur
3334802c83 Refactoring use commun code between option, result and accum 2019-07-27 02:17:56 +02:00
bors
09e3989758 Auto merge of #62086 - petrochenkov:builtout, r=eddyb
Define built-in macros through libcore

This PR defines built-in macros through libcore using a scheme similar to lang items (attribute `#[rustc_builtin_macro]`).
All the macro properties (stability, visibility, etc.) are taken from the source code in libcore, with exception of the expander function transforming input tokens/AST into output tokens/AST, which is still provided by the compiler.

The macros are made available to user code through the standard library prelude (`{core,std}::prelude::v1`), so they are still always in scope.
As a result **built-in macros now have stable absolute addresses in the library**, like `core::prelude::v1::line!()`, this is an insta-stable change.

Right now `prelude::v1` is the only publicly available absolute address for these macros, but eventually they can be moved into more appropriate locations with library team approval (e.g. `Clone` derive -> `core::clone::Clone`).

Now when built-in macros have canonical definitions they can be imported or reexported without issues (https://github.com/rust-lang/rust/issues/61687).

Other changes:
- You can now define a derive macro with a name matching one of the built-in derives (https://github.com/rust-lang/rust/issues/52269). This was an artificial restriction that could be worked around with import renaming anyway.

Known regressions:
- Empty library crate with a crate-level `#![test]` attribute no longer compiles without `--test`. Previously it didn't compile *with* `--test` or with the bin crate type.

Fixes https://github.com/rust-lang/rust/issues/61687
Fixes https://github.com/rust-lang/rust/issues/61804
r? @eddyb
2019-07-26 23:29:02 +00:00
Esteban Küber
6263eb438d ignore-tidy-trailing-newlines 2019-07-26 12:18:28 -07:00
bors
c43753f910 Auto merge of #63015 - Centril:rollup-ydhpcas, r=Centril
Rollup of 22 pull requests

Successful merges:

 - #62084 (allow clippy::unreadable_literal in unicode tables)
 - #62120 (Add missing type links in documentation)
 - #62310 (Add missing doc links in boxed module)
 - #62421 (Introduce `as_deref` to Option)
 - #62583 (Implement Unpin for all raw pointers)
 - #62692 (rustc: precompute the largest Niche and store it in LayoutDetails.)
 - #62801 (Remove support for -Zlower-128bit-ops)
 - #62828 (Remove vector fadd/fmul reduction workarounds)
 - #62862 (code cleanup)
 - #62904 (Disable d32 on armv6 hf targets)
 - #62907 (Initialize the MSP430 AsmParser)
 - #62956 (Implement slow-path for FirstSets::first)
 - #62963 (Allow lexer to recover from some homoglyphs)
 - #62964 (clarify and unify some type test names)
 - #62970 (ci: gate toolstate repo pushes on the TOOLSTATE_PUBLISH envvar)
 - #62980 (std: Add more accessors for `Metadata` on Windows)
 - #62983 (Remove needless indirection through Rc)
 - #62985 (librustc_errors: Support ui-testing flag in annotate-snippet emitter)
 - #63002 (error_index_generator should output stdout/stderr when it panics.)
 - #63004 (Add test for issue-54062)
 - #63007 (ci: debug network failures while downloading awscli from PyPI)
 - #63009 (Remove redundant `mut` from variable declaration.)

Failed merges:

r? @ghost
2019-07-26 16:57:54 +00:00
Mazdak Farrokhzad
232d27c306
Rollup merge of #63009 - Rosto75:master, r=matklad
Remove redundant `mut` from variable declaration.
2019-07-26 18:57:08 +02:00
Mazdak Farrokhzad
0222498610
Rollup merge of #63007 - pietroalbini:debug-awscli-install, r=Mark-Simulacrum
ci: debug network failures while downloading awscli from PyPI

This adds some random debug code to our CI script while downloading awscli, to *hopefully* pinpoint what's causing the network failures.

r? @Mark-Simulacrum
cc #62967
2019-07-26 18:57:06 +02:00
Mazdak Farrokhzad
3a1ee9b70d
Rollup merge of #63004 - JohnTitor:add-tests-for-54062, r=Centril
Add test for issue-54062

The ICE is no longer reproduced.

Closes #54062
2019-07-26 18:57:05 +02:00
Mazdak Farrokhzad
8882e424f8
Rollup merge of #63002 - gilescope:better-build-diagnostics, r=Mark-Simulacrum
error_index_generator should output stdout/stderr when it panics.

**bootstrap change**

Call error_index_generator tool using run_quiet which will additionally print std out and std err of the command when it returns an error.
(was `run` uses `run_silent` under the covers.)

Why: PR #62871 is hitting a build error but the panic isn't getting shown so its unclear what the problem is.
2019-07-26 18:57:03 +02:00
Mazdak Farrokhzad
571a965143
Rollup merge of #62985 - phansch:support_ui_testing_flag, r=estebank
librustc_errors: Support ui-testing flag in annotate-snippet emitter

This adds support for the `-Z ui-testing` flag to the new
annotate-snippet diagnostic emitter.

Support for the flag was added to `annotate-snippet-rs` in these PRs:

* https://github.com/rust-lang/annotate-snippets-rs/pull/3
* https://github.com/rust-lang/annotate-snippets-rs/pull/5

r? @estebank

Closes #61811
2019-07-26 18:57:01 +02:00
Mazdak Farrokhzad
0614a94d67
Rollup merge of #62983 - Mark-Simulacrum:remove-needless-rc, r=petrochenkov
Remove needless indirection through Rc

NamedMatch is already cheap to clone due to Lrc's inside.
2019-07-26 18:56:59 +02:00