Commit Graph

121790 Commits

Author SHA1 Message Date
Eric Huss
fdeed85355 Update cargo 2020-06-09 19:55:04 -07:00
Lzu Tao
fff822fead Migrate to numeric associated consts 2020-06-10 01:35:47 +00:00
bors
bb8674837a Auto merge of #73190 - Dylan-DPC:rollup-9wbyh4y, r=Dylan-DPC
Rollup of 8 pull requests

Successful merges:

 - #72417 (Remove `RawVec::reserve_in_place`.)
 - #73098 (Add Item::is_fake for rustdoc)
 - #73122 (Resolve E0584 conflict)
 - #73123 (Clean up E0647 explanation)
 - #73133 (Enforce unwind invariants)
 - #73148 (Fix a typo (size of the size))
 - #73149 (typo: awailable -> available)
 - #73161 (Add mailmap entry)

Failed merges:

r? @ghost
2020-06-10 00:48:35 +00:00
Santiago Pastorino
a01485c0da
Fix rustc-dev-guide url 2020-06-09 21:19:26 -03:00
Manish Goregaokar
e003c3ea05 Add test for proc macro resolution in intra doc links 2020-06-09 16:35:59 -07:00
Manish Goregaokar
4eda3f77bd intra-doc macro resolution should also handle proc macros 2020-06-09 16:35:59 -07:00
Dylan DPC
74380d712d
Rollup merge of #73161 - tspiteri:mailmap, r=nikomatsakis
Add mailmap entry
2020-06-10 01:06:35 +02:00
Dylan DPC
8a0e6e9335
Rollup merge of #73149 - cuviper:awailable, r=steveklabnik
typo: awailable -> available
2020-06-10 01:06:34 +02:00
Dylan DPC
80d60cc25e
Rollup merge of #73148 - DarkEld3r:patch-1, r=jonas-schievink
Fix a typo (size of the size)
2020-06-10 01:06:32 +02:00
Dylan DPC
161a8bf865
Rollup merge of #73133 - doctorn:unwind-mir-validation, r=jonas-schievink
Enforce unwind invariants

I had a quick look at #72959. The failure message probably needs to be more detailed but I just wanted to check I got the right idea. I have no idea how to right a test for this either...

r? @jonas-schievink

Resolves #72959 (hypothetically)
2020-06-10 01:06:30 +02:00
Dylan DPC
4ac3efa96e
Rollup merge of #73123 - GuillaumeGomez:cleanup-e0647, r=Dylan-DPC
Clean up E0647 explanation

r? @Dylan-DPC
2020-06-10 01:06:29 +02:00
Dylan DPC
95479d4905
Rollup merge of #73122 - doctorn:issue-73116, r=varkor
Resolve E0584 conflict

Adds a new error code (`E0761`) to indicate ambiguity in module file names and an accompanying expanded description to resolve a conflict over `E0584`.

Resolves #73116
2020-06-10 01:06:27 +02:00
Dylan DPC
cbfdff7a6b
Rollup merge of #73098 - jyn514:rustdoc-is-fake, r=GuillaumeGomez
Add Item::is_fake for rustdoc

I wasn't aware items _could_ be fake, so I think having a function
mentioning it could be helpful. Also, I'd need to make this change for
cross-crate intra-doc links anyway, so I figured it's better to make the
refactor separate.
2020-06-10 01:06:25 +02:00
Dylan DPC
860e6bdd2f
Rollup merge of #72417 - nnethercote:rm-RawVec-reserve_in_place, r=Amanieu
Remove `RawVec::reserve_in_place`.

And some related clean-ups.

