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//! Provides the heap allocator for the kernel.\n\nmod linked_list_allocator;\n\nuse self::linked_list_allocator::LinkedListAllocator;\nuse alloc::allocator::{GlobalAlloc, Layout, Opaque};\nuse arch::{self, Architecture};\nuse memory::{Addres...
rust
edit
0
2
mit
3f166960ac772d499c5cd6e4d8f7ce51c5b75f79
aeleos/BoringOS
kernel/src/memory/allocator/mod.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n// run-pass\n\n#![feature(thread_local)]\n\n#[thread_local]\nstatic S: u32 = 222;\n\nfn main() {\n let local = &S as *const u32 as usize;\n let foreign = std::thread::spawn(|| &S as *const u32 as usize).join().unwrap();\n assert_ne!(...
rust
edit
0
2
apache-2.0
2af53e9a15aed1e9798867c9233a722530d03177
graydon/rust,graydon/rust,graydon/rust,aidancully/rust,graydon/rust,aidancully/rust,graydon/rust,aidancully/rust,aidancully/rust,aidancully/rust,aidancully/rust,graydon/rust
src/test/ui/tls.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse frame::ChannelAssignment;\n\nfn decode_left_side(buffer: &mut [i32]) {\n let block_size = buffer.len() / 2;\n\n for i in 0..block_size {\n let left = buffer[i];\n let side = buffer[i + block_size];\n\n // right channel\n buf...
rust
edit
0
2
bsd-3-clause
0c3050489f3f21849d5c05d0a189a7677436e189
sourrust/flac
src/frame/decoder.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n/* AES-128 CBC mode\n *\n * Dmitry Vasiliev <<EMAIL>>\n */\n\nextern crate serialize;\n\nextern crate aes_lib;\n\nuse std::path::Path;\nuse std::io::fs::File;\nuse std::iter::repeat;\n\nuse serialize::base64::FromBase64;\n\nuse aes_lib::{decr...
rust
edit
0
2
mit
9cb99ff0f63f19a1a193b1eef545a37cd531d9c1
hdima/matasano-crypto-challenges
2/10/src/aes_cbc.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n\n//! Storing sounds, textures, animations etc.\n\n// Extern crates.\nuse std::os::self_exe_path;\n\n/// A place to store sounds, textures, animations etc.\n///\n/// The idea is to have one object which the app can use\n/// to load assets for...
rust
edit
0
3
mit
43b133f292b9500df1962fb649ea24fdef4e02ad
KevinFrans3/piston,axelmagn/piston,getynge/piston,PistonDevelopers/piston,PistonDevelopers/piston,caldwell/piston,oldmanmike/piston,mitchmindtree/piston,bvssvni/piston,bvssvni/piston,placrosse/piston,Potpourri/piston,tempbottle/piston
src/asset_store.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nmod vm;\nmod command;\nmod parse;\nmod program;\n\nuse vm::VM;\nuse program::Program;\nuse std::io::Write;\n\nfn main() {\n let mut vm = VM::new();\n let mut program = Program::new();\n loop {\n print!(\"{}\", \"bf> \");\n ...
rust
edit
1
3
mit
4054bf238f66623be2a861502ff79b612d60396b
nafarlee/thoughtfuck
src/main.rs
rejected_duplicate
Near-duplicate of sample 119944
true
[ { "role": "user", "content": "Write rust code for the following: Print help message with -h or --help flag" }, { "role": "assistant", "content": "use 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 f...
rust
new_file
0
3
mit
85d526886d93194f05c75dfb673dece681551e9b
naoty/table
src/main.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n#![feature(test)]\n\nextern crate identicon;\nextern crate md_5 as md5;\nextern crate test;\n\nuse md5::{Digest, Md5};\nuse test::Bencher;\n\nuse identicon::Identicon;\n\n#[bench]\nfn generate(x: &mut Bencher) {\n let input = \"42\".as_byt...
rust
edit
0
2
mit
b7cdee8d0f461eb4013fb7cfe7a98f7cc66a63fe
dgraham/identicon
benches/generate.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse curl::http::handle;\nuse super::server;\n\n#[test]\npub fn test_simple_head() {\n let srv = server!(\n recv!(b\"HEAD / HTTP/1.1\\r\\n\\\n Host: localhost:{PORT}\\r\\n\\\n Accept: */*\\r\\n\\\n ...
rust
edit
0
1
mit
d282f75a86ab9a534cb9ce04f165fabfc83358d0
alexcrichton/curl-rust,alexcrichton/curl-rust,carllerche/curl-rust,alexcrichton/curl-rust
test/test_head.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse std::collections::HashMap;\n\npub struct School {\n grades: HashMap<u32, Vec<String>>\n}\n\nimpl School {\n pub fn new() -> School {\n School { grades: HashMap::new() }\n }\n\n pub fn add(&mut self, grade: u32, student:...
rust
edit
1
1
mit
d342fdbb3af88cbf711592cc5182706d7628417e
exercism/xrust,sacherjj/rust,exercism/xrust,sacherjj/rust,petertseng/exercism-rust,petertseng/exercism-rust,sacherjj/rust,petertseng/exercism-rust
exercises/grade-school/example.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n// run-pass\n\nfn main () {\n let n = (1, (2, 3)).1.1;\n assert_eq!(n, 3);\n\n let n = (1, (2, (3, 4))).1.1.1;\n assert_eq!(n, 4);\n}\n\n```\n\nApply this change: Test a range, which is not nested indexing" }, { "role": "a...
rust
edit
0
1
apache-2.0
776deb6b9f326f5ba5984e4d55cb5010a17ce559
graydon/rust,aidancully/rust,graydon/rust,graydon/rust,graydon/rust,graydon/rust,aidancully/rust,aidancully/rust,aidancully/rust,aidancully/rust,graydon/rust,aidancully/rust
src/test/ui/tuple/nested-index.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse std::fmt;\nuse rustc_serialize::json::{ToJson, Json};\n\n#[derive(Debug, Clone, RustcDecodable, RustcEncodable)]\npub enum State {\n Alive,\n Dead,\n}\n\nimpl PartialEq for State {\n fn eq(&self, p: &State) -> bool {\n mat...
rust
edit
0
4
mit
5329788bf80a7120ccdbb28f87bfe979ca305915
kumabook/pink-spider,kumabook/pink-spider,kumabook/pink-spider,kumabook/pink-spider
src/model/state.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nmod immediate;\n#[cfg(feature = \"std\")]\nmod multithreaded;\n\n#[cfg(all(feature = \"std\", not(any(target_arch = \"asmjs\", target_arch = \"wasm32\"))))]\npub use self::multithreaded::MultiThreadedWorker as PlatformWorker;\n#[cfg(any(not(f...
rust
edit
1
0
apache-2.0
a7b1a5997f386171604b81e689b293c03d64324a
image-rs/jpeg-decoder
src/worker/mod.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nextern crate syn;\n\nuse std::env;\nuse std::fs::File;\nuse std::io::{Write, BufWriter};\nuse syn::DeriveInput;\n\npub fn generate_elm(_: &DeriveInput) {\n let mut path = env::current_dir().unwrap();\n path.push(\"generated/test.txt\");...
rust
edit
0
1
mit
44f1f889f89e787730b787fdf418fbc47d140092
mijnadres/serde_elm
src/derive/mod.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\npub trait RequestTimeoutable {\n type Output;\n\n fn append_request_timeout(self, timeout: u64) -> Self::Output;\n}\n\nmacro_rules! request_timeoutable {\n ($($t:ty), +) => (\n $(impl RequestTimeoutable for $t {\n t...
rust
edit
1
2
mit
a55f4863b08f9f66eec614dcad5ef5bbcb4c545c
cosmo0920/ruroonga_command
src/request_timeoutable/mod.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
2
1
apache-2.0
7bfe3ae00a36e8162e2f8f5b47eb7127562e1d17
graydon/rust,GBGamer/rust,graydon/rust,GBGamer/rust,aidancully/rust,aidancully/rust,graydon/rust,graydon/rust,aidancully/rust,graydon/rust,GBGamer/rust,graydon/rust,GBGamer/rust,aidancully/rust,aidancully/rust,GBGamer/rust,GBGamer/rust,aidancully/rust,GBGamer/rust,GBGamer/rust
src/test/run-pass/issue-23304-2.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n#[crate_id = \"rlua#0.3.0\"];\n#[crate_type = \"lib\"];\n#[license = \"MIT\"];\n\n#[feature(globs)];\n#[feature(macro_rules)];\n\npub use lua::Lua;\n\npub mod ffi;\n\npub mod lua;\npub mod state;\n\npub mod traits;\npub mod types;\npub mod st...
rust
edit
0
0
mit
c2a004469c319be6f71fac6b1ab2da2e41d2da2e
KokaKiwi/lua-rs,KokaKiwi/lua-rs,KokaKiwi/lua-rs
src/librlua/lib.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nextern crate mtl;\nextern crate libc;\n\nuse mtl::sys::{MTLCopyAllDevices,MTLOrigin, MTLOriginMake, MTLClearColorMake};\n\n#[test]\nfn it_works() {\n let _origin = MTLOriginMake(50, 21, 11);\n let _color = MTLClearColorMake(50.0, 21.0, ...
rust
edit
0
1
apache-2.0
7f3397f623c4c748e50c6980ffe8a9ac6084aaf9
burtonageo/metl
tests/lib.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse ncurses::*;\n\nuse irc::client::prelude::*;\n\npub struct DisplayArea {\n window: WINDOW,\n}\n\nimpl DisplayArea {\n pub fn new() -> DisplayArea {\n let mut w = 0;\n let mut h = 0;\n getmaxyx(stdscr, &mut h, &mu...
rust
edit
1
3
mit
f7f6e73438177020a1be04584a2d66381de0bd06
FreeFull/ircclient
src/tui/displayarea.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse {osc_types, errors};\n\n/// Common MTP size for ethernet\npub const MTP: usize = 1536;\n\npub fn destruct(message: &mut [u8], size: usize) -> Result<osc_types::OscPacket, errors::OscError> {\n Ok(osc_types::OscPacket::OscMessage)\n}\n`...
rust
edit
2
3
apache-2.0
cd26e032a51d957e4fc6a951c6c71cf19dfff87e
klingtnet/rosc
src/osc_server.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse std::io::{Write,Result};\nuse std::str;\n\n\npub struct FauxStdout {\n buffer: String\n}\n\n\nimpl Write for FauxStdout {\n fn write(&mut self, buf: &[u8]) -> Result<usize> {\n self.buffer += str::from_utf8(buf).expect(\"u8 s...
rust
edit
0
2
mit
76d80d0014f5869b084b414b38f4567147ff14b3
nafarlee/thoughtfuck
tests/common/mod.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n// DragonFlyBSD's __error function is declared with \"static inline\", so it must\n// be implemented in the libc crate, as a pointer to a static thread_local.\nf! {\n #[deprecated(since = \"0.2.77\", \"Use `__errno_location()` instead\")]\...
rust
edit
0
1
apache-2.0
d371bdcc1ec3e8446395f376468ee296070f75a4
rust-lang/libc,rust-lang/libc,rust-lang/libc
src/unix/bsd/freebsdlike/dragonfly/errno.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse errors::*;\n\nuse rsa::Rsa;\n\nuse bignum::BigNumTrait;\nuse bignum::OpensslBigNum as BigNum;\n\npub fn run() -> Result<(), Error> {\n let bits = 512;\n let rsa = Rsa::<BigNum>::generate(bits);\n\n let m = BigNumTrait::gen_random...
rust
edit
0
3
mit
fe90373c67b7a826a2200379c26cb320d6cad366
aopicier/cryptopals-rust
challenges/src/set6/challenge41.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
bf15d040c0aa7c6b99221e1b13ae12b5b811a795
aidancully/rust,rohitjoshi/rust,pshc/rust,KokaKiwi/rust,pelmers/rust,andars/rust,nwin/rust,omasanori/rust,rohitjoshi/rust,krzysz00/rust,dwillmer/rust,reem/rust,dwillmer/rust,KokaKiwi/rust,vhbit/rust,l0kod/rust,gifnksm/rust,aneeshusa/rust,rohitjoshi/rust,jashank/rust,jashank/rust,cllns/rust,KokaKiwi/rust,cllns/rust,jash...
src/test/compile-fail/gated-associated_consts.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n//#![warn(missing_doc)]\n#![allow(dead_code)]\n#![allow(unused_variables)]\n#![forbid(non_camel_case_types)]\n#![forbid(unsafe_code)]\n\n//! This crate currently provides an almost XML 1.0/1.1-compliant pull parser.\n\n#[cfg(test)]\n#[macro_u...
rust
edit
1
0
mit
8cbac840215837124c8094080d1eb198012a724f
netvl/xml-rs
src/lib.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\npub mod xattr;\npub mod ignore;\n\n#[cfg(feature=\"git\")] pub mod git;\n\n#[cfg(not(feature=\"git\"))]\npub mod git {\n use std::iter::FromIterator;\n use std::path::{Path, PathBuf};\n\n use fs::fields as f;\n\n\n pub struct GitC...
rust
edit
1
1
mit
8b60285320ae211d016d14c29d492d5648df32d0
ogham/exa,ogham/exa
src/fs/feature/mod.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements. See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership. The ASF licenses th...
rust
edit
0
2
apache-2.0
b1d05ae8e1261ee681439ca204366938e7dbcb37
terminalcloud/thrift,terminalcloud/thrift,terminalcloud/thrift,terminalcloud/thrift,terminalcloud/thrift,terminalcloud/thrift,terminalcloud/thrift,terminalcloud/thrift,terminalcloud/thrift,terminalcloud/thrift,terminalcloud/thrift,terminalcloud/thrift,terminalcloud/thrift
lib/rs/src/transport/server/mod.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nextern crate txtpic;\nuse txtpic::calculate_string_brightness::calculate_string_brightness;\n\nfn main() {\n println!(\"{}\", calculate_string_brightness(\"@\"));\n println!(\"{}\", calculate_string_brightness(\"%\"));\n println!(\"{...
rust
edit
0
1
mit
0ff7316096a397748fcea9e5536cb28232fd7f4a
jdormit/txtpic
src/main.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse std::time::Instant;\n\n// When this struct is dropped, it logs a message stating its name and how long, in seconds,\n// execution time was. Can be used to time functions or other critical areas.\npub struct ExecutionTimer<'a> {\n\tstart_t...
rust
edit
3
1
mit
5a5cddd30e9da2a1f3037f0464e727a910ac9fec
PhilipDaniels/qork,PhilipDaniels/qork,PhilipDaniels/qork
src/rust/qork/src/execution_timer.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse std::env;\nuse std::path::PathBuf;\nuse std::process::Command;\n\nfn main() -> std::io::Result<()> {\n let dist = env::var(\"CODEQL_DIST\").expect(\"CODEQL_DIST not set\");\n let db = env::var(\"CODEQL_EXTRACTOR_RUBY_WIP_DATABASE\")...
rust
edit
0
7
mit
1e38c705b8e99fd920ea4de60cfa39b2a90cec12
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
autobuilder/src/main.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n#![crate_name = \"irc\"]\n#![crate_type = \"dylib\"]\n#![feature(convert, hasher_write, slice_patterns)]\n\n#![allow(stable_features)]\n// hasher_write was stabilised in rust 1.4\n\n#![deny(unused_must_use, warnings, unused_variables, unused_...
rust
edit
1
0
apache-2.0
01b26332ef434288c5eec694416f7fb93267e1f9
infinityb/rust-irc
src/lib.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\npub const USAGE: &'static str = \"\nUsage: jswag build [options] [<file>...]\n jswag run [options] [<file>...]\n jswag [options] <file>...\n jswag (--help | --version)\n\nCommands:\n build Compiles all files and run...
rust
edit
1
0
mit
4de4192228fc004440d6ccbf88f7a6bfc262c582
LukasKalbertodt/jswag,LukasKalbertodt/jswag
src/args.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n/* automatically generated by rust-bindgen */\n\nextern \"C\" {\n #[link_name = \"\\u{1}a\"]\n pub static mut a: *mut ::std::os::raw::c_char;\n}\nextern \"C\" {\n #[link_name = \"\\u{1}b\"]\n pub static mut b: *const ::std::os::ra...
rust
edit
0
0
bsd-3-clause
1fc8172889e981d45e819c9f394fe4b6b41dbc38
emilio/rust-bindgen,rust-lang/rust-bindgen,rust-lang/rust-bindgen,emilio/rust-bindgen,emilio/rust-bindgen,emilio/rust-bindgen,emilio/rust-bindgen,rust-lang/rust-bindgen,rust-lang/rust-bindgen
tests/expectations/tests/issue-511.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nextern mod extra;\nuse std::task::spawn;\nuse std::comm::{stream,Chan,Port};\nuse std::cell::Cell;\n\nfn generate(ch: &Chan<int>) {\n let mut i = 2;\n loop {\n ch.send(i);\n i = i + 1;\n }\n}\n\nfn filter(in_ch: &Port<i...
rust
edit
null
null
mit
f1a68c9432950243a5e7f94883181fa0d3841a5f
am0d/rust-projects,am0d/rust-projects
first/prime-sieve.rs
rejected_syntax
Syntax error detected by tree-sitter
false
[ { "role": "user", "content": "Here is the current file:\n```rust\n/*\n TODO:\n 1. Copy downloaded files to other places.\n 2. Verify the downloaded package.\n 3. Make it support repos someday.\n*/\ncrate hyper;\nuse self::hyper::client;\n\nmacro_rules! custom_try {\n ($x:expr) => (match $x {\...
rust
edit
null
null
bsd-3-clause
d99b1133c05fdb6fd146cff8f2f49b44e3d32061
hch12907/wiz
src/install/download.rs
rejected_syntax
Syntax error detected by tree-sitter
false
[ { "role": "user", "content": "Here is the current file:\n```rust\n// The target triplets have the form of 'arch-vendor-system'.\n//\n// When building for Linux (e.g. the 'system' part is\n// 'linux-something'), replace the vendor with 'unknown'\n// so that mapping to rust standard targets happens correctly....
rust
edit
0
2
apache-2.0
2131647655d0a0726f49601c98903e4d151206f4
crossbeam-rs/crossbeam,crossbeam-rs/crossbeam,crossbeam-rs/crossbeam,crossbeam-rs/crossbeam
build-common.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse crate::spec::{LinkArgs, LinkerFlavor, LldFlavor, TargetOptions};\n\npub fn opts() -> TargetOptions {\n let mut pre_link_args = LinkArgs::new();\n pre_link_args.insert(\n LinkerFlavor::Lld(LldFlavor::Ld),\n vec![\n ...
rust
edit
0
1
apache-2.0
c85768ed71eb09689e2065b122310dad2e1c42f6
graydon/rust,aidancully/rust,aidancully/rust,aidancully/rust,aidancully/rust,graydon/rust,aidancully/rust,aidancully/rust,graydon/rust,graydon/rust,graydon/rust,graydon/rust
src/librustc_target/spec/fuchsia_base.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nmod _common;\n\nuse _common::validate;\nuse std::u64;\n\nfn main() {\n for exp in 19..64 {\n let power: u64 = 1 << exp;\n validate(&power.to_string());\n for offset in 1..123 {\n validate(&(power + offset).t...
rust
edit
0
4
apache-2.0
d0fc5d9e6b932139755e2141bfdfa7a1380925ba
aidancully/rust,aidancully/rust,aidancully/rust,graydon/rust,aidancully/rust,graydon/rust,graydon/rust,graydon/rust,aidancully/rust,graydon/rust,aidancully/rust,graydon/rust
src/etc/test-float-parse/u64-pow2.rs
accepted
null
true
[ { "role": "user", "content": "Write rust code for the following: Add structs to represent RTCP packets (SR, RR, SDES, BYE)" }, { "role": "assistant", "content": "// ================================================================================================\n\ntype SSRC = u32;\ntype ...
rust
new_file
0
1
bsd-2-clause
6efacc72a63af7c8dd35c7e5dd77fe1a823c075d
csperkins/crtp
src/main.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n//! A simple example which prints out information about available Metal devices\n\nextern crate mtl;\n\n#[cfg(not(any(target_os = \"macos\", target_os = \"ios\")))]\nfn main() {\n println!(\"Metal is not supported on this platform\");\n}\n...
rust
edit
0
2
apache-2.0
a49ccac879e884db8984233b9e56fd952783ca61
burtonageo/metl
examples/mtlinfo.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n// compile-flags: -C no-prepopulate-passes\n#![crate_type = \"lib\"]\n#![feature(ffi_returns_twice)]\n\nextern {\n // CHECK-LABEL: @foo()\n // CHECK: attributes #1 = { {{.*}}returns_twice{{.*}} }\n #[no_mangle]\n #[ffi_returns_twi...
rust
edit
1
1
apache-2.0
76403e574231ae54dc7ccf227750af907ea13db3
aidancully/rust,aidancully/rust,graydon/rust,graydon/rust,aidancully/rust,graydon/rust,graydon/rust,aidancully/rust,aidancully/rust,graydon/rust,aidancully/rust,graydon/rust
src/test/codegen/ffi-returns-twice.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nmod common;\n\n#[cfg(target_os = \"macos\")]\nmod tests {\n const TEST_PLATFORM: &str = \"macos\";\n\n use super::common::check_browser;\n use webbrowser::Browser;\n\n #[actix_rt::test]\n async fn test_open_default() {\n ...
rust
edit
0
1
apache-2.0
8aaecbd725d25c08111185c474539a2c656f8f09
amodm/webbrowser-rs,amodm/webbrowser-rs,amodm/webbrowser-rs,amodm/webbrowser-rs,amodm/webbrowser-rs
tests/test_macos.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n#[rustversion::attr(not(nightly), ignore)]\n#[cfg_attr(skip_ui_tests, ignore)]\n#[test]\nfn ui() {\n let t = trybuild::TestCases::new();\n t.compile_fail(\"tests/ui/*.rs\");\n}\n\n```\n\nApply this change: Disable ui test on miri" }, ...
rust
edit
0
1
apache-2.0
2ec5f2b839c9012b15fd280ea0135d26a1af29db
dtolnay/cxx,dtolnay/cxx,dtolnay/cxx,dtolnay/cxx
tests/compiletest.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nextern crate reqwest;\nextern crate env_logger;\n\nuse std::env;\n\nfn main() {\n env_logger::init().unwrap();\n\n let url = match env::args().nth(1) {\n Some(url) => url,\n None => {\n println!(\"Usage: reqwest...
rust
edit
0
6
apache-2.0
bdad94a00c6c3f99a43c5b7094906d52e18f418e
mysangle/reqwest,mysangle/reqwest
examples/reqwest.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse super::*;\n\n/// Public information about a peer\n#[derive(Clone, Debug)]\npub struct Peer {\n peer_id: PeerId,\n ltvk: PublicKey,\n kepks: VecDeque<PublicKey>,\n history: RunHistory,\n}\n\nimpl Peer {\n pub fn new(peer_id:...
rust
edit
2
1
mit
6ffa5c1959e0f49a61eaf60c6b1522a5dcdf61e5
ElementsProject/dicemix,ElementsProject/dicemix,ElementsProject/dicemix,ElementsProject/dicemix,ElementsProject/dicemix
src/state/peer.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse rect::Rect;\r\nuse std::ops::{Add, Sub};\r\n\r\npub const ZERO: Point = Point { x: 0, y: 0 };\r\npub const UP: Point = Point { x: 0, y: -1 };\r\npub const DOWN: Point = Point { x: 0, y: 1 };\r\npub const LEFT: Point = Point { x: -1, y: 0 ...
rust
edit
1
0
mit
5ecacf200f4eaaad68e5fddd497596049c978f53
Vectorious/geom-rs,Vectorious/geom-rs
src/point.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n#![feature(old_path)]\n\nextern crate piston;\nextern crate graphics;\nextern crate sdl2_window;\nextern crate opengl_graphics;\n\nuse std::cell::RefCell;\nuse opengl_graphics::{\n GlGraphics,\n OpenGL,\n Texture,\n};\nuse sdl2_windo...
rust
edit
0
3
mit
a0b048a0d8df16b657f0195b2096fac5d7a13540
Abica/piston-examples,carols10cents/piston-examples,Potpourri/piston-examples,sinistersnare/piston-examples,placrosse/piston-examples,dannyflax/piston-examples
image/src/main.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n#![no_main]\n#[macro_use]\nextern crate libfuzzer_sys;\n\nlibfuzzer_sys::fuzz_target!(|data: &[u8]| {\n let _ = asn1::parse(data, |d| {\n d.read_element::<()>()?;\n d.read_element::<bool>()?;\n\n d.read_element::<i8>()...
rust
edit
0
0
bsd-3-clause
7efe276fcff4000b2554f837e96af3280d1bf987
alex/rust-asn1,alex/rust-asn1
fuzz/fuzz_targets/fuzz_asn1_parse.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
1
apache-2.0
e8137d7ceadfa25b06e35e358870bb2687b0443d
graydon/rust,graydon/rust,GBGamer/rust,GBGamer/rust,GBGamer/rust,graydon/rust,graydon/rust,graydon/rust,GBGamer/rust,aidancully/rust,aidancully/rust,aidancully/rust,GBGamer/rust,aidancully/rust,aidancully/rust,GBGamer/rust,GBGamer/rust,aidancully/rust,graydon/rust,GBGamer/rust
src/test/compile-fail/issue-22560.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse super::*;\nmod basic_test;\n#[ cfg( any( feature = \"derive_clone_dyn\" ) ) ]\nmod clone_dyn_test;\n\n```\n\nApply this change: Fix tests of module `derive_tools`, test with valid features" }, { "role": "assistant", "content":...
rust
edit
0
0
mit
43e68c7e409778c4a01539734938e6a9e13e90b7
Wandalen/wTools,Wandalen/wTools
rust/test/derive/inc.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n//! errors provides error generics for the gpx parser.\n\n// This gives us our error boilerplate macros.\nerror_chain!{\n errors {\n /// InvalidChildElement signifies when an element has a child that isn't\n /// valid per the...
rust
edit
0
0
mit
2fd8e8870a10e31bbf71708c50a90ec19abd22bd
georust/rust-gpx
src/errors.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\npub trait FromLossy<T>: Sized {\n fn from_lossy(_: T) ...
rust
edit
0
3
mit
42eeb54af3652867e6c0d584a3fa16b0e459ce75
google/rrg
proto/src/convert.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse backends::Backend;\nuse message::WireMessage;\nuse errors::Result;\n\npub struct NullBackend;\n\nimpl NullBackend {\n fn new() -> NullBackend {\n NullBackend {}\n }\n}\n\nimpl Backend for NullBackend {\n fn panic_on_error(...
rust
edit
0
1
mit
bca575ce26e02910b25edd2d196b753c49666809
bzikarsky/gelf-rust
src/backends/null.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n//! Provides types and functions related to working with PostgreSQL\n//!\n//! Much of this module is re-exported from database agnostic locations.\n//! However, if you are writing code specifically to extend Diesel on\n//! PostgreSQL, you may...
rust
edit
1
0
apache-2.0
d039e2645203fcb0a0fa4e2a4d8da15374e70f30
sgrif/diesel,sgrif/diesel,diesel-rs/diesel,diesel-rs/diesel
diesel/src/pg/mod.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse std::sync::{ RwLock, RwLockReadGuard, Arc };\nuse std::sync::mpsc::{ Receiver };\n\nuse models::Grid;\nuse grid_displayers::GridDisplayer;\n\npub struct SimpleTerminal;\n\nimpl SimpleTerminal {\n pub fn new() -> SimpleTerminal {\n ...
rust
edit
0
4
mit
dc78224ec7f05b00781595a4177aa55fb54b8270
mateusmedeiros/rust_of_life
src/grid_displayers/simple_terminal.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse std::io;\n\nfn main() {\n println!(\"Guess the number!\");\n\n println!(\"Please input your guess.\");\n\n let mut guess = String::new();\n\n io::stdin().read_line(&mut guess)\n .ok()\n .e...
rust
edit
0
1
mit
bc91d32cb2a1456e70feee4e8f371fa0b08e8090
juliangrosshauser/guessing_game
src/main.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse std::fmt::{Display, Formatter, Result};\n\n#[derive(Clone, Copy, Debug, PartialEq)]\npub enum Orientation {\n Right = 0,\n UpRight = 1,\n Up = 2,\n UpLeft = 3,\n Left = 4,\n DownLeft = 5,\n Down = 6,\n DownRight = 7,\n Still = 8,...
rust
edit
0
2
apache-2.0
f175e21dad3722244a862269c5c3839a45ddbadf
Laastine/zombie-shooter,Laastine/zombie-shooter
src/character/orientation.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n// Copyright 2016 Francis Gagné\n//\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// ...
rust
edit
0
0
apache-2.0
e74e5b323fda25764f3d2ab56efd17e293ed4b9a
FraGag/feeds-to-pocket
src/main.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse std::fmt;\nuse irc::client::prelude::*;\nuse irc::error::Error as IrcError;\n\npub trait Plugin: Send + Sync + fmt::Debug {\n fn is_allowed(&self, server: &IrcServer, message: &Message) -> bool;\n fn execute(&mut self, server: &IrcS...
rust
edit
0
2
mit
735f59e3421d9cd9aa908318880467e93af2d788
Mavulp/frippy
src/plugin.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nextern crate rand;\nextern crate wasm_bindgen;\nextern crate wasm_bindgen_test;\n\nuse rand::rngs::StdRng;\nuse rand::Rng;\nuse rand::SeedableRng;\nuse wasm_bindgen::prelude::*;\nuse wasm_bindgen_test::*;\n\n#[wasm_bindgen]\npub fn generate_f...
rust
edit
0
1
apache-2.0
86f2185ed9116cfe08e08c2930bf035483e69f5c
rust-lang/rand
tests/wasm_bindgen/src/lib.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n#[macro_use]\nextern crate descriptor;\nextern crate expector;\n\nuse std::time::Duration;\nuse std::thread::sleep;\n\nuse descriptor::*;\nuse expector::*;\n\nfn main() {\n describe(\"example group 1\", source_location!(), |eg| {\n ...
rust
edit
0
7
mit
5987bb70fdc9721f5532d426930ace8ae716acff
samphippen/descriptor
examples/descriptor.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse std::io::Command;\nuse std::os;\n\n#[allow(unused_must_use)]\nfn main() {\n let mut build = os::getcwd().unwrap();\n build.push_many(&[\"ext\", \"libqmlrswrapper\", \"build\"]);\n\n /* Ignore error, the return value is not reliab...
rust
edit
0
3
apache-2.0
464d9ec401322972004e95dc6d90c4c504bbcd3b
Jxspy/qmlrs,flanfly/qmlrs,Jxspy/qmlrs,cyndis/qmlrs,florianjacob/qmlrs,flanfly/qmlrs,cyndis/qmlrs,florianjacob/qmlrs
build.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse std::thread;\nuse std::sync::Mutex;\n\nstruct Philosopher {\n name: String,\n left: usize,\n right: usize,\n}\n\nimpl Philosopher {\n fn new(name: &str, left: usize, right: usize) -> Philosopher {\n Philosopher {\n ...
rust
edit
7
3
mit
13fd89bb1936af38504e374a63f3a5e16bd59944
juliangrosshauser/dining_philosophers
src/main.rs
rejected_lint
Too many lint violations: 7
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nextern crate test;\nextern crate rand;\nextern crate \"nalgebra\" as na;\n\nuse rand::{IsaacRng, Rng};\nuse test::Bencher;\nuse na::{UnitQuat, Rot2, Rot3, Vec1, Vec3};\n\n#[path=\"common/macros.rs\"]\nmod macros;\n\nbench_construction!(_bench...
rust
edit
0
0
bsd-3-clause
c034708e061101f6f53941466320d18d001becf2
mbStavola/nalgebra,tempbottle/nalgebra,tomaka/nalgebra,jaredly/nalgebra,sebcrozet/nalgebra,tikue/nalgebra,sebcrozet/nalgebra,ProtectedMode/nalgebra
benches/construction.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nextern crate pkg_config;\nextern crate gcc;\n\nfn main() {\n if !pkg_config::find_library(\"liblmdb\").is_ok() {\n gcc::compile_library(\"liblmdb.a\",\n &[\"mdb/libraries/liblmdb/mdb.c\",\n ...
rust
edit
0
3
mit
e2abe9f5b06771bc3fe80112084eb1c3d1c70a32
vhbit/lmdb-rs,vhbit/lmdb-rs
liblmdb-sys/build.rs
rejected_duplicate
Near-duplicate of sample 119751
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n#![feature(slicing_syntax)]\n\nmod board;\n\n#[cfg(not(test))]\nfn main() {\n let mut brd = board::Board::new(65, 248).random();\n let mut timer = std::io::Timer::new().unwrap();\n let ref mut worker_pool = board::WorkerPool::new_with_defa...
rust
edit
1
1
mit
869d0c85bbb6eda3b92c78b6508cc672cbcd95fe
crazymykl/rust-life
src/main.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n/// This file contains commands to generally control and administer the bot.\nextern crate irc;\n\nuse irc::Client;\nuse irc::interface::CommandEvent;\n\nfn say(event: &mut CommandEvent) {\n if event.args[0].starts_with(\"#\") {\n i...
rust
edit
0
3
mit
d0c8b1ef6ba86df2eb54b483128b8e66deb91c34
daboross/zaldinar,daboross/zaldinar
src/plugins/control.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n#![feature(test)]\n\nextern crate test;\nuse test::Bencher;\nextern crate lonlat_bng;\nuse lonlat_bng::convert_to_bng_threaded_vec;\n\nextern crate rand;\nuse rand::distributions::{IndependentSample, Range};\n\n#[bench]\nfn bench_threads(b: &...
rust
edit
0
2
mit
237483267fce790df1deb2b4e368edc1fc65321e
urschrei/rust_bng,urschrei/lonlat_bng,urschrei/lonlat_bng,urschrei/rust_bng,urschrei/lonlat_bng
benches/benchmarks.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n//! Human-readable aliases for room IDs.\n\nuse diesel::{LoadDsl, insert};\nuse diesel::pg::PgConnection;\nuse diesel::pg::data_types::PgTimestamp;\n\nuse error::APIError;\nuse schema::room_aliases;\n\n/// A new room alias, not yet saved.\n#[...
rust
edit
0
1
mit
1ba62c94535c8ce6002ec0c12c15017e3bd2bdb1
yblein/ruma,yblein/ruma
src/room_alias.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nextern crate cairo_sys;\nextern crate cairo;\nextern crate chrono;\nextern crate futures;\nextern crate mio;\nextern crate pango;\nextern crate pangocairo;\nextern crate tokio_core;\nextern crate tokio_timer;\nextern crate xcb_util;\nextern c...
rust
edit
4
1
mit
e328227aecb7a2105a8a0d78706349126849ad64
mjkillough/hue
src/main.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n#![deny(missing_docs)]\n//! An encoder and decoder for FITS images.\n//!\n//! The *Flexible Image Transport System* ([FITS][fits]) is\n//! > an open standard defining a digital file format useful for storage,\n//! > transmission and processin...
rust
edit
0
1
mit
dbf2292fee15aa5ff7268a56eb450d3c9cec8396
fifth-postulate/fits-rs
src/lib.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n#[macro_use(owned_tree, shared_tree)]\nextern crate entmut;\n\n// This will define macros for generalized tests of Nav and Editor impls.\n#[cfg(test)]\n#[macro_use]\nmod view_tests;\n\n#[cfg(test)]\n#[macro_use]\nmod owned {\n view_tests!(...
rust
edit
0
0
apache-2.0
5542ac07d8f08934a7cb06e586f9a20514d91751
dstu/entmut
tests/lib.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n#[macro_use]\nextern crate nom;\n\npub mod metadata;\nmod utility;\n\nuse metadata::metadata;\n\npub struct Stream<'a> {\n pub metadata: Vec<metadata::Block<'a>>,\n //frames: Vec<u32>\n}\n\nnamed!(stream <&[u8], Stream>,\n chain!(\n blo...
rust
edit
1
0
bsd-3-clause
03bdcbd44b2d029e5956e90bc2d3570372d4edf4
sourrust/flac
src/lib.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\npub use std::clone::Clone;\npub use std::cmp::{Eq, PartialEq};\npub use std::convert::From;\npub use std::default::Default;\npub use std::fmt::{self, Debug, Formatter};\npub use std::hash::{Hash, Hasher};\npub use std::marker::Copy;\npub use ...
rust
edit
0
0
apache-2.0
dd3d6fa5fa8107167e45484fcc3061cd47eb5858
dtolnay/syn
src/export.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse std::ascii::AsciiExt;\n\nstruct Rotor<'a> {\n rotor: &'a [u8]\n}\n\nimpl<'a> Rotor<'a> {\n pub fn new(rotor: &'a str) -> Rotor<'a> {\n Rotor {\n rotor: rotor.as_bytes(),\n }\n }\n\n fn substitute(&self...
rust
edit
2
3
mit
f201fac99b4ae0e6485121e166c926988c8328b9
iKevinY/ultra
src/lib.rs
rejected_duplicate
Near-duplicate of sample 119855
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n#[macro_use]\nextern crate askama;\n\nuse askama::Template;\n\n#[derive(Template)]\n#[template(path = \"let.html\")]\nstruct LetTemplate<'a> {\n s: &'a str,\n}\n\n#[test]\nfn test_let() {\n let t = LetTemplate { s: \"foo\" };\n asser...
rust
edit
0
1
apache-2.0
4f4b5a3a65eed09fbb9578ce9df72076e0b05f66
djc/askama,djc/askama,djc/askama
testing/tests/vars.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse glam::f32::Vec2;\nuse serde::{Deserialize, Serialize};\n\nuse crate::components::*;\n\n#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]\npub enum PlayerUpdate {\n Move(PlayerMoveInputEvent),\n Shoot(PlayerShootInputEvent),...
rust
edit
0
0
mit
c9ad24752042bc3138fa14c727d4edd4aa2712eb
svenstaro/zombenum
shared/src/messages/client.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n//! Provides drilldown related procedures.\n//! This module will be used with `SelectCommand` type by `+` operation\n//! to concatinate `select` and `drilldown` queries.\n//!\n//! Also this module support `pseudo_table` and `staged_columns` m...
rust
edit
1
0
mit
eb7b0c6ddf644e2212e86872ad6d19de9d802b6a
cosmo0920/ruroonga_command
src/selectable/mod.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nextern crate tesseract_sys;\n\nuse self::tesseract_sys::TessDeleteText;\nuse std::convert::AsRef;\nuse std::ffi::CStr;\nuse std::os::raw::c_char;\n\n/// Wrapper around Tesseract's returned strings\npub struct TesseractText(*const c_char);\n\n...
rust
edit
0
1
mit
969f15b8c15e835167852ba3d12f830111332685
antimatter15/tesseract-rs,antimatter15/tesseract-rs
src/plumbing/tesseract_text.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n// Copyright 2014 Jonathan Eyolfson\n\n#![feature(globs)]\n\nextern crate libc;\n\npub use buffer::Buffer;\npub use compositor::Compositor;\npub use display::Display;\npub use list::List;\npub use region::Region;\npub use registry::Registry;\...
rust
edit
2
0
mit
83d4eb17571690dddfbfb79924179ab313add306
eyolfson/rust-wayland
src/lib.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nextern crate futures;\n\nuse std::thread;\nuse futures::sync::oneshot;\nuse futures::Future;\n\n\nfn send_shared_oneshot_and_wait_on_multiple_threads(threads_number: u32) {\n let (tx, rx) = oneshot::channel::<u32>();\n let f = rx.shared...
rust
edit
0
4
apache-2.0
06353325d523bb73cb840a5acd52cd2e18d91de7
alexcrichton/futures-rs,Idolf/futures-rs
tests/shared.rs
rejected_duplicate
Near-duplicate of sample 120457
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n#[test]\nfn it_works() {\n}\n\n\nmod SVM {\n /// Singly-linked cons list.\n ///\n /// This is used internally to represent list primitives in the machine.\n pub enum List<T> {\n Cons(T ~List<T>),\n Nil\n }\n\n ...
rust
edit
0
1
mit
a5cdb46a511bda985f6121c36a7b17393b5edc8a
hawkw/seax,hawkw/seax
seax-svm/src/lib.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n// Copyright (c) 2014 liquid_amber\n// This file is distributed under MIT license.\n// See LICENSE file.\n\nextern crate green;\n\n#[start]\nfn start(argc: int, argv: *const *const u8) -> int {\n green::start(argc, argv, green::basic::even...
rust
edit
null
null
mit
a3ec167561efbca2648767a6f60666c72e5afd56
liquidamber/rust-examples,liquidamber/rust-examples,liquidamber/rust-examples,liquidamber/rust-examples,liquidamber/rust-examples
b002_fib_para.rs
rejected_syntax
Syntax error detected by tree-sitter
false
[ { "role": "user", "content": "Here is the current file:\n```rust\nextern crate tcod;\nextern crate rslike;\n\nuse rslike::gui::{GUI, TCODConsole};\nuse rslike::engine::Game;\nuse rslike::util::units::Size;\n\nfn main() {\n let game = Game::new();\n let mut tcod_console = TCODConsole::new(Size::new(100...
rust
edit
0
1
bsd-3-clause
1ca9012cfaf435e6306e942998d4ab1050da2880
jgilchrist/rslike
src/main.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n#[rustversion::attr(not(nightly), ignore)]\n#[test]\nfn ui() {\n let t = trybuild::TestCases::new();\n t.compile_fail(\"tests/ui/*.rs\");\n}\n\n```\n\nApply this change: Disable ui test on miri" }, { "role": "assistant", "co...
rust
edit
0
1
apache-2.0
6dd04dadec68eb35f908d8dfa57e1a75a2644a9b
dtolnay/quote
tests/compiletest.rs
rejected_duplicate
Near-duplicate of sample 121129
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n//! Data structures and functions used by IA-32e but not Protected Mode.\n\nmacro_rules! bit {\n ( $x:expr ) => {\n 1 << $x\n };\n}\n\nmacro_rules! check_flag {\n ($doc:meta, $fun:ident, $flag:ident) => (\n #[$doc]\n ...
rust
edit
3
0
mit
df803f1c85bfe832438edd2e6fd4623ae18f1ce2
gz/rust-x86,gz/rust-x86
src/bits64/mod.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nextern crate pkg_config;\n\nfn main() {\n match pkg_config::find_library(\"portaudio-2.0\")\n {\n Ok(..) => {},\n Err(e) => println!(\"Cloud not find pkg-config ({})\", e),\n }\n}\n\n\n```\n\nApply this change: Revert \...
rust
edit
0
2
mit
44db4d8ea4d28b68b6bbdf1e8edaaf40fad3cc9c
mvdnes/portaudio-rs
portaudio_sys/build.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\npub fn main() {\n let x = [1];\n match x {\n [_, _, _, _, _, .._] => ::core::util::unreachable(),\n [.._, _, _, _, _] => ::core::util::unreachable(),\n [_, .._, _, _] => ::core::util::unreachable(),\n [_, _] ...
rust
edit
0
5
apache-2.0
070137ce905d0177e8d112385f1d8dc7b2407006
j16r/rust,zaeleus/rust,reem/rust,miniupnp/rust,rprichard/rust,mihneadb/rust,quornian/rust,hauleth/rust,AerialX/rust,ejjeong/rust,pczarn/rust,vhbit/rust,jbclements/rust,pelmers/rust,0x73/rust,Ryman/rust,pshc/rust,jashank/rust,erickt/rust,rohitjoshi/rust,sarojaba/rust-doc-korean,XMPPwocky/rust,pelmers/rust,jbclements/rus...
src/test/run-pass/vec-matching.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse std::marker::PhantomData;\n\nuse irc::client::prelude::*;\n\nuse plugin::*;\nuse FrippyClient;\n\nuse error::ErrorKind as FrippyErrorKind;\nuse error::FrippyError;\nuse failure::ResultExt;\n\n#[derive(PluginName, Default, Debug)]\npub str...
rust
edit
1
2
mit
3360430bcb90273fcec2b8f4f49f22471e75226e
Mavulp/frippy
src/plugins/help.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse std::fmt;\n\nuse std::os::raw::c_char;\n\nuse super::nif_interface::{ NIF_TERM };\n\npub fn fmt<'a>(term: NIF_TERM, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {\n const SIZE: usize = 1024;\n let mut bytes: Vec<u8> = Vec::with...
rust
edit
1
4
apache-2.0
362b291574e42e6698b0a354736fda29e50cf4eb
hansihe/Rustler
src/wrapper/term.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
0
0
apache-2.0
d26c839719bb9ecdf63e927e453149c70db37752
rsertelon/habitat,habitat-sh/habitat,habitat-sh/habitat,habitat-sh/habitat,rsertelon/habitat,rsertelon/habitat,rsertelon/habitat,habitat-sh/habitat,habitat-sh/habitat,habitat-sh/habitat,rsertelon/habitat,rsertelon/habitat,habitat-sh/habitat,rsertelon/habitat,habitat-sh/habitat
src/lib.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n//! Provides token definitions for HTML stream processing. The goal of this\n//! library is to provide a simple API over which higher abstraction can be\n//! built on.\n//!\n//! ## Example\n//!\n//! ```rust\n//! #[macro_use]\n//! extern crate...
rust
edit
1
0
apache-2.0
b83593e75846b1305752b5d7bacaa39154875951
Nemo157/hamlet,Nemo157/hamlet
src/lib.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n\nuse super::*;\n\n//\n\ntests_impls!\n{\n #[ test ]\n fn basic()\n {\n /* qqq : write tests for modules of wpublisher */\n a_id!( true, true );\n }\n}\n\n//\n\ntests_index!\n{\n basic,\n}\n\n```\n\nApply this change: Write test ro...
rust
edit
0
1
mit
f70c53532a828226cba645bc9d874e7a7a45f510
Wandalen/wTools,Wandalen/wTools
rust/test/publisher/inc/publisher_test.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse std::path::PathBuf;\nuse parser::ArgumentParser;\nuse super::Parse;\nuse test_parser::{check_ok};\n\nfn parse_str(args: &[&str]) -> PathBuf {\n let mut val: PathBuf = From::from(\"\");\n {\n let mut ap = ArgumentParser::new()...
rust
edit
0
1
mit
2e16bc5bbcbc6b921807e06fc38951b33bfb7093
tailhook/rust-argparse,SamuelMarks/rust-argparse
src/test_path.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nextern crate rayon;\n\nuse rayon::prelude::*;\nuse rayon::par_iter::collect;\n\nmod types;\npub use types::TestResult;\n\npub trait Runnable {\n fn run(&self) -> TestResult;\n}\n\nmod reporters;\nuse reporters::{Reporter, CompositeReporter...
rust
edit
2
4
mit
01d20f759b086009ed7ef4a9a7a2f2126476241a
justinlatimer/littletest
src/lib.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n// build-pass (FIXME(62277): should be check-pass)\n\nconst C: &str = \"abc {}\";\nstatic S: &str = \"{bla}\";\n\n#[allow(unreachable_code)]\nfn main() {\n panic!(\"here's a brace: {\"); //~ WARN panic message contains a brace\n std::pa...
rust
edit
0
1
apache-2.0
1993f1efe717680479242e711848a4d38f35cf1b
aidancully/rust,graydon/rust,aidancully/rust,aidancully/rust,graydon/rust,graydon/rust,aidancully/rust,graydon/rust,aidancully/rust,graydon/rust,graydon/rust,aidancully/rust
src/test/ui/panic-brace.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nextern crate document;\n\nuse std::cmp::min;\nuse std::io::File;\n\nuse document::parser::Parser;\n\nfn pretty_error(xml: &str, position: uint) -> &str {\n let s = xml.slice_from(position);\n let l = s.char_len();\n s.slice_chars(0, ...
rust
edit
0
4
mit
5617c6aa0f350dfc8bddc6dab3307b08e8053c6d
shepmaster/sxd-rust
document/src/bin/open.rs
rejected_duplicate
Near-duplicate of sample 119870
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nfn is_saddle_point(input: &[Vec<u64>], px: usize, py: usize) -> bool {\n let value = input[py][px];\n\n for y in 0..input.len() {\n if input[y][px] < value {\n return false;\n }\n }\n\n for x in 0..input[0...
rust
edit
2
9
mit
605c324df257b7b79e43027fe457885355a101d5
attilahorvath/exercism-rust
saddle-points/src/lib.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nextern crate tvdb;\nuse tvdb::v2::Tvdb;\n\n#[test]\nfn basic() {\n let t = Tvdb::new(\"0629B785CE550C8D\");\n t.login().unwrap();\n println!(\"{:?}\", t.search(\"scrubs\"));\n panic!();\n}\n\n```\n\nApply this change: Remove testi...
rust
edit
0
2
unlicense
7c04328868235282535ef38fe818480a2ab9ae87
dbr/tvdb-rs
tests/v2.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n#[macro_use] extern crate libeuler;\n\nuse libeuler::traits::DigitsHelper;\n\n/// It can be seen that the number, 125874, and its double, 251748, contain exactly the same\n/// digits, but in a different order.\n///\n/// Find the smallest posi...
rust
edit
0
3
mit
87925bf4cb3fa6b4e01940938ce29d984eaa12a4
zmbush/euler,zmbush/euler
sol_0052/main.rs
accepted
null
true