messages
listlengths
2
2
language
stringclasses
8 values
prompt_type
stringclasses
2 values
lint_errors
int64
0
129
⌀
cyclomatic_complexity
int64
0
32
⌀
license
stringclasses
7 values
commit
stringlengths
40
40
repos
stringlengths
5
116k
new_file
stringlengths
4
220
status
stringclasses
6 values
error
stringlengths
26
74
⌀
is_valid_syntax
bool
2 classes
[ { "role": "user", "content": "Write rust code for the following: Add examples of vector initialization" }, { "role": "assistant", "content": "fn main() {\n let v: Vec<i32> = Vec::new();\n\n // Macro usage for vector\n let v_from_macro = vec![1, 2, 3];\n}\n" } ]
rust
new_file
4
1
mit
fe066d8be5a32c5065fb04e51675cf450edca91c
pgrzesik/learning-rust
16_vectors/src/main.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n/**\n * Copyright 2021 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *...
rust
edit
1
1
apache-2.0
905ff7b99544ebec7fd3610ace206d8a04d90ca1
GoogleChromeLabs/wasm-bindgen-rayon,GoogleChromeLabs/wasm-bindgen-rayon,GoogleChromeLabs/wasm-bindgen-rayon
test/src/lib.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse std::env;\nuse std::path::Path;\n\nuse ctl10n;\n\nconst LOCALES: &[&str] = &[\"zh\", \"en\"];\n\nfn main() {\n for locale in LOCALES {\n println!(\"cargo:rerun-if-changed=locales/{}.toml\", locale);\n }\n println!(\"cargo:...
rust
edit
1
2
unlicense
5db454869ae07f5892bf5ac5d8d797bcb2c7558d
iovxw/rssbot
build.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nextern crate clap;\n\nuse clap::{Arg, App};\nuse std::ffi::OsStr;\nuse std::fs::File;\nuse std::io;\n\nfn main() {\n let app = App::new(env!(\"CARGO_PKG_NAME\"))\n .version(env!(\"CARGO_PKG_VERSION\"))\n .author(\"Scott Olson...
rust
edit
0
4
mit
f07465f053730316f037549a30dfdeb18740be04
solson/rin
src/main.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse std::fmt::Write;\n\npub extern \"C\" fn encode_i8(buf: &mut String, val: i8) {\n write!(buf, \"{}\", val).unwrap();\n}\n\npub extern \"C\" fn encode_i8(buf: &mut String, val: i8) {\n write!(buf, \"{}\", val).unwrap();\n}\n```\n\nApply t...
rust
edit
0
1
apache-2.0
291c79134fa5e2deeebb5a6133de5f8d3788f775
hyunsik/tokamak,hyunsik/tokamak,hyunsik/tokamak,hyunsik/tokamak,hyunsik/tokamak,hyunsik/tokamak
src/repl/value_printer.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n#![crate_name = \"seax_scheme\"]\n#![crate_type = \"lib\"]\n#![feature(convert,core,box_syntax,box_patterns)]\n\n#[macro_use]\nextern crate seax_svm as svm;\n\npub mod ast;\n\n/// Contains the Scheme parser.\n///\n/// This parser is based on ...
rust
edit
2
0
mit
cccd10dc6d597009f0766594e83923d18e6c746c
hawkw/seax,hawkw/seax
seax_scheme/src/lib.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse vmx;\n\npub struct ClearLocalInterruptsGuard;\n\nimpl ClearLocalInterruptsGuard {\n pub fn new() -> Self {\n vmx::cli();\n ClearLocalInterruptsGuard {}\n }\n}\n\nimpl Drop for ClearLocalInterruptsGuard {\n fn drop(&...
rust
edit
1
1
mit
00bbf21ea262fdbb90849f15aebefb1d8327bc5d
iankronquist/rustyvisor,iankronquist/rustyvisor,iankronquist/rustyvisor
src/cli.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n/// Exercise 10.10: Write a program that calls sleep(60) in an infinite loop.\n/// Every five times through the loop (every 5 minutes), fetch the current\n/// time of day and print the tm_sec field. Run the program overnight and\n/// explain ...
rust
edit
0
1
mit
91afdaf698917650afe9b22c4cc1de5b91a18609
philippkeller/apue-rust,philippkeller/apue-rust,philippkeller/apue-rust
src/bin/10-signals/e10-sleep60.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n// Copyright 2018 The Rust Project Developers. See the COPYRIGHT\n// file at the top-level directory of this distribution and at\n// http://rust-lang.org/COPYRIGHT.\n//\n// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or\n//...
rust
edit
0
1
apache-2.0
a79db050c81b214062e54aae1ed6652dfef804d5
graydon/rust,aidancully/rust,graydon/rust,aidancully/rust,GBGamer/rust,aidancully/rust,graydon/rust,graydon/rust,GBGamer/rust,GBGamer/rust,aidancully/rust,aidancully/rust,GBGamer/rust,GBGamer/rust,graydon/rust,GBGamer/rust,GBGamer/rust,graydon/rust,aidancully/rust,GBGamer/rust
src/test/run-pass/env-null-vars.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nextern crate libc;\n\nuse std::ffi::CStr;\nuse std::str;\nuse libc::c_char;\n\n#[no_mangle]\npub extern \"C\" fn count_substrings(value: *const c_char, substr: *const c_char) -> i32 {\n let c_value = unsafe { CStr::from_ptr(value).to_bytes...
rust
edit
0
3
mit
67757c3e662e19747a927ba7a43c313ef2e9f74f
zsiciarz/rust-ffi-stringtools,zsiciarz/rust-ffi-stringtools,zsiciarz/rust-ffi-stringtools,zsiciarz/rust-ffi-stringtools,zsiciarz/rust-ffi-stringtools,zsiciarz/rust-ffi-stringtools,zsiciarz/rust-ffi-stringtools
src/lib.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\npub use self::config::Config;\npub use self::process_builder::{process, ProcessBuilder};\npub use self::result::{Wrap, Require};\npub use self::errors::{CargoResult, CargoError, BoxError, ChainError, CliResult};\npub use self::errors::{CliErr...
rust
edit
1
0
apache-2.0
ba17daeac8fa2645ce72d9e6fcfee987bd39c138
apjanke/cargo,youprofit/cargo,tsurai/cargo,vyskocilm/cargo,tafia/cargo,apjanke/cargo,Gankro/cargo,lucab/cargo,ruud-v-a/cargo,eminence/cargo,achanda/cargo,durka/cargo,huonw/cargo,mceier/cargo,wesleywiser/cargo,huonw/cargo,takkanm/cargo,mceier/cargo,ThinTim/cargo,eminence/cargo,Turbo87/cargo,ucarion/cargo,lucab/cargo,vys...
src/cargo/util/mod.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n#![allow(dead_code, unused_imports, unused_variables)]\n\nuse syntax::ast;\nuse syntax::ast::{MetaItem, Expr};\nuse syntax::codemap::Span;\nuse syntax::ext::base::{Annotatable, ExtCtxt};\nuse syntax::ext::build::AstBuilder;\nuse syntax::ext::...
rust
edit
0
1
mit
f360f8e1bc582a2a176dab7f0ae98242f4cab4fd
burtonageo/rebind
rebind_plugins/src/derive_action.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse glutin::Window;\n\nuse event::{Event, PollEvents, Reactor};\nuse render::{Context, GlutinContext, MetaContext};\n\npub struct Harness<A, C>\n where A: Application<C>,\n C: MetaContext\n{\n application: A,\n context: Cont...
rust
edit
0
4
mit
52149bd39f72947b966876e355ec3f5b370afaa0
olson-sean-k/bismuth
src/framework.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\npub fn find_saddle_points(input: &[Vec<u64>]) -> Vec<(usize, usize)> {\n let (width, height) = match (input.len(), input[0].len()) {\n (0, _) | (_, 0) => return Vec::new(),\n (n, k) => (n, k),\n };\n\n let mut saddle_po...
rust
edit
0
7
mit
53c359b69d6acdcabee5a95a55bf63f7733308fb
exercism/xrust,exercism/xrust,petertseng/exercism-rust,petertseng/exercism-rust,petertseng/exercism-rust
exercises/saddle-points/example.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nextern crate json_typegen_shared;\nextern crate clap;\n\nuse json_typegen_shared::codegen_from_macro;\nuse clap::{Arg, App};\n\nfn main() {\n let matches = App::new(\"JSON code generation CLI\")\n .version(\"0.1.0\")\n...
rust
edit
0
4
apache-2.0
e8bc8eb14f51d110ed842f4e308654b84ba8c484
evestera/json_sample,evestera/json_typegen,evestera/json_sample,evestera/json_typegen,evestera/json_typegen,evestera/json_sample
json_typegen_cli/src/main.rs
accepted
null
true
[ { "role": "user", "content": "Write rust code for the following: Rust: Implement first parts of safe Rust API" }, { "role": "assistant", "content": "extern crate elektra_sys;\n\nuse elektra_sys::*;\nuse std::boxed::Box;\nuse std::error::Error;\nuse std::ffi::{CStr, CString};\nuse std::fmt;\n\ntr...
rust
new_file
0
2
bsd-3-clause
189dc0a1d60835a192332018a16c3b36a7e6b02f
BernhardDenner/libelektra,mpranj/libelektra,petermax2/libelektra,BernhardDenner/libelektra,ElektraInitiative/libelektra,mpranj/libelektra,petermax2/libelektra,BernhardDenner/libelektra,mpranj/libelektra,ElektraInitiative/libelektra,petermax2/libelektra,BernhardDenner/libelektra,petermax2/libelektra,petermax2/libelektra...
src/bindings/rust/elektra/src/lib.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse std::fmt::Display;\nuse thiserror::Error;\n\n#[derive(Error, Debug)]\n#[error(\"braced error: {msg}\")]\nstruct BracedError {\n msg: String,\n}\n\n#[derive(Error, Debug)]\n#[error(\"braced error\")]\nstruct BracedUnused {\n extra: u...
rust
edit
0
1
apache-2.0
18f327f8346e975d5043088200cf90545ff59a72
dtolnay/thiserror
tests/test_display.rs
rejected_duplicate
Near-duplicate of sample 120900
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n/// Code based on <https://github.com/defuz/sublimate/blob/master/src/core/settings.rs>\n/// released under the MIT license by @defuz\nuse plist::Error as PlistError;\nuse std::io::{Read, Seek};\n\npub use serde_json::Value as Settings;\npub ...
rust
edit
0
2
mit
24892347314e85b175038427bb88ed1d453de914
trishume/syntect
src/highlighting/settings.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nextern crate flate2;\nextern crate regex;\nextern crate tar;\nextern crate time;\n#[macro_use]\nextern crate try_opt;\n\nmod macros;\nmod time_utils;\npub mod backend;\npub mod collections;\npub mod signatures;\n\n```\n\nApply this change: Us...
rust
edit
1
0
mit
819c9ba992c573cdc743564d97ab91c4f2fcbe46
mbrt/ruplicity,mbrt/ruplicity
src/lib.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nextern crate rustyline;\nextern crate lrs;\n\n\nuse lrs::parse;\nuse rustyline::Editor;\nuse rustyline::error::ReadlineError as RLError;\n\nfn main() {\n // Prompt constants\n let header = format!(\"lrs v{}\", env!(\"CARGO_PKG_VERSION\"...
rust
edit
0
5
apache-2.0
6fe0862e33b60f537cafd56e069c09b932a6bb54
jzhu98/telescope
src/main.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nextern crate time;\n\nuse std::process::{Command, exit, ExitStatus};\nuse std::env;\nuse time::PreciseTime;\n\n#[cfg(unix)]\nuse std::os::unix::process::ExitStatusExt ;\n\n#[cfg(unix)]\nfn signal(status: &ExitStatus) -> Option<i32> { status.s...
rust
edit
0
6
isc
895c21076af2336bf600fd134e3440120b43ab65
equalsraf/totalrecall
src/main.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse ncurses::*;\n\nuse std::sync::Arc;\nuse std::sync::RwLock;\nuse std::sync::mpsc::Sender;\nuse std::sync::Arc;\nuse std::sync::RwLock;\nuse event::Modifier;\nuse event::InputEvent;\nuse client::generic::GenericClient;\nuse buffer::Buffer;\...
rust
edit
null
null
mit
7c55bf75ac0deb9bbf884c2eb632c50d4df31666
chrisseto/rho
src/rho/host/curses.rs
rejected_syntax
Syntax error detected by tree-sitter
false
[ { "role": "user", "content": "Here is the current file:\n```rust\n//! Errors with semantic, crate level meaning.\n//!\n//! This crate uses [`thiserror`](https://github.com/dtolnay/thiserror) to accomplish error handling.\n//!\n//! While functions that return `Error` could return errors from other libraries,...
rust
edit
2
1
mit
a71bd4db8ee448b357f735e4dceb4f3953e82962
Hoverbear/digitalocean
src/error.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or\n// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license\n// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your\n// option. This file may not be copied, ...
rust
edit
1
0
apache-2.0
eb0f2ee0f33a360cc38b086a86f27b092ea95adb
endoli/hostinfo.rs
src/lib.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nmod common;\n\nuse self::common::*;\nuse std::io;\n\n#[test]\nfn test_downcast() {\n assert_eq!(\n \"oh no!\",\n bail_literal().unwrap_err().downcast::<&str>().unwrap(),\n );\n assert_eq!(\n \"oh no!\",\n ...
rust
edit
2
1
apache-2.0
3a1a7e855c505cef8a1e7983d20da4fd02d88566
dtolnay/anyhow
tests/test_downcast.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nextern crate rustc_expand;\nextern crate rustc_parse as parse;\nextern crate rustc_span;\nextern crate syntax;\n\nuse rustc_span::source_map::FilePathMapping;\nuse rustc_span::FileName;\nuse syntax::ast;\nuse syntax::ptr::P;\nuse syntax::sess...
rust
edit
0
4
apache-2.0
95bec6aea28ba3d985576a4e7149e9b36e6396fc
dtolnay/syn
tests/common/parse.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n#[allow(ctypes)];\n#[no_std];\n#[feature(asm)];\n//#[no_core];\n#[feature(macro_rules)];\n\n\nmod core;\npub mod stdio;\npub mod idt;\n\n\n#[no_mangle]\npub unsafe fn main() {\n idt::idt_install();\n stdio::clear_screen(stdio::Green);\n...
rust
edit
0
3
mit
19254e3a850ca1ebea72dad2c59cf124d67200d3
jvns/puddle,jvns/puddle
main.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n#[macro_use] extern crate clap;\n#[macro_use] extern crate log;\nextern crate env_logger;\n\nmod cli;\nmod cd;\n\nuse std::process::exit;\n\nfn main() {\n env_logger::init().expect(\"Failed to initialize logger.\");\n\n match run_cli() ...
rust
edit
null
null
mit
d5ac6c14f09e962b05a2671e582bc79fd8c497b0
jhelwig/homers
src/main.rs
rejected_syntax
Syntax error detected by tree-sitter
false
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse std::io;\nuse std::fs::{self, DirEntry};\nuse std::path::Path;\n\nfn walk_dirs(dir: &Path, cb: &Fn(&DirEntry)) -> io::Result<()> {\n if try!(fs::metadata(dir)).is_dir() {\n for entry in try!(fs::read_dir(dir)) {\n let...
rust
edit
null
null
mit
f2e3f09d68b0130c3d9588826a789c4c62f21d05
kubkon/deqnap
src/main.rs
rejected_syntax
Syntax error detected by tree-sitter
false
[ { "role": "user", "content": "Here is the current file:\n```rust\n// xfail-stage0\n\n#[attr = \"val\"]\nmod mod1 {\n}\n\nfn main() {\n}\n```\n\nApply this change: test: Add test cases for outer attributes on all item types" }, { "role": "assistant", "content": "// xfail-stage0\n\n#[attr = \"val\...
rust
edit
null
null
apache-2.0
697fdaac24c0f973da8569b1249d8c778e510082
XMPPwocky/rust,emk/rust,ktossell/rust,stepancheg/rust-ide-rust,XMPPwocky/rust,pshc/rust,pelmers/rust,fabricedesre/rust,jroesch/rust,ebfull/rust,P1start/rust,pshc/rust,pelmers/rust,kimroen/rust,jashank/rust,stepancheg/rust-ide-rust,aepsil0n/rust,jashank/rust,michaelballantyne/rust-gpu,miniupnp/rust,j16r/rust,servo/rust,...
src/test/run-pass/item-attributes.rs
rejected_syntax
Syntax error detected by tree-sitter
false
[ { "role": "user", "content": "Here is the current file:\n```rust\n#![no_std]\n\nuse libtock_low_level_debug::{AlertCode, LowLevelDebug};\nuse libtock_platform::{ErrorCode, Syscalls};\nuse libtock_runtime::TockSyscalls;\n\n#[panic_handler]\nfn panic_handler(_info: &core::panic::PanicInfo) -> ! {\n // Sign...
rust
edit
0
1
apache-2.0
895c3af8ea92b1710a54344683b0d5df071813df
tock/libtock-rs
panic_handlers/small_panic/src/lib.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse std::io::prelude::*;\nuse std::path::Path;\nuse std::fs::{File, create_dir};\n\nfn main() {\n let dst = Path::new(concat!(env!(\"HOME\"), \"/.xr3wm/config.rs\"));\n if !dst.exists() {\n match create_dir(dst.parent().unwrap())...
rust
edit
2
3
mit
546fe95d720966dfa152b483e75e1508c203e780
tsurai/xr3wm
build.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n\nuse std::rc::{Rc};\nuse std::cell::{RefCell};\nuse std::collections::HashMap;\n\n#[derive(Clone, Debug)]\npub struct Var(Rc<RefCell<i32>>);\n\nimpl Var {\n fn new() -> Var {\n Var(Rc::new(RefCell::new(0)))\n }\n\n pub fn set(&sel...
rust
edit
0
2
mit
01e611ac3d74ef4a81ecf64c279fc619b3f5033f
wibbe/tiny-rts
src/cmd.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n// 单元结构体\nstruct Nil;\n\n// 元组结构体\nstruct Pair(i32, f64);\n\n// 带有两个字段的结构体\nstruct Point {\n x: f64,\n y: f64,\n}\n\n// 结构体可以作为另一个结构体的字段\n#[allow(dead_code)]\nstruct Rectangle {\n p1: Point,\n p2: Point,\n}\n\nfn main() {\n // ...
rust
edit
0
1
apache-2.0
d2b8e36f0cf1ad52e093fd36b7346eef40c78bc7
aakloxu/rust-by-example-cn,aakloxu/rust-by-example-cn,jinyuanxie/rust-by-example-cn,rust-lang-cn/rust-by-example-cn,jinyuanxie/rust-by-example-cn,rust-lang-cn/rust-by-example-cn
examples/custom_types/structs/structs.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n#![feature(plugin)]\n#![feature(test)]\n\n#![plugin(clippy)]\n\n#[cfg(test)]\nextern crate test;\n#[cfg(test)]\nextern crate rand;\n#[cfg(test)]\n#[macro_use]\nextern crate quickcheck;\n\npub extern crate nalgebra;\n\npub const EPSILON: f32 =...
rust
edit
1
0
mit
7c4b8d4c185ca740befe889d74146f3f6939d864
svenstaro/bvh
src/lib.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nmod client;\n\nmod network;\n\n#[cfg(test)]\nmod tests {\n #[test]\n fn it_works() {\n }\n}\n\n```\n\nApply this change: Add public modifier to client module" }, { "role": "assistant", "content": "pub mod client;\n\nmod n...
rust
edit
1
1
mit
e1c54525cc7fa9a1e61652d4d7242dd96fa7547b
pgrzesik/learning-rust
communicator/src/lib.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse std::collections::HashMap;\n\npub fn word_count(phrase: &str) -> HashMap<String, u32> {\n let phrase = phrase.to_lowercase();\n let words = phrase.split(|c: char| !c.is_alphanumeric())\n .filter(|s| !s.is_empty())\n .m...
rust
edit
0
1
mit
b791f8c35ca4489608d6895761873020c4a31c1e
attilahorvath/exercism-rust
word-count/src/lib.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse cocoa::base::id;\nuse std::collections::HashMap;\n#[allow(unused_imports)]\nuse sys::MTLCompileOptions;\n\npub struct CompileOptions {\n pub fast_math_enabled: bool,\n pub language_version: (), // Todo(George): Make this field the r...
rust
edit
0
1
apache-2.0
9a19c84a0776210e659b51836988db4800d3924d
burtonageo/metl
src/compile_options.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n\n/// Get the port from a string (ip)\npub fn parse_port(string: &str) -> &str {\n let a = match string.find(':') {\n Some(pos) => pos + 1,\n None => 0,\n };\n\n let mut b = 0;\n for c in string.chars().skip(a) {\n ...
rust
edit
0
0
mit
57685c7bdd0e1b5aed898e2e1fd509fb8d359f3e
rexlunae/redox,rexlunae/redox,Lacaranian/redox,Lacaranian/redox,Lacaranian/redox,Lacaranian/redox,Lacaranian/redox,rexlunae/redox
kernel/common/parse_ip.rs
rejected_duplicate
Near-duplicate of sample 120568
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n#![feature(deprecated)]\n\n// @has deprecated_future/struct.S.html '//*[@class=\"stab deprecated\"]' \\\n// 'Deprecated since 99.99.99: effectively never'\n#[deprecated(since = \"99.99.99\", note = \"effectively never\")]\npub struct S;\...
rust
edit
1
0
apache-2.0
c8752415dc0775960accc5f6ae11be782910b3c6
graydon/rust,aidancully/rust,aidancully/rust,graydon/rust,graydon/rust,aidancully/rust,graydon/rust,graydon/rust,graydon/rust,aidancully/rust,aidancully/rust,aidancully/rust
src/test/rustdoc/deprecated-future.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n/// Trait of dispatcher.\n///\n/// A (collision) dispatcher typically takes two bodies in parameter and return the corresponding\n/// narrow phase algorithm.\npub trait Dispatcher<G1, G2, NF> {\n /// Deduce the narrow phase from two bodies...
rust
edit
0
1
bsd-3-clause
42a17a3ae76fa4d83d1a850140dc77424b0ea460
sebcrozet/ncollide,steveklabnik/ncollide,MichaelRiss/ncollide,MichaelRiss/ncollide,steveklabnik/ncollide,sebcrozet/ncollide
src/broad/dispatcher.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n// Modified from the `peeking_take_while` crate. Copyright 2017 Nick Fitzgerald. License MIT OR\n// Apache-2.\n\nuse std::iter::Peekable;\n\npub(crate) struct PeekingTakeWhile<'a, I: Iterator, P> {\n iter: &'a mut Peekable<I>,\n pred: P...
rust
edit
0
2
apache-2.0
b57628aafff6457a5bea1649310c1b586ffb2099
time-rs/time
time-macros/src/peeking_take_while.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse std::fmt;\n\npub struct Symbol {\n ns: Option<String>,\n name: String,\n}\n\nimpl fmt::Display for Symbol {\n fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {\n if let Some(ref ns) = self.ns {\n write!(f, ...
rust
edit
2
2
mit
3492bf5bf4434a2ebea1198a80ba8c567f4aae1f
pavel-v-chernykh/lust
src/ast/nodes/symbol.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n// ignore-windows: Concurrency on Windows is not supported yet.\n#![feature(atomic_from_mut)]\n#![feature(core_intrinsics)]\n\nuse std::intrinsics::atomic_load;\nuse std::sync::atomic::Ordering::*;\nuse std::sync::atomic::{AtomicU16, AtomicU3...
rust
edit
2
1
apache-2.0
dafd813c16231834d3bce7875a8c616d1e49a8c1
rust-lang/miri,rust-lang/miri,rust-lang/miri,rust-lang/miri
tests/compile-fail/weak_memory/imperfectly_overlapping.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse super::Compat;\nuse futures::Stream as Stream01;\n\nimpl<St: Stream01> Stream01CompatExt for St {}\n\n/// Extension trait for futures 0.1 [`Stream`][Stream01]\npub trait Stream01CompatExt: Stream01 {\n /// Converts a futures 0.1 [`Stre...
rust
edit
0
2
apache-2.0
ea27ba3e05b279f6c3430b1846de71527aa00215
alexcrichton/futures-rs
futures-util/src/compat/stream01ext.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nextern crate hyper;\n\nmod contentlength;\npub mod http_version;\npub mod download;\n\n/// Represents a byte, in `u64`.\ntype Byte = u64;\n\n```\n\nApply this change: Add new custom types, import new mods" }, { "role": "assistant", ...
rust
edit
1
0
mit
837569f82d023b629d46fec622f965659e8beec9
derniercri/snatch
src/lib.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n\npub fn puzzle(input: &str) -> u32 {\n let initial_world_state = WorldState {\n steps: 0,\n elevator_floor: 0,\n };\n let mut queue = vec![initial_world_state];\n while !queue.is_empty() {\n let world = queue...
rust
edit
1
3
mit
f5e1d7b60c833026c9f36b2c133e5ce32b73271b
carols10cents/adventofcode-rs
src/lib.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT\n// file at the top-level directory of this distribution and at\n// http://rust-lang.org/COPYRIGHT.\n//\n// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE o...
rust
edit
5
0
apache-2.0
eef866275ed319496cef4659830897c445ab10af
ajroetker/rustc-serialize,SimonSapin/rustc-serialize,rust-lang-nursery/rustc-serialize,DenisKolodin/rustc-serialize,shepmaster/rustc-serialize,gbersac/rustc-serialize,rust-lang/rustc-serialize,indefini/rustc-serialize,rust-lang-deprecated/rustc-serialize
src/lib.rs
rejected_lint
Too many lint violations: 5
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nextern crate xswag_base as base;\nextern crate lalrpop_util;\n\npub mod lex;\npub mod ast;\npub mod grammar;\n\nuse base::diag::Report;\nuse lalrpop_util::ParseError;\n\npub fn parse_compilation_unit(file: &base::code::FileMap)\n -> (Resul...
rust
edit
5
3
mit
a00cd44d0dc0db59bbeefad9f09c19a7ee6a3d39
LukasKalbertodt/xswag-syntax-java
src/lib.rs
rejected_lint
Too many lint violations: 5
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n#![feature(asm, alloc_error_handler, core_intrinsics, lang_items, naked_functions)]\n#![no_std]\n\nextern crate alloc;\n\nmod callback;\n\npub mod adc;\npub mod ble_composer;\npub mod ble_parser;\npub mod buttons;\npub mod console;\npub mod d...
rust
edit
0
0
apache-2.0
70c111ca0bef3ac0a137a4bbb71ec303e0e74613
tock/libtock-rs
src/lib.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n//! The mathematical constant tau.\n\nextern crate core;\n\n/// The mathematical constant [tau](http://tauday.com/),\n/// where pi is defined as tau/2.\n///\n/// We provide it as `f64` for now.\n///\n/// ```rust{.example}\n/// assert!(tau::TA...
rust
edit
0
1
mit
df4c5e8d0ab0562264ee3c6a900754679a3b950c
FranklinChen/rust-tau
src/lib.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n//! A dead-simple test helper for rust.\n//!\n//! Example\n//! --------\n//!\n//! ```rust\n//! use bear::fixture;\n//!\n//! // Get a content of 'tests/fixtures/hello.txt'\n//! let content = fixture(\"hello.txt\");\n//!\n//! // Do whatever you...
rust
edit
0
1
bsd-2-clause
958fe51f514f35d90cc606dd95e3c24e81c8fb35
simnalamburt/bear
src/lib.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#![crate_name = \"skia\"]\n#![cr...
rust
edit
0
0
bsd-3-clause
983713e980e94dbfefae46bed2fc962a0ac61e3d
akiss77/skia,nox/skia,vvuk/skia,akiss77/skia,akiss77/skia,akiss77/skia,vvuk/skia,vvuk/skia,nox/skia,vvuk/skia,larsbergstrom/skia,mmatyas/skia,mmatyas/skia,larsbergstrom/skia,vvuk/skia,nox/skia,vvuk/skia,akiss77/skia,vvuk/skia,akiss77/skia,larsbergstrom/skia,nox/skia,larsbergstrom/skia,akiss77/skia,nox/skia,larsbergstro...
src/lib.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse todo::list::List;\n\npub fn delegate(mut path: Path, mut args: Vec<String>) {\n // First argument contains the program / file name,\n // so let's discard it to make postprocessing easier\n if args.len() > 0 {\n args.remove...
rust
edit
0
3
mit
29d5194c438bf97c491ab419ec358b00e6672a6d
viseztrance/todo
src/cli.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n// Run with `rust run hello.rs`\n\nfn main() {\n println(\"Hello World!\");\n}\n\n```\n\nApply this change: Update rust example to confort to the requirements stated in the README" }, { "role": "assistant", "content": "// Run w...
rust
edit
0
1
mit
92981e29861e839779399cfa67d4cadcdb8ea16b
pxlpnk/xhelloworlds,pxlpnk/xhelloworlds,pxlpnk/xhelloworlds,pxlpnk/xhelloworlds,pxlpnk/xhelloworlds,pxlpnk/xhelloworlds,pxlpnk/xhelloworlds,pxlpnk/xhelloworlds,pxlpnk/xhelloworlds,pxlpnk/xhelloworlds,pxlpnk/xhelloworlds,pxlpnk/xhelloworlds
rust/hello.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n\n\n// -*- rust -*-\nuse std;\nimport std::rand;\n\n#[test]\nfn test() {\n let r1: rand::rng = rand::mk_rng();\n log r1.next();\n log r1.next();\n {\n let r2 = rand::mk_rng();\n log r1.next();\n log r2.next();...
rust
edit
null
null
apache-2.0
e62093d4d99c7e0c011e94760b22de6bfbb607a7
rust-lang/rand
src/test/stdtest/rand.rs
rejected_syntax
Syntax error detected by tree-sitter
false
[ { "role": "user", "content": "Here is the current file:\n```rust\n//! TODO FITZGEN\n\n#![deny(missing_docs)]\n\nextern crate leb128;\n#[macro_use] extern crate nom;\n\npub mod parser;\nmod types;\npub use types::*;\n\n\n#[cfg(test)]\nmod tests {\n #[test]\n fn it_works() {\n }\n}\n\n```\n\nApply th...
rust
edit
2
1
apache-2.0
d997b51d324bd5bc06026110caf9813b82621d5b
gimli-rs/gimli,gimli-rs/gimli
src/lib.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse hyper::client::Client;\nuse hyper::client::response::Response;\nuse hyper::error::Error;\nuse hyper::header::Headers;\nuse hyper::method::Method;\n\n/// Trait that represents some methods to send a specific request\npub trait GetResponse ...
rust
edit
0
2
mit
a2a1f3482f4f01ad8086e9e4cab7c6f460ec5367
derniercri/snatch
src/client.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nextern crate octavo;\n\nuse octavo::digest::Digest;\nuse octavo::digest::adler32::Adler32;\nuse octavo::digest::crc32::CRC32;\nuse octavo::digest::md5::MD5;\nuse octavo::digest::sha3::*;\n\nfn hex<T: AsRef<[u8]>, D: Digest>(data: T, mut diges...
rust
edit
0
1
mit
42b515faa378e1f860d2453db7f3f39909e5f365
bluss/octavo,Ticki/octavo,libOctavo/octavo,hauleth/octavo,steveklabnik/octavo
examples/sums.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse std::mem::size_of_val;\n\n// This function borrows a slice\nfn analyze_slice(slice: &[int]) {\n println!(\"first element of the slice: {}\", slice[0]);\n println!(\"the slice has {} elements\", slice.len());\n}\n\nfn main() {\n /...
rust
edit
null
null
apache-2.0
519c5f6b422107179727e2c86db0195b7b40d93c
shaleh/rust-by-example,mdinger/rust-by-example,rust-lang-cn/rust-by-example-cn,DenisKolodin/rust-by-example,rwaldron/rust-by-example,aakloxu/rust-by-example-cn,XadillaX/zh-rust-by-example,MatejLach/rust-by-example,nodakai/rust-by-example,brunotag/rust-by-example,beni55/rust-by-example,sohan99/rust-by-example,colinvh/ru...
src/array/array.rs
rejected_syntax
Syntax error detected by tree-sitter
false
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse std::collections::HashMap;\n\nuse rustc_serialize::json;\n\nuse schema::{UnitOption, UnitStates};\nuse fleet::FleetAPI;\n\npub struct Client {\n fleet: FleetAPI,\n}\n\nimpl Client {\n pub fn new(root_url: &'static str) -> Client {\n...
rust
edit
0
1
mit
ac81cc05d6ada97714a7994ee369a018428b62bb
jimmycuadra/rust-fleet,jimmycuadra/rust-fleet
src/client.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n//! An implementation of [FLAC](https://xiph.org/flac), free lossless audio\n//! codec, written in Rust.\n//!\n//! The code is available on [GitHub](https://github.com/sourrust/flac).\n//!\n//! # Examples\n//!\n//! Basic decoding from a file....
rust
edit
1
0
bsd-3-clause
4db393aea926554fcb1e2bbe9fe3af0289acf657
sourrust/flac
src/lib.rs
rejected_duplicate
Near-duplicate of sample 119795
true
[ { "role": "user", "content": "Write rust code for the following: Add some code for coverage testing" }, { "role": "assistant", "content": "pub struct Foo {\n a: u64,\n b: i8,\n}\n\nimpl Foo {\n pub fn new() -> Foo {\n Foo { a: 42, b: 41 }\n }\n\n pub fn add(&mut self) {\n ...
rust
new_file
0
1
mit
e172a34e5a7d6053d2aa26697c5afec6ff4405a9
mvdnes/rust-travis-test,mvdnes/rust-travis-test
src/lib.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse async_trait::async_trait;\nuse serenity::client::Context;\nuse serenity::model::id::{ChannelId, GuildId, MessageId};\nuse serenity::model::user::User;\nuse serenity::model::Permissions;\nuse typemap_rev::TypeMap;\n\nuse crate::database::s...
rust
edit
1
1
mit
667b6c7202b07b1c0e5d581e8cb6d9acad42feca
Samoxive/SafetyJim,Samoxive/SafetyJim
src/discord/message_processors/mod.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse std::path::PathBuf;\n\nfn main() {\n let dir: PathBuf = [\"../tree-sitter-ruby\", \"src\"].iter().collect();\n\n cc::Build::new()\n .include(&dir)\n .file(dir.join(\"parser.c\"))\n .file(dir.join(\"scanner.cc\")...
rust
edit
0
2
mit
d00c956028d04ac22ab2ffd92914ce9b0c9418b6
github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql
extractor/build.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n// Copyright (c) <2015> <lummax>\n// Licensed under MIT (http://opensource.org/licenses/MIT)\n\npub mod setjmp {\n extern crate libc;\n\n pub use self::arch::jmp_buf;\n\n extern {\n fn _setjmp(env: *mut jmp_buf) -> libc::c_int...
rust
edit
2
1
mit
8300f7b83fb92d219526e23ce971d1baa70f1a59
lummax/librcimmixcons,lummax/librcimmixcons,lummax/librcimmixcons,lummax/librcimmixcons
src/posix.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n// Can't have a regular bench because [feature(test)] is restricted\n// to nightly.\n\n #[asdf]\n// ^^^^^^^ERR(<1.30.0-beta) The attribute `asdf` is currently unknown\n// ^^^^ERR(>=1.30.0-beta) The attribute `asdf` is currently unknown\n/...
rust
edit
0
1
mit
e91bdcbed72d839de35f5f234edc324235872e2d
rust-lang/sublime-rust,rust-lang/sublime-rust,jhasse/sublime-rust
tests/error-tests/benches/bench_err.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n//! An implementation of [FLAC](https://xiph.org/flac), free lossless audio\n//! codec, written in Rust.\n//!\n//! # Examples\n//!\n//! Basic decoding from a file.\n//!\n//! ```\n//! match flac::Stream::from_file(\"path/to/file.flac\") {\n//!...
rust
edit
1
0
bsd-3-clause
e92c9e2ffd5820b7b28330fdbbb302ce0cedab80
sourrust/flac
src/lib.rs
rejected_duplicate
Near-duplicate of sample 120008
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nextern crate tray_rust;\n\nuse tray_rust::linalg;\nuse tray_rust::film;\nuse tray_rust::geometry;\nuse tray_rust::geometry::Geometry;\n\nfn main() {\n let width = 800u;\n let height = 600u;\n let mut rt = film::RenderTarget::new(widt...
rust
edit
null
null
mit
6bfb283d92e58d08a3dd8122b24973d89db14cbe
voidException/tray_rust,Twinklebear/tray_rust,GuzTech/tray_rust
src/main.rs
rejected_syntax
Syntax error detected by tree-sitter
false
[ { "role": "user", "content": "Here is the current file:\n```rust\n// FIXME should be in run-pass\n\n// -*- rust -*-\n\n// error-pattern: Non-boolean return type\n\n// this checks that a pred with a non-bool return\n// type is rejected, even if the pred is never used\n\npure fn bad(a: int) -> int { ret 37; }...
rust
edit
null
null
apache-2.0
360d7c2c1d7370059cca8cd4c5b820e80c9d1bed
aepsil0n/rust,nwin/rust,reem/rust,bombless/rust,fabricedesre/rust,dwillmer/rust,rohitjoshi/rust,defuz/rust,dinfuehr/rust,mvdnes/rust,kimroen/rust,servo/rust,victorvde/rust,ruud-v-a/rust,Ryman/rust,pshc/rust,0x73/rust,sae-bom/rust,stepancheg/rust-ide-rust,achanda/rand,fabricedesre/rust,ktossell/rust,richo/rust,andars/ru...
src/test/run-pass/pred-not-bool.rs
rejected_syntax
Syntax error detected by tree-sitter
false
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse std::collections::VecDeque;\n\npub struct CircularBuffer<T> {\n buffer: VecDeque<T>,\n size: usize,\n}\n\n#[derive(Debug, PartialEq)]\npub enum Error {\n EmptyBuffer,\n FullBuffer,\n}\n\nimpl<T> CircularBuffer<T> {\n pub fn...
rust
edit
1
3
bsd-2-clause
a5031a02708a0dd566cc57ad6a2abfc59da0fe59
gyn/exercism,gyn/exercism,gyn/exercism,gyn/exercism
rust/circular-buffer/src/lib.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nextern crate unicode_names;\n\nuse std::env;\n\nfn main() {\n for argument in env::args().skip(1) {\n match unicode_names::character(argument.as_ref()) {\n Some(c) => println!(\"{} = {}\", c, argument),\n None...
rust
edit
0
2
mit
9018107e1ecd8c815b262caa4caa54c9e5b3b3f8
antifuchs/chars,antifuchs/chars
src/main.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nextern crate r68k_tools;\n\nuse r68k_tools::srecords::write_s68;\nuse std::io::LineWriter;\nuse r68k_tools::memory::MemoryVec;\n\nfn main() {\n let mut lw = LineWriter::new(vec![]);\n\n let data: Vec<u8> = (0u8 .. 0xFFu8).collect();\n ...
rust
edit
0
1
mit
62b5deba941c5ee40e76422986c2d45c8ca8e01c
marhel/r68k,marhel/r68k
tools/examples/srecords.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nfn main() {\n let x = 3;\n\n if number < 4 {\n println!(\"Number less than 4!\");\n } else {\n println!(\"Number equal to or greater than 4!\");\n }\n}\n\n```\n\nApply this change: Fix error in control flow example" ...
rust
edit
0
2
mit
b64b1e1b308e5ae1108494fc107968d7a85e03da
pgrzesik/learning-rust
control_flow/src/main.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse metadata::{Metadata, StreamInfo, metadata_parser};\nuse frame::{frame_parser, Frame};\n\nenum ParserState {\n Marker,\n Metadata,\n Frame,\n}\n\npub struct Stream {\n pub info: StreamInfo,\n pub metadata: Vec<Metadata>,\n pub frames...
rust
edit
null
null
bsd-3-clause
b3c65ef04495e04506a1e6493744c355afd97dad
sourrust/flac
src/stream.rs
rejected_syntax
Syntax error detected by tree-sitter
false
[ { "role": "user", "content": "Here is the current file:\n```rust\n#[cfg(test)]\nmod tests {\n #[test]\n fn it_works() {\n }\n}\n\n```\n\nApply this change: Use an existing graph implementation\n\nUsing the implementation of a linked graph described here:\nhttp://smallcultfollowing.com/babysteps/blo...
rust
edit
1
3
mit
e6e0df32845e741fa8448fe2f1e16a47fc9f647a
charlieegan3/graph_match
src/lib.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n/* Stones esoteric programming language\n * (c) 2016 Zack Hixon - see LICENSE.txt */\n\n#[derive(Debug)]\n//#[derive(Copy, Clone)]\nstruct Stone {\n x: i32,\n y: i32,\n id: i32\n}\n\nfn main() {\n let mut stone = Stone {x: 32, y: ...
rust
edit
0
1
mit
eb03357b6af017fd6c9da9950d4948a2a22cdc95
cheezgi/stones
src/main.rs
accepted
null
true
[ { "role": "user", "content": "Write rust code for the following: Add glium hello world example\n\nTaken from: http://glium.github.io/glium/book/tuto-02-triangle.html" }, { "role": "assistant", "content": "#[macro_use]\nextern crate glium;\n\nfn main() {\n use glium::{glutin, Surface};\n\n ...
rust
new_file
0
4
mit
0bbbaa6f6c68a36f83b2ff70419aa43e8863e286
emmnm/bismuth
src/main.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n// run-pass\n\n// Test that functional record update/struct update syntax works inside\n// a closure when the feature `capture_disjoint_fields` is enabled.\n\n#![feature(capture_disjoint_fields)]\n//~^ WARNING: the feature `capture_disjoint_f...
rust
edit
0
2
apache-2.0
5e983d7b3f03e9243d905e0579f32be00170c9af
graydon/rust,aidancully/rust,graydon/rust,aidancully/rust,graydon/rust,aidancully/rust,graydon/rust,aidancully/rust,graydon/rust,aidancully/rust,graydon/rust,aidancully/rust
src/test/ui/closures/2229_closure_analysis/run_pass/fru_syntax.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or\n// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license\n// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your\n// option. This file may not be copied, ...
rust
edit
null
null
apache-2.0
e8d04dde5bd85cd4f9b7ce0e4ac3e3f1c8206912
endoli/message-format.rs
src/message.rs
rejected_syntax
Syntax error detected by tree-sitter
false
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse bit_vec::BitVec;\n\npub fn shift(state: &mut BitVec) {\n let range = 1 .. state.len();\n\n for i in range.rev() {\n let pred = state[i - 1];\n state.set(i, pred);\n };\n\n state.set(0, false);\n}\n\n#[cfg(test)]\...
rust
edit
0
2
bsd-2-clause
76dc41fea07a91d67ab264d0ae56c04e930b1055
ranweiler/lfsr-rs
src/lfsr.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\ntrait Foo<const N: usize> {\n fn do_x(&self) -> [u8; N];\n}\n\nstruct Bar;\n\nconst T: usize = 42;\n\nimpl Foo<N = const 3> for Bar {\n//~^ERROR expected lifetime, type, or constant, found keyword `const`\n//~^^ERROR cannot constrain an as...
rust
edit
null
null
apache-2.0
8a7c1306b43895a97c0675c6d854afa468a22aad
graydon/rust,graydon/rust,graydon/rust,aidancully/rust,graydon/rust,aidancully/rust,aidancully/rust,aidancully/rust,graydon/rust,aidancully/rust,aidancully/rust,graydon/rust
src/test/ui/const-generics/parser-error-recovery/issue-89013.rs
rejected_syntax
Syntax error detected by tree-sitter
false
[ { "role": "user", "content": "Here is the current file:\n```rust\nextern crate hyper;\n\nuse std::io::Read;\nuse hyper::Client;\nuse hyper::header::Connection;\n\nstatic WEEKDAY_WEBSITE: &'static str = \"http://www.hvilkenukeerdet.no\";\n\nfn main() {\n let client = Client::new();\n\n let mut res = cl...
rust
edit
0
1
mit
3eaa05c19753452b3a337094cdf24fe093b9985e
cristeahub/hvilkenukeerdet
src/main.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse std::env;\n\nconst HELP_MESSAGE: &str = r#\"\nUsage:\n table -h | --help\n\nOptions:\n -h --help Print help message\n\"#;\n\nfn main() {\n for arg in env::args() {\n match &*arg {\n \"-h\" | \"--help\" => println!(...
rust
edit
0
3
mit
353e74aede10cf47b2cc4e94eeb5924a6df6812b
naoty/table
src/main.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nmod rooms;\n\nuse std::io;\n\n\nfn move_to_next_room_if_possible<'a>(room: &'a rooms::Room, \n next_room: Option<&'a rooms::Room>, \n direction: &str) \n ...
rust
edit
0
3
bsd-2-clause
728cd69c3a751f0b30fb8321a443532661ad3aae
donmccaughey/rust_rooms
src/main.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse game::constants::PISTOL_AUDIO_PATH;\nuse rodio;\nuse rodio::Sink;\nuse std::fs::File;\nuse std::io::BufReader;\n\npub struct CharacterAudio {\n sink: Sink,\n}\n\nimpl CharacterAudio {\n pub fn new() -> CharacterAudio {\n #[allow(depr...
rust
edit
1
2
apache-2.0
c3db779e8b0e60633359c947b96e8f9a5e2c5ba6
Laastine/zombie-shooter,Laastine/zombie-shooter
src/character/audio.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n#[macro_use]\nextern crate log;\nextern crate env_logger;\nextern crate dotenv;\nextern crate libc;\n\nuse std::{env, ptr};\nuse std::ffi::CString;\nuse libc::{c_char, c_int};\n\n/// Literally taken from the libstd\n/// (sys/unix/process.rs t...
rust
edit
0
1
mit
3ee2a6940c04fe5dba850124f24ccd70e275a539
badboy/dotenv-shell
src/main.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse util::{bitfields, bits::Bits, primitive_enum};\n\nbitfields! {\n /// 4000208h - IME - Interrupt Master Enable Register (R/W)\n /// Bit Expl.\n /// 0 Disable all interrupts (0=Disable All, 1=See [`InterruptEnable...
rust
edit
0
1
mit
55946cf8068630366ca4b2cdf8d748ecb9e5fb71
ExPixel/Pyrite2,ExPixel/Pyrite2
gba/src/memory/io/types/interrupts.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n//! Muxed. A tmux project manager with no runtime dependencies.\nextern crate getopts;\nextern crate libc;\nextern crate yaml_rust;\nextern crate rand;\n\nuse std::env;\n\nmod tmux;\nmod command;\nmod project;\n\nuse project::parser;\nuse pro...
rust
edit
1
1
mit
3fdb0b05d8863c04e5a7831895fa07643a528355
brianp/muxed,brianp/muxed
src/main.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n#[cfg(not(all(\n feature = \"derive\",\n feature = \"full\",\n feature = \"parsing\",\n feature = \"printing\",\n feature = \"visit\",\n feature = \"visit-mut\",\n feature = \"fold\",\n feature = \"clone-impls\",\n ...
rust
edit
0
0
apache-2.0
831ad549f9d0b5137bde66163c67352991c929f5
dtolnay/syn
tests/features/mod.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n// Copyright 2013 The Rust Project Developers. See the COPYRIGHT\n// file at the top-level directory of this distribution and at\n// http://rust-lang.org/COPYRIGHT.\n//\n// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or\n//...
rust
edit
null
null
apache-2.0
ee06ed2bfd233b57c5989696bb723bddf6569622
defuz/rust,TheNeikos/rust,AerialX/rust-rt-minimal,zubron/rust,KokaKiwi/rust,aepsil0n/rust,zaeleus/rust,sarojaba/rust-doc-korean,nwin/rust,LeoTestard/rust,andars/rust,mitsuhiko/rust,bluss/rand,dwillmer/rust,mihneadb/rust,nham/rust,krzysz00/rust,jroesch/rust,mitsuhiko/rust,jbclements/rust,P1start/rust,nham/rust,sarojaba/...
src/libcore/rt/work_queue.rs
rejected_syntax
Syntax error detected by tree-sitter
false
[ { "role": "user", "content": "Here is the current file:\n```rust\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#![feature(use_extern_macros, pr...
rust
edit
1
2
mit
bd2f274ca8976ed9885fe6103e5b8609e1624c57
nrc/rustc-perf,nrc/rustc-perf,nrc/rustc-perf
collector/benchmarks/script-servo/components/dom_struct/lib.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n#![allow(clippy::block_in_if_condition_stmt, clippy::range_plus_one)]\n\nextern crate proc_macro;\n\nmod ast;\nmod attr;\nmod expand;\nmod fmt;\nmod prop;\nmod valid;\n\nuse proc_macro::TokenStream;\nuse syn::{parse_macro_input, DeriveInput};...
rust
edit
2
1
apache-2.0
54adff8fc5cbab7a628ac5222e558812c7cb5c5b
dtolnay/thiserror
impl/src/lib.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse clap::{App, Arg};\n\nfn main() {\n // You can define a function (or a closure) to use as a validator to argument values. The\n // function must accept a String and return Result<(), String> where Err(String) is the message\n // d...
rust
edit
0
2
apache-2.0
c27b2e299c624f6f53dc0e9935216c55f0a00006
clap-rs/clap,clap-rs/clap,clap-rs/clap
examples/15_custom_validator.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n#[macro_use] extern crate clap;\n#[macro_use] extern crate log;\nextern crate env_logger;\n\nmod cli;\n\nfn main() {\n env_logger::init().expect(\"Failed to initialize logger.\");\n\n run_cli();\n}\n\nfn run_cli<'a>() -> Result<(), &'a ...
rust
edit
0
3
mit
25430893c9d21b6ed1827aa48fef09d806c029b9
jhelwig/homers
src/main.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nextern crate metl;\n\nuse metl::extras::window::{Event, WindowBuilder};\nuse metl::{ClearColor, PixelFormat};\n\nfn main() {\n let device = metl::Device::system_default_device().unwrap();\n let mut window = WindowBuilder::new(device)\n ...
rust
edit
0
4
apache-2.0
2cbf17361ffb8415133b530184eb8607e22e3816
burtonageo/metl
examples/metal_triangle.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nextern crate littletest;\n\nuse littletest::{Runnable, TestResult, TestOptions, TestRunner};\n\nstruct TestCase {\n result: TestResult\n}\n\nunsafe impl Sync for TestCase {}\n\nimpl TestCase {\n fn new(result: TestResult) -> TestCase {\...
rust
edit
0
1
mit
77ae0e495ff13ef18bb7db607910022c6cca9c04
justinlatimer/littletest
tests/lib.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n// aux-build:unit-return.rs\n\n#![crate_name = \"foo\"]\n\nextern crate unit_return;\n\n// @has 'foo/fn.f0.html' '//*[@class=\"rust fn\"]' 'F: FnMut(u8) + Clone'\npub fn f0<F: FnMut(u8) + Clone>(f: F) {}\n\n// @has 'foo/fn.f1.html' '//*[@clas...
rust
edit
0
1
apache-2.0
0f24ccd21d9f734a21daaf3566900127167556d1
aidancully/rust,aidancully/rust,graydon/rust,aidancully/rust,aidancully/rust,graydon/rust,graydon/rust,aidancully/rust,graydon/rust,graydon/rust,graydon/rust,aidancully/rust
src/test/rustdoc/unit-return.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse std::sync::Arc;\r\n\r\nuse ra_syntax::ast::{NameOwner};\r\n\r\nuse crate::{\r\n Name, AsName, Const, ConstSignature, Static,\r\n type_ref::{TypeRef},\r\n PersistentHirDatabase,\r\n};\r\n\r\nimpl ConstSignature {\r\n pub(crate)...
rust
edit
0
1
apache-2.0
cff9a7dfadc6069bbc7b49c3ceb8497c78d426ab
rust-analyzer/rust-analyzer,rust-analyzer/rust-analyzer,rust-analyzer/rust-analyzer,rust-analyzer/rust-analyzer,rust-analyzer/rust-analyzer
crates/ra_hir/src/code_model_impl/konst.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse rocket::response::NamedFile;\nuse std::io;\nuse std::path::{Path, PathBuf};\n\n#[get(\"/<path..>\", rank = 5)]\nfn all(path: PathBuf) -> io::Result<NamedFile> {\n NamedFile::open(Path::new(\"static/\").join(path))\n}\n\n```\n\nApply th...
rust
edit
0
1
apache-2.0
cf47daa8e140cf61e4d965df2840813a9d3fde8c
shssoichiro/Rocket,antonpirker/Rocket,shssoichiro/Rocket,antonpirker/Rocket,antonpirker/Rocket,shssoichiro/Rocket
examples/todo/src/static_files.rs
accepted
null
true