You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So I came across this, and the message I received asked me to create a bug report.
Mac OSX 10.9.3, x86_64
Original error:
rustc -L /usr/local/lib/glfw -L lib/glfw-rs/lib -L lib/gl-rs/lib -L lib/cgmath-rs/lib -O --out-dir=target src/main.rs
src/main.rs:79:14: 79:22 error: internal compiler error: borrow-vec associated with bad sty: &ty_err
src/main.rs:79 let size = (vertices.len() * mem::size_of::<GLfloat>()) as GLsizeiptr;
^~~~~~~~
note: the compiler hit an unexpected failure path. this is a bug.
note: we would appreciate a bug report: http://doc.rust-lang.org/complement-bugreport.html
note: run with `RUST_BACKTRACE=1` for a backtrace
task 'rustc' failed at 'Box<Any>', /Users/rustbuild/src/rust-buildbot/slave/nightly-mac/build/src/libsyntax/diagnostic.rs:112
rustc version is rustc 0.11.0-nightly (b57d272e9908e164a72bd1a688141031705e1208 2014-07-11 01:11:36 +0000)
Code:
#![feature(globs)]
extern crate native;
extern crate glfw;
extern crate cgmath;
extern crate gl;
use glfw::Context;
use gl::types::*;
use std::mem;
mod shader;
#[start]
fn start(argc: int, argv: *const *const u8) -> int {
native::start(argc, argv, main)
}
fn main() {
// Init
let context = glfw::init(glfw::FAIL_ON_ERRORS).unwrap();
// Set window hints to load OpenGL 3.2 on OSX
context.window_hint(glfw::ContextVersion(3, 2));
context.window_hint(glfw::OpenglForwardCompat(true));
context.window_hint(glfw::OpenglProfile(glfw::OpenGlCoreProfile));
// Create a window
let (window, events) = context.create_window(1100, 775, "Post Processing Effects",
glfw::Windowed).expect("Failed to create window!");
window.set_key_polling(true);
window.set_size_polling(true);
window.make_current();
gl::load_with(|s| context.get_proc_address(s));
// Shaders
let mut shader = shader::Shader::new();
shader.attach_from_file("vertex_shader.glsl", gl::VERTEX_SHADER);
shader.attach_from_file("fragment_shader.glsl", gl::FRAGMENT_SHADER);
shader.link();
shader.bind_frag_color_name("color");
shader.set();
// VAO and VBO
let vertices = [
-0.5, -0.5,
0.5, -0.5,
0.0, 0.5,
];
let mut vao = 0;
let mut vbo = 0;
unsafe {
// Create a vertex array object
gl::GenVertexArrays(1, &mut vao);
gl::BindVertexArray(vao);
// Create a vertex buffer object
gl::GenBuffers(1, &mut vbo);
gl::BindBuffer(gl::ARRAY_BUFFER, vbo);
}
// Calculate the size of the vertex data in bytes
let size = (vertices.len() * mem::size_of::<GLfloat>()) as GLsizeiptr;
unsafe {
gl::BufferData(
gl::ARRAY_BUFFER,
size,
mem::transmute(&(vertices[0])),
gl::STATIC_DRAW
);
}
// Shader attributes
shader.layout_attribs("position_in");
// Main loop
while !window.should_close() {
context.poll_events();
for (_, event) in glfw::flush_messages(&events) {
match event {
glfw::KeyEvent(glfw::KeyEscape, _, glfw::Press, _) => {
window.set_should_close(true);
},
_ => {},
}
}
gl::ClearColor(0.0, 0.0, 0.0, 1.0);
gl::Clear(gl::COLOR_BUFFER_BIT);
let count = (vertices.len() / 2) as i32;
gl::DrawArrays(gl::TRIANGLES, 0, count);
window.swap_buffers();
}
}
I hope this is enough information, I can provide more if needed.
The text was updated successfully, but these errors were encountered:
I hope this is enough information, I can provide more if needed.
(It would be convenient if you could reduce the example as much as possible: preferably enough to remove the dependency on external crates to make it easy to reproduce. :) )
minor: update libc to 0.2.148
This update is a follow-up for [rust-lang#112374](rust-lang#112374).
The command that does this update:
`cargo update -p libc`
So I came across this, and the message I received asked me to create a bug report.
Mac OSX 10.9.3, x86_64
Original error:
rustc version is
rustc 0.11.0-nightly (b57d272e9908e164a72bd1a688141031705e1208 2014-07-11 01:11:36 +0000)
Code:
I hope this is enough information, I can provide more if needed.
The text was updated successfully, but these errors were encountered: