Commit Graph

139205 Commits

Author SHA1 Message Date
Simonas Kazlauskas 7130e462ee Fix sizes of repr(C) enums on hexagon
Enums on hexagon use a smallest size (but at least 1 byte) that fits all
the enumeration values. This is unlike many other ABIs where enums are
at least 32 bits.
2021-02-22 01:05:17 +02:00
Simon Vandel Sillesen 2d1e0adfe9 New pass to deduplicate blocks 2021-02-21 21:51:54 +01:00
Simon Vandel Sillesen 1e865709a6 Make MatchBranchSimplification clean up after itself 2021-02-21 21:22:04 +01:00
Simon Vandel Sillesen ccecc4f6bf Drive-by formatting of comment 2021-02-21 21:22:04 +01:00
Nixon Enraght-Moony ba22a69d96 Extract string_to_value to its own function 2021-02-21 20:10:57 +00:00
Nixon Enraght-Moony a22d948eb0
Apply suggestions from code review
Co-authored-by: Joshua Nelson <joshua@yottadb.com>
2021-02-21 19:45:32 +00:00
Stein Somers d9daedd433 BTreeMap: correct tests for alternative choices of B 2021-02-21 19:06:46 +01:00
Matthias Krüger da9a588d4f remove redundant wrapping of return types of allow_internal_unstable() and rustc_allow_const_fn_unstable() 2021-02-21 18:11:27 +01:00
Michael Howell 575c75b324
Update src/test/rustdoc/description.rs
Co-authored-by: Joshua Nelson <joshua@yottadb.com>
2021-02-21 09:31:39 -07:00
Michael Howell a6b85fbc78
Update src/test/rustdoc/description.rs
Co-authored-by: Joshua Nelson <joshua@yottadb.com>
2021-02-21 09:31:23 -07:00
Joshua Nelson 0238986de7 Propagate RUSTDOCFLAGS in the environment when documenting
Previously, RUSTDOCFLAGS would get overriden when bootstrap set
`RUSTDOCFLAGS` itself. Propagate the flag manually, using the same logic
as `RUSTFLAGS`.

This also extracts the logic into a helper function to make sure it's
the same.
2021-02-21 11:29:09 -05:00
Ralf Jung 12608832c3 improve UnsafeCell docs 2021-02-21 17:24:19 +01:00
bors 728f3976f0 Auto merge of #6771 - MortenLohne:master, r=flip1995
Fix FP in inherent_to_string when the function has generic parameters

Minimal example of the false positive:
````
struct G;

impl G {
    fn to_string<const _N: usize>(&self) -> String {
        "G.to_string()".to_string()
    }
}

fn main() {
    let g = G;
    g.to_string::<1>();
}
````
Clippy emits an `inherent_to_string` warning, and suggests that we implement `Display` for `G` instead. However, this is not possible, since the generic parameter _N only exists in this function, not in `G` itself. This particular example uses const generics, which is where the issue is most likely to come up, but this PR skips the lint if the `to_string` function has any kind of generic parameters.

changelog: Fix FP in `inherent_to_string`
2021-02-21 16:10:03 +00:00
bors 208e95781b Auto merge of #6770 - ThibsG:PostfixEnumVariant, r=flip1995
Fix camel case postfix for `enum_variant_names` lint

Fix camel case postfix

Fixes: #4639

changelog: none
2021-02-21 15:58:47 +00:00
bors 8a47901bac Auto merge of #6765 - camsteffen:unnecessary-wraps-pedantic, r=flip1995
Change unnecessary_wraps to pedantic

changelog: Change unnecessary_wraps to pedantic

There seems to be enough evidence that this lint is not wanted as warn-by-default. Attempted before at #6380. False positives at #6721 and #6427. Actually requested to change the category at #6726.

Closes #6726
2021-02-21 15:33:50 +00:00
bors d2ddf9c796 Auto merge of #6754 - camsteffen:spanlesseq-res, r=flip1995
Teach SpanlessEq binding IDs

changelog: Fix collapsible_match false positive

Fixes #6740

This PR changes the way `SpanlessEq` determines whether two local variables are the same. Instead of checking that the names match, it checks that the `HirId`s match. If local bindings are declared within the expressions that are being compared, `SpanlessEq` will remember bindings that correspond to each other in a `FxHashMap<HirId, HirId>`. This makes `SpanlessEq` more flexible while also fixing false positives.

Example: `{ let x = 1; x + 2 }` is equal to `{ let y = 1; y + 2 }`.

