Commit graph

124862 commits

Author SHA1 Message Date
Ralf Jung
854d8e8ceb update Miri 2020-08-06 23:55:30 +02:00
Leijurv
6eeae7d420
Fix typo "TraitObligatiom" -> "TraitObligation" 2020-08-06 14:37:32 -07:00
Joshua Nelson
f05e9da493 Still print help even if there's no span 2020-08-06 17:10:52 -04:00
Nicholas Nethercote
ebbf07a154 Change the type of AssertModuleSource::available_cgus.
It's currently a `BTreeSet<Symbol>`, which is a strange type. The
`BTreeSet` suggests that element order is important, but `Symbol` is a
type whose ordering isn't useful to humans. The ordering of the
collection only manifests in an obscure error message ("no module named
`...`") that doesn't appear in any tests.

This commit changes the `Symbol` to a `String`, which is more
typical.
2020-08-07 06:58:14 +10:00
Bastian Kauschke
37c29adabc allow complex expressions in assoc consts 2020-08-06 22:37:20 +02:00
bors
71f8d0c8f1 Auto merge of #75228 - tmiasko:keep-stdout-open, r=ecstatic-morse
Keep stdout open in limit_vector_count test
2020-08-06 20:22:20 +00:00
Vadim Petrochenkov
a7eabec1df Add some comments for magic numbers + Add tests 2020-08-06 22:55:26 +03:00
Vadim Petrochenkov
6b25c50ed4 Fix clippy 2020-08-06 22:13:11 +03:00
Vadim Petrochenkov
712de2b521 rustc_expand: Don not beautify doc comments before passing them to macros
Beautify all doc strings in rustdoc instead, including those in `#[doc]` attributes
2020-08-06 22:13:11 +03:00
Vadim Petrochenkov
000c070b70 rustc_ast/comments: Modernize some enum reexports 2020-08-06 22:13:11 +03:00
Vadim Petrochenkov
46f48d31fe rustc_ast: Stop using "string typing" for doc comment tokens
Explicitly store their kind and style retrieved during lexing in the token
2020-08-06 22:13:11 +03:00
Amanieu d'Antras
9abdb6db6f Fix ICE when using asm! on an unsupported architecture
Fixes #75220
2020-08-06 19:52:15 +01:00
bors
0d75c91def Auto merge of #75218 - Aaron1011:feature/prof-metadata-query, r=Mark-Simulacrum
Record query name when profiling "metadata_decode_entry"
2020-08-06 18:26:50 +00:00
Aaron Hill
bbcacddef6
Don't call a function in function-arguments-naked.rs
Fixes #75096

It's U.B. to use anything other than inline assmebling in a naked
function. Fortunately, the `#break` directive works fine without
anything in the function body.
2020-08-06 12:12:59 -04:00
bors
c15bae53b5 Auto merge of #75086 - lzutao:u32const, r=oli-obk
Use u32::from_ne_bytes to fix a FIXME and add comment about that

`u32::from_ne_bytes` has been const stable since 1.44.
2020-08-06 14:21:48 +00:00
Aaron Hill
c9bd9431d0
Record query name when profiling "metadata_decode_entry" 2020-08-06 09:33:34 -04:00
bors
4b0882cfaa Auto merge of #74889 - JohnTitor:hrtb-tests, r=nikomatsakis
Add HRTB-related regression test

Closes #59311 and cc #71546
This closes the former but the test is taken from https://github.com/rust-lang/rust/issues/71546#issuecomment-620638437 since it seems they have the same cause and it's simplified.
2020-08-06 12:12:59 +00:00
Guillaume Gomez
57b517bf1d Clean up E0747 explanation 2020-08-06 13:33:54 +02:00
Tim Diekmann
a784729cde Add as_mut_ptr to NonNull<[T]> 2020-08-06 11:45:54 +02:00
Lzu Tao
eff7d568d8 Note about endianness of returned value
in {integer}::from_be_bytes and friends.
2020-08-06 07:33:07 +00:00
bors
3cfc7fe78e Auto merge of #75008 - eddyb:rmeta-indexed-trait-impls, r=nikomatsakis
rustc_metadata: track the simplified Self type for every trait impl.

For the `traits_impls_of` query, we index the impls by `fast_reject::SimplifiedType` (a "shallow type"), which allows some simple cases like `impl Trait<..> for Foo<..>` to be efficiently iterated over, by e.g. `for_each_relevant_impl`.

This PR encodes the `fast_reject::SimplifiedType` cross-crate to avoid needing to deserialize the `Self` type of every `impl` in order to simplify it - the simplification itself should be cheap, but the deserialization is less so.

We could go further from here and make loading the list of impls lazy, for a given simplified `Self` type, but that would have more complicated implications for performance, and this PR doesn't do anything in that regard.

r? @nikomatsakis cc @Mark-Simulacrum
2020-08-06 03:23:57 +00:00
Joshua Nelson
2dad90d8b5 Suggest f() for functions and add a test case 2020-08-05 20:46:02 -04:00
Tomasz Miąsko
888bc07c6b Keep stdout open in limit_vector_count test 2020-08-06 00:00:00 +00:00
Nazım Can Altınova
cedf96c834
Add a test for BTreeMap lifetime bound to see if it compiles 2020-08-05 23:44:34 +02:00
Nazım Can Altınova
62e06a4d09
Make IntoIterator lifetime bounds of &BTreeMap match with &HashMap 2020-08-05 23:32:13 +02:00
Yuki Okushi
cc36c3d140
Add a FIXME comment 2020-08-06 05:21:03 +09:00
bors
22ee68dc58 Auto merge of #75166 - JulianKnodt:i64494, r=lcnr
Add regression test for #64494

Add regression test to indicate if this compilation ever succeeds.
Fixes #64494

r? @lcnr
2020-08-05 20:20:56 +00:00
bors
52b179b4b5 Auto merge of #75005 - adamreichold:limit-vector-count, r=Amanieu
Limit I/O vector count on Unix

Unix systems enforce limits on the vector count when performing vectored I/O via the readv and writev system calls and return EINVAL when these limits are exceeded. This changes the standard library to handle those limits as short reads and writes to avoid forcing its users to query these limits using platform specific mechanisms.

Fixes #68042
2020-08-05 17:58:55 +00:00
Bastian Kauschke
0d54f571c1 impl review 2020-08-05 18:30:37 +02:00
Bastian Kauschke
a5a5ca0da8 add tracking issue 2020-08-05 18:30:37 +02:00
Bastian Kauschke
188bbf840d forbid complex types for generic parameters 2020-08-05 18:30:37 +02:00
Bastian Kauschke
289e5fca7e forbid generic params in complex consts 2020-08-05 18:30:37 +02:00
Bastian Kauschke
375bccb8b3 add min_const_generics feature gate 2020-08-05 18:30:37 +02:00
bors
db870ea71b Auto merge of #75194 - Aaron1011:feature/macro-backtrace-numbers, r=eddyb
Show backtrace numbers in backtrace whenever more than one is involved

Previously, we only displayed 'frame' numbers in a macro backtrace when more
than two frames were involved. This commit should help make backtrace
more readable, since these kinds of messages can quickly get confusing.
2020-08-05 16:08:53 +00:00
Adam Reichold
9073acdc98 Add fallback for cfg(unix) targets that do not define libc::_SC_IOV_MAX. 2020-08-05 17:15:08 +02:00
Aaron Hill
f9f8923393
Show backtrace numbers in backtrace whenever more than one is involved
Previously, we only displayed 'frame' numbers in a macro backtrace when more
than two frames were involved. This commit should help make backtrace
more readable, since these kinds of messages can quickly get confusing.
2020-08-05 11:05:12 -04:00
Adam Reichold
04a0114e7e Rely only on POSIX semantics for I/O vector count
All #[cfg(unix)] platforms follow the POSIX standard and define _SC_IOV_MAX so
that we rely purely on POSIX semantics to determine the limits on I/O vector
count.
2020-08-05 16:57:02 +02:00
Adam Reichold
87edccf0f0 Reduce synchronization overhead of I/O vector count memoization 2020-08-05 16:57:02 +02:00
Adam Reichold
6672f7be03 Memoize the I/O vector count limit
Keep the I/O vector count limit in a `SyncOnceCell` to avoid the overhead of
repeatedly calling `sysconf` as these limits are guaranteed to not change during
the lifetime of a process by POSIX.
2020-08-05 16:57:02 +02:00
Adam Reichold
9468752581 Query maximum vector count on Linux and macOS
Both Linux and MacOS enforce limits on the vector count when performing vectored
I/O via the readv and writev system calls and return EINVAL when these limits
are exceeded. This changes the standard library to handle those limits as short
reads and writes to avoid forcing its users to query these limits using
platform specific mechanisms.
2020-08-05 16:57:02 +02:00
bors
ec9d5241f7 Auto merge of #75165 - JulianKnodt:i72787, r=lcnr
Add regression test for #72787

Add regression test for Issue #72787
Fixes #72787

~~Still waiting on running tests locally to bless the error output~~

r? @lcnr
2020-08-05 14:00:00 +00:00
Guillaume Gomez
cd4633917d Clean up E0746 explanation 2020-08-05 14:14:21 +02:00
Aaron Hill
48bc398207
Handle fieldless tuple structs in diagnostic code
Fixes #75062
2020-08-05 07:59:26 -04:00
bors
8b84156c6e Auto merge of #75169 - ehuss:update-cargo, r=ehuss
Update cargo

8 commits in 2d5c2381e4e50484bf281fc1bfe19743aa9eb37a..1653f354644834073d6d2541e27fae94588e685e
2020-07-31 21:56:08 +0000 to 2020-08-04 23:14:37 +0000
- Fix close_output test. (rust-lang/cargo#8587)
- clippy fixes, use matches! macro in more places (rust-lang/cargo#8575)
- Display embedded man pages for built-in commands. (rust-lang/cargo#8456)
- Add mdman for generating man pages. (rust-lang/cargo#8577)
- Fix typo 'more then' -&gt; 'more than' in error and comments (rust-lang/cargo#8581)
- cargo login: make login message less ambiguous (rust-lang/cargo#8579)
- Fix broken link in Build Cache chapter. (rust-lang/cargo#8578)
- Fix intra-doc tests for renamed lint. (rust-lang/cargo#8576)
2020-08-05 11:17:36 +00:00
bors
1d69e3b1d7 Auto merge of #75124 - nnethercote:clean-up-rustdoc-main, r=oli-obk
Clean up rustdoc's `main()`

It can be simplified and made more similar to rustc's `main()`.

r? @oli-obk
2020-08-05 09:09:17 +00:00
Aaron Hill
0d8260ee48
Label rustfmt toolstate issues with A-rustfmt
This makes it easier to filter toolstate issues by the tool involved.
2020-08-05 05:03:08 -04:00
Waffle Lapkin
188ef3a200
Fix typo in librustc_feature/active.rs 2020-08-05 11:02:47 +03:00
bors
7f8ff84b51 Auto merge of #75155 - davidtwco:polymorphization-incr-comp-optimisations, r=lcnr
polymorphization: various improvements

This PR includes a handful of polymorphisation-related changes:

- @Mark-Simulacrum's suggestions [from this comment](https://github.com/rust-lang/rust/pull/74633#issuecomment-668684433):
    - Use a `FiniteBitSet<u32>` over a `FiniteBitSet<u64>` as most functions won't have 64 generic parameters.
    - Don't encode polymorphisation results in metadata when every parameter is used (in this case, just invoking polymorphisation will probably be quicker).
- @lcnr's suggestion [from this comment](https://github.com/rust-lang/rust/pull/74717#discussion_r463690015).
    - Add an debug assertion in `ensure_monomorphic_enough` to make sure that polymorphisation did what we expect.

r? @lcnr
2020-08-05 06:55:42 +00:00
Lzu Tao
d9f260e95e Remove unused FromInner impl for Ipv4Addr 2020-08-05 05:53:07 +00:00
Lzu Tao
725d37cae0 Make doctests of Ipv4Addr::from(u32) easier to read 2020-08-05 05:31:17 +00:00