Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Closed
Changes from 1 commit
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
8e3b9d2
Stabilize todo macro
Jun 15, 2019
560bf1b
Update src/libcore/macros.rs
Sep 4, 2019
711f673
Update macros.rs
Sep 4, 2019
445e735
Prevent rustdoc feature to be passed down to doctests
GuillaumeGomez Sep 25, 2019
366fdeb
Add new rustdoc-ui test to ensuire that rustdoc feature isn't passed …
GuillaumeGomez Sep 30, 2019
2ab7a67
Replace mentions of IRC with Discord
Oct 2, 2019
9fbb2a9
Fix missing calls to drop on unwind with lto=fat; issue 64655.
pnkfelix Oct 2, 2019
a371972
Regression tests for issue 64655.
pnkfelix Oct 2, 2019
3adcc3e
fix typo
pnkfelix Oct 2, 2019
c80ffcb
metadata: Remove `CrateMetadata::imported_name`
petrochenkov Sep 29, 2019
45d168a
metadata: Do not pass crate name after renaming to `register_crate`
petrochenkov Sep 29, 2019
cea2462
metadata: Remove `locator::Context::ident`
petrochenkov Sep 29, 2019
2293bdd
metadata: Simplify interface of `resolve_crate`
petrochenkov Sep 29, 2019
61a75af
metadata: Remove `CrateMetadata::host_lib`
petrochenkov Oct 1, 2019
498d908
metadata: Remove `CrateMetadata::name`
petrochenkov Oct 2, 2019
2d827b0
metadata: Remove unused `Option` from `fn dlsym_proc_macros`
petrochenkov Oct 2, 2019
94525e5
Dual proc macros: Use crate disambiguator from the target crate
petrochenkov Oct 2, 2019
a8d70d1
Add visit_projection_elem method to visitors
spastorino Oct 2, 2019
287ceed
Deprecate `#![plugin]` and `#[plugin_registrar]`.
Centril Sep 21, 2019
1b8ec97
plugin_registrary: use normal deprecation instead of hard coded warning.
Centril Oct 3, 2019
d1f95ef
--bless ui-fulldeps tests
Centril Oct 3, 2019
e7e6dec
Apply suggestions from code review
pnkfelix Oct 3, 2019
5e7e8cd
Update attributes.rs
pnkfelix Oct 3, 2019
71e5f78
Update issue-64655-extern-rust-must-allow-unwind.rs
pnkfelix Oct 3, 2019
4396a1c
add regression test for #60218
nikomatsakis Sep 20, 2019
e86af1b
Add long error explanation for E0556
GuillaumeGomez Oct 3, 2019
1d49f9a
update ui tests
GuillaumeGomez Oct 3, 2019
126bf3b
typo: fix typo in E0392
mathstuf Oct 3, 2019
b9ed642
Make visit_projection iterative
spastorino Oct 2, 2019
25c6376
Rollup merge of #61879 - stjepang:stabilize-todo, r=withoutboats
Centril Oct 3, 2019
fd7b2f8
Rollup merge of #64675 - Centril:deprecate-plugin, r=oli-obk
Centril Oct 3, 2019
e82d1d7
Rollup merge of #64706 - nikomatsakis:issue-60218-test-case, r=centril
Centril Oct 3, 2019
3c31eb3
Rollup merge of #64741 - GuillaumeGomez:prevent-rustdoc-feature-docte…
Centril Oct 3, 2019
38d76d8
Rollup merge of #65004 - BO41:mentions, r=alexcrichton
Centril Oct 3, 2019
527a747
Rollup merge of #65020 - pnkfelix:targetted-fix-for-always-marking-ru…
Centril Oct 3, 2019
7af56ad
Rollup merge of #65026 - petrochenkov:ice1, r=eddyb
Centril Oct 3, 2019
f258e49
Rollup merge of #65055 - GuillaumeGomez:long-err-explanation-E0556, r…
Centril Oct 3, 2019
320b931
Rollup merge of #65056 - spastorino:place-mut-visitor-adjusts, r=oli-obk
Centril Oct 3, 2019
dd97e17
Rollup merge of #65057 - mathstuf:fix-warning-typo, r=Centril
Centril Oct 3, 2019
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
Fix missing calls to drop on unwind with lto=fat; issue 64655.
  • Loading branch information
pnkfelix committed Oct 2, 2019
commit 9fbb2a9b347d44074fff8aab27cd161a9cd54c74
51 changes: 38 additions & 13 deletions src/librustc_codegen_llvm/attributes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -273,25 +273,50 @@ pub fn from_fn_attrs(
} else if codegen_fn_attrs.flags.contains(CodegenFnAttrFlags::RUSTC_ALLOCATOR_NOUNWIND) {
// Special attribute for allocator functions, which can't unwind
false
} else if let Some(id) = id {
} else if let Some(_) = id {
// rust-lang/rust#64655, rust-lang/rust#63909: to minimize
// risk associated with changing cases where nounwind
// attribute is attached, this code is deliberately mimicking
// old control flow based on whether `id` is `Some` or `None`.
//
// However, in the long term we should either:
// - fold this into final else (i.e. stop inspecting `id`)
// - or better still: whole-heartedly adopt Rust PR #63909.
//
// see also Rust RFC 2753.

let sig = cx.tcx.normalize_erasing_late_bound_regions(ty::ParamEnv::reveal_all(), &sig);
if cx.tcx.is_foreign_item(id) {
// Foreign items like `extern "C" { fn foo(); }` are assumed not to
// unwind
false
} else if sig.abi != Abi::Rust && sig.abi != Abi::RustCall {
// Any items defined in Rust that *don't* have the `extern` ABI are
// defined to not unwind. We insert shims to abort if an unwind
// happens to enforce this.
false
} else {
// Anything else defined in Rust is assumed that it can possibly
// unwind
if sig.abi == Abi::Rust || sig.abi == Abi::RustCall {
// Any Rust method (or `extern "Rust" fn` or `extern
// "rust-call" fn`) is explicitly allowed to unwind
// (unless it has no-unwind attribute, handled above).
true
} else {
// Anything else is either:
//
// 1. A foreign item (like `extern "C" { fn foo(); }`), or
//
// 2. A Rust item using a non-Rust ABI (like `extern "C" fn foo() { ... }`).
//
// Foreign items (case 1) are assumed to not unwind; it is
// UB otherwise. (At least for now; see also
// rust-lang/rust#63909 and Rust RFC 2753.)
//
// Items defined in Rust with non-Rust ABIs (case 2) are
// defined to not unwind. We insert shims to abort if an
// unwind happens to enforce this.
//
// In either case, we mark item as explicitly nounwind.
false
}
} else {
// assume this can possibly unwind, avoiding the application of a
// `nounwind` attribute below.
//
// (But: See comments in previous branch. Specifically, it is
// unclear whether there is real value in the assumption this
// can unwind. The conservatism here may just be papering over
// a real problem by making some UB a bit harder to hit.)
true
});

Expand Down