-
Notifications
You must be signed in to change notification settings - Fork 12.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of #66018 - pnkfelix:issue-64872-revert-64324, r=alexcri…
…chton Revert PR 64324: dylibs export generics again (for now) As discussed on PR #65781, this is a targeted attempt to undo the main semantic change from PR #64324, by putting `dylib` back in the set of crate types that export generic symbols. The main reason to do this is that PR #64324 had unanticipated side-effects that caused bugs like #64872, and in the opinion of @alexcrichton and myself, the impact of #64872 is worse than #64319. In other words, it is better for us, in the short term, to reopen #64319 as currently unfixed for now than to introduce new bugs like #64872. Fix #64872 Reopen #64319
- Loading branch information
Showing
12 changed files
with
79 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
src/test/ui/cross-crate/issue-64872/auxiliary/a_def_obj.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// compile-flags: -C debuginfo=2 | ||
|
||
// no-prefer-dynamic | ||
#![crate_type = "rlib"] | ||
|
||
pub trait Object { fn method(&self) { } } | ||
|
||
impl Object for u32 { } | ||
impl Object for () { } | ||
impl<T> Object for &T { } | ||
|
||
pub fn unused() { | ||
let ref u = 0_u32; | ||
let _d = &u as &dyn crate::Object; | ||
_d.method() | ||
} |
7 changes: 7 additions & 0 deletions
7
src/test/ui/cross-crate/issue-64872/auxiliary/b_reexport_obj.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// compile-flags: -C debuginfo=2 -C prefer-dynamic | ||
|
||
#![crate_type="dylib"] | ||
|
||
extern crate a_def_obj; | ||
|
||
pub use a_def_obj::Object; |
12 changes: 12 additions & 0 deletions
12
src/test/ui/cross-crate/issue-64872/auxiliary/c_another_vtable_for_obj.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// no-prefer-dynamic | ||
// compile-flags: -C debuginfo=2 | ||
#![crate_type="rlib"] | ||
|
||
extern crate b_reexport_obj; | ||
use b_reexport_obj::Object; | ||
|
||
pub fn another_dyn_debug() { | ||
let ref u = 1_u32; | ||
let _d = &u as &dyn crate::Object; | ||
_d.method() | ||
} |
9 changes: 9 additions & 0 deletions
9
src/test/ui/cross-crate/issue-64872/auxiliary/d_chain_of_rlibs_and_dylibs.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// compile-flags: -C debuginfo=2 -C prefer-dynamic | ||
|
||
#![crate_type="rlib"] | ||
|
||
extern crate c_another_vtable_for_obj; | ||
|
||
pub fn chain() { | ||
c_another_vtable_for_obj::another_dyn_debug(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// run-pass | ||
|
||
// note that these aux-build directives must be in this order: the | ||
// later crates depend on the earlier ones. (The particular bug that | ||
// is being exercised here used to exhibit itself during the build of | ||
// `chain_of_rlibs_and_dylibs.dylib`) | ||
|
||
// aux-build:a_def_obj.rs | ||
// aux-build:b_reexport_obj.rs | ||
// aux-build:c_another_vtable_for_obj.rs | ||
// aux-build:d_chain_of_rlibs_and_dylibs.rs | ||
|
||
extern crate d_chain_of_rlibs_and_dylibs; | ||
|
||
pub fn main() { | ||
d_chain_of_rlibs_and_dylibs::chain(); | ||
} |