CC `@xFrednet` I think this will resolve some concerns in #6463
2021-02-21 15:22:35 +00:00
0yoyoyo ce1a521012 Apply tidy check 2021-02-21 22:51:49 +09:00
Guillaume Gomez 20f2497efd Update CI scripts 2021-02-21 14:27:22 +01:00
Guillaume Gomez 8005092cf0 Add rustdoc gui tests 2021-02-21 14:25:12 +01:00
Guillaume Gomez fa131845bc Ignore nodejs/npm files 2021-02-21 14:21:38 +01:00
Guillaume Gomez 50b39b2b65 Add new rustdoc-gui test suite 2021-02-21 14:21:04 +01:00
Matthias Krüger a9b90c02a2 rustc_mir: remove redundant wrapping of return type in numeric_intrinsic() 2021-02-21 13:44:16 +01:00
Matthias Krüger 76b9b16b4d rustc_codegen_ssa: remove unneeded wrapping of return type of execute_copy_from_cache_work_item (always returns Ok(..)) 2021-02-21 13:40:39 +01:00
Matthias Krüger 393878b15b remove redundant return value Ok(()) of clear_relocations() 2021-02-21 13:25:28 +01:00
Matthias Krüger 85bd00fd85 parser: remove unneccessary wrapping of return value in parse_extern() 2021-02-21 13:25:12 +01:00
bors 3e826bb112 Auto merge of #82359 - JohnTitor:rollup-6puemik, r=JohnTitor
Rollup of 11 pull requests

Successful merges:

 - #81300 (BTree: share panicky test code & test panic during clear, clone)
 - #81706 (Document BinaryHeap unsafe functions)
 - #81833 (parallelize x.py test tidy)
 - #81966 (Add new `rustc` target for Arm64 machines that can target the iphonesimulator)
 - #82154 (Update RELEASES.md 1.50 to include methods stabilized in #79342)
 - #82177 (Do not delete bootstrap.exe on Windows during clean)
 - #82181 (Add check for ES5 in CI)
 - #82229 (Add [A-diagnostics] bug report template)
 - #82233 (try-back-block-type test: Use TryFromSliceError for From test)
 - #82302 (Remove unsafe impl Send for CompletedTest & TestResult)
 - #82349 (test: Print test name only once on timeout)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2021-02-21 12:23:45 +00:00
Matthias Krüger 00bc134e43 remove unneccessary wrapping of return value in mk_await_expr() 2021-02-21 13:01:01 +01:00
Matthias Krüger 12080dc3a3 rustc_parse: remove unneccessary wrapping of return value in fn mk_range() which would always return Ok(..) 2021-02-21 12:54:49 +01:00
Matthias Krüger 4cb649bdb1 remove unneccessary wrapping of return value of allow_unstable(), it would always return Some(thing) 2021-02-21 12:52:51 +01:00
Camille GILLOT 903f65f215 Simplify hashing. 2021-02-21 12:22:22 +01:00
Ashley Mannix 60a9dcc4e3
update tracking issue for raw_os_nonzero 2021-02-21 19:43:42 +10:00
bors ef14688221 Auto merge of #82340 - kennytm:fix-82254, r=Mark-Simulacrum
Fix some Python2→3 error in publish_toolstate.py

Fix #82254.

The error is primarily due to `data = json.dumps(…)` producing a `str` instead of a `bytes`, which are different types on Python 3. But then `urllib.request.urlopen(…, data)` cannot accept `data` as a `str`, thus the error.

This PR added `.encode()` call after `json.dumps()` to ensure we are sending `bytes`. Additionally, we added type annotation to ensure things can statically type-check with `mypy` on both Python 2 and 3.
2021-02-21 09:42:50 +00:00
0yoyoyo 17176ccd78 Add indication of anonymous lifetime position 2021-02-21 18:38:20 +09:00
0yoyoyo fece59b56c Change `find_anon_type` method to function 2021-02-21 18:29:14 +09:00
Yuki Okushi d7fb4de791
Rollup merge of #82349 - tmiasko:pretty-test-timeout, r=Mark-Simulacrum
test: Print test name only once on timeout

Pretty formatter when using multiple test threads displays test name twice on
timeout event. This implicitly suggest that those are two different events,
while in fact they are always printed together.

Print test name only once.

Before:

```
running 3 tests
test src/lib.rs - c (line 16) ... ok
test src/lib.rs - a (line 3) ... ok
test src/lib.rs - b (line 9) ... test src/lib.rs - b (line 9) has been running for over 60 seconds
test src/lib.rs - b (line 9) ... ok
```

After:

```
running 3 tests
test src/lib.rs - c (line 16) ... ok
test src/lib.rs - a (line 3) ... ok
test src/lib.rs - b (line 9) has been running for over 60 seconds
test src/lib.rs - b (line 9) ... ok
```
2021-02-21 15:26:50 +09:00
Yuki Okushi 01e1d2d5e8
Rollup merge of #82302 - tmiasko:test-unsafe-send, r=Mark-Simulacrum
Remove unsafe impl Send for CompletedTest & TestResult
2021-02-21 15:26:49 +09:00
Yuki Okushi 2793859e86
Rollup merge of #82233 - ijackson:try-block-type-test, r=Mark-Simulacrum
try-back-block-type test: Use TryFromSliceError for From test

