Skip to content

Rollup of 10 pull requests #75684

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 46 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
e720f42
See also X-Link mem::{swap, take, replace}
Havvy Aug 2, 2020
7835c8c
docs(marker/copy): clarify that `&T` is also `Copy`
janriemer Aug 2, 2020
9b0f3d1
Fix documentation error
jack-champagne Aug 13, 2020
a876b3d
docs(marker/copy): provide example for `&T` being `Copy`
janriemer Aug 16, 2020
43dec0e
rephrase: struct -> type
janriemer Aug 16, 2020
dce8644
add back emojis that have been removed accidentally
janriemer Aug 16, 2020
9061da2
add empty line above code block
janriemer Aug 16, 2020
56daf63
docs: add `derive` for struct
janriemer Aug 16, 2020
b0eb55a
Add test demonstrating the issue.
jumbatm Aug 15, 2020
db75313
Fix stack overflow for recursive types.
jumbatm Aug 15, 2020
154b74e
Actually introduce a cycle in Reffy test.
jumbatm Aug 16, 2020
a1fa4e0
Remove unnecessary rebinding of def ids.
jumbatm Aug 16, 2020
80c2c80
Remove structural equiv check for Array const.
jumbatm Aug 16, 2020
bca48ad
Reduce indentation by replacing match arm w/ early return.
jumbatm Aug 16, 2020
6c57de1
Don't memoize seen types.
jumbatm Aug 16, 2020
7708abb
Avoid double hashset lookup.
jumbatm Aug 16, 2020
1321a2d
Also accept Refs for is_primitive_or_pointer
jumbatm Aug 16, 2020
bc15dd6
Wrap recursion in `ensure_sufficient_stack`.
jumbatm Aug 17, 2020
431a465
Move to intra doc links for keyword documentation
poliorcetics Aug 17, 2020
a4995fc
Refactor `impl_for_type` into a separate function
jyn514 Aug 17, 2020
833bbb1
Say `tcx.lang_items()` less
jyn514 Aug 17, 2020
dae3a4f
Return all impls, not just the primary one
jyn514 Aug 17, 2020
c6ac860
impl_for_type -> PrimitiveType::impls
jyn514 Aug 17, 2020
3b1d2e3
Allow reusing the code in `collect_trait_impls`
jyn514 Aug 17, 2020
1b74f04
Use `impls` for intra doc links as well
jyn514 Aug 17, 2020
2858074
xpy fmt
jyn514 Aug 17, 2020
7be824e
Add a test
jyn514 Aug 17, 2020
38b920d
Capture output from threads spawned in tests
tmandry Aug 5, 2020
e24aa73
rewrite old test so that its attributes are consistent with what we w…
pnkfelix Jun 15, 2020
01e8e9f
When building lint specs map for a given scope, check if forbid prese…
pnkfelix Jun 15, 2020
ef03a5d
Regression test.
pnkfelix Jun 15, 2020
4ec4c4f
review suggestion: use existing defn rather than new intern call
pnkfelix Jun 30, 2020
8c4641b
BTreeMap: check some invariants, avoid recursion in depth first search
ssomers Aug 18, 2020
d9d84dc
Add doc examples count for --show-coverage
GuillaumeGomez Aug 18, 2020
f957bae
Update rustdoc-ui tests
GuillaumeGomez Aug 18, 2020
522d177
docs: add another `derive` for `Copy`able struct
Aug 18, 2020
7ae6928
Rollup merge of #73379 - pnkfelix:issue-70819-disallow-override-forbi…
tmandry Aug 18, 2020
3271a75
Rollup merge of #75038 - rust-lang:Havvy-patch-1, r=steveklabnik
tmandry Aug 18, 2020
36ac8ec
Rollup merge of #75049 - janriemer:patch-1, r=poliorcetics
tmandry Aug 18, 2020
03922c6
Rollup merge of #75172 - tmandry:test-thread-capture, r=dtolnay
tmandry Aug 18, 2020
c0f429f
Rollup merge of #75480 - ssomers:btree_check_invariant, r=Mark-Simula…
tmandry Aug 18, 2020
61e2369
Rollup merge of #75499 - jack-champagne:jack-champagne/issue-75412, r…
tmandry Aug 18, 2020
e6b2bd6
Rollup merge of #75554 - jumbatm:fix-clashing-extern-decl-overflow, r…
tmandry Aug 18, 2020
c915685
Rollup merge of #75646 - poliorcetics:intra-links-keywords, r=jyn514
tmandry Aug 18, 2020
198dce3
Rollup merge of #75649 - jyn514:inherent-lang-impls, r=GuillaumeGomez
tmandry Aug 18, 2020
5dc062e
Rollup merge of #75665 - GuillaumeGomez:doc-examples-coverage, r=jyn514
tmandry Aug 18, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Also accept Refs for is_primitive_or_pointer
jumbatm committed Aug 17, 2020

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 1321a2dce32893588a0ec4ba586c3a04fb5e47cf
9 changes: 5 additions & 4 deletions src/librustc_lint/builtin.rs
Original file line number Diff line number Diff line change
@@ -2184,8 +2184,9 @@ impl ClashingExternDeclarations {
};

#[allow(rustc::usage_of_ty_tykind)]
let is_primitive_or_pointer =
|kind: &ty::TyKind<'_>| kind.is_primitive() || matches!(kind, RawPtr(..));
let is_primitive_or_pointer = |kind: &ty::TyKind<'_>| {
kind.is_primitive() || matches!(kind, RawPtr(..) | Ref(..))
};

match (a_kind, b_kind) {
(Adt(a_def, a_substs), Adt(b_def, b_substs)) => {
@@ -2274,8 +2275,8 @@ impl ClashingExternDeclarations {
// These definitely should have been caught above.
(Bool, Bool) | (Char, Char) | (Never, Never) | (Str, Str) => unreachable!(),

// An Adt and a primitive type. This can be FFI-safe is the ADT is an enum with a
// non-null field.
// An Adt and a primitive or pointer type. This can be FFI-safe if non-null
// enum layout optimisation is being applied.
(Adt(..), other_kind) | (other_kind, Adt(..))
if is_primitive_or_pointer(other_kind) =>
{