Commit Graph

121780 Commits

Author SHA1 Message Date
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
ortem
47c26e69a9 Implement new gdb/lldb pretty-printers
Replace old GDB and LLDB pretty-printers with new ones
which were originally written for IntelliJ Rust.
New LLDB pretty-printers support synthetic children.
New GDB/LLDB pretty-printers support all Rust types
supported by old pretty-printers, and also support:
Rc, Arc, Cell, Ref, RefCell, RefMut, HashMap, HashSet.
2020-06-09 16:13:11 +03: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
Ayaz Hafiz
2981395d0c
fixup! Add regression test for const generic ICE in #72819 2020-06-08 18:04:41 -07:00
Ayaz Hafiz
f82382af28
fixup! Add regression test for const generic ICE in #72819 2020-06-08 17:46:28 -07:00
bors
5d39f1fa29 Auto merge of #73147 - Dylan-DPC:rollup-9saqhj5, r=Dylan-DPC
Rollup of 8 pull requests

Successful merges:

 - #71842 (doc: make impl block collapsible if it has an associated constant)
 - #72912 (Add new E0758 error code)
 - #73008 (Update RELEASES.md)
 - #73090 (Use `LocalDefId` directly in `Resolver::export_map`)
 - #73118 (Improve the wording in documentation of std::mem::drop)
 - #73124 (Removed lifetime parameters from Explanation of E0207 )
 - #73138 (Use shorthand linker strip arguments in order to support MacOS)
 - #73143 (Update books)

Failed merges:

r? @ghost
2020-06-08 23:52:04 +00:00
Dylan MacKenzie
b6121a5419 Add regression test for #73137
Co-authored-by: Aaron1011 <aa1ronham@gmail.com>
2020-06-08 16:51:26 -07:00
marmeladema
51e17249da save_analysis: better handle functions signature 2020-06-09 00:20:23 +01:00
marmeladema
7b94fdb95c save_analysis: better handle paths 2020-06-09 00:11:32 +01:00
Dylan MacKenzie
c3b0b7b68f Revert #71956 2020-06-08 14:58:37 -07:00
Nicholas Nethercote
c9cbe7e7eb Rename some identifiers in RawVec and libarena.
- Use `len` more consistently for the number of elements in a vector,
  because that's the usual name.
- Use `additional` more consistently for the number of elements we want
  to add, because that's what `Vec::reserve()` uses.
- Use `cap` consistently rather than `capacity`.
- Plus a few other tweaks.

This increases consistency and conciseness.
2020-06-09 07:55:35 +10:00
Nicholas Nethercote
cb8bc8e05d Remove RawVec::reserve_in_place.
Also remove a now-unnecessary `placement` argument.
2020-06-09 07:55:34 +10:00
Nicholas Nethercote
7145b87751 Remove the reserve_in_place calls in {Typed,Dropless}Arena::grow.
They are pointless. No reasonable allocator will be able to satisfy a
`reserve_in_place` request that *doubles* the size of an allocation when
dealing with allocations that are 4 KiB and larger.

Just to be sure, I confirmed on Linux that the `reserve_in_place` calls
never succeed.

(Note however that the `reserve_in_place` call for `DroplessArena::grow`
did occasionally succeed prior to the off-by-one fix in the previous
commit, because we would sometimes do a `reserve_in_place` request for
the chunk's current size, which would trivially succeed!)
2020-06-09 07:55:34 +10:00