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// check-pass\n\n#[cfg(FALSE)]\nfn simple_attr() {\n #[attr] if true {}\n #[allow_warnings] if true {}\n}\n\n#[cfg(FALSE)]\nfn if_else_chain() {\n #[first_attr] if true {\n } else if false {\n } else {\n }\n}\n\n#[cfg(FALSE)... | rust | edit | 2 | 3 | apache-2.0 | 1b681d6652bacce6b741ca66725f25b9afb16bc8 | graydon/rust,aidancully/rust,graydon/rust,aidancully/rust,aidancully/rust,graydon/rust,graydon/rust,aidancully/rust,graydon/rust,aidancully/rust,aidancully/rust,graydon/rust | src/test/ui/if-attrs/cfg-false-if-attr.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nuse std::collections::HashMap;\n\nfn get_sorted_chars(string : &str) -> String {\n let mut chars : Vec<char> = string.chars().collect();\n chars.sort();\n let mut sorted_string = String::new();\n for c in chars {\n sorted_s... | rust | edit | 0 | 2 | mit | d410b80ab1372a185937af9adc09473691966bf3 | SingingTree/CodeKata,SingingTree/CodeKata,SingingTree/CodeKata,SingingTree/CodeKata | Kata06/anagrams/src/lib.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n// This file is part of libfringe, a low-level green threading library.\n// Copyright (c) Ben Segall <<EMAIL>>\n// Copyright (c) Nathan Zadoks <<EMAIL>>\n// See the LICENSE file included in this distribution.\n#![cfg(target_os = \"linux\")]\n... | rust | edit | 0 | 1 | apache-2.0 | 957f11df3f613fa5bfbc0a96f353f8352391e60c | QuiltOS/libfringe,whitequark/libfringe,QuiltOS/libfringe,whitequark/libfringe,RustOS-Fork-Holding-Ground/libfringe,RustOS-Fork-Holding-Ground/libfringe | tests/fpe.rs | rejected_duplicate | Near-duplicate of sample 120128 | true |
[
{
"role": "user",
"content": "Write rust code for the following: x86_common: Add definition of global start_info"
},
{
"role": "assistant",
"content": "use ::xen::StartInfo;\n\npub mod defs;\npub mod barrier;\npub mod memory;\n\nextern {\n // Start info is not present on all architecture, thi... | rust | new_file | 2 | 0 | mit | d58946887e60576a3e42cf33b7397583dd3701a1 | uni-rs/uni.rs | src/arch/x86_common/mod.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n// Implements http://rosettacode.org/wiki/Rot-13\n\nfn rot13 (string: &str) -> String {\n fn rot13u8 (c: char) -> char {\n let d = c as u8;\n match c {\n 'a' .. 'm'\n | 'A' .. 'M' => (d + 13) as char,\n ... | rust | edit | 3 | 2 | unlicense | 96346761b5f0d34452f8c1178316bbfbe90f5b33 | crespyl/rust-rosetta,magum/rust-rosetta,pfalabella/rust-rosetta,crr0004/rust-rosetta,magum/rust-rosetta,JIghtuse/rust-rosetta,ZoomRmc/rust-rosetta,ghotiphud/rust-rosetta,Hoverbear/rust-rosetta,sakeven/rust-rosetta | src/rot13.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nuse std::collections::BTreeMap;\nuse std::string::ToString;\nuse std::default::Default;\nuse rustc_serialize::json::{Json,ToJson};\n\nuse parse::*;\n\n// subtypes shared across record types\n\nmake_prop_type!(File, \"File\",\n url: String... | rust | edit | 3 | 0 | mit | 977098b093601eaa7fbb9c397b0561bd219a294d | robn/jmap-rs | src/types.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nextern crate yaml_rust;\nuse self::yaml_rust::{YamlLoader, Yaml};\n\npub fn from_yaml(yaml_file: String) -> Vec<String> {\n let docs = YamlLoader::load_from_str(&yaml_file).unwrap();\n let doc = &docs[0];\n\n let key = Yaml::from_str... | rust | edit | 0 | 1 | mit | 15bfe8a88ee8e2492c26c93fa6a7fa2093cd88a5 | schultyy/Sokan | src/configuration.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n// force-host\n// no-prefer-dynamic\n\n#![feature(repr128)]\n#![crate_type = \"proc-macro\"]\n\nextern crate proc_macro;\n\nuse proc_macro::{Delimiter, Group, Ident, Span, TokenStream, TokenTree};\nuse std::iter::FromIterator;\n\n#[proc_macro... | rust | edit | 1 | 1 | apache-2.0 | 3ab803845028b02e8c0174020c7ae2c6eb736f8f | graydon/rust,aidancully/rust,graydon/rust,graydon/rust,aidancully/rust,graydon/rust,aidancully/rust,graydon/rust,aidancully/rust,graydon/rust,aidancully/rust,aidancully/rust | tests/ui/crashes/auxiliary/proc_macro_crash.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nuse ffi;\n\nuse libc;\n\nuse std::slice;\nuse std::str;\nuse std::ptr;\nuse std::ffi::CStr;\n\npub fn decode_c_str(c_str: *const ffi::yaml_char_t) -> Option<String> {\n if c_str == ptr::null() {\n None\n } else {\n unsafe ... | rust | edit | 2 | 2 | mit | bfcaf962d2bf6cebb09f79d26207cc15ee195a51 | kimhyunkang/libyaml-rust,kimhyunkang/libyaml-rust | src/codecs.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n//! Evolve a Population of Individuals in an Environment\n//!\n//! Evolution is the culmination of individuals in a population competing in a\n//! harsh environment for limited resources. Here the environment is determined\n//! by the fitness... | rust | edit | 0 | 1 | mit | e4a5fe49dd7d3cdb67a3b52b29243018790ab6b0 | darwins-challenge/nadezhda,darwins-challenge/nadezhda | src/darwin/evolve.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nextern crate gtk;\n\nuse gtk::prelude::*;\nuse std::ops::Not;\nuse std::sync::{Arc, RwLock};\n\n\nfn main() {\n if gtk::init().is_err() {\n println!(\"Failed to initialize GTK.\");\n return;\n }\n\n let window = gtk::Wi... | rust | edit | 0 | 3 | unlicense | cc557e16c3acb3c37b50abd93622221ca537d22d | Hoverbear/rust-rosetta | tasks/animation/src/main.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nextern crate wechat;\n\nuse wechat::WeChatClient;\n\nstatic APPID: &'static str = \"wxd7aa56e2c7b1f4f1\";\nstatic SECRET: &'static str = \"2817b66a1d5829847196cf2f96ab2816\";\n\n#[test]\nfn test_fetch_access_token() {\n let mut client = We... | rust | edit | 0 | 2 | mit | 648824ecbe2dfe2aab30cd9190a3afc87786d76d | messense/wechat-rs | tests/test_client.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n#[derive(Debug)]\npub enum ExpectedVersion {\n Exist, // -4 to say that the stream should exist with any number of events in it.\n NoConflict, // -2 states that this write should never conflict with anything and should always succe... | rust | edit | 0 | 3 | mit | bb287148f4b6f6e1ecf18d37f5445f6cb2ef9ee3 | MitinPavel/http_event_store | src/expected_version.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n#[cfg(feature = \"float\")]\nextern crate num_traits;\n\nmod assertions;\nmod base;\n\npub use assertions::basic::{ComparableAssertion, EqualityAssertion};\npub use assertions::float::FloatAssertion;\npub use assertions::iterator::IteratorAss... | rust | edit | 1 | 0 | apache-2.0 | cff755ccab5d883b3de1871cf6893fce632ae4f4 | google/assertor | src/lib.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nmacro_rules! format_print (\n ($format_str: expr, $opt_str: expr, $data: expr, $no_flag: expr) => (\n {\n println!($format_str, if $no_flag {\n $opt_str\n } else {\n \"\"\n }, $data);\n }\n );\n);\n\n```\n... | rust | edit | 2 | 0 | bsd-3-clause | c73af486ddd5be2df0dd4c855886ad9b03103176 | sourrust/flac | examples/commands/utility.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nuse buffer::Buffer;\nuse buffer::gap_buffer::GapBuffer;\npub use self::group::OperationGroup;\n\npub mod group;\n\npub trait Operation {\n fn run(&mut self, &mut GapBuffer);\n fn reverse(&mut self, &mut GapBuffer);\n}\n\n```\n\nApply th... | rust | edit | 0 | 0 | mit | 5709dd335031fec8a1105cad80f71f200af0fe2a | jmacdonald/scribe | src/buffer/operation/mod.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nextern crate futures;\nextern crate tokio_core;\nextern crate tokio_process;\n\nuse std::env;\nuse std::sync::mpsc::channel;\nuse std::sync::{Once, ONCE_INIT};\nuse std::thread;\n\nuse tokio_core::{Loop, LoopHandle};\nuse tokio_process::Comma... | rust | edit | 0 | 3 | mit | f4f7bb232e49ec4b671d4ba18a516b45ea6c5e15 | tokio-rs/tokio,tokio-rs/tokio | tests/smoke.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n//! Helpers to program the task state segment.\n//! See Intel 3a, Chapter 7, Section 7\n\nuse segmentation;\n\n/// In 64-bit mode the TSS holds information that is not\n/// directly related to the task-switch mechanism,\n/// but is used for f... | rust | edit | 1 | 1 | mit | 7954f0a464ba961e361b9e0a90f9b8590733f966 | phil-opp/rust-x86_64 | src/tss.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n#[cfg(test)]\nmod test {\n #[test]\n fn it_works() {\n }\n}\n\n```\n\nApply this change: Add initial Kudu FFI bindings"
},
{
"role": "assistant",
"content": "#![allow(non_camel_case_types)]\n\nuse std::os::raw::c_char;\n\... | rust | edit | 0 | 0 | apache-2.0 | 49fb6260f30e4ad40fe6a7b83bed50dc8733a319 | danburkert/kudu-rs | kudu-sys/src/lib.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nfn main() {}\n\nconst fn unsize(x: &[u8; 3]) -> &[u8] { x }\n//~^ ERROR unsizing casts are not allowed in const fn\nconst fn closure() -> fn() { || {} }\n//~^ ERROR function pointers in const fn are unstable\nconst fn closure2() {\n (|| {}... | rust | edit | 8 | 2 | apache-2.0 | 007390c21cc5e5e8705d455d20fba1df13bd7362 | graydon/rust,graydon/rust,GBGamer/rust,graydon/rust,aidancully/rust,GBGamer/rust,graydon/rust,GBGamer/rust,GBGamer/rust,aidancully/rust,aidancully/rust,graydon/rust,aidancully/rust,GBGamer/rust,graydon/rust,GBGamer/rust,aidancully/rust,GBGamer/rust,GBGamer/rust,aidancully/rust | src/test/ui/consts/min_const_fn/cast_errors.rs | rejected_lint | Too many lint violations: 8 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n// vim: tw=80\n//! A struct with a constructor method\n#![deny(warnings)]\n\nuse mockall::*;\n\npub struct A {}\n\n#[automock]\nimpl A {\n pub fn new() -> Self {\n unimplemented!()\n }\n}\n\n#[test]\nfn returning() {\n let ctx... | rust | edit | 0 | 1 | apache-2.0 | 383fb14f33927f0198a463277e9f7458df4bf2ea | asomers/mockall,asomers/mockall | mockall/tests/automock_constructor_in_struct.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n//! Define trait for vectors\n\nuse ndarray::{LinalgScalar, Array, Ix1};\nuse num_traits::float::Float;\n\n/// Methods for vectors\npub trait Vector {\n type Scalar;\n /// L-2 norm\n fn norm(&self) -> Self::Scalar;\n}\n\nimpl<A: Floa... | rust | edit | 0 | 2 | mit | 1e75543481635df8d9fe676c4723f8d37dee53fd | termoshtt/ndarray-linalg | src/vector.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nuse std::error;\nuse std::fmt::{self, Display, Formatter};\nuse std::result;\n\nuse Class;\n\npub type Result<T> = result::Result<T, Error>;\n\n#[derive(Debug, PartialEq)]\npub enum Error {\n ArgumentError(String),\n TypeError(String),\... | rust | edit | 2 | 2 | mit | 27f2a328921178af4354bce2df7b4282e6bd7136 | d-unseductable/ruru | src/result.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nextern crate hyper;\nextern crate rustc_serialize;\n\nuse rustc_serialize::json;\n\nmod state;\n\nuse hyper::server::{Server, Request, Response};\n\nfn hello(req: Request, res: Response) {\n\tlet game = state::initialState();\n\tlet encoded =... | rust | edit | 0 | 3 | mit | 6d3e9410759042880aefd4ced5866261ad2a7022 | d3k4r/aqueren | src/main.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nextern crate bio;\nuse std::io;\nuse std::cmp;\nuse bio::io::fasta;\n\nfn main() {\n let reader = fasta::Reader::new(io::stdin());\n let mut num_seqs = 0;\n let mut total = 0;\n let mut max_len = 0;\n let mut min_len = 0;\n let mu... | rust | edit | 0 | 5 | mit | 2acdacf6808c8d59448c69ae729d45fe8d8863aa | bjpop/biotool,supernifty/biotool,supernifty/biotool,bjpop/biotool,drpowell/biotool,lonsbio/biotool,biotool-paper/biotool,drpowell/biotool,drpowell/biotool,biotool-paper/biotool,supernifty/biotool,supernifty/biotool,supernifty/biotool,biotool-paper/biotool,drpowell/biotool,drpowell/biotool,biotool-paper/biotool,drpowell... | rust/src/main.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nuse clap::{App, ArgMatches};\n\nuse prelude::*;\nuse config::Config;\n\nuse commands::{react_native_xcode, react_native_gradle, react_native_codepush};\n\n\npub fn make_app<'a, 'b: 'a>(app: App<'a, 'b>) -> App<'a, 'b> {\n app.about(\"provi... | rust | edit | 1 | 3 | bsd-3-clause | 4cae3f8c4182e79726f7dbef25e3c13b0fff7d12 | getsentry/sentry-cli,getsentry/sentry-cli,getsentry/sentry-cli | src/commands/react_native.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nuse crate::internal::Array;\nuse crate::{enum_map, Enum, EnumMap};\nuse arbitrary::{Arbitrary, Result, Unstructured};\n\nimpl<'a, K: Enum<V>, V: Arbitrary<'a>> Arbitrary<'a> for EnumMap<K, V> {\n fn arbitrary(u: &mut Unstructured<'a>) -> R... | rust | edit | 0 | 2 | apache-2.0 | 613d4f937598cedecb2242a22c6d81355902ec11 | xfix/enum-map | enum-map/src/arbitrary.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n// ignore-tidy-linelength\n#![deny(broken_intra_doc_links)]\n\npub mod char {}\n\n/// See also [type@char]\n// @has intra_link_prim_precedence/struct.MyString.html '//a/@href' 'https://doc.rust-lang.org/nightly/std/primitive.char.html'\npub s... | rust | edit | 0 | 0 | apache-2.0 | bcd6fe35e0b7577de7a72114270f9c2daa431738 | graydon/rust,aidancully/rust,aidancully/rust,aidancully/rust,graydon/rust,graydon/rust,aidancully/rust,graydon/rust,aidancully/rust,aidancully/rust,graydon/rust,graydon/rust | src/test/rustdoc/intra-link-prim-precedence.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nuse value::Value;\nuse block::BasicBlock;\nuse ffi::core;\n\n/// A PHI node represents a value which is selected based on the predecessor of the current block.\npub type PhiNode = Value;\n\nimpl PhiNode {\n /// Adds an incoming value to the ... | rust | edit | 0 | 2 | bsd-3-clause | 03074c0ef71485f75c8d69f877960311304be15f | hyunsik/llvm-rust | src/phi.rs | rejected_duplicate | Near-duplicate of sample 119749 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n#![deny(clippy)]\n\n#[allow(dead_code)]\nstruct Foo;\n\nimpl Iterator for Foo {\n type Item = ();\n\n fn next(&mut self) -> Option<()> {\n let _ = self.len() == 0;\n unimplemented!()\n }\n}\n\nimpl ExactSizeIterator for... | rust | edit | 3 | 1 | apache-2.0 | dc8d29be4ac405e61b6c403b0ea09809e55b8efa | aidancully/rust,graydon/rust,aidancully/rust,aidancully/rust,aidancully/rust,graydon/rust,graydon/rust,graydon/rust,aidancully/rust,graydon/rust,aidancully/rust,graydon/rust | tests/run-pass/ice_exacte_size.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n#![no_main]\nuse arbitrary::Arbitrary;\nuse libfuzzer_sys::fuzz_target;\nuse serde::Serialize;\n\n#[derive(Arbitrary, Debug, Serialize)]\nenum Value {\n Bool(bool),\n Number(f64),\n String(String),\n Array(Vec<Value>),\n Object... | rust | edit | 0 | 0 | apache-2.0 | f65f87afe3a2208d5336b7851ab785a4b9039315 | bheisler/TinyTemplate | fuzz/fuzz_targets/render_template.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nuse std::fs::File;\nuse std::io::Read;\nuse std::mem::transmute;\nuse std::thread::sleep_ms;\nuse std::env;\n\nfn main() {\n let delay = match env::args().nth(1).and_then(|s| s.parse::<f32>().ok()) {\n Some(d) => 60.0 * d,\n ... | rust | edit | 3 | 4 | mit | 35c49af9cc0701bbc8bd1d8ccdc41855125854e5 | systemd-cron/systemd-cron-next,systemd-cron/systemd-cron-next | src/bin/boot-delay.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n//! This is a very early work-in-progress binding to various Linux Kernel APIs.\n//!\n//! It is not yet ready for use in your projects. Once version 0.1 or higher\n//! is released, you are welcome to start using it :)\n\n#![cfg(target_os=\"li... | rust | edit | 0 | 1 | mit | fb2c51c0393bb41b453869425014de38f4d18591 | Techern/linux-api-rs | src/lib.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n#![feature(plugin)]\n#![plugin(tag_safe)]\n\n// Path is relative to rustc invocation directory - package root in this case\n#[tagged_safe(print=\"tests/compile-fail/libstd_foo.txt\")]\nextern crate std as _std;\n\n#[req_safe(print)]\n#[deny(n... | rust | edit | 1 | 1 | mit | 8fc3ef130a4587e96b4319db801984d2997f9077 | thepowersgang/tag_safe | tests/compile-fail/extern.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n// min-lldb-version: 310\n\n// We have to ignore android because of this issue:\n// https://github.com/rust-lang/rust/issues/74847\n// ignore-android\n//\n// We need to use inline assembly, so just use one platform\n// only-x86_64\n\n// compi... | rust | edit | 2 | 1 | apache-2.0 | c34c77c764491460449a6bef06b2149c3ab82f2d | aidancully/rust,aidancully/rust,graydon/rust,aidancully/rust,aidancully/rust,graydon/rust,aidancully/rust,graydon/rust,graydon/rust,aidancully/rust,graydon/rust,graydon/rust | src/test/debuginfo/function-arguments-naked.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n#[deny(missing_docs)]\n\nextern crate bosun_emitter;\n#[macro_use]\nextern crate chan;\nextern crate chan_signal;\n#[macro_use]\nextern crate log;\nextern crate env_logger;\nextern crate rustc_serialize;\nextern crate toml;\n\npub mod config;... | rust | edit | 2 | 0 | mit | 4385ddf842f7b4d0219264972a71362b59cf4605 | lukaspustina/rs-collector,lukaspustina/rs-collector | src/lib.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nuse nom::be_u8;\n\nuse utility::to_u32;\n\nnamed!(header <&[u8], (u8, bool, u32)>,\n chain!(\n block_byte: be_u8 ~\n length: map!(take!(3), to_u32),\n || {\n let is_last = (block_byte >> 7) == 1;\n let block_type = bloc... | rust | edit | null | null | bsd-3-clause | ac124dc448e00b166daf296bc79f582857a4e319 | sourrust/flac | src/metadata/parser.rs | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n#![feature(use_extern_macros)]\n\nextern crate clap;\nextern crate jump;\n\nuse clap::{Arg, App, AppSettings};\nuse jump::Config;\nuse std::process;\nuse std::env;\n\nmacro_rules! exit_if_err {\n ($x:expr, $msg:expr) => (match $x {\n ... | rust | edit | 0 | 2 | mit | 655df804260f44e1f083d724a71a37e73cb371f1 | rockwotj/jump | src/bin/jump.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n/*\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nuse colored::Colorize;\nuse diff::Result::*;\n... | rust | edit | 0 | 6 | mit | e89ad9c7544e36ac0667d86d6643dce5dd05401a | wincent/relay,xuorig/relay,yungsters/relay,wincent/relay,facebook/relay,yungsters/relay,kassens/relay,facebook/relay,xuorig/relay,josephsavona/relay,facebook/relay,kassens/relay,xuorig/relay,atxwebs/relay,kassens/relay,wincent/relay,kassens/relay,atxwebs/relay,xuorig/relay,josephsavona/relay,wincent/relay,xuorig/relay,... | compiler/crates/fixture-tests/src/print_diff.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nuse std::ops::{Mul,Add};\n\n#[derive(Copy,Clone)]\npub struct Vec3<T: Mul<T, Output = T> + Add<T, Output = T> + Copy + Clone> {\n x: T,\n y: T,\n z: T,\n}\n\nimpl <T: Mul<T, Output = T> + Add<T, Output = T> + Copy + Clone> Vec3<T> {\... | rust | edit | 1 | 1 | mit | 13e009099651dd12c0bd5521672fcea74f3c793f | Chair-of-Indefinite-Studies/scratchapixel | scratchapixel/src/geometry/vector.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n// check-pass\n\n#![feature(generic_associated_types)]\n\ntrait CallWithShim: Sized {\n type Shim<'s>\n where\n Self: 's;\n}\n\n#[derive(Clone)]\nstruct ShimMethod<T: CallWithShim + 'static>(pub &'static dyn for<'s> Fn(&'s mut T:... | rust | edit | 1 | 1 | apache-2.0 | 87241e909933b30bb31af4edf58d1a331589df3c | graydon/rust,aidancully/rust,aidancully/rust,graydon/rust,aidancully/rust,aidancully/rust,graydon/rust,aidancully/rust,graydon/rust,graydon/rust,aidancully/rust,graydon/rust | src/test/ui/deriving/issue-89188-gat-hrtb.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}\n\nimpl Philosopher {\n fn new(name: &str) -> Philosopher {\n Philosopher {\n name: name.to_string()\n }\n }\n\n fn eat(&se... | rust | edit | 6 | 3 | mit | 46465e2dcd0ed4c0400b2fbc40b3829d878ea467 | juliangrosshauser/dining_philosophers | src/main.rs | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n\n#[ allow( unused_imports ) ]\nuse clone_dyn as TheModule;\n#[ allow( unused_imports ) ]\nuse test_tools::*;\n\nmod clone_dyn_test;\n\n```\n\nApply this change: Fix tests of module `clone_dyn`, test code under features"
},
{
"role": ... | rust | edit | 0 | 0 | mit | cc42f2e661eddef90290ba073af4110ee6074b9e | Wandalen/wTools,Wandalen/wTools | rust/test/derive/clone_dyn_tests.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nuse std::{io, fs};\n\nmacro_rules! readln {\n () => {\n {\n let mut line = String::new();\n match io::stdin().read_line(&mut line) {\n Ok(n) => Some(line.trim().to_string()),\n Err... | rust | edit | 5 | 7 | mit | 8961b666d789c347cf966abb50353bb4ff9bf715 | Lacaranian/redox,Lacaranian/redox,rexlunae/redox,Lacaranian/redox,Lacaranian/redox,Lacaranian/redox,rexlunae/redox,rexlunae/redox | filesystem/apps/test/test.rs | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nuse super::TheModule;\nuse TheModule::*;\nuse test_tools::*;\n\n//\n\nfn basic_test()\n{\n // test.case( \"basic\" );\n let src = vec![ 1, 2, 3 ];\n let exp = ( vec![ 2, 3, 4 ], vec![ 0, 1, 2 ] );\n let got : ( Vec< _ >, Vec< _ > ) = src.... | rust | edit | 0 | 1 | mit | 93cd82056c709f3cb9e52b8e2860109d72e58df9 | Wandalen/wTools,Wandalen/wTools | rust/test/iter/basic_test.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n\n#[test]\nfn full_interface()\n{\n}\n\n\n```\n\nApply this change: Write example with full interface"
},
{
"role": "assistant",
"content": "use std::collections::HashMap;\n\n/*\n var track = [];\n var commandWith = ( e ) => { t... | rust | edit | null | null | mit | fb5c4b6fc5e76765004967eba0fd4ce5a3833058 | Wandalen/wTools,Wandalen/wTools | rust/test/commandsaggregator/commandsaggregator.rs | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n#![feature(globs)]\n#![feature(phase)]\n#![feature(unboxed_closures)]\n#![feature(macro_rules)]\n\nextern crate regex;\n\n\npub mod parsers;\n\n#[macro_escape]\npub mod macros;\n\nmod tests;\n\nmod peruse {\n pub use parsers;\n}\n\n\n```\n... | rust | edit | 1 | 0 | mit | d6abf189b87877d6a54284825fb9efb066cd42b7 | DanSimon/peruse | src/peruse/lib.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nuse std::path::Path;\n\n#[derive(Debug, PartialEq)]\npub enum Type {\n CoffeeScript,\n JavaScript,\n JSON,\n XML,\n Ruby,\n Rust,\n ERB\n}\n\npub fn from_path(path: &Path) -> Option<Type> {\n match path.to_str() {\n ... | rust | edit | 0 | 3 | mit | ea48ba0aff50d178dc5ade0dff1b88a47854c64f | jmacdonald/scribe | src/buffer/type_detection.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n// Copyright (c) Aptos\n// SPDX-License-Identifier: Apache-2.0\n\n//! Aptos Rosetta CLI\n//!\n//! Why have an Aptos version of the Rosetta CLI?\n//!\n//! The Rosetta CLI doesn't build on my Mac easily and I just wanted something simple to tes... | rust | edit | 1 | 2 | apache-2.0 | 115847b93118a45341bca9ae3239e0e87f4e1e8e | aptos-labs/aptos-core,aptos-labs/aptos-core,aptos-labs/aptos-core,aptos-labs/aptos-core,aptos-labs/aptos-core,aptos-labs/aptos-core,aptos-labs/aptos-core | crates/aptos-rosetta-cli/src/main.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nmod drop;\n\nuse self::drop::DetectDrop;\nuse anyhow::Error;\nuse std::marker::Unpin;\nuse std::mem;\nuse std::sync::atomic::AtomicBool;\nuse std::sync::atomic::Ordering::SeqCst;\nuse std::sync::Arc;\n\n#[test]\nfn test_error_size() {\n as... | rust | edit | 5 | 1 | apache-2.0 | 95e25cf787a806eec12a672dd554a0bb612b9315 | dtolnay/anyhow | tests/test_repr.rs | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n// Copyright 2017 Dmitry Tantsur <<EMAIL>>\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// ... | rust | edit | 0 | 1 | apache-2.0 | 80fb80c9111af6eee5c1996c3bf520c4e92693b9 | dtantsur/rust-openstack,dtantsur/rust-openstack | src/utils.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\npub trait Summarizable {\n fn summary(&self) -> String {\n String::from(\"Read more...\")\n }\n}\n\npub struct NewsArticle {\n pub headline: String,\n pub location: String,\n pub author: String,\n pub content: String,... | rust | edit | 0 | 1 | mit | 1bfdb804b27ebb9ecde4ac9d638c034a446767f0 | pgrzesik/learning-rust | traits/src/lib.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n//! The [os2](https://docs.microsoft.com/en-us/typography/opentype/spec/os2) table\n\nuse font_types::Tag;\n\n/// 'os/2'\npub const TAG: Tag = Tag::new(b\"os/2\");\n\ninclude!(\"../../generated/generated_os2.rs\");\n\n```\n\nApply this change... | rust | edit | 0 | 0 | apache-2.0 | 4413b14c63b3340d2a7541171000875623812c66 | googlefonts/fontations,googlefonts/fontations | read-fonts/src/tables/os2.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nuse iron::Response;\nuse iron::modifier::Modifier;\nuse serde::Serialize;\nuse serde_json::to_string;\n\n#[derive(Clone, Debug)]\npub struct SerializableResponse<T: Serialize>(pub T);\n\nimpl<T> Modifier<Response> for SerializableResponse<T> ... | rust | edit | 0 | 1 | mit | 03ed42c85fe77e42b12d42fe7bad7a500641536d | yblein/ruma,yblein/ruma | src/modifier.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nuse {SChunks};\nuse std::io::Error;\nuse std::fs::File;\nuse std::io::Write;\n\n/// This function takes as parameter a file name and a vector of chaunks.\n/// The function will create a file, and append to the buffer each chunk.\npub fn write... | rust | edit | 1 | 3 | mit | 6fb721fd7b82262bacfc077dcab66b02e14d8282 | derniercri/snatch | src/write.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\npub enum ASN1Tag {\n Bool = 1,\n Integer = 2,\n BitString = 3,\n OctetString = 4,\n ObjectIdentifier = 6,\n PrintableString = 19,\n UTCTime = 23,\n Sequence = 48,\n}\n\n```\n\nApply this change: Use hex and show your w... | rust | edit | 0 | 0 | bsd-3-clause | 6a21170217cdea88bd0445788a59834cb2a5f20a | alex/rust-asn1,alex/rust-asn1 | src/common.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nuse std::error::Error;\nuse std::{fmt, io};\n\n/// This type represents the possible errors that can occur while\n/// sending DogstatsD metrics.\n#[derive(Debug)]\npub enum DogstatsdError {\n /// Chained IO errors.\n IoError(io::Error),... | rust | edit | 1 | 2 | mit | 34ba6fb57c18cd2c65931c04b4aa9b7b5f3c2d8d | mcasper/dogstatsd-rs | src/error.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n//! Iota\n//!\n//! A highly customisable text editor built with modern hardware in mind.\n//!\n//! This module contains all you need to create an `iota` executable.\n\n#![cfg_attr(feature=\"clippy\", feature(plugin))]\n#![cfg_attr(feature=\"c... | rust | edit | 1 | 0 | mit | e29d5b8858ae12f4ddf8a3b1d04fc631fc1ddec1 | gchp/iota | src/iota/lib.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nstruct Counter {\n count: u32\n}\n\nimpl Counter {\n fn new() -> Counter {\n Counter { count: 0 }\n }\n}\n\nimpl Iterator for Counter {\n type Item = u32;\n\n fn next(&mut self) -> Option<Self::Item> {\n self.coun... | rust | edit | 0 | 2 | mit | 39c2e0b773aab43bdc8b6b5f73e2b90d2ae562c7 | pgrzesik/learning-rust | 24_iterators/src/lib.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nmod osx;\nmod linux;\nmod windows;\n\n#[derive(Debug)]\npub struct Network {\n agr_ctl_rssi: i32,\n agr_ext_rssi: i32,\n agr_ctl_noise: i32,\n agr_ext_noise: i32,\n state: String,\n op_mode: String, \n last_tx_rate: i32,\... | rust | edit | 1 | 1 | mit | 9d190ffb44169d9f4c487dc1cdf9ee29d362be53 | camp4climber/wifi | src/scanner/mod.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n\n\nerror_chain! {\n links { }\n\n foreign_links {\n Io(::std::io::Error) #[cfg(unix)];\n }\n\n errors {\n HttpStatus(e: u32) {\n description(\"http request returned an unsuccessful status code\")\n ... | rust | edit | 0 | 0 | apache-2.0 | 2a029261551634d95a991b5b3d6265d6438088a9 | theindigamer/rustup.rs,inejge/rustup.rs,rust-lang/rustup,inejge/rustup.rs,Boddlnagg/rustup.rs,rust-lang/rustup,Boddlnagg/rustup.rs,rust-lang/rustup,nodakai/rustup.rs,Boddlnagg/rustup.rs,nodakai/rustup.rs,inejge/rustup.rs,theindigamer/rustup.rs,Boddlnagg/rustup.rs,rust-lang/rustup,theindigamer/rustup.rs,nodakai/rustup.r... | src/download/src/errors.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nuse std::error::Error;\nuse std::thread;\n\nuse ::arrayfire::*;\n\nmacro_rules! implement_handler {\n ($fn_name:ident) => {\n pub fn $fn_name(error_code: AfError) {\n match error_code {\n AfError::SUCCESS =... | rust | edit | 1 | 4 | bsd-3-clause | db321f0f0301671a0dc68e4e2d9a4cc00781f8a1 | 9prady9/arrayfire-rust,arrayfire/arrayfire-rust,arrayfire/arrayfire_rust,9prady9/arrayfire-rust,arrayfire/arrayfire-rust,arrayfire/arrayfire-rust,9prady9/arrayfire-rust,9prady9/arrayfire-rust | tests/error_handler.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n// Copyright 2017 Serde Developers\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 | 1 | 1 | apache-2.0 | a740f7677211ffdcf293e98984d7a7ddb5b4f9b8 | serde-rs/serde | test_suite/no_std/src/main.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n/// Description for new columns\n#[derive(Debug, Clone)]\npub struct ColumnDescription {\n pub name: String,\n\n // TODO: make this use one of the enums\n /// Type of the data, see the cfitsio documentation\n pub data_type: String... | rust | edit | 1 | 1 | apache-2.0 | deabbce2100cb976a5acd9f4630193c34b79b002 | mindriot101/rust-fitsio,mindriot101/rust-cfitsio,mindriot101/rust-fitsio,mindriot101/rust-fitsio,mindriot101/rust-fitsio,mindriot101/rust-fitsio,mindriot101/rust-cfitsio | fitsio/src/columndescription.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\ns! {\n pub struct sigaction {\n pub sa_flags: ::c_uint,\n pub sa_sigaction: sighandler_t,\n pub sa_mask: sigset_t,\n _restorer: *mut ::c_void,\n }\n}\n\n```\n\nApply this change: Fix undeclared type name erro... | rust | edit | 0 | 0 | apache-2.0 | 5a8485b96e41d1b62e7eb77e26d7a477a6167473 | rust-lang-nursery/libc,philippkeller/libc,cybergeek94/libc,rust-lang/libc,anatol/libc,diwic/libc,rust-lang-nursery/libc,philippkeller/libc,philippkeller/libc,rust-lang-nursery/libc,zethra/libc,diwic/libc,cactorium/libc,DiamondLovesYou/libc,diwic/libc,cactorium/libc,anatol/libc,rust-lang/libc,mneumann/libc,superriva/lib... | src/unix/notbsd/android/b64.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nextern crate hyper;\nextern crate pbr;\n\nuse std::sync::{Arc, Mutex};\n\npub mod client;\npub mod contentlength;\npub mod download;\npub mod http_version;\npub mod response;\npub mod write;\n\n/// Represents a number of bytes, as `u64`.\ntyp... | rust | edit | 1 | 0 | mit | e13f03ed6193dd7aabd2724fb3a9057066ecc429 | derniercri/snatch | src/lib.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nuse std::result;\n\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 ... | rust | edit | 2 | 1 | apache-2.0 | 9b3c2c28282f945079989948f9e83cc310dd8cb7 | mindriot101/rust-cfitsio,mindriot101/rust-cfitsio,mindriot101/rust-fitsio,mindriot101/rust-fitsio,mindriot101/rust-fitsio,mindriot101/rust-fitsio,mindriot101/rust-fitsio | fitsio/src/fitserror.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nuse ordered_float::OrderedFloat;\nuse std::ops::Sub;\nuse std::time::Duration;\nuse web_sys::window;\n\n#[derive(Copy, Clone, PartialOrd, PartialEq, Ord, Eq, Debug)]\npub struct Instant(OrderedFloat<f64>);\n\nimpl Instant {\n pub fn now() ... | rust | edit | 0 | 1 | apache-2.0 | 73cc3d1f2fdb2db8c85d6c89abdfb51a5782588d | CryZe/livesplit-core,CryZe/livesplit-core | src/platform/wasm/web/time.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nuse cocoa::base::id;\n\n/// `MTLStructType` is part of the reflection API that allows Metal framework\n/// code to query details of a struct that is passed as an argument of a Metal\n/// shading language function. You do not allocate or initi... | rust | edit | 0 | 2 | apache-2.0 | bdc47d3abf3b31d522542c6a451f7414b10e59cd | burtonageo/metl | metal-sys/src/classes/mtl_struct_type.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n#[macro_use]\nextern crate diesel;\n#[macro_use]\nextern crate diesel_codegen;\n\nextern crate dotenv;\n\npub mod schema;\npub mod models;\n\nuse diesel::prelude::*;\nuse diesel::sqlite::SqliteConnection;\nuse dotenv::dotenv;\nuse std::env;\n... | rust | edit | 3 | 1 | apache-2.0 | f35848c4eabd101be967a5a75741a00de62516b9 | diesel-rs/diesel,sgrif/diesel,sgrif/diesel,diesel-rs/diesel | src/lib.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nextern crate file_dialog;\nextern crate glfw_window;\nextern crate shader_version;\nextern crate opengl_graphics;\n\nuse file_dialog::FileDialog;\nuse glfw_window::GlfwWindow;\nuse opengl_graphics::glyph_cache::GlyphCache as Font;\nuse shader... | rust | edit | 0 | 1 | mit | ca253f70ff62929e3fc8742ea54253907d5277c7 | cybergeek94/file_dialog | examples/file_chooser.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\ntrait Persister {\n fn add_item(&self, &Item) -> i32;\n fn change_item_desc(&self, i32, &str);\n fn update_item(&self, &Item);\n fn remove_item(&self, i32);\n fn get_items(&self) -> Vec<Item>;\n}\n\n```\n\nApply this change: Re... | rust | edit | 0 | 0 | apache-2.0 | a3ab3e739095a17074169d4a697baa34edf5432d | nham/hippo | src/persist.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nuse std::os::getenv;\n\nstruct Request {\n path: ~str,\n querystring: ~str\n}\n\n\nfn main() {\n print(\"content-type: text/plain\\r\\n\\r\\n\");\n println(\"hello from rust!\");\n let req=Request{ path: getenv(\"PATH_INFO\").u... | rust | edit | null | null | bsd-3-clause | 5d6fbf05936a0fd1d58800ab1d9b9d73b4b69a8c | Earlz/rustymvc,tempbottle/rustymvc | proto/protomvc.rs | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nuse super::*;\nuse redox::*;\n\nimpl Editor {\n pub fn exec(&mut self, Inst(n, cmd): Inst) {\n use super::Mode::*;\n use super::PrimitiveMode::*;\n use super::CommandMode::*;\n match self.cursor().mode {\n ... | rust | edit | 0 | 3 | mit | e5299c9a2fec3a0e826f53374884523c17927803 | Lacaranian/redox,rexlunae/redox,Lacaranian/redox,Lacaranian/redox,rexlunae/redox,Lacaranian/redox,rexlunae/redox,Lacaranian/redox | filesystem/apps/sodium/exec.rs | rejected_duplicate | Near-duplicate of sample 120272 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nextern crate num_traits;\n#[macro_use]\nextern crate log;\n\npub mod math;\npub mod world;\n\n```\n\nApply this change: Add a short root module documentation"
},
{
"role": "assistant",
"content": "//! Functionality used by both th... | rust | edit | 1 | 0 | apache-2.0 | f151b399d960a2ed24daf59e00a62f678757b906 | adRichter/plantex,adRichter/plantex | base/src/lib.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nuse std::env;\nuse std::thread;\nuse std::collections::HashMap;\nuse std::process::Command;\n\nuse http::app::App;\n\nconst DEFAULT_APP_HOME: &'static str = \"~/.zas\";\n\npub struct AppManager {\n pub next_port: u16,\n app_home: String... | rust | edit | 3 | 2 | mit | 35265058f0d2614abc21c7202fb2cc2f2d79e19b | juanibiapina/zas,juanibiapina/zas,juanibiapina/zas | src/http/app_manager.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nuse tag::TagType;\nuse core::{mem, str, slice};\n\n\n#[repr(packed)]\npub struct BootCommandLineTag {\n\ttag_type: u32,\n\tsize: u32,\n\tstring: u8, // the first byte of the string\n}\n\nimpl BootCommandLineTag {\n\t/// Get the boot loader na... | rust | edit | 0 | 1 | apache-2.0 | f3c018453afd030f573286ec6f3bb54a16079fb0 | stallmanifold/rust-multiboot2 | src/boot_command_line.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nuse std::collections::VecDeque;\n\n#[derive(Debug)]\npub struct CircularBuffer<T> {\n buffer: VecDeque<T>,\n size: usize,\n}\n\n#[derive(Debug, PartialEq)]\npub enum Error {\n EmptyBuffer,\n FullBuffer,\n}\n\nimpl<T> CircularBuffe... | rust | edit | 1 | 3 | bsd-2-clause | 000b6286af347746d11498e60678ac677a99d5ee | gyn/exercism,gyn/exercism,gyn/exercism,gyn/exercism | rust/circular-buffer/src/lib.rs | rejected_duplicate | Near-duplicate of sample 120979 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nextern crate libc;\n\nuse std::ffi::CStr;\nuse std::os::raw::c_char;\nuse libc::size_t;\nuse libc::strncpy;\n\nmod rnc {\n #[test]\n fn add_i_i() {\n assert_eq!(\"II\", add(\"I\", \"I\"));\n }\n\n #[test]\n fn add_i_ii()... | rust | edit | 1 | 2 | mit | 6fce68a91046cd4f3824a82471dc3395d8461692 | 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//! Netherrack-specific I/O operations for Rust\n\npub mod reader;\n\npub mod writer;\n\n#[cfg(test)]\nmod test {\n\n use super::reader::NetherrackReader;\n use super::writer::NetherrackWriter;\n\n use std::io::Cursor;\n\n #[test]... | rust | edit | 1 | 1 | apache-2.0 | 90b4f4ece65a0f45e8448fb636536a63bc9ca0b6 | Techern/Netherrack | src/io/operations/mod.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n///\n/// Possible error conditions from a `try_sync()` call on the scheduler\n///\n#[derive( Clone, PartialEq, Debug)]\npub enum TrySyncError {\n /// The queue is busy, so the function has not been executed\n Busy\n}\n\n```\n\nApply thi... | rust | edit | 0 | 2 | apache-2.0 | 1dcf93dc7b0b11edfa0079f0df05615d73c371b9 | Logicalshift/desync | src/scheduler/try_sync_error.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n//! Types for the *m.room.avatar* event.\n\nuse ruma_events_macros::StateEventContent;\nuse serde::{Deserialize, Serialize};\n\nuse super::ImageInfo;\nuse crate::StateEvent;\n\n/// A picture that is associated with the room.\n///\n/// This ca... | rust | edit | 0 | 1 | mit | 0ae0a89467cda0b928919dfaa95331dc83136c64 | ruma/ruma | ruma-events/src/room/avatar.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n#![feature(plugin)]\n\n#[plugin] extern crate compile_msg;\n\n#[cfg(rare)]\ncompile_note!(\"only emitted with --cfg rate\");\n\nfn main() {\n compile_note!(\"useful information: \", 1, \" instance\");\n\n compile_warning!(\"x\");\n\n ... | rust | edit | 0 | 1 | apache-2.0 | b111838732f51cff1a74a88825ff1920c08549b8 | huonw/compile_msg | examples/basic.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n\nuse array::Array;\n\n#[derive(Copy, Clone)]\npub union MaybeUninitCopy<T>\n where T: Copy\n{\n empty: (),\n value: T,\n}\n\nimpl<T> MaybeUninitCopy<T>\n where T: Copy\n{\n /// Create a new MaybeUninit with uninitialized inter... | rust | edit | 0 | 2 | apache-2.0 | 9fc6737e1bb5048b26bf3478753cb1483017fa50 | bluss/arrayvec | src/maybe_uninit_copy.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nextern crate liquid;\n\nuse grammar::{LexicalUnit, ProductionRule, RuleComponent, Grammar};\nuse self::liquid::{Renderable, Context, Value, FilterError};\n\nstatic template : &'static str = include_str!(\"parser.liquid\");\n\npub fn generate(... | rust | edit | null | null | mit | 80c0ec7ac4045c8a7fe60020ffcb4a51788c5f92 | Shiroy/lalr_gen | src/generator.rs | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nuse std::slice;\nuse std::mem;\n\npub enum UniformPrimitiveType {\n Float,\n Int\n}\n\npub enum UniformDatumType {\n Vec1(UniformPrimitiveType),\n Vec2(UniformPrimitiveType),\n Vec3(UniformPrimitiveType),\n Vec4(UniformPrimi... | rust | edit | 2 | 2 | apache-2.0 | 3a8d90bc6d0cd14a43dc3da322e7260cd6f751d4 | kylewlacy/glitter,kylewlacy/glitter | src/uniform_data.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nextern crate silkthread_base;\nextern crate silkthread_toolkit;\n\nuse silkthread_base::basic::*;\nuse silkthread_toolkit::io::*;\n\nfn main() {\n // Start up\n let main_env = DynamicEnvironment::new();\n main_env.import(IoTools::new... | rust | edit | 0 | 3 | apache-2.0 | 37508e1e12755366edaa33708b2f0f43397a845b | Logicalshift/gossyp,Logicalshift/gossyp | src/main.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nextern crate \"pkg-config\" as pkg_config;\nuse std::os;\nuse std::old_io::{self, fs, Command};\nuse std::old_io::process::InheritFd;\n\nfn main() {\n match pkg_config::find_library(\"sass\") {\n Ok(_) => return,\n Err(_) => ... | rust | edit | null | null | mit | b27141a77ad908f15269bf503fd1a21733582dc0 | Keats/sass-sys | build.rs | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n// AsRef and AsMut allow for cheap reference-to-reference conversions.\n// Read more about them at https://doc.rust-lang.org/std/convert/trait.AsRef.html\n// and https://doc.rust-lang.org/std/convert/trait.AsMut.html, respectively.\n\n// I AM... | rust | edit | 0 | 1 | mit | dab90f7b91a6000fe874e3d664f244048e5fa342 | carols10cents/rustlings,carols10cents/rustlings | exercises/conversions/as_ref_mut.rs | rejected_duplicate | Near-duplicate of sample 120765 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\npub const NUL: u8 = 0;\npub const TAB: u8 = b'\\t';\npub const LF: u8 = b'\\n';\npub const CR: u8 = b'\\r';\npub const SPACE: u8 = b' ';\npub const ESCAPE: u8 = b'=';\npub const DEFAULT_LINE_SIZE: u8 = 128;\n\n```\n\nApply this change: Commen... | rust | edit | 0 | 0 | mit | ae794053107b3015d374f736afc934b6ef1522d8 | aswaving/yenc | src/constants.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n#[derive(Clone, Debug, PartialEq)]\npub enum Atom {\n Nil,\n True,\n False,\n}\n\n#[derive(Clone, Debug, PartialEq)]\npub enum Term {\n Atom(Atom),\n Integer(i64),\n}\n\n```\n\nApply this change: Add a user defined atom"
},
... | rust | edit | 0 | 0 | mit | 5ed7e2b588e77bcf89ed553bf4512e516a316deb | scrogson/scotty | src/term.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\nfn to_fizz_buzz(i: int) -> (int, &str) {\n let message = match i {\n _ if i % 15 == 0 => \"FizzBuzz\",\n _ if i % 3 =... | rust | edit | 0 | 5 | mit | 270ed2dcdea9f3c6d69c1b71c51cf6f0034ba7ae | liquidamber/rust-examples,liquidamber/rust-examples,liquidamber/rust-examples,liquidamber/rust-examples,liquidamber/rust-examples | p002_fizz_buzz.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nuse super::Status;\nuse crate as ion_shell;\nuse builtins_proc::builtin;\n\nmacro_rules! string_function {\n (#[$outer:meta], $method:tt) => {\n #[$outer]\n pub fn $method(args: &[small::String], _shell: &mut crate::Shell<'_>... | rust | edit | 1 | 0 | mit | fbe1b8e31397f4afaf237e74455ef1fe91cbc7a9 | redox-os/ion,redox-os/ion,redox-os/ion | src/lib/builtins/conditionals.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nuse std::fmt;\n\n#[derive(Debug)]\npub enum ErrorLevel {\n Info,\n Warning,\n Error,\n}\n\npub struct Error(pub (ErrorLevel, &'static str));\n\nimpl fmt::Display for Error {\n fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {... | rust | edit | 0 | 2 | apache-2.0 | 47c209dba656f149ae7c9e88f50124f2bd67ccc2 | Willifme/robin_core,Willifme/robin_core,Willifme/robin_core | src/error/mod.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nuse std::mem;\nuse std::slice;\n\n/// Slice from `vec[vec.len()..vec.capacity()]`\npub unsafe fn remaining_capacity_as_slice_mut<A>(vec: &mut Vec<A>) -> &mut [A] {\n slice::from_raw_parts_mut(\n vec.as_mut_slice().as_mut_ptr().offse... | rust | edit | 0 | 2 | mit | b65059812a2b366550c6622608410a5f22aebded | stepancheg/rust-protobuf,stepancheg/rust-protobuf,stepancheg/rust-protobuf | protobuf/src/misc.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nuse {HashSet};\nuse std::collections::{HashMap, RingBuf, Deque};\nuse graph::{Graph, NodeIndex, Digraph};\n\n/// Do a breadth-first search of the graph, returning the resulting breadth-\n/// first forest.\nfn bfs_forest<T, G: Graph<T>>(g: &G,... | rust | edit | 2 | 6 | mit | 7f388d551a37a12e329dadf3f692905f6038f0e3 | nham/gymnosporangium | src/traversal.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nuse std::net::TcpStream;\nuse std::io::prelude::*;\n\nfn main() {\n\tlet mut connection = TcpStream::connect(\"127.0.0.1:6667\").unwrap();\n\tlet _ = connection.write(b\"Hello World\\n\");\n\tlet mut bytes = connection.bytes();\n\tconst COMMA... | rust | edit | 5 | 6 | mit | ae65e0c8f478878477dae459b2a26aa1e8c4f47f | nickmass/rust-irc | src/main.rs | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\npub use self::client::{Client, ClientResponse};\npub use self::error::Error;\npub use self::publisher::{Publisher, PublisherStream};\npub use self::service::Service;\npub use self::subscriber::Subscriber;\n\nuse crate::rosmsg::RosMsg;\nuse cr... | rust | edit | 1 | 1 | mit | e4210a0094dc74a072039982db290857db87330e | adnanademovic/rosrust | rosrust/src/tcpros/mod.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nuse std::process::Command;\n\nfn git_hash() -> String {\n let output = Command::new(\"git\")\n .args(&[\"rev-parse\", \"--short\", \"HEAD\"])\n .output()\n .unwrap();\n String::from_utf8_lossy(&output.stdout).into()... | rust | edit | 3 | 2 | mit | 9b8382264c8b48bcd67bdb3984383fda3ce2a3c0 | autozimu/LanguageClient-neovim,autozimu/LanguageClient-neovim,autozimu/LanguageClient-neovim,autozimu/LanguageClient-neovim,autozimu/LanguageClient-neovim,autozimu/LanguageClient-neovim,autozimu/LanguageClient-neovim,autozimu/LanguageClient-neovim,autozimu/LanguageClient-neovim,autozimu/LanguageClient-neovim,autozimu/L... | build.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nextern crate ai;\n\nuse ai::agent::Agent;\nuse ai::environment::Environment;\nuse ai::environment::CoinFlip;\nuse ai::random::RandomImpl;\nuse ai::types::{Action, Observation, Reward};\n\n// Without this, cargo test warns that \"main\" is unu... | rust | edit | 0 | 3 | mit | 44f7fe9ea2942c9c5a6b0606eef7b5d6292a1cf5 | dinowernli/marvin | src/main.rs | accepted | null | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.