r? @oli-obk
2020-06-10 01:06:23 +02:00
Mateusz Mikuła
377c55039a Remove missed cfg(bootstrap) 2020-06-10 00:24:15 +02:00
marmeladema
5bfa7f0ff4 save_analysis: fix enum reference to point to variant rather than constructor
Fixes #61302
2020-06-09 23:09:14 +01:00
marmeladema
9015c41433 save_analysis: improve pretty printing of enum 2020-06-09 23:04:58 +01:00
Niko Matsakis
e0ec3d5dc6
fix URLs, include ARM 2020-06-09 18:01:58 -04:00
Mateusz Mikuła
e237e0280b Reoder order in which MinGW libs are linked 2020-06-09 23:58:39 +02:00
LeSeulArtichaut
c9f2cbf215
Automatically prioritize unsoundness issues 2020-06-09 22:58:32 +02:00
bors
283522400b Auto merge of #72972 - lzutao:clippy, r=Manishearth
Pull changes from rust-lang/rust-clippy
2020-06-09 20:56:54 +00:00
Alexis Bourget
1312d30a6a Remove a lot of unecessary/duplicated comments 2020-06-09 22:40:30 +02:00
Alexis Bourget
b03164e667 Move to unstable, linking the issue 2020-06-09 22:15:05 +02:00
Vadim Petrochenkov
d60df536d5 Add tests for modifying lint levels for lints reported at expansion time 2020-06-09 22:36:33 +03:00
Vadim Petrochenkov
217a7451c4 expand: Give reasonable NodeIds to lints associated with macro definitions 2020-06-09 22:36:28 +03:00
Vadim Petrochenkov
73d5cb0a45 expand: Give reasonable NodeIds to lints associated with macro expansions 2020-06-09 22:27:13 +03:00
Matthias Krüger
58023fedfc Fix more clippy warnings
Fixes more of:

clippy::unused_unit
clippy::op_ref
clippy::useless_format
clippy::needless_return
clippy::useless_conversion
clippy::bind_instead_of_map
clippy::into_iter_on_ref
clippy::redundant_clone
clippy::nonminimal_bool
clippy::redundant_closure
clippy::option_as_ref_deref
clippy::len_zero
clippy::iter_cloned_collect
clippy::filter_next
2020-06-09 18:51:08 +02:00
Santiago Pastorino
c99164e7a1
Relate existential associated types with variance Invariant 2020-06-09 13:21:27 -03:00
Lzu Tao
41c845efd9 Merge commit 'ff0993c5e9162ddaea78e83d0f0161e68bd4ea73' into clippy 2020-06-09 14:36:01 +00:00
Amanieu d'Antras
5541f689e9 Handle assembler warnings properly 2020-06-09 15:01:02 +01:00
David Wood
d4d3d7de68
lint: transitive FFI-safety for transparent types
This commit ensures that if a `repr(transparent)` newtype's only
non-zero-sized field is FFI-safe then the newtype is also FFI-safe.

Previously, ZSTs were ignored for the purposes of linting FFI-safety
in transparent structs - thus, only the single non-ZST would be checked
for FFI-safety. However, if the non-zero-sized field is a generic
parameter, and is substituted for a ZST, then the type would be
considered FFI-unsafe (as when every field is thought to be zero-sized,
the type is considered to be "composed only of `PhantomData`" which is
FFI-unsafe).

In this commit, for transparent structs, the non-zero-sized field is
identified (before any substitutions are applied, necessarily) and then
that field's type (now with substitutions) is checked for FFI-safety
(where previously it would have been skipped for being zero-sized in
this case).

To handle the case where the non-zero-sized field is a generic
parameter, which is substituted for `()` (a ZST), and is being used
as a return type - the `FfiUnsafe` result (previously `FfiPhantom`) is
caught and silenced.

Signed-off-by: David Wood <david@davidtw.co>
2020-06-09 14:37:08 +01:00
David Wood
3e7aabb1b3
lint: check for unit ret type after normalization
This commit moves the check that skips unit return types to after
where the return type has been normalized - therefore ensuring that
FFI-safety lints are not emitted for types which normalize to unit.

Signed-off-by: David Wood <david@davidtw.co>
2020-06-09 14:37:05 +01:00
Nathan Corbyn
9495ee21b7 Address comments 2020-06-09 11:21:36 +01:00
Nathan Corbyn
039da0b832 Update comments 2020-06-09 11:14:41 +01:00
bors
feb3536eba Auto merge of #72114 - anyska:vtable-rename, r=nikomatsakis
Rename traits::Vtable to ImplSource.

Originally suggested by @eddyb.

