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/// Content type of the event `data` or `metadata`.\n#[derive(Debug, Copy, Clone, PartialEq, Eq)]\npub enum ContentType {\n /// Raw bytes\n Bytes,\n /// JSON values usable with projections in EventStore\n Json\n}\n\nimpl Into<i32>... | rust | edit | 0 | 2 | mit | e66741954d9e46a28f3b7368f7006bbe19200f37 | koivunej/eventstore-tcp,koivunej/eventstore-tcp | src/content_type.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nuse game::{Position, Move, Color, NumPlies, NumMoves, MilliSec};\n\npub mod options;\n\npub enum CmdVal {\n Uci,\n Debug(bool),\n IsReady,\n SetOption(options::Name, options::Val),\n Register(Vec<RegisterParam>),\n UciNewGam... | rust | edit | 1 | 0 | mit | e4779c9b59ebeecb9074a55b4a6c22fb87ecee8b | theemathas/binary_turk | src/uci/types/mod.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n#[cxx::bridge]\nmod ffi {\n extern \"C++\" {\n fn f(callback: fn() -> Result<()>);\n }\n}\n\nfn main() {}\n\n```\n\nApply this change: Fix conflict between pr 456 and fallible fn ui test"
},
{
"role": "assistant",
"co... | rust | edit | 0 | 1 | apache-2.0 | 836341a6435cbfd518f614b41fd91d787ba245d4 | dtolnay/cxx,dtolnay/cxx,dtolnay/cxx,dtolnay/cxx | tests/ui/fallible_fnptr.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nuse std::env;\nuse std::fs::File;\nuse std::io::Write;\nuse std::path::Path;\nuse std::process::Command;\n\nfn main() {\n let output_dir = env::var(\"OUT_DIR\").unwrap();\n let output_file_path = Path::new(&output_dir).join(\"git-hash\"... | rust | edit | 2 | 1 | mit | 953362c624644a4b483c4155f02ef0d6089acc10 | dbaron/wgmeeting-github-ircbot,dbaron/wgmeeting-github-ircbot | build.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n/// Divide `n` by `divisor`, and round up to the nearest integer\n/// if not evenly divisable.\n#[inline]\npub fn div_round_up(n: usize, divisor: usize) -> usize {\n if n == 0 {\n 0\n } else {\n (n - 1) / divisor + 1\n ... | rust | edit | 0 | 2 | apache-2.0 | 7169780b07c12bd2fcf9703ad47db773a62eb6bc | cuviper/rayon,cuviper/rayon | src/math.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nuse std::thread;\nuse std::sync::mpsc::{channel, Sender, Receiver, self};\n\nuse message::Message;\n\npub struct UserView<'a> {\n _incoming_sender: Sender<Message>,\n _view_guard: thread::JoinGuard<'a, ()>\n}\n\npub fn start<'a>() -> Us... | rust | edit | 0 | 2 | mit | ae1c35a7587b6ef19b2c5c7753279ff91f48cfdd | timonv/lax | src/user_view.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nuse std::env;\n\nfn main() {\n // Decide ideal limb width for arithmetic in the float parser. Refer to\n // src/lexical/math.rs for where this has an effect.\n let target_arch = env::var(\"CARGO_CFG_TARGET_ARCH\").unwrap();\n matc... | rust | edit | 0 | 6 | apache-2.0 | ff8443b20b19c12422050da6ecb476398999b25f | serde-rs/json,google/serde_json_lenient | build.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n#![no_main]\n#[macro_use] extern crate libfuzzer_sys;\nextern crate url;\nuse std::str;\n\nfuzz_target!(|data: &[u8]| {\n if let Ok(utf8) = str::from_utf8(data) {\n let _ = url::Url::parse(utf8);\n }\n});\n\n```\n\nApply this cha... | rust | edit | 0 | 0 | apache-2.0 | 4b5a4222bb58f2345c251dd068e16851da5c4e24 | servo/rust-url,servo/rust-url | fuzz/fuzzers/parse.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nmacro_rules! log {\n (target: $target:expr, $lvl:expr, $($arg:tt)+) => {\n let _ = $target;\n let _ = log!($lvl, $($arg)+);\n };\n ($lvl:expr, $($arg:tt)+) => {{\n let _ = $lvl;\n let _ = format_args!($($a... | rust | edit | 0 | 0 | bsd-3-clause | c5f1c73be37c758804b79c9165cb1b3cebfb11f5 | rust-lang/rust-bindgen,rust-lang/rust-bindgen,rust-lang/rust-bindgen,rust-lang/rust-bindgen | src/log_stubs.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n// Implements http://rosettacode.org/wiki/Binary_digits\nuse std::vec::Vec;\nuse std::string::String;\n\n#[cfg(not(test))]\nfn main() {\n let bins=binaries(16u);\n for s in bins.iter() {\n println!(\"{}\", s);\n }\n}\n\nfn bin... | rust | edit | null | null | unlicense | 8274a5f3e826b2bef69b64b6c56e8897cff30e55 | magum/rust-rosetta,pfalabella/rust-rosetta,crr0004/rust-rosetta,crespyl/rust-rosetta,magum/rust-rosetta,sakeven/rust-rosetta,ghotiphud/rust-rosetta,ZoomRmc/rust-rosetta,JIghtuse/rust-rosetta,Hoverbear/rust-rosetta | src/binary_digits.rs | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n#![feature(ascii_ctype)]\nuse std::ascii::AsciiExt;\n\npub fn rotate(text: &str, key: usize) -> String {\n text.chars()\n .map(|x| match x {\n _ if x.is_ascii_lowercase() => {\n let v = (x as u8 - b'a' + ke... | rust | edit | 2 | 4 | bsd-2-clause | 1857c88ff7127689da538b31cdce7a9839cda61c | gyn/exercism,gyn/exercism,gyn/exercism,gyn/exercism | rust/rotational-cipher/src/lib.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nuse std::fmt;\n\ntype OscResult<T> = Result<T, OscError>;\n\npub enum OscError {\n BadOscPacket(String),\n BadOscAddress(String),\n BadOscMessage(String),\n BadOscString(String),\n BadOscBundle,\n}\n\nimpl fmt::Display for OscE... | rust | edit | 0 | 2 | apache-2.0 | a2ba0a2562488c986a653e68c09d8fb0d4ca79b2 | klingtnet/rosc | src/errors.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\nuse std::process::Command;\nuse ... | rust | edit | 2 | 1 | bsd-3-clause | 52172f188e5c23f0e46894aec49d8cfde7be9d42 | nox/skia,vvuk/skia,akiss77/skia,akiss77/skia,nox/skia,vvuk/skia,larsbergstrom/skia,larsbergstrom/skia,larsbergstrom/skia,akiss77/skia,larsbergstrom/skia,vvuk/skia,nox/skia,vvuk/skia,larsbergstrom/skia,akiss77/skia,nox/skia,larsbergstrom/skia,vvuk/skia,akiss77/skia,nox/skia,larsbergstrom/skia,vvuk/skia,akiss77/skia,lars... | build.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 | 2 | 1 | apache-2.0 | 279ec9b9b871dc6ef52ebc808adca177f596795e | gifnksm/rust,krzysz00/rust,l0kod/rust,omasanori/rust,dwillmer/rust,dwillmer/rust,gifnksm/rust,zachwick/rust,kwantam/rust,graydon/rust,nwin/rust,seanrivera/rust,l0kod/rust,seanrivera/rust,vhbit/rust,sae-bom/rust,pelmers/rust,TheNeikos/rust,krzysz00/rust,nwin/rust,ejjeong/rust,jroesch/rust,TheNeikos/rust,aneeshusa/rust,j... | src/test/run-pass/macro-with-braces-in-expr-position.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nuse std::rand::random;\n\nfn main() {\n let random_value = random::<u8>() % 10u8;\n let mut guess = 0u8;\n\n println!(\"{}\", random_value);\n\n}\n\n```\n\nApply this change: Add function to check for equality"
},
{
"role": "... | rust | edit | null | null | bsd-2-clause | 3f89110d2805289ef83d17018ceded346f3239a9 | ambidextrousTx/ToyRustPrograms | guess.rs | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nuse netbuf::Buf;\nuse {Transport, StreamSocket};\n\n\n/// Transport is thing that provides buffered I/O for stream sockets\nimpl<'a, S: StreamSocket> Transport<'a, S> {\n /// Get the reference to the underlying stream\n ///\n /// It'... | rust | edit | 2 | 1 | mit | a476e763ee36c7c9ca8ec427befb45bd046a7d00 | tailhook/rotor-stream | src/transport.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n#![allow(dead_code)]\nfn main() {\n let (word_a, word_b) = words();\n let message = format!(\"{}{}!\", word_a, word_b);\n output(message);\n //output(message);\n}\n\nfn words() -> (String, String) {\n (format!(\"こんにちは\"), forma... | rust | edit | 0 | 3 | mit | 10a9369ee1899a403a4843a096e0742e615d951f | chikoski/rust-exercises | exercises/ownership/src/main.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\ntype Cell = u8;\n\npub struct VM {\n cells: [Cell; 30_000],\n data_pointer: usize,\n}\n\n\nimpl VM {\n pub fn new() -> VM {\n VM { cells: [0; 30_000], data_pointer: 0 }\n }\n\n\n pub fn output(&self) -> Cell {\n s... | rust | edit | 0 | 1 | mit | 84571a1f4bc547e45501a5b4aa73dcadde25b980 | nafarlee/thoughtfuck | src/vm.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nextern crate core;\nextern crate iron;\nextern crate mount;\nextern crate rustc_serialize;\nextern crate staticfile;\nextern crate toml;\nextern crate url;\n\nuse std::path::Path;\nuse std::sync::Arc;\nuse std::sync::Mutex;\n\nuse iron::prelu... | rust | edit | 3 | 1 | mit | df1c2b8b59d989e17a89bd160a1fcfae54e8d9a3 | agersant/polaris,agersant/polaris,jxs/polaris,agersant/polaris,jxs/polaris | src/main.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n/// Maximum number of channels supported in the FLAC format.\npub const MAX_CHANNELS: usize = 8;\n\n/// Audio frame that contains one sample for each channel.\npub struct Frame {\n pub header: Header,\n pub footer: Footer,\n}\n\n/// Channel... | rust | edit | 0 | 0 | bsd-3-clause | 26c74bef555d25675dd90bc48e7df24adf136914 | sourrust/flac | src/frame/types.rs | rejected_duplicate | Near-duplicate of sample 122001 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n#[derive(Debug, Clone)]\npub struct File {\n pub contents: Vec<u8>,\n pub mode: u32,\n}\n\nimpl File {\n pub fn new(contents: Vec<u8>) -> Self {\n File {\n contents,\n mode: 0o644,\n }\n }\n}\n\... | rust | edit | 0 | 2 | mit | 73420b6aef196bc3474af5b64b7fc694e374273c | iredelmeier/filesystem-rs | src/fake/node.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nextern crate serde;\nextern crate serde_json;\n\nuse hyper::Client;\nuse hyper::client::{Body, Response};\nuse hyper::header::Headers;\nuse hyper::status::StatusCode;\nuse jira_request::*;\nuse std::io::Read;\n\npub fn send<R: JIRARequest, T:... | rust | edit | 0 | 4 | mit | 0298621c29df687710997c076ccda167b69d40f7 | dorayakikun/alfred_jira_workflow | src/jira_client.rs | rejected_duplicate | Near-duplicate of sample 119917 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n#![feature(platform_intrinsics)]\n#![feature(simd, simd_ffi, link_llvm_intrinsics)]\n#![feature(cfg_target_feature)]\n\nextern crate rand;\nextern crate x86intrin;\n\npub mod color;\npub mod decision;\npub mod field;\nmod field_bit;\n#[cfg(ta... | rust | edit | 3 | 0 | mit | 90b23ac320e17bc71458d298d6472c80b661fe9e | mayah/rust-puyoai,mayah/rust-puyoai | puyocore/src/lib.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n//! Codec for chunk type 13 = FLI_BLACK.\n\nuse ::RasterMut;\n\n/// Magic for a FLI_BLACK chunk - No Data.\n///\n/// This chunk has no data following the header. All pixels in the\n/// frame are set to color index 0.\npub const FLI_BLACK: u1... | rust | edit | 0 | 3 | mit | 20bb52511b94a759e80ebe26c72f08cf0e7e175f | wangds/libflic,wangds/libflic | src/codec/codec013.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n#![cfg(feature = \"glacier\")]\n\nextern crate rusoto_core;\nextern crate rusoto_glacier;\nextern crate env_logger;\n\nuse rusoto_glacier::{Glacier, GlacierClient, ListVaultsInput};\nuse rusoto_core::{DefaultCredentialsProvider, Region, defau... | rust | edit | 0 | 1 | mit | e97668009a93fece84e4140a967a0496568de08f | rusoto/rusoto,DualSpark/rust-aws,mattico/rusoto,DualSpark/rusoto,SecurityInsanity/rusoto,mattico/rusoto,mattico/rusoto,rusoto/rusoto,DualSpark/rust-aws,SecurityInsanity/rusoto,DualSpark/rusoto,DualSpark/rusoto,DualSpark/rust-aws,rusoto/rusoto | integration_tests/tests/glacier.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n// Copyright 2014–2017 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 | 2 | 1 | apache-2.0 | 5949d8b2d7b2bd01cfa454b029e7d921aedd7e27 | GBGamer/rust,graydon/rust,graydon/rust,GBGamer/rust,aidancully/rust,graydon/rust,graydon/rust,GBGamer/rust,aidancully/rust,graydon/rust,aidancully/rust,aidancully/rust,GBGamer/rust,aidancully/rust,GBGamer/rust,GBGamer/rust,aidancully/rust,GBGamer/rust,graydon/rust,GBGamer/rust | src/test/ui/lint/lint-group-nonstandard-style.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nuse table::Table;\n\nuse std::collections::TreeMap;\n\npub struct Rusql<'a> {\n pub map: TreeMap<String, Table<'a>>,\n}\n\n\nimpl<'a> Rusql<'a> {\n pub fn new() -> Rusql<'a> {\n return Rusql {\n map: TreeMap::new(),\n ... | rust | edit | 0 | 1 | mit | e13f1966e1680838f51397c4e2afb7570c977d70 | mttr/rusql,mttr/rusql | src/rusql.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nextern crate zmq;\n\nuse zmq::{Context, Message};\n\nfn main() {\n println!(\"24 days of Rust - zmq (day 20)\");\n let args = std::env::args().collect::<Vec<_>>();\n if args.len() < 2 {\n println!(\"Usage: {} (client|server)\"... | rust | edit | 0 | 4 | mit | b47e0d6d777161b8b066fc377d85b687b8b87128 | folkengine/24daysofrust,folkengine/24daysofrust,zsiciarz/24daysofrust,folkengine/24daysofrust,zsiciarz/24daysofrust,zsiciarz/24daysofrust | src/day20.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n//! Common HTTP functionality for the Teepee project.\n//!\n//! Anything shared between both client and server belongs in here, but this crate is not expected\n//! to be used directly.\n//!\n//! Any crate using types from this crate should re... | rust | edit | 4 | 0 | apache-2.0 | e3b780294bb28d5db04169d200bf96c8ef45e1fe | teepee/teepee,teepee/teepee | src/httpcommon/lib.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n#[macro_use]\nextern crate rouille;\n\nuse std::io;\n\nfn main() {\n rouille::start_server(\"localhost:8000\", move |request| {\n let _entry = rouille::LogEntry::start(io::stdout(), request);\n\n if let Ok(r) = rouille::match... | rust | edit | 0 | 6 | apache-2.0 | 9f7a4a72eaa37c32105889b8cfd4786c4a6895f3 | tomaka/rouille | examples/hello_world.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nextern crate sdl2;\nextern crate native;\n\nfn main() {\n sdl2::init(sdl2::InitEverything);\n\n let win = match sdl2::video::Window::new(\"Hello World!\", sdl2::video::Positioned(100), sdl2::video::Positioned(100), 960, 540, sdl2::video... | rust | edit | 0 | 1 | mit | 8099e801d66b4c575dad662b0e8539c520f4a98a | xyproto/hello_sdl2,xyproto/hello_sdl2,xyproto/hello_sdl2,xyproto/hello_sdl2,xyproto/hello_sdl2,xyproto/hello_sdl2,xyproto/hello_sdl2 | rust-cargo/src/main.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nuse std::fmt::Debug;\n\npeg::parser!{\n grammar g() for str {\n pub rule returns_impl_trait() -> impl Debug\n = \"\" { Box::new(5) }\n }\n}\n\nfn main() {\n assert_eq!(format!(\"{:?}\", g::returns_impl_trait(\"\")),... | rust | edit | 1 | 1 | mit | 8a40aa35f32fa573f2dc99756b9f687dee38767e | kevinmehall/rust-peg,kevinmehall/rust-peg | tests/run-pass/return_type.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nuse Conn;\nuse conn::futures::read_packet::ReadPacket;\nuse conn::futures::write_packet::WritePacket;\nuse errors::*;\nuse lib_futures::Async;\nuse lib_futures::Async::Ready;\nuse lib_futures::Future;\nuse lib_futures::Poll;\nuse proto::Packe... | rust | edit | 1 | 3 | apache-2.0 | ec670cd181fc26d0cf6a1966e9851d929493f8e9 | blackbeam/mysql_async | src/conn/futures/ping.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n#![feature(proc_macro_hygiene, decl_macro)]\n\n#[macro_use]\nextern crate rocket;\n\n#[macro_use]\nextern crate rocket_contrib;\n\n// #[macro_use]\nextern crate diesel;\n\nmod schema;\n// mod models;\n\nuse rocket_contrib::databases::diesel::... | rust | edit | 0 | 1 | mit | d4ccd00abc3024ff4a82a76ee04d7151e5f12bc0 | ghotiphud/rust-web-starter,ghotiphud/rust-web-starter,ghotiphud/rust-web-starter,ghotiphud/rust-web-starter | api_server/src/main.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n#![feature(plugin_registrar)]\nextern crate rustc;\nextern crate syntax;\n\nuse rustc::plugin::Registry;\nuse syntax::ast::TokenTree;\nuse syntax::codemap::Span;\nuse syntax::ext::base::{ExtCtxt, MacExpr, MacResult};\nuse syntax::ext::build::... | rust | edit | 0 | 1 | apache-2.0 | 79ea5e8021919131981e0cfe2716b6253951aa92 | cmr/speculate.rs | src/lib.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nuse super::types::{OrigFileName, Details};\nuse parser::{Parser, ParseError};\n\n// Parses a wuala file conflict encoded in the file name in the form:\n//\n// '<base_name> (conflicting version <version> from <host>).<extension>'\n//\n// e.... | rust | edit | 0 | 2 | bsd-3-clause | 5690ac18e96b3a17c2446ec43bf89c6b5f82988c | dan-t/rust-confsolve | src/file_conflict/dropbox.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n#[macro_use]\nextern crate nom;\nextern crate pcapng;\n\nuse std::env;\nuse std::fs;\nuse std::io::Read;\nuse nom::IResult;\nuse pcapng::block::parse_blocks;\n\nfn main() {\n let args: Vec<_> = env::args().collect();\n if args.len() != ... | rust | edit | 0 | 4 | mit | 73a872b658f5fa810a1f20bb40aa519618f9d27f | richo/pcapng-rs | examples/read_pcapng.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nuse std::ops::{Deref, DerefMut};\nuse std::collections::HashMap;\n\nuse term::Term;\nuse token::Token;\n\n#[derive(Debug, Clone, PartialEq)]\npub struct TermVector(HashMap<Term, Vec<u32>>);\n\nimpl TermVector {\n pub fn new() -> TermVector... | rust | edit | 1 | 3 | apache-2.0 | 8f4f31bebca976596b00bfffbcb1712c9047434e | kitesearch/kite | kite/src/term_vector.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nuse core::ptr;\n\nuse super::SDTHeader;\n\n#[repr(packed)]\n#[derive(Clone, Copy, Debug, Default)]\npub struct SSDT {\n pub header: SDTHeader,\n pub data: &'static [u8]\n\n}\n\nimpl SSDT {\n pub fn new(header: *const SDTHeader) -> Op... | rust | edit | 2 | 2 | mit | 8ad0c96b3ab0d4863904257d79531a66c50281f0 | Lacaranian/redox,rexlunae/redox,rexlunae/redox,Lacaranian/redox,Lacaranian/redox,rexlunae/redox,Lacaranian/redox,Lacaranian/redox | kernel/acpi/ssdt.rs | rejected_duplicate | Near-duplicate of sample 120636 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nuse std::io;\nuse std::io::prelude::*;\n\nuse std::fs::File;\nuse std::env;\n\nmod parser;\nuse parser::lexer;\n\nfn repl_loop() {\n println!(\"the poli language\\n\");\n\n loop {\n print!(\">>> \");\n io::stdout().flush()... | rust | edit | 0 | 5 | mit | c27caed736f77f43a2a5bc18fcc7bdfc4c19f654 | polilang/poli,polilang/poli,polilang/poli | src/main.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n//! The kind traits\n\n#[lang=\"const\"]\npub trait Const {\n // Empty.\n}\n\n#[lang=\"copy\"]\npub trait Copy {\n // Empty.\n}\n\n#[lang=\"send\"]\npub trait Send {\n // Empty.\n}\n\n#[lang=\"owned\"]\npub trait Owned {\n // Empt... | rust | edit | 0 | 0 | apache-2.0 | 38ba2c4941ede8d999a0208c50f1ad077ba259da | andars/rust,nwin/rust,rprichard/rust,pelmers/rust,mihneadb/rust,mvdnes/rust,pelmers/rust,retep998/rand,jroesch/rust,untitaker/rust,quornian/rust,zachwick/rust,aidancully/rust,barosl/rust,LeoTestard/rust,arthurprs/rand,graydon/rust,TheNeikos/rust,miniupnp/rust,robertg/rust,j16r/rust,servo/rust,cllns/rust,barosl/rust,zub... | src/libcore/kinds.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n// -*- rust -*-\n// error-pattern:9:2\n\n/* 1\n * 2\n * 3\n */\nfn main() {\n %; // parse error on line 9, but is reported on line 6 instead.\n}\n\n```\n\nApply this change: Fix up test for last commit"
},
{
"role": "assistant",
... | rust | edit | null | null | apache-2.0 | 1efe5f0577eabc44f93d16b67a8b4d0ba9e0192f | sae-bom/rust,dinfuehr/rust,quornian/rust,michaelballantyne/rust-gpu,pythonesque/rust,victorvde/rust,carols10cents/rust,sae-bom/rust,zachwick/rust,0x73/rust,defuz/rust,emk/rust,graydon/rust,servo/rust,AerialX/rust,erickt/rust,jroesch/rust,mvdnes/rust,AerialX/rust-rt-minimal,nham/rust,carols10cents/rust,bombless/rust,din... | src/test/compile-fail/multiline-comment-line-tracking.rs | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nuse uuid::Uuid;\nuse error::Error;\nuse model::provider::Provider;\nuse super::{conn, Model};\n\npub trait Enclosure where Self: Model {\n fn new(provider: Provider, identifier: String) -> Self;\n fn find_by_entry_id(entry_id: Uuid) -> ... | rust | edit | 0 | 2 | mit | 6f01cffdef30ad4a8502f3f20ee69561d2e96f8d | kumabook/pink-spider,kumabook/pink-spider,kumabook/pink-spider,kumabook/pink-spider | src/model/enclosure.rs | accepted | null | true |
[
{
"role": "user",
"content": "Write rust code for the following: net/conn: Add definition of type EtherType, ProtocolIdType and PortType"
},
{
"role": "assistant",
"content": "//! Definition of various types related to connexions\n\n/// Type of the ether_type\npub type EtherType = u16;\n/// Type... | rust | new_file | 0 | 0 | mit | 514e5c55e5b2ad79769ead45cdc2680c610ec71b | uni-rs/uni.rs | src/net/conn/defs.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nuse env::Env;\nuse gobjects::*;\nuse library;\nuse nameutil::*;\nuse super::general;\n\npub struct Info {\n pub full_name: String,\n pub class_id: library::TypeId,\n pub name: String,\n pub parents: Vec<general::StatusedTypeId>,\n... | rust | edit | 6 | 2 | mit | e08305a9a92a674e2ecf3e7837ad1d6506878166 | EPashkin/gir,gtk-rs/gir,gtk-rs/gir,insanebits/gir,gkoz/gir,EPashkin/gir,GuillaumeGomez/gir,gkoz/gir,GuillaumeGomez/gir,GuillaumeGomez/gir,insanebits/gir,gtk-rs/gir | src/analysis/widget.rs | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nextern crate libc;\n\npub mod anoncreds;\npub mod crypto;\npub mod sovrin;\npub mod wallet;\n\nuse self::libc::{c_char, c_uchar};\n\n#[no_mangle]\npub extern fn init_client(host_and_port: *const c_char) -> i32 {\n unimplemented!();\n}\n\n#... | rust | edit | 10 | 2 | apache-2.0 | 4d4cc120a92e36f80889605b44a3e6296da5ed1b | peacekeeper/indy-sdk,MRJCrunch/indy-sdk,MRJCrunch/indy-sdk,peacekeeper/indy-sdk,korsimoro/indy-sdk,peacekeeper/indy-sdk,srottem/indy-sdk,Artemkaaas/indy-sdk,evernym/sovrin-client-rust,srottem/indy-sdk,Artemkaaas/indy-sdk,evernym/sovrin-client-rust,korsimoro/indy-sdk,MRJCrunch/indy-sdk,peacekeeper/indy-sdk,Artemkaaas/in... | src/c_callable/mod.rs | rejected_lint | Too many lint violations: 10 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nextern crate i2cdev;\nextern crate nix;\n\nmod utils;\n\npub mod bme280;\npub use bme280::*;\n\n```\n\nApply this change: Fix visibility of inner module."
},
{
"role": "assistant",
"content": "extern crate i2cdev;\nextern crate ni... | rust | edit | 2 | 0 | mit | ea5e8f7e54e4b38caac8d14b97008233dadc99e4 | chiro/bme280-rs | src/lib.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nuse lazy_static::lazy_static;\nuse std::env;\nuse std::path::PathBuf;\n\nlazy_static! {\n pub static ref CARGO_TARGET_DIR: PathBuf = {\n match env::var_os(\"CARGO_TARGET_DIR\") {\n Some(v) => v.into(),\n None =... | rust | edit | 2 | 1 | apache-2.0 | f940b04de6524f94140f3630434f89034e0a6481 | graydon/rust,aidancully/rust,graydon/rust,aidancully/rust,graydon/rust,graydon/rust,aidancully/rust,aidancully/rust,aidancully/rust,graydon/rust,aidancully/rust,graydon/rust | tests/cargo/mod.rs | rejected_duplicate | Near-duplicate of sample 121602 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n\n/// A Doc comment\n#[AnAttribute]\npub struct Foo {\n #[rustfmt_skip]\n f : SomeType, // Comment beside a field\n f: SomeType, // Comment beside a field\n // Comment on a field\n #[AnAttribute]\n g: SomeOtherType,\n /... | rust | edit | 0 | 0 | apache-2.0 | 5e3c2640ec6dbd3abacd28fa2826cb94f23f4e8e | aidancully/rust,aidancully/rust,graydon/rust,graydon/rust,SingingTree/rustfmt,studoot/rustfmt,rust-lang/rustfmt,rust-lang/rustfmt,graydon/rust,aidancully/rust,SingingTree/rustfmt,graydon/rust,graydon/rust,studoot/rustfmt,aidancully/rust,Emilgardis/rustfmt,flutterhash/rustfmt,aidancully/rust,Emilgardis/rustfmt,graydon/r... | tests/target/structs.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nuse std::sync::Mutex;\n\nfn main() {\n let m = Mutex::new(5);\n\n {\n let mut num = m.lock().unwrap();\n *num = 6;\n }\n\n println!(\"m = {:?}\", m);\n}\n\n```\n\nApply this change: Use mutex with multiple threads an... | rust | edit | 0 | 4 | mit | 801e8be6d3b504bb572082a06e700f843d728cd4 | pgrzesik/learning-rust | 28_shared_state/src/main.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\npub type c_char = i8;\npub type c_long = i64;\npub type c_ulong = u64;\npub type wchar_t = u32;\n\n```\n\nApply this change: Correct the type of c_char.\n\nOn ARM64, it is supposed to be unsigned char:\n\n $ aarch64-unknown-cloudabi-cc -dM -... | rust | edit | 4 | 0 | apache-2.0 | ee3d0578e602d39134a5f40c48ee557807386a27 | rust-lang-nursery/libc,rust-lang/libc,rust-lang/libc,rust-lang/libc,rust-lang-nursery/libc,rust-lang-nursery/libc | src/cloudabi/aarch64.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nextern crate ruroonga_command as ruroonga;\nuse ruroonga::selectable::drilldown::Drilldown;\nuse ruroonga::selectable::drilldown_builder::DrilldownBuilder;\nuse ruroonga::commandable::Commandable;\nuse ruroonga::queryable::Queryable;\nuse rur... | rust | edit | 0 | 1 | mit | 79e00b113c0987f726037fa28c04ce8e169057ac | cosmo0920/ruroonga_command | examples/drilldown_builder.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nuse webcore::value::Reference;\nuse webcore::try_from::TryInto;\nuse webcore::value::Value;\n\n/// The `ArrayBuffer` object is used to represent a generic, fixed-length raw binary data buffer.\n/// You cannot directly manipulate the contents ... | rust | edit | 0 | 1 | apache-2.0 | 1db69c4043bdd005613554494b32455e2e50d96c | koute/stdweb,koute/stdweb,koute/stdweb | src/webapi/array_buffer.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n// Copyright (c) 2018 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 copy o... | rust | edit | 0 | 1 | apache-2.0 | 5bdf03f9e10302c7f34b14ac3b20a5aa2d84a8e2 | habitat-sh/habitat,habitat-sh/habitat,habitat-sh/habitat,habitat-sh/habitat,rsertelon/habitat,habitat-sh/habitat,rsertelon/habitat,habitat-sh/habitat,rsertelon/habitat,rsertelon/habitat,rsertelon/habitat,habitat-sh/habitat,habitat-sh/habitat,rsertelon/habitat,rsertelon/habitat | components/butterfly/src/protocol/swim.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n\npub fn puzzle(input: &str) -> usize {\n 0\n}\n\n#[cfg(test)]\nmod test {\n use super::*;\n\n}\n\n```\n\nApply this change: Set up a BFS queue"
},
{
"role": "assistant",
"content": "\npub fn puzzle(input: &str) -> usize {\n... | rust | edit | 2 | 2 | mit | 7b375eb2e0cb28a55c97150a9d964967a6ba6618 | carols10cents/adventofcode-rs | src/lib.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n\npub fn puzzle(input: &str) -> u32 {\n let initial_world_state = WorldState {\n steps: 0,\n elevator_floor: 0,\n };\n let mut queue = vec![initial_world_state];\n while !queue.is_empty() {\n let world = queue... | rust | edit | 1 | 3 | mit | 59fa132dd23aa5f660d96dd81c3c47b8d4358d40 | carols10cents/adventofcode-rs | src/lib.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nextern crate libc;\n\nuse libc::funcs::posix88::unistd::getlogin;\nuse std::c_str::CString;\nuse std::os;\n\n\nfn main() {\n unsafe {\n\n let login_c = getlogin() as *const libc::c_char;\n let login = CString::new(login_c, fa... | rust | edit | 0 | 2 | apache-2.0 | f6ccf0372cb0d924567426432ab1d7aa1d87277e | gmjosack/coreutils.rs | src/bin/logname.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n/// Error type\n///\n/// `cfitsio` passes errors through integer status codes. This struct wraps this and its associated\n/// error message.\n#[derive(Debug, PartialEq, Eq)]\npub struct FitsError {\n pub status: i32,\n pub message: Stri... | rust | edit | 2 | 2 | apache-2.0 | 64c853d6d03c36816fba05b9c0fc6d3226252625 | mindriot101/rust-cfitsio,mindriot101/rust-fitsio,mindriot101/rust-fitsio,mindriot101/rust-fitsio,mindriot101/rust-fitsio,mindriot101/rust-fitsio,mindriot101/rust-cfitsio | fitsio/src/fitserror.rs | accepted | null | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.