Using `i32` is rather fragile because it has many implementations.  Recently in an early draft of another MR (#82228) I did something that introduced a new `i32 as From<something>` impl and this test broke.

TryFromSliceError is nice because it doesn't seem likely to grow new conversions.  We still have one conversion, from Infallible.

My other MR is going to be reworked and won't need this any more but having done it I thought I would submit it rather than just throw it away.  Sorry for the tiny MR.
2021-02-21 15:26:48 +09:00
Yuki Okushi b9040c717c
Rollup merge of #82229 - estebank:issue-templace, r=Mark-Simulacrum
Add [A-diagnostics] bug report template
2021-02-21 15:26:47 +09:00
Yuki Okushi 2a57acf179
Rollup merge of #82181 - GuillaumeGomez:es5-checks-ci, r=Mark-Simulacrum
Add check for ES5 in CI

Follow-up of #82145.

r? ```@Mark-Simulacrum```
2021-02-21 15:26:46 +09:00
Yuki Okushi 13a3c6e170
Rollup merge of #82177 - rylev:no-delete-bootstrap-windows, r=Mark-Simulacrum
Do not delete bootstrap.exe on Windows during clean

Windows does not allow deleting currently running executables.

This an addition to ```@jyn514's``` change in https://github.com/rust-lang/rust/pull/80574.
2021-02-21 15:26:45 +09:00
Yuki Okushi 0fd78eda8d
Rollup merge of #82154 - CDirkx:ip-changelog, r=Mark-Simulacrum
Update RELEASES.md 1.50 to include methods stabilized in #79342

I noticed that #79342 was missing from the release notes for 1.50.
2021-02-21 15:26:44 +09:00
Yuki Okushi 882fd69b22
Rollup merge of #81966 - deg4uss3r:degausser/aarch64_apple_ios_sim, r=shepmaster
Add new `rustc` target for Arm64 machines that can target the iphonesimulator

This PR lands a new target (`aarch64-apple-ios-sim`) that targets arm64 iphone simulator, previously unreachable from Apple Silicon machines.

resolves #81632

r? `@shepmaster`
2021-02-21 15:26:42 +09:00
Yuki Okushi 4c1f195e0b
Rollup merge of #81833 - the8472:parallel-bootstrap-rustfmt, r=Mark-Simulacrum
parallelize x.py test tidy

Running tidy on individual commits when rewriting git history was somewhat of an annoyance, so I have parallelized it a bit.

running `time ./x.py test tidy` with warm IO caches:

old:

```
real	0m11.123s
user	0m14.495s
sys	0m5.227s
```

new:

```
real	0m1.834s
user	0m13.545s
sys	0m3.094s
```

There's further room for improvement (<0.9s should be feasible) but that would require bigger changes.
2021-02-21 15:26:41 +09:00
Yuki Okushi 56ae3fb2f0
Rollup merge of #81706 - SkiFire13:document-binaryheap-unsafe, r=Mark-Simulacrum
Document BinaryHeap unsafe functions

`BinaryHeap` contains some private safe functions but that are actually unsafe to call. This PR marks them `unsafe` and documents all the `unsafe` function calls inside them.

While doing this I might also have found a bug: some "SAFETY" comments in `sift_down_range` and `sift_down_to_bottom` are valid only if you assume that `child` doesn't overflow. However it may overflow if `end > isize::MAX` which can be true for ZSTs (but I think only for them). I guess the easiest fix would be to skip any sifting if `mem::size_of::<T> == 0`.

Probably conflicts with #81127 but solving the eventual merge conflict should be pretty easy.
2021-02-21 15:26:40 +09:00
Yuki Okushi 3219a100fa
Rollup merge of #81300 - ssomers:btree_cleanup_leak_tests, r=Mark-Simulacrum
BTree: share panicky test code & test panic during clear, clone

Bases almost all tests of panic on the same, richer definition, and extends it to cloning to test panic during clone.

r? ```@Mark-Simulacrum```
2021-02-21 15:26:36 +09:00
bors ed58a2b03b Auto merge of #79100 - a1phyr:better_assert_eq, r=m-ou-se
Improve assert_eq! and assert_ne!

This PR improves `assert_eq!` and `assert_ne!` by moving the panicking code in an external function.

It does not change the fast path, but the move of the formatting in the cold path (the panic) may have a positive effect on in instruction cache use and with inlining.

Moreover, the use of trait objects instead of generic may improve compile times for `assert_eq!`-heavy code.

Godbolt link: ~~https://rust.godbolt.org/z/TYa9MT~~ \
Updated: https://rust.godbolt.org/z/bzE84x
2021-02-21 05:41:09 +00:00
Camelid 6a85719b6a rustdoc: Remove unnecessary `Cell` around `param_env` 2021-02-20 17:12:22 -08:00
Michael Howell fd5a710092 Use has for non-regexes 2021-02-20 17:51:41 -07:00
Michael Howell dcf49916e4 Fix formatting for description rustdoc UI tests 2021-02-20 17:50:01 -07:00
Michael Howell 8b3b1c922e Add rustdoc UI tests for new description behaviour 2021-02-20 17:43:13 -07:00