r? @nikomatsakis
2020-06-09 09:14:49 +00:00
Trevor Spiteri
aef6335c15 Add mailmap entry 2020-06-09 10:51:15 +02:00
David Wood
a8640cdf47
improper_ctypes: add test for #66202
This commit adds a test of the improper ctypes lint, checking that
return type are normalized bethat return types are normalized before
being checked for FFI-safety, and that transparent newtype wrappers
are FFI-safe if the type being wrapped is FFI-safe.

Signed-off-by: David Wood <david@davidtw.co>
2020-06-09 09:03:15 +01:00
Dylan McKay
0340359b2a [AVR] Update ABI type classification logic to match the the AVR-Clang ABI
This patch brings the AVR calling convention argument classification
logic in line with AVR Clang's behaviour.

AVR-Clang currently uses the `clang::DefaultABIInfo` ABI implementation.
This calling convention promotes all aggregates to indirect, no matter their
size.

It is also unnecessary to perform any integer width extension for AVR as
the minimum argument size matches the minimum describable size of
abi::Primitive::Int - 8 bits.

At some point in the future, an AVR-GCC compatible argument
classification implementation should be adopted in both Clang and Rust.
2020-06-09 17:41:04 +12:00
Dylan McKay
1f0652ff67 [AVR] Rename the 'none_base' target spec module to 'freestanding_base' 2020-06-09 17:41:04 +12:00
Dylan McKay
8ba9cbd5c0 [AVR] Remove AVR-specific logic from libstd
It is not possible to compile libstd for AVR anyway.
2020-06-09 17:41:04 +12:00
Dylan McKay
b4a041c050 [AVR] Update the compiletest library to recognize AVR as a 16-bit target 2020-06-09 17:40:53 +12:00
Dylan McKay
e369cf6b27 [AVR] Re-bless the UI tests
Patch generated with `./x.py test --stage 1 src/test/ui/feature-gates --bless`.
2020-06-09 17:35:50 +12:00
Dylan McKay
edc344e8e9 [AVR] Raise and link to a tracking issue for the avr-interrupt calling convention
Also fix the order of the feature gate to fix the tidy errors.
2020-06-09 17:35:50 +12:00
Dylan McKay
13edc57bfa [AVR] Add required references for AVR to the parser test suites 2020-06-09 17:35:48 +12:00
Dylan McKay
91bff8ccdf [AVR] Fix debug printing of function pointers
This commit fixes debug printing of function pointers on AVR. AVR does
not support `addrspacecast` instructions, and so this patch modifies
libcore so that a `ptrtoint` IR instruction is used and the address
space cast is avoided.
2020-06-09 17:34:07 +12:00
Jake Goulding
690bb8af51 [AVR] Add AVR platform support 2020-06-09 17:34:07 +12:00
bors
ccac43b86b Auto merge of #73153 - ecstatic-morse:revert-71956, r=tmandry
Revert #71956

...since it caused unsoundness in #73137. Also adds a reduced version of #73137 to the test suite. The addition of the `MaybeInitializedLocals` dataflow analysis has not been reverted, but it is no longer used.

Presumably there is a more targeted fix, but I'm worried that other bugs may be lurking. I'm not yet sure what the root cause of #73137 is.

This will need to get backported to beta.

r? @tmandry
2020-06-09 03:41:43 +00:00
Ayush Kumar Mishra
b05555290c Remove noisy suggestion of hash_map #72642
Fixed failing test-cases

Remove noisy suggestion of hash_map #72642

Fixed failing test-cases
2020-06-09 08:49:05 +05:30
Aaron Hill
88262984eb
Show SyntaxContext in formatted Span debug output
This is only really useful in debug messages, so I've switched to
calling `span_to_string` in any place that causes a `Span` to end up in
user-visible output.
2020-06-08 21:47:33 -04:00
Aaron Hill
0fcea2e423
Don't lose empty where clause when pretty-printing
Previously, we would parse `struct Foo where;` and `struct Foo;`
identically, leading to an 'empty' `where` clause being omitted during
pretty printing. This will cause us to lose spans when proc-macros
involved, since we will have a collected `where` token that does not
appear in the pretty-printed item.

We now explicitly track the presence of a `where` token during parsing,
so that we can distinguish between `struct Foo where;` and `struct Foo;`
during pretty-printing
2020-06-08 21:09:54 -04:00