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": "Here is the current file:\n```rust\n#![feature(custom_attribute)]\n#![allow(dead_code, unused_attributes)]\n\n#[miri_run]\nfn make_vec() -> Vec<i32> {\n let mut v = Vec::with_capacity(4);\n v.push(1);\n v.push(2);\n v\n}\n\n#[miri_run]\nfn make_vec_macro() -> Vec<i3...
rust
edit
0
1
apache-2.0
936537ea84934469a82ce768510966fd95f7977b
aidancully/rust,tsion/miri,graydon/rust,aidancully/rust,GBGamer/rust,graydon/rust,GBGamer/rust,GBGamer/rust,GBGamer/rust,graydon/rust,rust-lang/miri,GBGamer/rust,rust-lang/miri,GBGamer/rust,aidancully/rust,graydon/rust,rust-lang/miri,aidancully/rust,rust-lang/miri,graydon/rust,GBGamer/rust,aidancully/rust,graydon/rust,...
test/vecs.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse libc::system;\nuse std::ffi::CString;\n\nstatic TMUX_NAME: &'static str = \"tmux\";\n\nfn call(command: String) {\n let system_call = CString::new(format!(\"{} {}\", TMUX_NAME, command)).unwrap();\n unsafe { system(system_call.as_pt...
rust
edit
2
1
mit
ad536e62bacad46f1e90705aa40d63bdc82ab978
brianp/muxed,brianp/muxed
src/tmux/mod.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n// Copyright 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 or\n//...
rust
edit
0
1
apache-2.0
13d17adf6059552358c8601aaa407aea5ddddb98
GBGamer/rust,GBGamer/rust,GBGamer/rust,aidancully/rust,aidancully/rust,graydon/rust,aidancully/rust,graydon/rust,graydon/rust,aidancully/rust,GBGamer/rust,graydon/rust,graydon/rust,GBGamer/rust,GBGamer/rust,aidancully/rust,graydon/rust,GBGamer/rust,aidancully/rust,GBGamer/rust
src/librustc_data_structures/obligation_forest/node_index.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n// Copyright (c) 2016-2017 Chef Software Inc. and/or applicable contributors\n//\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 c...
rust
edit
4
2
apache-2.0
6322895acb2d1a2171155736ca79ba0773663ec3
habitat-sh/habitat,habitat-sh/habitat,habitat-sh/habitat,rsertelon/habitat,habitat-sh/habitat,habitat-sh/habitat,rsertelon/habitat,rsertelon/habitat,habitat-sh/habitat,rsertelon/habitat,rsertelon/habitat,rsertelon/habitat,habitat-sh/habitat,habitat-sh/habitat,rsertelon/habitat
src/binlink.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse std::fs::remove_file;\nuse std::process::{Command, Output};\n\nconst RUSTC_COLOR_ARGS: &[&str] = &[\"--color\", \"always\"];\n\npub fn compile_test_cmd(filename: &str) -> Output {\n Command::new(\"rustc\")\n .args(&[\"--test\", ...
rust
edit
0
1
mit
592ae6b4d2b4745704dfb3ed10bbc5a60d3cacfc
carols10cents/rustlings,carols10cents/rustlings
src/util.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n//! A simple utility for getting the size of a terminal.\n//!\n//! Supports both Linux, MacOS, and Windows.\n//!\n//! This crate requires a minimum rust version of 1.48.0 (2020-11-19)\n//!\n//! # Example\n//!\n//! ```\n//! use terminal_size:...
rust
edit
0
1
apache-2.0
6443031642ebd84ddd145d419cbb57a5ac6f8c0d
eminence/terminal-size
src/lib.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n// This test ensures that rustdoc does not panic on inherented associated types\n// that are referred to without fully-qualified syntax.\n\n#![feature(inherent_associated_types)]\n#![allow(incomplete_features)]\n\npub struct Struct;\n\nimpl S...
rust
edit
0
0
apache-2.0
7bad85e815346dfbfabab8179a941b6f4031ea91
aidancully/rust,aidancully/rust,aidancully/rust,aidancully/rust,aidancully/rust,graydon/rust,aidancully/rust,graydon/rust,graydon/rust,graydon/rust,graydon/rust,graydon/rust
src/test/rustdoc-ui/ambiguous-inherent-assoc-ty.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n// check-pass\n\nmacro_rules! def_target {\n ($target: expr) => {\n #[target_feature(enable=$target)]\n unsafe fn f() {\n #[target_feature(enable=$target)]\n ()\n }\n };\n}\n\ndef_target!(\"avx...
rust
edit
3
1
apache-2.0
48cad460bc664d110c013b02a21ede7612f1a8e6
aidancully/rust,aidancully/rust,aidancully/rust,graydon/rust,graydon/rust,aidancully/rust,aidancully/rust,graydon/rust,graydon/rust,graydon/rust,aidancully/rust,graydon/rust
src/test/ui/macros/issue-68058.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse command::Command;\nuse vm::VM;\n\n\npub struct Program {\n instructions : Vec<Command>,\n instruction_pointer: Option<usize>,\n is_seeking: bool,\n current_depth: u64,\n goal_depth: Option<u64>,\n}\n\n\nimpl Program {\n ...
rust
edit
0
5
mit
f8a5b27ca6932cb433643fbe4971cac2e6a00667
nafarlee/thoughtfuck
src/program.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n/// Ye Olde Await Macro\n///\n/// Basically a translation of polling to yielding. This crate's macro is\n/// reexported in the `futures_await` crate, you should not use this crate\n/// specifically. If I knew how to define this macro in the `...
rust
edit
1
0
apache-2.0
82fc83d10bd86fca43d246b0ab77df470fa9ea7c
alexcrichton/futures-rs
futures-await-macro/src/lib.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n#![macro_escape]\nmacro_rules! hash_module (($hash_name:ident, $hashbytes:expr, $blockbytes:expr) => (\n\n#[link(name = \"sodium\")]\nextern {\n fn $hash_name(h: *mut u8,\n m: *u8,\n mlen: c_ulonglong) -> ...
rust
edit
null
null
mit
641cab47e16517005d88d344199dd1f01069f5fb
romanb/sodiumoxide,Fraser999/sodiumoxide,maidsafe/sodiumoxide,markuskobler/sodiumoxide
src/sodiumoxide/crypto/hash_macros.rs
rejected_syntax
Syntax error detected by tree-sitter
false
[ { "role": "user", "content": "Here is the current file:\n```rust\n/// Weather update server\n/// Binds PUB socket to tcp://*:5556 and ipc://weather.ipc\n/// Publishes random weather updates\n\nextern crate zmq;\n\nuse std::rand::Rng;\n\nfn main() {\n let mut context = zmq::Context::new();\n let mut pu...
rust
edit
0
1
apache-2.0
560f3d90102a3077bbeb557efb66ae202ced8af0
dginev/rust-zmq,tempbottle/rust-zmq,pblasucci/rust-zmq,alexkamp/rust-zmq,erickt/rust-zmq,petehayes102/rust-zmq,jedisct1/rust-zmq,cristicbz/rust-zmq,pfernie/rust-zmq
src/examples/zguide/weather-server/main.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n/// Look for a directive in a comment string.\n/// The directive is of the form \"foo:\" and should follow the leading `;` in the comment:\n///\n/// ; dominates: ebb3 ebb4\n///\n/// Return the comment text following the directive.\npub fn mat...
rust
edit
0
2
apache-2.0
6237d4e7ccef4f0cf7cf146706b4f2fd6ead8c30
stoklund/cretonne,stoklund/cretonne,stoklund/cretonne
lib/filetests/src/match_directive.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n#![cfg(feature = \"comprehendmedical\")]\n\nextern crate rusoto_comprehendmedical;\nextern crate rusoto_core;\n\nuse rusoto_comprehendmedical::{ComprehendMedical, ComprehendMedicalClient, DetectPHIRequest};\nuse rusoto_core::Region;\n\n#[test...
rust
edit
0
2
mit
6c8cb7f7ed273b0b2b03c168923256adb952d91b
rusoto/rusoto,DualSpark/rusoto,DualSpark/rust-aws,DualSpark/rusoto,rusoto/rusoto,DualSpark/rust-aws,rusoto/rusoto,DualSpark/rusoto,DualSpark/rust-aws
integration_tests/tests/comprehendmedical.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n// Copyright (c) 2016, Matthew O'Connor\nextern crate system_zero_core;\n\nuse std::io;\nuse std::io::{BufRead, Write};\nuse system_zero_core::*;\nuse system_zero_core::ast::*;\n\nconst PROMPT: &'static str = \"> \";\n\nfn prompt() -> () {\n ...
rust
edit
0
8
isc
78568c481b094259bc62f960f5ffe92ac99c6e39
oconnor0/system-zero
szi/src/main.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n#![macro_escape]\nmacro_rules! hash_module (($hash_name:ident, $hashbytes:expr, $blockbytes:expr) => (\n\n#[link(name = \"sodium\")]\nextern {\n fn $hash_name(h: *mut u8,\n m: *u8,\n mlen: c_ulonglong) -> ...
rust
edit
null
null
mit
641cab47e16517005d88d344199dd1f01069f5fb
romanb/sodiumoxide,Fraser999/sodiumoxide,maidsafe/sodiumoxide,markuskobler/sodiumoxide
src/sodiumoxide/crypto/hash_macros.rs
rejected_syntax
Syntax error detected by tree-sitter
false
[ { "role": "user", "content": "Here is the current file:\n```rust\n\n\nuse at::{AtRust, AtTrigger};\nuse plugins::get;\n\nuse select::document::Document;\nuse select::predicate::{Attr, Class, Name};\nuse rand;\n\n\n\npub fn eksi(trigger: &AtTrigger, at: &AtRust) {\n let url = format!(\"https://eksisozluk....
rust
edit
1
4
mit
25a7847a1825ebee3c1386e55753783cf1d115b3
onur/at_sirk
src/plugins/eksi.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\npub struct Post {\n state: Option<Box<State>>,\n content: String\n}\n\nimpl Post {\n pub fn new() -> Post {\n Post {\n state: Some(Box::new(Draft {})),\n content: String::new()\n }\n }\n\n pu...
rust
edit
null
null
mit
75c663a8aa85c636145d436eead80c48cfad0115
pgrzesik/learning-rust
blog/src/lib.rs
rejected_syntax
Syntax error detected by tree-sitter
false
[ { "role": "user", "content": "Here is the current file:\n```rust\nextern crate tiny_http;\n\n#[cfg(not(feature = \"ssl\"))]\nfn main() { println!(\"This example requires the `ssl` feature to be enabled\"); }\n\n#[cfg(feature = \"ssl\")]\nfn main() {\n use tiny_http::{Server, Response};\n\n let server ...
rust
edit
0
2
apache-2.0
971132a46bfb64e03c52d64be4f333e61c8cf9fd
frewsxcv/tiny-http,frewsxcv/tiny-http,tiny-http/tiny-http
examples/ssl.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n// Copyright 2015 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
0
apache-2.0
a94f684129dbf8cb4c87abe69ff45765cf24e501
GBGamer/rust,graydon/rust,GBGamer/rust,graydon/rust,aidancully/rust,aidancully/rust,graydon/rust,aidancully/rust,aidancully/rust,GBGamer/rust,GBGamer/rust,GBGamer/rust,aidancully/rust,GBGamer/rust,graydon/rust,GBGamer/rust,GBGamer/rust,aidancully/rust,graydon/rust,graydon/rust
src/librustc_trans/diagnostics.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n#![allow(unused_variables)]\n#![allow(bad_style)]\n\nuse std::path::Path;\nuse std::{fs, io};\nuse FileTime;\n\npub fn set_file_times(p: &Path, atime: FileTime, mtime: FileTime) -> io::Result<()> {\n unimplemented!()\n}\n\npub fn set_symli...
rust
edit
1
1
apache-2.0
92f3170bf07444163a0a5929e5707b003351e317
alexcrichton/filetime
src/wasm.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse std::io::Write; // need it to flush stdout\n\nstatic PROMPT: &'static str = \"> \";\n\nfn main() {\n\n // we allocate a String for the user input\n let mut input: String = String::new();\n\n loop {\n\n print!(\"{}\", PROMP...
rust
edit
2
4
mit
9673403f0580222da1d54aec39435996d2185702
mossberg/relish
src/main.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nmod js_obj;\nmod js_type;\n\nuse std::string::String;\n\npub struct JsUndef;\npub struct JsNull;\npub struct JsBool(bool);\npub struct JsNum(f64);\npub struct JsSym(String);\n\npub struct JsStr {\n text: String,\n}\n\nimpl JsStr {\n con...
rust
edit
1
1
mit
d7ae0370396cf76e3e057ec7da83504f7a7673f4
rustoscript/french-press
src/js_types/mod.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse gc_error::GcError;\nuse types::binding::Binding;\nuse types::js_var::{JsPtrEnum, JsVar};\n\npub trait Backend {\n fn alloc(&mut self, var: JsVar, ptr: Option<JsPtrEnum>) -> Result<Binding, GcError>;\n fn load(&self, bnd: &Binding) -...
rust
edit
0
0
mit
b5feafd4728f335c3806ef59cd5b224dd4852a45
rustoscript/js.rs-common
src/backend.rs
rejected_duplicate
Near-duplicate of sample 120816
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nextern crate sdl2;\n\n#[test]\nfn display_name_no_segfault() {\n let sdl_context = sdl2::init().unwrap();\n let video_subsystem = sdl_context.video().unwrap();\n // hopefully no one has a 100 screen to see this test pass\n let r =...
rust
edit
0
2
mit
ac87f8153a4958b9fca9299c5c030a5b43135b1e
Rust-SDL2/rust-sdl2,Cobrand/rust-sdl2,Rust-SDL2/rust-sdl2,Cobrand/rust-sdl2,Cobrand/rust-sdl2,AngryLawyer/rust-sdl2,Rust-SDL2/rust-sdl2
tests/video.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n\nuse std::io;\nuse std::io::prelude::*;\nuse job::jobs;\nuse agent::client;\n\npub fn start() {\n let mut stdout = io::stdout();\n loop {\n\n write!(&mut stdout, \"builr> \");\n stdout.flush();\n \n let inpu...
rust
edit
0
7
mit
9b77956324057f73dbdaa74966610c44e4f46a93
evadnoob/rustoleum
src/repl/repl.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n#[link(name = \"http\",\n package_id = \"http\",\n vers = \"0.1-pre\",\n uuid = \"d2ad8df0-547a-4ce1-99c6-a9da3b98fb3e\",\n url = \"https://github.com/chris-morgan/rust-http/tree/master/src/http\")];\n\n#[comment = \"R...
rust
edit
null
null
apache-2.0
28bced7ff104579ecf6b47d4c4ee57e160390aa6
servo/rust-http,servo/rust-http,Shraddha512/rust-http,Shraddha512/rust-http,Shraddha512/rust-http,chris-morgan/rust-http,servo/rust-http,Shraddha512/rust-http,Shraddha512/rust-http,chris-morgan/rust-http,chris-morgan/rust-http,servo/rust-http,chris-morgan/rust-http
src/http/lib.rs
rejected_syntax
Syntax error detected by tree-sitter
false
[ { "role": "user", "content": "Here is the current file:\n```rust\nextern crate libc;\n\nuse std::os::raw::c_char;\nuse libc::size_t;\nuse libc::strncpy;\n\n#[test]\nfn add_i_i() {\n let actual_value = _add(\"I\", \"I\");\n\n assert_eq!(\"II\", actual_value);\n}\n\n#[test]\nfn add_i_ii() {\n let act...
rust
edit
1
1
mit
fec416f9634b22add475d5f7825f3eb89d51c54c
ben--/kata-rnc,ben--/kata-rnc,ben--/kata-rnc
src/rust/src/lib.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n\n#[ allow( unused_imports ) ]\nuse super::*;\n\n//\n\ntests_impls!\n{\n\n #[ cfg( any( feature = \"chrono\", feature = \"time_chrono\" ) ) ]\n #[ test ]\n fn basic()\n {\n use TheModule::*;\n\n // test.case( \"time::now\" );\n l...
rust
edit
0
1
mit
e8166739d469098b0a7f0d44bb30cd460dec6357
Wandalen/wTools,Wandalen/wTools
rust/test/time/inc/now_test.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n#![cfg(any(target_arch=\"x86\", target_arch=\"x86_64\"))]\n\n#![no_std]\n#![crate_name=\"cpu\"]\n#![crate_type=\"rlib\"]\n#![feature(asm)]\n\n#[allow(unstable)] #[macro_use]\nextern crate core;\n\npub use cpu::*;\n\n#[macro_use] mod bitflags;...
rust
edit
0
0
mit
a06b8e1eb33a0b9b1bc66bd10005f2f41837b57c
Tobba/libcpu,rexlunae/redox,rexlunae/redox,phil-opp/rust-x86_64,gz/rust-x86,rexlunae/redox,gz/rust-x86,RustOS-Fork-Holding-Ground/libcpu
src/lib.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n// Copyright 2013 The Servo Project Developers. See the COPYRIGHT\n// file at the top-level directory of this distribution.\n//\n// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or\n// http://www.apache.org/licenses/LICENSE-2...
rust
edit
2
1
apache-2.0
79ad0fe2839bc5488917c95d57aba3500eff8a6e
mrobinson/rust-layers,glennw/rust-layers
scene.rs
rejected_duplicate
Near-duplicate of sample 119809
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nextern crate expression;\nextern crate rand;\n#[cfg(test)]\nextern crate expression_num;\n\npub mod parametric;\n\nuse std::fmt::Debug;\n\n/// Used to name symbols and variables.\npub trait Alphabet: Debug + PartialEq + Eq + PartialOrd + Ord ...
rust
edit
0
0
mit
effe6d5f408ce7c777d5e45d202af90b3dbdbffc
mneumann/lindenmayer-system
src/lib.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n#![feature(plugin)]\n#![plugin(eq_op)]\n\n#[deny(eq_op)]\nfn main() {\n\t//((1 + 1) & (1 + 1) == (1 + 1) & (1 + 1)); // does not work with compiletest yet due to multiple errors\n\t(1 + 2) * 3 - 5 < 3 * (2 + 1) - 5; //~ERROR\n}\n\n```\n\nAppl...
rust
edit
1
1
mit
06f15e9cff03e784120a113c249cbf8a9f25723a
llogiq/extra_lints
tests/compile-fail/complex_binop.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nextern crate gl_generator;\nextern crate khronos_api;\n\nuse std::os;\nuse std::io::File;\n\nfn main() {\n let dest = Path::new(os::getenv(\"OUT_DIR\").unwrap());\n\n let mut file = File::create(&dest.join(\"gl_bindings.rs\")).unwrap();...
rust
edit
0
1
apache-2.0
8828a0863e5e0c2ad0c3000eef483c452e13dcf9
gfx-rs/gfx_gl
build.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n\nexport ptr_eq;\n\nnative \"rust\" mod rustrt {\n fn rust_ptr_eq[T](@T a, @T b) -> int;\n}\n\nfn ptr_eq[T](@T a, @T b) -> bool { ret rustrt::rust_ptr_eq[T](a, b) != 0; }\n```\n\nApply this change: rustc: Implement ptr_eq in Rust. Shaves 4...
rust
edit
null
null
apache-2.0
45748a3be4275258ada5ca23b09c6b2f0122ca3f
KokaKiwi/rust,krzysz00/rust,krzysz00/rust,zubron/rust,richo/rust,AerialX/rust-rt-minimal,sae-bom/rust,emk/rust,pythonesque/rust,pshc/rust,avdi/rust,mvdnes/rust,untitaker/rust,l0kod/rust,cllns/rust,rprichard/rust,seanrivera/rust,omasanori/rust,philyoon/rust,nham/rust,ebfull/rand,jbclements/rust,nwin/rust,mdinger/rust,kr...
src/lib/box.rs
rejected_syntax
Syntax error detected by tree-sitter
false
[ { "role": "user", "content": "Here is the current file:\n```rust\nextern crate exa;\nuse exa::Exa;\n\nuse std::env::args_os;\nuse std::io::{stdout, stderr, Write, ErrorKind};\nuse std::process::exit;\n\nfn main() {\n let args = args_os().skip(1);\n match Exa::new(args, &mut stdout()) {\n Ok(mut...
rust
edit
0
5
mit
aa17e4d3df4c363a9389ae4c5ad4ea34044e0227
ogham/exa,ogham/exa
src/bin/main.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse super::{PluginConfig, PluginMode};\nuse crate::config::ServerAddr;\nuse log::trace;\nuse std::{net::SocketAddr, process::Stdio};\nuse tokio::process::Command;\n\npub fn plugin_cmd(plugin: &PluginConfig, remote: &ServerAddr, local: &Socket...
rust
edit
0
2
mit
e39de3416f2c5cdaaf8ac30a1a5e935228917ec0
shadowsocks/shadowsocks-rust,shadowsocks/shadowsocks-rust,zonyitoo/shadowsocks-rust,shadowsocks/shadowsocks-rust,shadowsocks/shadowsocks-rust
src/plugin/ss_plugin.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse std::path::PathBuf;\nuse std::process::Child;\nuse std::process::Command;\n\npub struct App {\n pub name: String,\n pub port: u16,\n #[allow(dead_code)]\n process: Child,\n}\n\nimpl App {\n pub fn new(name: &str, port: u16,...
rust
edit
1
1
mit
137fb7171664b486fc91ed8fa24f23e18d81ed9d
juanibiapina/zas,juanibiapina/zas,juanibiapina/zas
src/http/app.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n#![feature(test)]\n\nextern crate test;\nextern crate seahash;\n\n#[bench]\nfn gigabyte(b: &mut test::Bencher) {\n b.iter(|| {\n let mut x = 0;\n let mut buf = [15; 4096];\n\n for _ in 0..250000 {\n x ^= sea...
rust
edit
0
3
mit
592f19bcddfb1814ba37213472c98a6912e93a9f
ticki/tfs,redox-os/tfs
seahash/benches/gigabyte.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nextern crate rustpn;\n\nuse rustpn::parse;\nuse rustpn::vm::Vm;\nuse std::io::{stdin, BufRead};\n\nfn main() {\n let mut vm = Vm::<i64>::new_with_builtins();\n let stdin = stdin();\n for program in stdin.lock().lines() {\n let...
rust
edit
0
5
unlicense
61af13fb9f43f31b6455cf29beecd98ac7b2048f
scott-linder/rustpn
src/bin/rustpn.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse crate::syntax::namespace::Namespace;\nuse crate::syntax::ExternFn;\n\npub fn extern_fn(namespace: &Namespace, efn: &ExternFn) -> String {\n let receiver_type = match &efn.receiver {\n Some(receiver) => receiver.ident.to_string()...
rust
edit
0
2
apache-2.0
9d8d80bd811811067c6bae4f13cbdea152550887
dtolnay/cxx,dtolnay/cxx,dtolnay/cxx,dtolnay/cxx
syntax/mangle.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nextern crate quickcheck;\n\nuse self::quickcheck::{Gen, Arbitrary};\n\nuse {\n Graph,\n EdgeType,\n};\nuse graph::{\n IndexType,\n};\n\nimpl<N, E, Ty, Ix> Arbitrary for Graph<N, E, Ty, Ix>\n where N: Arbitrary,\n E: Arbit...
rust
edit
0
8
apache-2.0
e89f9a83b4c55ac20ee6d1dd1a7deef3599b3e9d
bluss/petulant-avenger-graphlibrary,petgraph/petgraph,Kha/petulant-avenger-graphlibrary
src/quickcheck.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n// Copyright 2020 Google LLC\n//\n// Use of this source code is governed by an MIT-style license that can be found\n// in the LICENSE file or at https://opensource.org/licenses/MIT.\n\nuse std::io::{Read, Write, Result};\n\npub fn copy_until<...
rust
edit
0
6
mit
fdb35d8e188e4ef4062266868af8f255d7371ffa
google/rrg
src/io.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse color::Color;\n\npub struct Program {\n image: Vec<Vec<Color>>,\n}\n\nimpl Program {\n pub fn get(coords: (usize, usize)) -> Option<Color> {\n unimplemented!();\n }\n\n pub fn neighbors(coords: (usize, usize)) -> &[Colo...
rust
edit
0
1
mit
13c35f4ddba9ffbee5c3c522727f0ebe93f42cdb
ijks/piet-rs
src/program.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n#![no_main]\n\nuse arbitrary::Arbitrary;\nuse libfuzzer_sys::fuzz_target;\n\n#[derive(Arbitrary, Debug, Clone)]\nenum FloatInput {\n F32(f32),\n F64(f64),\n}\n\n#[derive(Arbitrary, Debug, Clone)]\nstruct Inputs {\n inputs: Vec<(Float...
rust
edit
0
0
apache-2.0
efadf150807ae818a0734ac60d699e0a85db892b
dtolnay/ryu
fuzz/fuzz_targets/fuzz_ryu.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\npub struct Position {\n pub line: u64,\n pub offset: u64,\n}\n\n```\n\nApply this change: Implement Copy and Clone traits for Position." }, { "role": "assistant", "content": "#[derive(Copy, Clone)]\npub struct Position {\n...
rust
edit
0
0
mit
fdd60b2d75006ab63530182f120e63f1f9b4eb89
jmacdonald/scribe
src/buffer/position.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
7db0f843472dbce2c422f046c0f97b91b21e0f77
endoli/message-format.rs
src/icu/ast/placeholder_format.rs
rejected_syntax
Syntax error detected by tree-sitter
false
[ { "role": "user", "content": "Here is the current file:\n```rust\n// Copyright 2013 The Servo Project Developers. See the COPYRIGHT\n// file at the top-level directory of this distribution.\n//\n// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or\n// http://www.apache.org/licenses/LICENSE-2...
rust
edit
0
0
apache-2.0
721035f467be745761df0d2d3c6068eb1f7b673c
mbrubeck/rust-geom,ruud-v-a/rust-geom,servo/rust-geom
lib.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse super::AttestationData;\nuse crate::test_utils::TestRandom;\nuse serde_derive::Serialize;\nuse ssz_derive::{Decode, Encode};\nuse test_random_derive::TestRandom;\nuse tree_hash_derive::{CachedTreeHash, TreeHash};\n\n/// Used for pairing a...
rust
edit
0
0
apache-2.0
07b94b30bac12180e9671d3ad6f7a2fd1e15844a
sigp/lighthouse,sigp/lighthouse,sigp/lighthouse,sigp/lighthouse
eth2/types/src/attestation_data_and_custody_bit.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse proc_macro2::{Delimiter, Group, Ident, Punct, Spacing, Span, TokenStream, TokenTree};\nuse std::iter::FromIterator;\nuse syn::{Expr, Type};\n\n#[test]\nfn parse_interpolated_leading_component() {\n // mimics the token stream correspond...
rust
edit
1
1
apache-2.0
33d56ca9d1c8d6c3fdb791d8e0b8093ef88c2a9d
dtolnay/syn
tests/test_path.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse common::math::lcm;\n\n/// Returns the smallest number than can divided by all numbers between one and `target`\nfn smallest_multiple(target: uint) -> uint {\n range(1, target).fold(1, |a, b| { lcm(a, b) })\n}\n\n#[cfg(test)]\nmod test ...
rust
edit
0
2
mit
80b723cb4b647d301260a91f51bb20fb715805ae
niax/euler-rust
src/prob5.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n// The MIT License (MIT)\n//\n// Copyright (c) 2015 dinowernli\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the...
rust
edit
1
0
mit
ae4254e32b15e52e7a46da975aaedba6f4a92aae
dinowernli/marvin
src/lib.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse std::{fmt::format, path::PathBuf};\n\nuse json5;\n\nuse crate::config::Config;\n\npub fn build(in_dir: PathBuf) -> Result<(), String> {\n let data_file = in_dir.join(\"_data/config.json5\");\n let data = std::fs::read_to_string(&dat...
rust
edit
1
3
mit
13f672cb8efc7da228e77e8a4515dcd65b34b771
chriskrycho/lightning-rs,chriskrycho/lightning-rs
src/build.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n#[macro_use] extern crate bitflags;\nextern crate gl as gl_lib;\n#[cfg(feature = \"cgmath\")] extern crate cgmath as cgmath_lib;\n#[cfg(feature = \"image\")] extern crate image as image_lib;\n\nmod ref_into;\n\n#[macro_use] mod macros;\nmod c...
rust
edit
15
0
apache-2.0
0cc206726550c06796f86f27a98d5671d7bd41a8
kylewlacy/glitter,kylewlacy/glitter
src/lib.rs
rejected_lint
Too many lint violations: 15
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse Addr;\nuse std::mem::transmute;\nuse system::memory::{read, write};\n\npub fn random() -> f64 {\n let random = unsafe { transmute::<Addr, extern \"C\" fn() -> f64>(0x80243b40) };\n random()\n}\n\npub fn cdyl_init_async() {\n let ...
rust
edit
1
1
mit
724fb86c9d70369eef1a9a84f78354495c436115
CryZe/libtww,CryZe/libtww,CryZe/libtww,CryZe/libtww,CryZe/libtww,CryZe/libtww
src/system/tww.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nmod evaluation;\npub use self::evaluation::*;\n\npub mod species;\n\nmod types;\npub use self::types::*;\n\n```\n\nApply this change: Make PokeSpecies a top-level export" }, { "role": "assistant", "content": "mod evaluation;\npub ...
rust
edit
3
0
mit
4709e67bfdf68ebd20a2d349c09e68f4ee523a3e
adamhammes/pokemon_go_data,adamhammes/pokemon_go_data,adamhammes/pokemon_go_data
src/lib.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n#[macro_use]\nextern crate solicit;\nextern crate rustc_serialize;\nextern crate time;\nextern crate openssl;\n\npub mod provider;\npub mod notification;\npub mod payload;\npub mod device_token;\npub mod response;\n\npub use provider::{Provid...
rust
edit
1
0
mit
33a96c201871c2b33dc211f3dd1660850592825f
pimeys/apns2,pimeys/apns2,tkabit/apns2,polyitan/apns2
src/lib.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse core::marker;\nuse core::pin::Pin;\nuse futures_core::future::{FusedFuture, Future};\nuse futures_core::task::{Context, Poll};\n\n/// Future for the [`pending()`] function.\n#[derive(Debug, Clone)]\n#[must_use = \"futures do nothing unles...
rust
edit
0
1
apache-2.0
99d5ebed1288fe61e21151c86b2223e8872070c0
alexcrichton/futures-rs
futures-util/src/future/pending.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n#[macro_use]\nextern crate diesel;\n\nuse diesel::*;\nuse diesel::dsl::count_star;\n\ntable! {\n users {\n id -> Integer,\n }\n}\n\nfn main() {\n use self::users::dsl::*;\n\n let source = users.select((id, count_star()));\n...
rust
edit
0
1
apache-2.0
2a5d5b63f9ae9e588b217971d2debe276619c841
sgrif/diesel,diesel-rs/diesel,diesel-rs/diesel,sgrif/diesel
diesel_compile_tests/tests/compile-fail/cannot_mix_aggregate_and_non_aggregate_selects.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 let mut build = cc::Build::new();\n build\n .include(&dir)\n .file(&dir.join(\"parser.c\"))\n .fi...
rust
edit
0
1
mit
74dd4dcc2ca9f8ef3185341bf6ea66c08e8e84f1
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\nuse std::env;\n\nextern crate shaman;\nextern crate libc;\nextern crate nix;\nextern crate rand;\nextern crate rustc_serialize;\nextern crate env_logger;\nextern crate argparse;\nextern crate quire;\nextern crate time;\nextern crate unshare;\...
rust
edit
1
3
mit
cbf7dce7ceecc45c08c438b906afae12cc5f8a69
tailhook/vagga,popravich/vagga,popravich/vagga,rrader/vagga,popravich/vagga,popravich/vagga,rrader/vagga,tailhook/vagga,tailhook/vagga,rrader/vagga,tailhook/vagga
src/main.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n#![ warn( rust_2018_idioms ) ]\n#![ warn( missing_debug_implementations ) ]\n#![ warn( missing_docs ) ]\n\n// #![ feature( trace_macros ) ]\n#![ feature( type_name_of_val ) ]\n\nuse type_constructor as TheModule;\n#[ allow( unused_imports ) ]...
rust
edit
0
1
mit
f696898a7a81b943e4c08d7e9ddeda7963555db1
Wandalen/wTools,Wandalen/wTools
rust/test/dt/type_constructor/type_constructor_tests.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nmod domain;\n\nuse std::fs::File;\nuse std::io::prelude::*;\n\nuse chrono::prelude::*;\nuse clap::{App, Arg};\nuse dotenv::dotenv;\nuse serde_derive::{Deserialize, Serialize};\n\nuse self::domain::{\n Entry, EntryId, EntryKind, Project, Pr...
rust
edit
2
1
mit
44b34e29a724adfd09482d0e7b2fe04bdf7e014a
maxdeviant/scribe
src/main.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n#![crate_name = \"foo\"]\n\n// @has foo/fn.foo.html\n// !@has - '//a[@href=\"http://a.a\"]'\n// @has - '//a[@href=\"#implementing-stuff-somewhere\"]' 'Implementing stuff somewhere'\n\n/// fooo\n///\n/// # Implementing [stuff](http://a.a) some...
rust
edit
0
1
apache-2.0
5022dd3b854792dd72d396e1586aa5b5c09975b2
aidancully/rust,aidancully/rust,aidancully/rust,aidancully/rust,graydon/rust,graydon/rust,aidancully/rust,graydon/rust,graydon/rust,graydon/rust,graydon/rust,aidancully/rust
src/test/rustdoc/remove-url-from-headings.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n// build-pass\n// compile-flags: -g\n\npub struct Dst {\n pub a: (),\n pub b: (),\n pub data: [u8],\n}\n\npub unsafe fn borrow(bytes: &[u8]) -> &Dst {\n let dst: &Dst = std::mem::transmute((bytes.as_ptr(), bytes.len()));\n dst\...
rust
edit
2
1
apache-2.0
4a4df29d6fa12c303e3991f0e0e3677342c4787c
graydon/rust,aidancully/rust,aidancully/rust,graydon/rust,aidancully/rust,graydon/rust,graydon/rust,aidancully/rust,graydon/rust,aidancully/rust,graydon/rust,aidancully/rust
src/test/ui/issues/issue-23477.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse std::io;\nuse winapi::ctypes::c_int;\nuse winapi::um::winnls as sys_winnls;\nuse winrust::{from_wide_string, to_wide_string};\n\nconst MAX_LOCALE_NAME_LEN: usize = 85usize;\n\n// TODO: remove panics\npub fn resolve_locale_name(tag: &str) ...
rust
edit
0
3
isc
419d81c18a9ce5b7c4b765cf7741abeb1f490f01
bbqsrc/kbdi
src/platform/winnls.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse std::io::{Write, BufWriter};\nuse std::fs::File;\nmod vector;\nuse vector::Vec3;\n\nfn main() {\n let v = Vec3 { i: 200f64, j: 200f64, k: 255f64 };\n let nx = 200;\n let ny = 200;\n let data = format!(\"{}\\n{} {}\\n{}\\n\", \"P3\", v...
rust
edit
0
3
mit
0e5cd25c1d231c231e7a428c6058daaaa74cdf83
corragon/rust-raytracer
src/main.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n// run-pass\n// This test is just checking that we won't ICE if logging is turned\n// on; don't bother trying to compare that (copious) output. (Note\n// also that this test potentially silly, since we do not build+test\n// debug versions of ...
rust
edit
0
1
apache-2.0
93f80bff940c4269e18836b3f4c5cefed19b361a
graydon/rust,aidancully/rust,graydon/rust,graydon/rust,aidancully/rust,graydon/rust,graydon/rust,aidancully/rust,graydon/rust,aidancully/rust,aidancully/rust,aidancully/rust
src/test/ui/rustc-rust-log.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse cortexm3;\nuse main::Chip;\nuse usb;\n\npub struct Hotel {\n mpu: cortexm3::mpu::MPU,\n systick: &'static cortexm3::systick::SysTick,\n}\n\nimpl Hotel {\n pub unsafe fn new() -> Hotel {\n Hotel {\n mpu: cortexm3...
rust
edit
2
3
apache-2.0
44ce6fdcc7375938d4020d0f796a34b6bd44dde9
google/tock-on-titan,google/tock-on-titan,google/tock-on-titan
src/chips/hotel/src/chip.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n#![feature(ascii_ctype)]\nuse std::ascii::AsciiExt;\n\npub fn encode(message: &str) -> String {\n let mut index = 0;\n message\n .chars()\n .filter_map(|c| match c {\n _ if c.is_ascii_digit() => Some(c),\n ...
rust
edit
2
4
bsd-2-clause
8d0fbd17c7e924c32c1b75f4634ba1f9165dfcf0
gyn/exercism,gyn/exercism,gyn/exercism,gyn/exercism
rust/atbash-cipher/src/lib.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nextern crate rustyline;\n\nuse rustyline::completion::FilenameCompleter;\nuse rustyline::error::ReadlineError;\nuse rustyline::Editor;\n\nfn main() {\n let c = FilenameCompleter::new();\n let mut rl = Editor::new();\n rl.set_complete...
rust
edit
0
3
mit
3a288cca93bc510ba30ce402c23bbf93d996d724
dubrowgn/rustyline,dubrowgn/rustyline,gwenn/rustyline,cavedweller/rustyline,kkawakam/rustyline
examples/example.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n#[derive(Debug, Eq, PartialEq, Copy, Clone)]\npub enum HeadingLevel {\n Level1,\n Level2,\n Level3,\n}\n\n#[derive(Debug, Eq, PartialEq, Copy, Clone)]\npub enum ListType {\n Unordered,\n Ordered,\n}\n\n#[derive(Debug, Eq, Parti...
rust
edit
0
0
mit
5b4c6a43be7ae4ce69acdf24cd0c7697ca6c7c2b
squid-lang/squid
src/ast/block.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n// Copyright 2015 Philipp Oppermann\n//\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//\n// http://w...
rust
edit
4
1
apache-2.0
5b1f2361f23a9d479004d8cdf063c708ebacf92a
phil-opp/blog_os,rafalmiel/blog_os,phil-opp/blogOS,phil-opp/blogOS,rafalmiel/blog_os,phil-opp/blog_os,phil-opp/blog_os,phil-opp/blog_os
src/lib.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n// Copyright 2013-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
0
1
apache-2.0
86357c37d26db32a1064a5d955f43c82452c9588
graydon/rust,aidancully/rust,graydon/rust,GBGamer/rust,aidancully/rust,aidancully/rust,graydon/rust,graydon/rust,GBGamer/rust,aidancully/rust,GBGamer/rust,GBGamer/rust,GBGamer/rust,GBGamer/rust,aidancully/rust,GBGamer/rust,graydon/rust,aidancully/rust,graydon/rust,GBGamer/rust
src/test/compile-fail/issue-5035.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nextern crate text;\n\n#[cfg(test)]\nmod tests {\n use text::Text;\n\n // #[test]\n // fn typename_as_constructor() {\n // let t = Text(String::from(\"XYZ\"));\n // println!(\"{:?}\", t);\n // assert!(false);\n ...
rust
edit
0
1
apache-2.0
82b689ce09d79e8aa579caec64976a9711e211df
imp/easystring-rs
tests/text.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n#![feature(unboxed_closures)]\n\nuse std::fmt;\n\npub use api::IntoLogger;\npub use api::Logger;\npub use config::Logger as LoggerConfig;\npub use config::Output as LoggerOutput;\n\nmod config;\nmod api;\nmod loggers;\n\npub enum Level {\n ...
rust
edit
1
2
mit
2cf8c527c910f0b67e1a4e592f35e95496b85bdc
daboross/fern-rs
src/lib.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
700d6ae98183811415ba40c2ec0f7360f4c60360
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 rosc;\n\nuse std::net;\n\n#[test]\nfn test_parse_ip_and_port() {\n let valid_addr = \"127.0.0.1:8080\".to_string();\n let mut addr = rosc::utils::parse_ip_and_port(&valid_addr);\n assert!(addr.is_ok());\n let (ip, por...
rust
edit
0
1
apache-2.0
f038ff87b78ddc9456914171f0231910f7f05ff6
klingtnet/rosc
tests/utils_test.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n#[macro_use]\nextern crate duct;\n\n#[test]\nfn examples() {\n let mut error = false;\n for file in std::fs::read_dir(\"clippy_tests/examples\").unwrap() {\n let file = file.unwrap().path();\n // only test *.rs files\n ...
rust
edit
0
8
apache-2.0
6982d66a595a5078ae5383b071ba5d4739bb5bd4
graydon/rust,graydon/rust,aidancully/rust,aidancully/rust,graydon/rust,aidancully/rust,graydon/rust,graydon/rust,aidancully/rust,aidancully/rust,aidancully/rust,graydon/rust
tests/examples.rs
accepted
null
true
[ { "role": "user", "content": "Write rust code for the following: Add a FauxStdout struct to use for output testing (unfinished)" }, { "role": "assistant", "content": "use std::io::{Write,Result};\nuse std::str;\n\n\npub struct FauxStdout {\n buffer: String\n}\n\n\nimpl Write for FauxStdout {\...
rust
new_file
0
1
mit
6516c68685d5b2a81012ef6463fad3cd92e51465
nafarlee/thoughtfuck
tests/common/mod.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse rustc_middle::mir;\nuse rustc_span::Symbol;\nuse rustc_target::spec::abi::Abi;\n\nuse crate::*;\nuse shims::foreign_items::EmulateByNameResult;\n\nimpl<'mir, 'tcx: 'mir> EvalContextExt<'mir, 'tcx> for crate::MiriEvalContext<'mir, 'tcx> {}...
rust
edit
1
9
apache-2.0
dca2bb68b3010a7cd47ae1e79674dcc7812828ce
rust-lang/miri,rust-lang/miri,rust-lang/miri,rust-lang/miri
src/shims/unix/freebsd/foreign_items.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse std::io::fs;\n\nfn main() {\n fs::rename(&Path::new(\"input.txt\"), &Path::new(\"output.txt\")).ok();\n fs::rename(&Path::new(\"docs\"), &Path::new(\"mydocs\")).ok();\n fs::rename(&Path::new(\"/input.txt\"), &Path::new(\"/output....
rust
edit
0
1
unlicense
7d08efac7ab91235e8c586de3dbdda52150dd7b4
crespyl/rust-rosetta,ZoomRmc/rust-rosetta,pfalabella/rust-rosetta,sakeven/rust-rosetta,magum/rust-rosetta,Hoverbear/rust-rosetta,JIghtuse/rust-rosetta,ghotiphud/rust-rosetta,crr0004/rust-rosetta,magum/rust-rosetta
src/rename_a_file.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nstruct Philosopher {\n name: String\n}\n\nfn main() {\n\n}\n\n```\n\nApply this change: Add associated function `new()` to `Philosopher`" }, { "role": "assistant", "content": "struct Philosopher {\n name: String\n}\n\nimpl P...
rust
edit
3
1
mit
65db00e0484a890e7a318750747761db39a0f8aa
juliangrosshauser/dining_philosophers
src/main.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)]\npub struct Protocol(pub u8);\n\nimpl Protocol {\n #[inline]\n pub fn value(&self) -> u8 {\n self.0\n }\n}\n\npub mod protocols {\n use super::Protocol;\n\n pub const IC...
rust
edit
0
2
apache-2.0
e93f202f7d4825d8310c6f6480258d9c71368833
faern/rips
packets/src/ip.rs
rejected_duplicate
Near-duplicate of sample 119786
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse std::string::String;\nuse js_types::js_obj::JsObjStruct;\nuse js_types::js_str::JsStrStruct;\nuse std::cmp::Ordering;\nuse std::hash::{Hash, Hasher};\nuse uuid::Uuid;\n\npub struct JsT {\n pub uuid: Uuid,\n pub t: JsType,\n}\n\nimpl...
rust
edit
3
3
mit
9e3cb44a8aa1e3418263ceed74945692a40c5ab6
rustoscript/french-press
src/js_types/js_type.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse std::{libc, ptr};\nuse raw;\nuse aux;\n\n// implement the same function that luaL_newstate uses, so we can test lua_newstate directly\n// FIXME (#10025): We can't define this as `unsafe extern \"C\"`\nextern \"C\" fn test_alloc(_ud: *mut ...
rust
edit
null
null
mit
73b090315a31519693f5fdbdfacb6496f24e2eba
beatgammit/rust-lua,kballard/rust-lua,trevex/luajit-rs,green-panther/rust-lua,beatgammit/rust-lua,tempbottle/rust-lua,kballard/rust-lua,tempbottle/rust-lua,green-panther/rust-lua,trevex/luajit-rs
tests.rs
rejected_syntax
Syntax error detected by tree-sitter
false
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse std::rand::random;\n\nmod guess {\n pub fn guessed_correctly(guess: uint, machine: uint) -> bool {\n guess == machine\n }\n}\n\nfn main() {\n let random_value = random::<uint>() % 10u;\n let mut guess = 0u;\n guess +...
rust
edit
null
null
bsd-2-clause
103bd257d6132c88db1e8b70796e13cbbecbe5a5
ambidextrousTx/ToyRustPrograms
guess.rs
rejected_syntax
Syntax error detected by tree-sitter
false
[ { "role": "user", "content": "Here is the current file:\n```rust\n// build-pass\n\n#![allow(incomplete_features)]\n#![feature(inline_const, half_open_range_patterns, exclusive_range_pattern)]\nfn main() {\n const N: u32 = 10;\n let x: u32 = 3;\n\n match x {\n const { N - 1 } ..= 10 => {},\n ...
rust
edit
null
null
apache-2.0
5bef429dacb216b45a6bfa4c020d108c1d8e726e
graydon/rust,aidancully/rust,graydon/rust,graydon/rust,aidancully/rust,graydon/rust,aidancully/rust,graydon/rust,aidancully/rust,aidancully/rust,graydon/rust,aidancully/rust
src/test/ui/inline-const/const-match-pat-range.rs
rejected_syntax
Syntax error detected by tree-sitter
false
[ { "role": "user", "content": "Here is the current file:\n```rust\n#![allow(missing_docs, unused_variables)]\n\nmod pascal_str;\nmod pascal_string;\n\npub use self::pascal_str::{Chars, Bytes, Lines, PascalStr};\npub use self::pascal_string::PascalString;\n\n#[cfg(test)]\nmod tests {\n}\n\n```\n\nApply this c...
rust
edit
1
1
mit
12fb91bafee024b3775c11eaa39cf348c4d7db11
burtonageo/pascal_string
src/utf8/mod.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nmod system_time_slot_clock;\nmod testing_slot_clock;\n\npub use crate::system_time_slot_clock::{Error as SystemTimeSlotClockError, SystemTimeSlotClock};\npub use crate::testing_slot_clock::{Error as TestingSlotClockError, TestingSlotClock};\n...
rust
edit
1
0
apache-2.0
3106d28bfa9ec50a769884f5d9529893ed98d1dc
sigp/lighthouse,sigp/lighthouse,sigp/lighthouse,sigp/lighthouse
beacon_chain/utils/slot_clock/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\nextern crate cmake;\nuse std::en...
rust
edit
0
3
bsd-3-clause
0b76470e8e58131e750373fc4b37088d55c5a63a
ecoal95/angle,ecoal95/angle,ecoal95/angle,ecoal95/angle,ecoal95/angle
build.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nextern crate libc;\n\nuse std::ops::Index;\nuse std::{ptr, mem};\n\nuse chip8::MEMORY_SIZE;\nuse chip8::codeblock::CodeBlock;\n\npub struct CodeCache {\n\tcode_blocks: [*mut CodeBlock; MEMORY_SIZE]\n}\n\nimpl CodeCache {\n\tpub fn new() -> Co...
rust
edit
0
3
mit
7b007d196f205293e0e3b1b8c99ecbfa850dcdb9
WisterToub/chip8dynarec
src/chip8/codecache.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nextern crate docopt;\nextern crate flac;\nextern crate rustc_serialize;\n\n#[macro_use]\nmod commands;\n\nuse std::env;\n\nuse commands::{streaminfo, comments, seektable, picture};\nuse docopt::Docopt;\n\nconst USAGE: &'static str = \"\nUsage...
rust
edit
2
2
bsd-3-clause
1c8e33fbb051c4ab70e421164f03f557788f5741
sourrust/flac
examples/metadata.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse actions::Action;\nuse notify::Event;\n\npub struct PrintAction;\n\nimpl PrintAction {\n pub fn new() -> PrintAction {\n PrintAction\n }\n}\n\nimpl Action for PrintAction {\n fn handle_change(&self, event: &Event) {\n ...
rust
edit
0
3
mit
c762858305850285b05b95e49fe7e0681d80282f
aag/eagle-eye
src/actions/print.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nfn main() {\n #[cfg(target_os = \"macos\")]\n #[cfg(feature = \"private_api\")]\n println!(\"cargo:rustc-link-search=framework={}\", \"/System/Library/PrivateFrameworks\");\n}\n\n```\n\nApply this change: Use xcode-select to find Pri...
rust
edit
0
1
apache-2.0
95254f5a64877b79239edc2f695bd36fa78d2664
mrmekon/rubrail-rs
build.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n#![crate_name = \"mnemosyne\"]\n#![crate_type = \"lib\"]\n#![feature(rustc_private)]\n#![feature(cstr_memory)]\n\nextern crate rustc;\nextern crate combine;\nextern crate seax_util as seax;\n\npub mod position;\npub mod ast;\npub mod compile;...
rust
edit
null
null
mit
0656062cfb4ef894812c828da927ec3297a9c6b7
hawkw/mnemosyne
core/src/lib.rs
rejected_syntax
Syntax error detected by tree-sitter
false
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse std::env;\nuse std::error::Error;\nuse std::fs::File;\nuse std::io::Write;\nuse std::path::PathBuf;\nuse std::process::Command;\n\nstruct Ignore;\n\nimpl<E> From<E> for Ignore where E: Error\n{\n fn from(_: E) -> Ignore { Ignore }\n}\n...
rust
edit
3
3
mit
d55a89c50cecb35314449bcf208db25a6478fd08
yasuyuky/ghteam-auth,yasuyuky/ghteam-auth
build.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n#[cxx::bridge]\nmod ffi {\n extern \"Rust\" {\n type Mut<'a>;\n }\n\n unsafe extern \"C++\" {\n type Thing;\n\n fn f(t: &Thing) -> Pin<&mut CxxString>;\n unsafe fn g(t: &Thing) -> Pin<&mut CxxString>;\n ...
rust
edit
0
1
apache-2.0
6ca15ddb0c9d0d001fd32cfeea8925f55b87fd69
dtolnay/cxx,dtolnay/cxx,dtolnay/cxx,dtolnay/cxx
tests/ui/mut_return.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nextern crate combine;\nextern crate combine_language;\nextern crate rsstreem;\n\npub mod parse;\n\n#[cfg(test)]\nmod tests {\n use super::*;\n use rsstreem::ast::*;\n\n #[test]\n fn add_expr_test() {\n let expr_string = \"1...
rust
edit
0
1
mit
d4df52e9e85f84f1dbacdbdce6f1c1e016f741c2
Everysick/rsstreem
parser/src/lib.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n\n\n\n// xfail-boot\nfn main() {\n obj foo(mutable i: int) {\n fn inc_by(incr: int) -> int { i += incr; ret i; }\n fn inc_by_5() -> int { ret self.inc_by(5); }\n\n // A test case showing that issue #324 is resolved. (...
rust
edit
null
null
apache-2.0
228422303fbaf41b7bae23e52c0b80d0d4ddf3be
hauleth/rust,andars/rust,mitsuhiko/rust,ktossell/rust,sae-bom/rust,zubron/rust,bombless/rust,pelmers/rust,emk/rust,erickt/rust,LeoTestard/rust,michaelballantyne/rust-gpu,mvdnes/rust,zachwick/rust,victorvde/rust,robertg/rust,aidancully/rust,barosl/rust,mitsuhiko/rust,0x73/rust,mihneadb/rust,XMPPwocky/rust,krzysz00/rust,...
src/test/run-pass/obj-self-4.rs
rejected_syntax
Syntax error detected by tree-sitter
false