Commit Graph

128968 Commits

Author SHA1 Message Date
Tomasz Miąsko
59c243331d Enable RenameReturnPlace MIR optimization on mir-opt-level >= 2
The destination propagation as currently implemented does not supersede
the NRVO, e.g., the destination propagation never applies if either
local has an address taken, while NRVO might.

Additionally, the issue with failing assertions had been already
resolved.

Continue running both optimizations at mir-opt-level >= 2.
2020-10-04 00:00:00 +00:00
Simon Vandel Sillesen
80d5017a6e Fix miscompile in SimplifyBranchSame 2020-10-04 00:00:00 +00:00
Scott McMurray
d74b8e0505 Replace some once(x).chain(once(y)) with [x, y] IntoIter
Now that we have by-value array iterators...
2020-10-03 16:51:43 -07:00
Dylan MacKenzie
14c3705c6c Ensure that the const-eval engine handles #[unwind(aborts)] 2020-10-03 16:26:09 -07:00
Joshua Nelson
5f76b95e9b Change DocFragments from enum variant fields to structs with a nested enum
This makes the code a lot easier to work with. It also makes it easier
to add new fields without updating each variant and `match`
individually.

- Name the `Kind` variant after `DocFragmentKind` from `collapse_docs`
- Remove unneeded impls
2020-10-03 19:21:56 -04:00
Stein Somers
a58089e097 BTreeMap/Set: complete the compile-time test cases 2020-10-04 01:04:29 +02:00
bors
bad9ad06c0 Auto merge of #77434 - jonas-schievink:ret-in-reg-2-electric-boogalo, r=nagisa
Returns values up to 2*usize by value

Addresses https://github.com/rust-lang/rust/pull/76986#discussion_r498306837 and https://github.com/rust-lang/rust/pull/76986#issuecomment-696415287 by doing the optimization on all targets.

This matches what we do for functions returning `&[T]` and other fat pointers, so it should be Harmless™
2020-10-03 22:13:01 +00:00
Dylan MacKenzie
a5f083133e Add check-pass test for #[unwind(aborts)] on a const fn 2020-10-03 14:53:09 -07:00
Dylan MacKenzie
98a2292919 Allow Abort terminators in a const-context
These appear along the cleanup path inside functions with
`#[unwind(aborts)]`. We don't const-check the cleanup path anyways,
since const-eval already has "abort-on-panic" semantics and there's
often drops that would otherwise be forbidden, so the check wasn't
really preventing anything anyways.
2020-10-03 14:38:01 -07:00
Camelid
250b4adc15
Fix capitalization in blog post name 2020-10-03 13:30:37 -07:00
Amanieu d'Antras
e41a14412e Support vectors with fewer than 8 elements for simd_select_bitmask 2020-10-03 20:35:59 +01:00
Guillaume Gomez
6ec2474622 Strenghten tests for crate-level attributes check 2020-10-03 21:33:48 +02:00
Guillaume Gomez
3950a6d8b6 Run attributes check at crate level 2020-10-03 21:33:47 +02:00
Guillaume Gomez
0e18017fa3 Ensure that the error isn't displayed more than once 2020-10-03 21:33:47 +02:00
Guillaume Gomez
5c836e3207 Add test for #[doc(alias = "...")] at crate level 2020-10-03 21:33:47 +02:00
Guillaume Gomez
0e68e1ba5c Prevent #[doc(alias = "...")] at crate level 2020-10-03 21:33:47 +02:00
Jubilee Young
2fcd1838ed Flatten arrows with further comment 2020-10-03 12:14:22 -07:00
Jake Vossen
018d587bc1 fixed going over 100 chars in line 2020-10-03 13:12:08 -06:00
bors
25c8c53dd9 Auto merge of #77500 - RalfJung:miri, r=RalfJung
update Miri

Fixes https://github.com/rust-lang/rust/issues/77406
r? `@ghost` Cc `@rust-lang/miri`
2020-10-03 18:36:32 +00:00
varkor
6647eeefb9 Add const_generics test for impl-trait-with-const-arguments 2020-10-03 18:48:56 +01:00
Ralf Jung
9f1861e0f8 update Miri 2020-10-03 19:47:58 +02:00
varkor
702906581e Move tests 2020-10-03 18:01:11 +01:00
ecstatic-morse
eaa0186662
Add quotes around command in CHANGELOG 2020-10-03 09:29:50 -07:00
varkor
3631d29287 Add tests for const_generics 2020-10-03 17:00:18 +01:00
Guillaume Gomez
d3b7b7e23a Enforce closing HTML tags to have a ">" character 2020-10-03 16:23:03 +02:00
bors
738d4a7a36 Auto merge of #74160 - CAD97:weak-as-unsized-ptr, r=RalfJung
Allow Weak::as_ptr and friends for unsized T

Relaxes `impl<T> Weak<T>` to `impl<T: ?Sized> Weak<T>` for the methods `rc::Weak::as_ptr`, `into_raw`, and `from_raw`.

Follow-up to #73845, which did most of the impl work to make these functions work for `T: ?Sized`.

We still have to adjust the implementation of `Weak::from_raw` here, however, because I missed a use of `ptr.is_null()` previously. This check was necessary when `into`/`from_raw` were first implemented, as `into_raw` returned `ptr::null()` for dangling weak. However, we now just (wrapping) offset dangling weaks' pointers the same as nondangling weak, so the null check is no longer necessary (or even hit). (I can submit just 17a928f as a separate PR if desired.)

