Auto merge of #97825 - Dylan-DPC:rollup-ya51k1k, r=Dylan-DPC
Rollup of 5 pull requests Successful merges: - #97058 (Various refactors to the incr comp workproduct handling) - #97301 (Allow unstable items to be re-exported unstably without requiring the feature be enabled) - #97738 (Fix ICEs from zsts within unsized types with non-zero offsets) - #97771 (Remove SIGIO reference on Haiku) - #97808 (Add some unstable target features for the wasm target codegen) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
This commit is contained in:
commit
7fe2c4b00d
18 changed files with 284 additions and 115 deletions
30
src/test/ui/stability-attribute/allow-unstable-reexport.rs
Normal file
30
src/test/ui/stability-attribute/allow-unstable-reexport.rs
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
// Allow an unstable re-export without requiring a feature gate.
|
||||
// #94972
|
||||
|
||||
// aux-build:lint-stability.rs
|
||||
// aux-build:lint-stability-reexport.rs
|
||||
#![feature(staged_api)]
|
||||
#![stable(feature = "lint_stability", since = "1.0.0")]
|
||||
|
||||
extern crate lint_stability;
|
||||
extern crate lint_stability_reexport;
|
||||
|
||||
#[unstable(feature = "unstable_test_feature", issue = "none")]
|
||||
pub use lint_stability::unstable;
|
||||
|
||||
// We want to confirm that using a re-export through another crate behaves
|
||||
// the same way as using an item directly
|
||||
#[unstable(feature = "unstable_test_feature", issue = "none")]
|
||||
pub use lint_stability_reexport::unstable_text;
|
||||
|
||||
// Ensure items which aren't marked as unstable can't re-export unstable items
|
||||
#[stable(feature = "lint_stability", since = "1.0.0")]
|
||||
pub use lint_stability::unstable as unstable2;
|
||||
//~^ ERROR use of unstable library feature 'unstable_test_feature'
|
||||
|
||||
fn main() {
|
||||
// Since we didn't enable the feature in this crate, we still can't
|
||||
// use these items, even though they're in scope from the `use`s which are now allowed.
|
||||
unstable(); //~ ERROR use of unstable library feature 'unstable_test_feature'
|
||||
unstable_text(); //~ ERROR use of unstable library feature 'unstable_test_feature'
|
||||
}
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
error[E0658]: use of unstable library feature 'unstable_test_feature'
|
||||
--> $DIR/allow-unstable-reexport.rs:22:9
|
||||
|
|
||||
LL | pub use lint_stability::unstable as unstable2;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= help: add `#![feature(unstable_test_feature)]` to the crate attributes to enable
|
||||
|
||||
error[E0658]: use of unstable library feature 'unstable_test_feature'
|
||||
--> $DIR/allow-unstable-reexport.rs:28:5
|
||||
|
|
||||
LL | unstable();
|
||||
| ^^^^^^^^
|
||||
|
|
||||
= help: add `#![feature(unstable_test_feature)]` to the crate attributes to enable
|
||||
|
||||
error[E0658]: use of unstable library feature 'unstable_test_feature': text
|
||||
--> $DIR/allow-unstable-reexport.rs:29:5
|
||||
|
|
||||
LL | unstable_text();
|
||||
| ^^^^^^^^^^^^^
|
||||
|
|
||||
= help: add `#![feature(unstable_test_feature)]` to the crate attributes to enable
|
||||
|
||||
error: aborting due to 3 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0658`.
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
#![crate_type = "lib"]
|
||||
#![feature(staged_api)]
|
||||
#![stable(feature = "lint_stability", since = "1.0.0")]
|
||||
|
||||
extern crate lint_stability;
|
||||
|
||||
// Re-exporting without enabling the feature "unstable_test_feature" in this crate
|
||||
#[unstable(feature = "unstable_test_feature", issue = "none")]
|
||||
pub use lint_stability::unstable_text;
|
||||
28
src/test/ui/unsized/issue-97732.rs
Normal file
28
src/test/ui/unsized/issue-97732.rs
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
// check-pass
|
||||
|
||||
#![feature(coerce_unsized)]
|
||||
|
||||
// Ensure that unsizing structs that contain ZSTs at non-zero offsets don't ICE
|
||||
|
||||
use std::ops::CoerceUnsized;
|
||||
|
||||
#[repr(C)]
|
||||
pub struct BoxWithZstTail<T: ?Sized>(Box<T>, ());
|
||||
|
||||
impl<S: ?Sized, T: ?Sized> CoerceUnsized<BoxWithZstTail<T>> for BoxWithZstTail<S> where
|
||||
Box<S>: CoerceUnsized<Box<T>>
|
||||
{
|
||||
}
|
||||
|
||||
pub fn noop_dyn_upcast_with_zst_tail(
|
||||
b: BoxWithZstTail<dyn ToString + Send>,
|
||||
) -> BoxWithZstTail<dyn ToString> {
|
||||
b
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let original = "foo";
|
||||
let boxed = BoxWithZstTail(Box::new(original) as Box<dyn ToString + Send>, ());
|
||||
let noop_upcasted = noop_dyn_upcast_with_zst_tail(boxed);
|
||||
assert_eq!(original, noop_upcasted.0.to_string());
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue