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

rustc prints unexpected token in infinite loop #31952

Closed
brson opened this issue Feb 28, 2016 · 3 comments
Closed

rustc prints unexpected token in infinite loop #31952

brson opened this issue Feb 28, 2016 · 3 comments
Labels
A-parser Area: The parsing of Rust source code to an AST

Comments

@brson
Copy link
Contributor

brson commented Feb 28, 2016

Parsing this

extern crate core;

use core::marker::PhantomData;

static mut my_static: u64 = init();

const fn init() -> u64 { 2 }

fn main() {
    let s: SBox<u64> =
}

struct SBox<T>(&'static mut T);

impl<T> SBox<T> {
    unsafe fn from_static(data: &'static mut T) -> SBox<T> {
        SBox(data)
    }
}

Spews this repeatedly:

examples/example1.rs:19:1: 19:2 error: unexpected token: `<eof>`
examples/example1.rs:19 }
                        ^
examples/example1.rs:19:1: 19:2 error: unexpected token: `<eof>`
examples/example1.rs:19 }
                        ^
examples/example1.rs:19:1: 19:2 error: unexpected token: `<eof>`
examples/example1.rs:19 }
                        ^
...
@brson brson added I-wrong A-parser Area: The parsing of Rust source code to an AST labels Feb 28, 2016
@brson
Copy link
Contributor Author

brson commented Feb 28, 2016

rustc 1.8.0-nightly (15e9a95 2016-02-26)

@bytwise
Copy link
Contributor

bytwise commented Feb 28, 2016

This looks like a duplicate of #31804

@brson
Copy link
Contributor Author

brson commented Feb 28, 2016

Thanks @bytwise !

@brson brson closed this as completed Feb 28, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-parser Area: The parsing of Rust source code to an AST
Projects
None yet
Development

No branches or pull requests

2 participants