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

ices/68296.sh: fixed with errors #368

Merged
merged 1 commit into from
May 17, 2020
Merged

ices/68296.sh: fixed with errors #368

merged 1 commit into from
May 17, 2020

Conversation

github-actions[bot]
Copy link
Contributor

Issue: rust-lang/rust#68296

#!/bin/bash

rustc -Zmir-opt-level=2 - << END
const FOO: *const u32 = { //~ ERROR any use of this value will cause an error
    let x = 42;
    &x
};

fn main() {
    let x = FOO;
}

END
=== stdout ===
=== stderr ===
warning: unused variable: `x`
 --> <anon>:7:9
  |
7 |     let x = FOO;
  |         ^ help: if this is intentional, prefix it with an underscore: `_x`
  |
  = note: `#[warn(unused_variables)]` on by default

error: untyped pointers are not allowed in constant
 --> <anon>:1:1
  |
1 | / const FOO: *const u32 = { //~ ERROR any use of this value will cause an error
2 | |     let x = 42;
3 | |     &x
4 | | };
  | |__^

error: aborting due to previous error; 1 warning emitted

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

=== stdout ===
=== stderr ===
warning: unused variable: `x`
 --> <anon>:7:9
  |
7 |     let x = FOO;
  |         ^ help: if this is intentional, prefix it with an underscore: `_x`
  |
  = note: `#[warn(unused_variables)]` on by default

error: untyped pointers are not allowed in constant
 --> <anon>:1:1
  |
1 | / const FOO: *const u32 = { //~ ERROR any use of this value will cause an error
2 | |     let x = 42;
3 | |     &x
4 | | };
  | |__^

error: aborting due to previous error; 1 warning emitted

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

@JohnTitor JohnTitor left a comment

Choose a reason for hiding this comment

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

I think it's fixed by rust-lang/rust#71665.

@JohnTitor JohnTitor merged commit 8014e6c into master May 17, 2020
@JohnTitor JohnTitor deleted the autofix/ices/68296.sh branch May 17, 2020 12:11
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