As a nice side effect, moves the `fn is_dangling` definition closer to `Weak::new`, which creates the dangling weak.

This technically stabilizes that "something like `align_of_val_raw`" is possible to do. However, I believe the part of the functionality required by these methods here -- specifically, getting the alignment of a pointee from a pointer where it may be dangling iff the pointee is `Sized` -- is uncontroversial enough to stabilize these methods without a way to implement them on stable Rust.

r? `@RalfJung,` who reviewed #73845.

ATTN: This changes (relaxes) the (input) generic bounds on stable fn!
2020-10-03 14:18:26 +00:00
Mark Rousskov
bcab97c12e Check all Cargo targets on CI 2020-10-03 09:53:13 -04:00
Mark Rousskov
f2961638c8 Place all-targets checking behind a flag
This matches Cargo behavior and avoids the (somewhat expensive) double checking,
as well as the unfortunate duplicate error messages (#76822,
rust-lang/cargo#5128).
2020-10-03 09:53:13 -04:00
Guillaume Gomez
ca199b16e5 Use char_indices() instead of chars() to prevent more than one-byte characters issue 2020-10-03 15:43:04 +02:00
varkor
96eb68b121 Add FIXME for const generic defaults 2020-10-03 14:28:55 +01:00
varkor
488b759d5c Replace "non trivial" with "non-trivial" 2020-10-03 14:28:54 +01:00
Guillaume Gomez
5bc148957e Correctly handle unicode characters and tags being open just before the end of the doc comment 2020-10-03 14:16:24 +02:00
Guillaume Gomez
30cabfd215 Don't warn if the tag is nested inside a <script> or inside a <style> 2020-10-03 14:16:24 +02:00
Guillaume Gomez
b2321bb8da Add test for invalid_html_tag lint in deny(rustdoc) 2020-10-03 14:16:24 +02:00
Guillaume Gomez
6163d89224 Improve code 2020-10-03 14:16:24 +02:00
Guillaume Gomez
4a3746e67b Fix visitor for invalid_html_tag lint 2020-10-03 14:16:24 +02:00
Guillaume Gomez
f9a65afb27 Make invalid_html_tags lint only run on nightly and being allowed by default 2020-10-03 14:16:24 +02:00
Guillaume Gomez
6271a0a46d Improve invalid_html_tags lint span 2020-10-03 14:16:24 +02:00
Guillaume Gomez
bc6ec6fe36 Add test for unclosed_html_tag lint 2020-10-03 14:16:24 +02:00
Guillaume Gomez
5fcbf4668e Add doc for invalid_html_tag lint 2020-10-03 14:16:24 +02:00
Guillaume Gomez
e6027a42e1 Add unclosed_html_tags lint 2020-10-03 14:16:23 +02:00
Ralf Jung
e27ef130c1
grammar nit 2020-10-03 12:15:26 +02:00
bors
6f56fbdc1c Auto merge of #77347 - jyn514:dox, r=Amanieu
Remove --cfg dox from rustdoc.rs

This was added in https://github.com/rust-lang/rust/pull/53076 because
several dependencies were using `cfg(dox)` instead of `cfg(rustdoc)` (now `cfg(doc)`).
I ran `rg 'cfg\(dox\)'` on the source tree with no matches, so I think
this is now safe to remove.

r? `@Mark-Simulacrum`
cc `@QuietMisdreavus` :)
2020-10-03 07:23:02 +00:00
Camelid
aa9b718cf0 Improve error messages 2020-10-02 19:53:09 -07:00
Jubilee Young
c47caeaaa9 Macro-expand test to cover all possible lanes 2020-10-02 19:38:56 -07:00
bors
8c54cf67c1 Auto merge of #77451 - Mark-Simulacrum:bump-version, r=pietroalbini
Bump version to 1.49.0

r? `@pietroalbini`
2020-10-03 02:10:42 +00:00
Valerii Lashmanov
d1d2184db4 SsoHashSet/Map - genericiy over Q removed
Due to performance regression, see SsoHashMap comment.
2020-10-02 20:13:23 -05:00
Camelid
21fb9dfa8d Use old error when there's partial resolution
The new error was confusing when there was partial resolution (something
like `std::io::nonexistent`); the old one is better for those cases.
2020-10-02 18:00:57 -07:00
Stein Somers
d71d13e82d BTreeMap: refactoring around edges, missed spots 2020-10-03 01:06:55 +02:00
bors
6ebad43c25 Auto merge of #77470 - jonas-schievink:rollup-9a2hulp, r=jonas-schievink
Rollup of 8 pull requests

Successful merges:

 - #75377 (Fix Debug implementations of some of the HashMap and BTreeMap iterator types)
 - #76107 (Write manifest for MAJOR.MINOR channel to enable rustup convenience)
 - #76745 (Move Wrapping<T> ui tests into library)
 - #77182 (Add missing examples for Fd traits)
 - #77251 (Bypass const_item_mutation if const's type has Drop impl)
 - #77264 (Only use LOCAL_{STDOUT,STDERR} when set_{print/panic} is used. )
 - #77421 (Revert "resolve: Avoid "self-confirming" import resolutions in one more case")
 - #77452 (Permit ty::Bool in const generics for v0 mangling)

Failed merges:

r? `@ghost`
2020-10-02 22:47:35 +00:00