Skip to content
This repository has been archived by the owner on May 23, 2024. It is now read-only.

ices/104631.rs: fixed with errors #1567

Merged
merged 1 commit into from
Apr 10, 2023
Merged

ices/104631.rs: fixed with errors #1567

merged 1 commit into from
Apr 10, 2023

Conversation

github-actions[bot]
Copy link
Contributor

Issue: rust-lang/rust#104631

//[normal] check-pass

#![feature(dyn_star)]
//~^ WARN the feature `dyn_star` is incomplete and may not be safe to use and/or cause compiler crashes

use std::fmt::Debug;

#[cfg_attr(over_aligned,      repr(C, align(1024)))]
#[cfg_attr(not(over_aligned), repr(C))]
#[derive(Debug)]
struct AlignedUsize(usize);

fn main() {
    let x = AlignedUsize(12) as dyn* Debug;
    //[over_aligned]~^ ERROR `AlignedUsize` needs to be a pointer-sized type
}
=== stdout ===
=== stderr ===
warning: the feature `dyn_star` is incomplete and may not be safe to use and/or cause compiler crashes
 --> /home/runner/work/glacier/glacier/ices/104631.rs:3:12
  |
3 | #![feature(dyn_star)]
  |            ^^^^^^^^
  |
  = note: see issue #102425 <https://github.com/rust-lang/rust/issues/102425> for more information
  = note: `#[warn(incomplete_features)]` on by default

error[E0277]: `AlignedUsize` needs to have the same ABI as a pointer
  --> /home/runner/work/glacier/glacier/ices/104631.rs:14:13
   |
14 |     let x = AlignedUsize(12) as dyn* Debug;
   |             ^^^^^^^^^^^^^^^^ `AlignedUsize` needs to be a pointer-like type
   |
   = help: the trait `PointerLike` is not implemented for `AlignedUsize`

error: aborting due to previous error; 1 warning emitted

For more information about this error, try `rustc --explain E0277`.
==============

=== stdout ===
=== stderr ===
warning: the feature `dyn_star` is incomplete and may not be safe to use and/or cause compiler crashes
 --> /home/runner/work/glacier/glacier/ices/104631.rs:3:12
  |
3 | #![feature(dyn_star)]
  |            ^^^^^^^^
  |
  = note: see issue #102425 <rust-lang/rust#102425> for more information
  = note: `#[warn(incomplete_features)]` on by default

error[E0277]: `AlignedUsize` needs to have the same ABI as a pointer
  --> /home/runner/work/glacier/glacier/ices/104631.rs:14:13
   |
14 |     let x = AlignedUsize(12) as dyn* Debug;
   |             ^^^^^^^^^^^^^^^^ `AlignedUsize` needs to be a pointer-like type
   |
   = help: the trait `PointerLike` is not implemented for `AlignedUsize`

error: aborting due to previous error; 1 warning emitted

For more information about this error, try `rustc --explain E0277`.
==============
@JohnTitor JohnTitor merged commit 1a44f4d into master Apr 10, 2023
@JohnTitor JohnTitor deleted the autofix/ices/104631.rs branch April 10, 2023 14:37
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants