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

ices/92537.sh: fixed with errors #1173

Merged
merged 1 commit into from
Mar 19, 2022
Merged

ices/92537.sh: fixed with errors #1173

merged 1 commit into from
Mar 19, 2022

Conversation

github-actions[bot]
Copy link
Contributor

Issue: rust-lang/rust#92537

#!/usr/bin/env bash

rustc --target x86_64-pc-windows-msvc -C debuginfo=1 - <<EOF
use std::mem::MaybeUninit;

unsafe fn make_fat_ptr<T: ?Sized>(_: &u32) -> *mut T {
    MaybeUninit::<*mut T>::uninit().assume_init()
}

struct VNode<'src> {
    _x: &'src [VNode<'src>]
}

fn main() {
    let g: *mut dyn Fn(&'_ u32) -> Option<VNode<'_>> =
        unsafe {make_fat_ptr(&12)};
}
EOF
=== stdout ===
=== stderr ===
warning: unused variable: `g`
  --> <anon>:12:9
   |
12 |     let g: *mut dyn Fn(&'_ u32) -> Option<VNode<'_>> =
   |         ^ help: if this is intentional, prefix it with an underscore: `_g`
   |
   = note: `#[warn(unused_variables)]` on by default

error: linker `link.exe` not found
  |
  = note: No such file or directory (os error 2)

note: the msvc targets depend on the msvc linker but `link.exe` was not found

note: please ensure that VS 2013, VS 2015, VS 2017, VS 2019 or VS 2022 was installed with the Visual C++ option

error: aborting due to previous error; 1 warning emitted

==============

=== stdout ===
=== stderr ===
warning: unused variable: `g`
  --> <anon>:12:9
   |
12 |     let g: *mut dyn Fn(&'_ u32) -> Option<VNode<'_>> =
   |         ^ help: if this is intentional, prefix it with an underscore: `_g`
   |
   = note: `#[warn(unused_variables)]` on by default

error: linker `link.exe` not found
  |
  = note: No such file or directory (os error 2)

note: the msvc targets depend on the msvc linker but `link.exe` was not found

note: please ensure that VS 2013, VS 2015, VS 2017, VS 2019 or VS 2022 was installed with the Visual C++ option

error: aborting due to previous error; 1 warning emitted

==============
Copy link
Member

@Alexendoo Alexendoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed this works on a windows machine and wasn't thrown off by the link error

warning: unused variable: `g`
  --> <anon>:12:9
   |
12 |     let g: *mut dyn Fn(&'_ u32) -> Option<VNode<'_>> =
   |         ^ help: if this is intentional, prefix it with an underscore: `_g`
   |
   = note: `#[warn(unused_variables)]` on by default

warning: 1 warning emitted

@Alexendoo Alexendoo merged commit d60e25b into master Mar 19, 2022
@Alexendoo Alexendoo deleted the autofix/ices/92537.sh branch March 19, 2022 13:26
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