Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rust puts garbage in data structures containing static lists #5917

Closed
mstewartgallus opened this issue Apr 17, 2013 · 3 comments
Closed

Rust puts garbage in data structures containing static lists #5917

mstewartgallus opened this issue Apr 17, 2013 · 3 comments

Comments

@mstewartgallus
Copy link
Contributor

The following gist compiles incorrectly, and prints garbage instead of the correct value.

https://gist.github.com/sstewartgallus/5406626

@jdm
Copy link
Contributor

jdm commented Apr 17, 2013

I think I came across this when doing my work with consts; iirc, looking at the LLVM IR that this produces shows various weird pointer casts that end up passing the complete wrong value when printing the list.

@catamorphism
Copy link
Contributor

Slightly better test case:

use std::io;

struct T (&'static [int]);
static t : T = T (&'static [5, 4, 3]);
fn main () {
    assert_eq!(t[0], 5);
}

Reproduced with 93c270c. Nominating for milestone 5, production-ready

@alexcrichton
Copy link
Member

I believe that this may be the cause of #7617

luqmana added a commit to luqmana/rust that referenced this issue Jul 27, 2013
@bors bors closed this as completed in 32622ce Jul 27, 2013
catamorphism added a commit to catamorphism/rust that referenced this issue Aug 22, 2013
flip1995 pushed a commit to flip1995/rust that referenced this issue Aug 28, 2020
Prelude imports are exempt from wildcard import warnings. Until now only
imports of the form

```
use ...::prelude::*;
```

were considered. This change makes it so that the segment `prelude` can
show up anywhere, for instance:

```
use ...::prelude::v1::*;
```

Fixes rust-lang#5917
flip1995 pushed a commit to flip1995/rust that referenced this issue Aug 28, 2020
Widen understanding of prelude import

Prelude imports are exempt from wildcard import warnings. Until now only
imports of the form

```
use ...::prelude::*;
```

were considered. This change makes it so that the segment `prelude` can
show up anywhere, for instance:

```
use ...::prelude::v1::*;
```

Fixes rust-lang#5917

changelog: Allow `prelude` to appear in any segment of the import path in [`wildcard_imports`]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants