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#[macro_export]\nmacro_rules! bson {\n ([$($val:tt),*]) => {{\n let mut array = Vec::new();\n\n $(\n array.push(bson!($val));\n )*\n\n $crate::Bson::Array(array)\n }};\n\n ([$val:expr]) => {{\n ...
rust
edit
0
0
mit
73a4c4a76c2724c222fe63ca7b966edd39e743e0
zonyitoo/bson-rs,thijsc/bson-rs,kyeah/bson-rs
src/macros.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n/// Doc-test test\n/// ```rust\n/// assert!(cargo_miri_test::make_true());\n/// ```\npub fn make_true() -> bool {\n issue_1705::use_the_dependency();\n issue_1691::use_me()\n}\n\n```\n\nApply this change: Use the `issue-1567` dependency...
rust
edit
0
1
apache-2.0
51c6f51c36b95420d9748b0d9d372ccbbaafc93d
rust-lang/miri,rust-lang/miri,rust-lang/miri,rust-lang/miri
test-cargo-miri/src/lib.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nextern crate toml;\nuse config::Config;\n\npub struct Workflow {\n config: Config,\n}\n\npub fn new() -> Workflow {\n let config = load_config();\n Workflow {\n config: config,\n }\n}\n\nfn load_config() -> Result<Config, S...
rust
edit
0
2
mit
294bd496c7126c78f99cdffaf1788f4b3cce2669
dorayakikun/alfred_jira_workflow
src/workflow.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n// Copyright 2020 Google LLC\n//\n// Use of this source code is governed by an MIT-style license that can be found\n// in the LICENSE file or at https://opensource.org/licenses/MIT.\n\nuse std::path::Path;\n\npub fn flags<P>(path: P) -> std::...
rust
edit
0
4
mit
d0917a9ae7db1bce84c636a3a4e5c02c44c09af1
google/rrg
src/fs/linux.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n#[derive(Copy, Clone, PartialEq, Eq)]\npub struct CachedStateFlags(u32);\n\nimpl CachedStateFlags {\n const MASK_IS_32: u32 = 1 << 0;\n const MASK_SS32: u32 = 1 << 1;\n const MASK_CPL3: u32 = 1 << 2;\n const MASK_FLAT_SEGS: u32 = ...
rust
edit
0
1
bsd-2-clause
2809b8f15836eff03877320fd918b47f19c530c8
copy/v86,copy/v86,copy/v86,copy/v86,copy/v86,copy/v86,copy/v86
src/rust/state_flags.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse hyper::header::{CONTENT_LENGTH, CONTENT_TYPE};\nuse hyper::{Request, Body, client::Client};\n\nuse crate::errors::RequestError;\n\n#[derive(Clone, Debug)]\npub struct Action(String);\n\nimpl Action {\n pub fn new(action: &str) -> Actio...
rust
edit
0
5
mit
2e62d676c2fc62129f1cf6d0c93981b9a38c39d7
SBSTP/rust-igd,SBSTP/rust-igd
src/aio/soap.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nextern crate dsfmt;\nextern crate test;\n\nuse test::Bencher;\n\nuse std::rand::{Rng, SeedableRng, Isaac64Rng, XorShiftRng};\nuse dsfmt::DSFMTRng;\n\n#[bench]\nfn bench_mt19937_1_000_000_rands(b: &mut Bencher){\n let mut rng: DSFMTRng = Se...
rust
edit
null
null
bsd-3-clause
2ff4f3e46d999e001ebb27da6029bf0e1bacb56d
Grieverheart/dsfmt-rs
benches/bench.rs
rejected_syntax
Syntax error detected by tree-sitter
false
[ { "role": "user", "content": "Here is the current file:\n```rust\npub fn compile(sass: String, style: &str) -> String {\n let parsed = SassReader::new(sass).parse();\n match style {\n \"nested\" => nested(parsed),\n \"compressed\" => compressed(parsed),\n \"expanded\" => exp...
rust
edit
0
2
mit
05d263bcba35b7f229462dc519cedaa67b387a86
carols10cents/sassers
src/lib.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n//! An implementation of [FLAC](https://xiph.org/flac), free lossless audio\n//! codec, written in Rust.\n//!\n//! The code is available on [GitHub](https://github.com/sourrust/flac).\n//!\n//! # Examples\n//!\n//! Basic decoding from a file....
rust
edit
1
0
bsd-3-clause
2d24d4d1ab14f99d72461c2cef52c21dab9d88c9
sourrust/flac
src/lib.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n#[derive(Default)]\npub struct Rsp {\n _dummy: i32\n}\n\nimpl Rsp {\n // TODO: Read general regs\n pub fn read_status_reg(&self) -> u32 {\n 0 // TODO: Properly implement this\n }\n}\n\n```\n\nApply this change: Make Rsp a u...
rust
edit
0
1
apache-2.0
9e3c9bdafa5b89ae8efc64f2948d2baf431177f1
yupferris/rustendo64,birkenfeld/rustendo64,bb2000/rustendo64
src/rsp.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse std::collections::HashMap;\n\nfn main() {\n let mut scores = HashMap::new();\n scores.insert(String::from(\"Blue\"), 10);\n scores.insert(String::from(\"Yellow\"), 50);\n\n let teams = vec![String::from(\"Blue\"), String::from...
rust
edit
0
3
mit
bf8cb9108682618e28d5cf69f090780e45d63fa8
pgrzesik/learning-rust
18_hash_maps/src/main.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse engine::World;\n\npub struct Game {\n pub world: World,\n}\n\nimpl Game {\n\n pub fn new() -> Game {\n Game {\n world: World::new(),\n }\n }\n\n pub fn step(&mut self) {\n\n }\n\n}\n\n```\n\nApply t...
rust
edit
0
1
bsd-3-clause
9bfab47a21c9c5522ded6d60b65e7e22e4f8e6be
jgilchrist/rslike
src/engine/game.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse std::iter::FromIterator;\n\n#[derive(PartialEq, Debug)]\npub struct RibonucleicAcid(String);\n\nimpl RibonucleicAcid {\n pub fn new(rna: &str) -> RibonucleicAcid {\n RibonucleicAcid(rna.into())\n }\n}\n\nimpl FromIterator<cha...
rust
edit
0
2
mit
b3877f8314e9ec60e95a84d7b1cf5e9c9e7ce7d0
attilahorvath/exercism-rust
rna-transcription/src/lib.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse crate::rc::Rc;\nuse crate::sync::Arc;\nuse core::panic::{RefUnwindSafe, UnwindSafe};\n\n// not covered via the Shared impl above b/c the inner contents use\n// Cell/AtomicUsize, but the usage here is unwind safe so we can lift the\n// imp...
rust
edit
0
0
apache-2.0
701e3a45a9b8d2eb32be1c44ac3ef780abb4075f
graydon/rust,aidancully/rust,graydon/rust,aidancully/rust,aidancully/rust,aidancully/rust,aidancully/rust,graydon/rust,graydon/rust,graydon/rust,aidancully/rust,graydon/rust
library/alloc/src/panic.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nmod array;\npub mod date_and_time;\npub mod floats;\nmod integers;\nmod primitives;\n#[cfg(feature = \"uuid\")]\nmod uuid;\n\n#[doc(hidden)]\npub mod sql_types {\n #[derive(Debug, Clone, Copy, Default)] pub struct Oid;\n #[derive(Debug,...
rust
edit
1
0
apache-2.0
75a68c772d5be9e512a2450a34c7e137259e87a6
diesel-rs/diesel,mcasper/diesel,diesel-rs/diesel,sgrif/diesel,cascalheira/diesel,sgrif/diesel,cascalheira/diesel,mcasper/diesel
diesel/src/pg/types/mod.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n//! Traits for converting to and from Perl scalars.\n\nuse std::fmt::Display;\nuse raw;\nuse SV;\n\n/// Fast unsafe conversion from raw SV pointer.\npub trait FromSV {\n /// Perform the conversion.\n unsafe fn from_sv(pthx: raw::Interpr...
rust
edit
2
3
bsd-2-clause
1096ab9e1378fa7a4b4dff9b378ed3b8adfc546b
vickenty/perl-xs,vickenty/perl-xs
src/convert.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nfn main() {\n println!(\"cargo:rustc-link-search=framework=/usr/local/opt/qt5/Frameworks\");\n println!(\"cargo:rustc-link-lib=c++\");\n}\n\n```\n\nApply this change: Make the QT location more dynamic" }, { "role": "assistant", ...
rust
edit
0
2
apache-2.0
c370b59753df16908a32a1d0a0bd3e5deb5bb919
w4tson/early-tea
build.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nextern crate rand;\nuse rand::Rng;\nuse std::env;\n\nconst CYPHERBYTES: usize = 32;\n\nfn main() {\n let args: Vec<_> = env::args().collect();\n if args.len() != 2 {\n println!(\"usage: {} file-to-encrypt\", args[0]);\n re...
rust
edit
0
4
unlicense
622c2f1e0cf8eae161f94f3022694332e1f75495
veorq/oee
oee.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n\n// use std::fmt::Debug;\n\n// pub fn insertion_sort<T: Debug>(array: &mut Vec<T>) {\npub fn insertion_sort(array: &mut Vec<f64>) {\n let n = array.len();\n\n if n > 1 {\n println!(\" simplesorts::insertion_sort(): N = {:?}\",...
rust
edit
0
2
bsd-3-clause
b4ea51198b400b0424b4d502b529120ff18294a9
nbigaouette/rust-sorting,nbigaouette/rust-sorting,nbigaouette/rust-sorting
src/simplesorts.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage schedule\n\nimport (\n\t\"testing\"\n)\n\nfunc TestGetRandomNumber(t *testing.T) {\n\tvar tests = []struct {\n\t\tmin int\n\t\tmax int\n\t}{\n\t\t{0, 0},\n\t\t{0, 1},\n\t\t{1, 1},\n\t\t{0, 10},\n\t\t{10, 20},\n\t}\n\tfor _, test := rang...
go
edit
3
4
mit
4435b29446381f14924a3608bb404194ea85c1f3
0xfoo/punchcard
schedule/random_test.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nextern crate tokio_core;\n\nuse rusoto_credential::{InstanceMetadataProvider, ProvideAwsCredentials};\nuse std::time::Duration;\nuse tokio_core::reactor::Core;\n\n#[test]\n#[ignore]\nfn it_fetches_basic_role() {\n // set env vars to point ...
rust
edit
0
3
mit
14d40f3873d8bc9dca69052c878c0d2ce5665707
DualSpark/rust-aws,DualSpark/rusoto,rusoto/rusoto,rusoto/rusoto,DualSpark/rust-aws,DualSpark/rusoto,rusoto/rusoto,DualSpark/rust-aws,DualSpark/rusoto
rusoto/credential/tests/instance-profile-test.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
null
null
apache-2.0
7331f5d649709a15070ef77dcd4ae309d31a4aeb
BurntSushi/regexp,BurntSushi/regexp,BurntSushi/regexp,BurntSushi/regexp
src/test/mod.rs
rejected_syntax
Syntax error detected by tree-sitter
false
[ { "role": "user", "content": "Here is the current file:\n```rust\n// STD Dependencies -----------------------------------------------------------\nuse std::fs::File;\n\n\n// Internal Dependencies ------------------------------------------------------\nuse super::{Chunk, Track};\n\n\n// Audio Writer Trait --...
rust
edit
0
2
apache-2.0
076232f8ae181ee3a83af8cc3e7c14d68c661263
BonsaiDen/discord-bot
src/audio/recorder/writer.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n// Copyright 2013 The Servo Project Developers. See the COPYRIGHT\n// file at the top-level directory of this distribution.\n//\n// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or\n// http://www.apache.org/licenses/LICENSE-2...
rust
edit
2
1
apache-2.0
146c460c4d249a8cc9ca95d6617bfb1cfcbc9fa8
mrobinson/rust-layers,glennw/rust-layers
scene.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse getopts::{getopts};\nuse help;\n\nfn verify_command(command: &str) -> bool {\n match command {\n \"new\" => true,\n \"open\" => true,\n _ => false\n }\n}\n\nfn run_command(command: &str) {\n println!(\"...
rust
edit
1
5
mit
32ceba8d73c11d879415200d97dca37dec0b4fac
brianp/muxed,brianp/muxed
src/initializer.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n#![crate_name = \"foo\"]\n\n#![feature(staged_api)]\n\n#[stable(feature = \"bar\", since = \"OLD 1.0\")]\npub trait Bar {}\n\n#[stable(feature = \"baz\", since = \"OLD 1.0\")]\npub trait Baz {}\n\npub struct Foo;\n\n// @has foo/trait.Bar.html...
rust
edit
1
0
apache-2.0
5ab4d46e9ada163f7f6025500313d2b51c87f657
graydon/rust,graydon/rust,graydon/rust,aidancully/rust,graydon/rust,aidancully/rust,aidancully/rust,aidancully/rust,aidancully/rust,aidancully/rust,graydon/rust,graydon/rust
src/test/rustdoc/implementor-stable-version.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n // aux-build:priv_dep.rs\n // aux-build:pub_dep.rs\n // compile-flags: --extern-private priv_dep\n#![deny(exported_private_dependencies)]\n\n// This crate is a private dependency\nextern crate priv_dep;\n// This crate is a public dependenct\...
rust
edit
0
1
apache-2.0
a05bfc6aeb8e5be70d15b3296cd4ba68d3578e01
aidancully/rust,aidancully/rust,aidancully/rust,graydon/rust,graydon/rust,aidancully/rust,aidancully/rust,graydon/rust,aidancully/rust,graydon/rust,graydon/rust,graydon/rust
src/test/ui/privacy/pub-priv-dep/pub-priv1.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n#![feature(associated_consts)]\n#![feature(type_ascription)]\n#![feature(use_extern_macros)]\n#![allow(plugin_as_library)]\n\n#[macro_use]\nextern crate tapioca;\n\ninfer_api!(httpbin, \"https://raw.githubusercontent.com/OJFord/tapioca/master...
rust
edit
0
3
mit
2c3d47be8d4658b12b75c06f51544eebb2b4ca3a
OJFord/tapioca
tests/status.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n// Copyright (c) 2016, Matthew O'Connor\nextern crate system_zero_core;\n\nuse std::io;\nuse std::io::{BufRead, Write};\nuse system_zero_core::*;\nuse system_zero_core::ast::*;\n\nconst PROMPT: &'static str = \"> \";\n\nfn prompt() -> () {\n ...
rust
edit
0
5
isc
d30a08f11a5d2907bebf9d262a5decf110b64334
oconnor0/system-zero
szi/src/main.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nextern crate rand;\n\nuse std::io;\nuse std::cmp::Ordering;\nuse rand::Rng;\n\nfn main() {\n println!(\"Hello in my guessing game!\");\n\n let secret_number = rand::thread_rng().gen_range(1, 101);\n\n println!(\"The secret number is:...
rust
edit
0
3
mit
d758c3d1a2a27e6e8ef54a7e7e71d1c01798fb85
pgrzesik/learning-rust
guessing_game/src/main.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n#[macro_use] extern crate match_any;\n\nuse std::any::Any;\n\nfn make_any<T: Any>(value: T) -> Box<Any> {\n Box::new(value)\n}\n\n#[test]\nfn empty() {\n match_any!(make_any(10) => \n x: i32 => { \n assert_eq!(*x, 10);...
rust
edit
0
1
mit
4864958aefdcaf77e3c5532a948ca40146934389
DarkEld3r/match_any
tests/main.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n//! The distrib module provides methods for executing the rendering in a\n//! distributed environment across multiple nodes. The worker module provides\n//! the Worker which does the actual job of rendering a subsection of the image.\n//! The...
rust
edit
4
1
mit
612a9f91ec1772151670a5795d6b1cb7e144e9dc
Twinklebear/tray_rust
src/exec/distrib/mod.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nextern crate json;\nextern crate tiled;\n\nextern crate cgmath;\n#[macro_use]\nextern crate gfx;\nextern crate specs;\nextern crate genmesh;\nextern crate gfx_device_gl;\nextern crate gfx_window_glutin;\nextern crate glutin;\nextern crate ima...
rust
edit
1
2
apache-2.0
0e519b65523c20e7f80ef0904eb7f9cf0d7fe295
Laastine/zombie-shooter,Laastine/zombie-shooter
src/main.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n// Ok, here are a bunch of values-- some are `Strings`, some are `&strs`. Your\n// task is to call one of these two functions on each value depending on what\n// you think each value is. That is, add either `string_slice` or `string`\n// befo...
rust
edit
0
1
mit
dbad16021cec2a842f5c8d6b9a28ba2039044cb8
ddevlin/rustlings,shaneutt/rustlings,StrongGoat/rustlings,carols10cents/rustlings,carols10cents/rustlings
strings/strings3.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nextern crate rand;\n\nuse rand::Rng;\nuse std::io;\n\nenum Card {\n ClubsAce,\n ClubsTen,\n ClubsKing,\n ClubsQueen,\n ClubsJack,\n ClubsNine,\n ClubsEight,\n ClubsSeven,\n SpadesAce,\n SpadesTen,\n SpadesKing...
rust
edit
0
3
mit
998b9161811cdf69a9f5aa437ae48bcc65a9489f
wahn/Rust_Examples
skat/src/main.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nmacro_rules! toml_template {\n ($name: expr) => {\nformat_args!(r##\"\n[package]\nname = \"{0}-fuzz\"\nversion = \"0.0.1\"\nauthors = [\"Automatically generated\"]\npublish = false\n\n[package.metadata]\ncargo-fuzz = true\n\n[dependencies....
rust
edit
4
0
apache-2.0
ccad93b3107928404bc60ca5749b6f4f642110bc
rust-fuzz/cargo-fuzz
src/templates.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse cell_gc;\nuse parser::parse;\nuse std::io::{self, Write};\nuse vm;\n\npub fn repl() -> io::Result<()> {\n cell_gc::with_heap(|hs| {\n let env = vm::Value::default_env(hs);\n\n loop {\n {\n let st...
rust
edit
2
5
mit
b3f71c829c47157ba38831017cbeffaf04df2e02
jorendorff/cell-gc,jorendorff/cell-gc
lisp/src/repl.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nextern crate image;\nextern crate libc;\nextern crate rust_resemble as resemble;\n\nuse libc::{c_double, size_t};\nuse image::load_from_memory;\nuse std::mem::forget;\n\n#[no_mangle]\npub extern \"C\" fn compare_images(img1: *const u8,\n ...
rust
edit
0
1
mit
035c9c6d94db320a7cc820eb50cedd5c3e0f44d0
danylaporte/node-rust-resemble,danylaporte/node-rust-resemble
src/lib.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n// Dummy main library\n// not_tested\n#[allow(dead_code)]\n#[cfg(not(test))]\n\nfn main() {\n}\n\n```\n\nApply this change: Check that source files are covered by Cargo.toml\n\nCloses https://github.com/Hoverbear/rust-rosetta/issues/236" },...
rust
edit
null
null
unlicense
a6f0d969307f70b1d0894c2ecfc6dac1800acdc4
magum/rust-rosetta,crr0004/rust-rosetta,ghotiphud/rust-rosetta,magum/rust-rosetta,Hoverbear/rust-rosetta,ZoomRmc/rust-rosetta,sakeven/rust-rosetta,crespyl/rust-rosetta,pfalabella/rust-rosetta,JIghtuse/rust-rosetta
src/lib.rs
rejected_syntax
Syntax error detected by tree-sitter
false
[ { "role": "user", "content": "Write rust code for the following: Bring code over from prototype, rename DontCare -> Head in recursive case, export types + traits" }, { "role": "assistant", "content": "pub struct Nil;\npub struct Cons<H, T>(pub H, pub T);\n\n#[allow(dead_code)]\npub enum Here {}\...
rust
new_file
0
2
mit
a1cfd237dd1c2e55d2ef9ee775c570b0830b2eba
Sgeo/hlist
src/lib.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n#![feature(const_fn)]\n#![no_main]\n#![no_std]\n\nextern crate common;\nextern crate support;\nextern crate hil;\nextern crate process;\nextern crate platform;\n\nmod sched;\n\npub mod syscall;\n\n#[allow(improper_ctypes)]\nextern {\n stat...
rust
edit
3
4
apache-2.0
16fb387bc3fe563f3cf09eb4d3d92ae29026f91a
google/tock-on-titan,google/tock-on-titan,google/tock-on-titan
src/main/main.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse std::convert::From;\n\nuse types::Value;\nuse binding::fixnum::{int_to_num, num_to_int};\n\nuse super::traits::Object;\n\n/// `Fixnum`\n#[derive(Debug, PartialEq)]\npub struct Fixnum {\n value: Value\n}\n\nimpl Fixnum {\n /// Create...
rust
edit
null
null
mit
58b8818e4e520e8ef920944ec32657796ed1599d
d-unseductable/ruru
src/class/fixnum.rs
rejected_code_smell
Internal duplication: ~126% of the file is inside repeated 12+ line blocks
null
[ { "role": "user", "content": "Here is the current file:\n```rust\n#[link(name = \"rusthttpserver\",\n vers = \"0.1-pre\",\n uuid = \"d2ad8df0-547a-4ce1-99c6-a9da3b98fb3e\",\n url = \"\")];\n\n#[comment = \"Rust HTTP server\"];\n#[license = \"MIT/ASL2\"];\n#[crate_type = \"lib\"];\n\n#[deny...
rust
edit
null
null
apache-2.0
550b5b6dcffb1ca1cbb7d8c9d5170cd3d01cce82
servo/rust-http,servo/rust-http,Shraddha512/rust-http,servo/rust-http,chris-morgan/rust-http,Shraddha512/rust-http,Shraddha512/rust-http,Shraddha512/rust-http,chris-morgan/rust-http,chris-morgan/rust-http,Shraddha512/rust-http,chris-morgan/rust-http,servo/rust-http
src/libhttp/lib.rs
rejected_syntax
Syntax error detected by tree-sitter
false
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse ::bot::{Bot, Node, RoomEvent};\n\n\npub struct Join;\n\nimpl Join {\n pub fn new() -> Self {\n Join\n }\n}\n\nimpl<'a> Node<'a> for Join {\n fn handle(&mut self, bot: &Bot, event: RoomEvent) {\n let body = &event.ra...
rust
edit
0
4
mit
e3a4e20e48cf9adc4be701af77259353d73544bf
jpypi/rustix
src/services/membership.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n//! Generic interface to secret storage backends.\n\nuse std::error;\n\n/// A generic error type which can contain any error caused by any of the\n/// libraries we call. This is used by our backend APIs for simplicity and\n/// extensibility,...
rust
edit
1
1
cc0-1.0
2f65da5cca0670b3d756abbe56b11dd368d63945
emk/credentials
src/backend.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse std::rand::random;\n\n/// Test helper to standardize how random files and directories are generated.\npub fn random_name() -> String {\n format!(\"test_{}\", random::<f64>())\n}\n\n\n```\n\nApply this change: Add a method to quickly cl...
rust
edit
0
2
mit
6e361e6eca051bc3f0e50d7439e41e59be29bad8
brianp/muxed,brianp/muxed
src/test_helper.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n\n#[ allow( unused_imports ) ]\nuse wpublisher as TheModule;\n\nmod inc;\n\n```\n\nApply this change: Fix tests of utility `wpublisher`, setup tests under features" }, { "role": "assistant", "content": "\n#[ allow( unused_imports ...
rust
edit
0
0
mit
93348dd720c8386e94a876554d594a9a06be761f
Wandalen/wTools,Wandalen/wTools
rust/test/publisher/wpublisher_tests.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nextern crate iron;\nextern crate rustc_serialize;\n\nuse iron::prelude::*;\nuse iron::status;\nuse diesel::prelude::*;\nuse rustc_serialize::json;\nuse database;\n\npub fn index(request: &mut Request) -> IronResult<Response> {\n println!(\...
rust
edit
0
1
mit
1e491c18ed2c5fe0c8c79d13d37a9adda7efc872
rlustin/lugh,rlustin/lugh,rlustin/lugh
src/api.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n// Copyright 2014 Michael Yang. All rights reserved.\n// Use of this source code is governed by a MIT-style\n// license that can be found in the LICENSE file.\n#![feature(concat_idents)]\n#![feature(libc)]\n\n//! BLAS bindings and wrappers.\n...
rust
edit
1
0
mit
eae94f8f6143521e3873d128eb4e673c212afe84
raineszm/rust-blas,mikkyang/rust-blas
src/lib.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse std::io::Write;\nuse std::process::Command;\n\nconst FORTUNE: &str = \"fortune\";\n\nfn main() {\n println!(\"[FORTUNE COOKIE]\");\n println!(\"{}\", fortune());\n}\n\n/// Get a fortune cookie.\nfn fortune() -> String {\n let out...
rust
edit
0
3
mit
7d5bb8da8fb3f4f1d2c2e6eee681fbb18fe89c8f
dcoles/experiments,dcoles/experiments,dcoles/experiments,dcoles/experiments
src/main.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n// Copyright 2020 Google LLC\n//\n// Use of this source code is governed by an MIT-style license that can be found\n// in the LICENSE file or at https://opensource.org/licenses/MIT.\n\nuse std::fs::File;\n\nuse log::{error, info};\n\nuse rrg:...
rust
edit
0
2
mit
b90c96f53022600bc6bbfe3a88823e956cc58047
google/rrg
src/main.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse query_source::Table;\n\n/// Sets the limit clause of a query. If there was already a limit clause, it\n/// will be overridden. This is automatically implemented for the various query\n/// builder types.\npub trait LimitDsl {\n type Out...
rust
edit
0
3
apache-2.0
0ba12d4d39360d11f34d00b829bd166b0a22187e
diesel-rs/diesel,sgrif/diesel,sgrif/diesel,diesel-rs/diesel
diesel/src/query_dsl/limit_dsl.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n#![crate_id=\"cargo-git-checkout\"]\n\nextern crate cargo;\nextern crate serialize;\nextern crate hammer;\nextern crate url;\n\nuse hammer::FlagConfig;\nuse cargo::{execute_main_without_stdin,CLIResult,CLIError,ToResult};\nuse cargo::sources:...
rust
edit
null
null
apache-2.0
46164bc53c7f3c2c5c0717905f82667ae1d3ed23
erickt/cargo,erickt/cargo
src/bin/cargo-git-checkout.rs
rejected_syntax
Syntax error detected by tree-sitter
false
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse leveldb::management::*;\nuse leveldb::options::*;\nuse utils::{open_database,tmpdir};\n\n#[test]\nfn test_destroy_database() {\n let tmp = tmpdir(\"destroy\");\n let database = open_database::<i32>(tmp.path(), true);\n drop(datab...
rust
edit
0
1
mit
03d7c5f0b594b492dd5bd80e756388f847039e3c
skade/leveldb,alekseysidorov/leveldb,alekseysidorov/leveldb
tests/management.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse std::vec::Vec;\n\nuse engine::Actor;\n\npub struct World {\n actors: Vec<Actor>,\n}\n\nimpl World {\n\n pub fn new() -> World {\n World {\n actors: Vec::new(),\n }\n }\n \n}\n\n```\n\nApply this change...
rust
edit
0
1
bsd-3-clause
045a7a6083ec3432ea411bd2b90333d49549598b
jgilchrist/rslike
src/engine/world.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse godcoin::{constants::MAX_TX_SIGNATURES, prelude::*};\n\npub mod minter;\npub use minter::*;\n\npub fn get_asset(grael: &str) -> Asset {\n grael.parse().unwrap()\n}\n\npub fn create_tx_header(fee: &str) -> Tx {\n let expiry = godcoin...
rust
edit
1
3
mit
a82683a2e51fce2adf6e57bcbf8ba78db0bbeb2f
godcoin/godcoin,godcoin/godcoin,godcoin/godcoin,godcoin/godcoin,godcoin/godcoin
crates/server/tests/common/mod.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse mio::*;\n\nuse super::selector::{EventHandler,Selector};\nuse super::tunnel_server::TunnelServer;\n\nconst TAG: &'static str = \"Relay\";\n\npub struct Relay {\n port: u16,\n}\n\nimpl Relay {\n pub fn new(port: u16) -> Relay {\n ...
rust
edit
2
2
apache-2.0
f68b69f37b05b5d6e1b2dcb4202f06bd4b76b98d
WPO-Foundation/gnirehtet,WPO-Foundation/gnirehtet,Genymobile/gnirehtet,WPO-Foundation/gnirehtet,WPO-Foundation/gnirehtet,Genymobile/gnirehtet,Genymobile/gnirehtet
rustrelay/src/relay/relay.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\npub fn is_valid(id: &str) -> bool {\n // check the length\n if id.len() < 2 {\n return false;\n }\n\n let mut index: u32 = 0;\n let mut number: Vec<u32> = Vec::new();\n\n for c in id.chars().rev() {\n if c.is_w...
rust
edit
0
8
bsd-2-clause
3937ee938b3de9e5d20bdcf21f79f44563f57b47
gyn/exercism,gyn/exercism,gyn/exercism,gyn/exercism
rust/luhn/src/lib.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse std::slice;\n\nuse ruby_sys::string;\n\nuse types::Value;\nuse util;\n\npub fn new(string: &str) -> Value {\n let str = util::str_to_cstring(string);\n\n unsafe { string::rb_str_new_cstr(str.as_ptr()) }\n}\n\npub fn from_value(value...
rust
edit
1
1
mit
aff9f0c2645dc5195c32a9d56c06a748769b417f
d-unseductable/ruru
src/binding/string.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n#![cfg_attr(feature = \"serde_derive\", feature(proc_macro))]\n\n#[cfg(feature = \"serde_derive\")]\n#[macro_use]\nextern crate serde_derive;\n\nextern crate serde;\nextern crate serde_json;\n\n#[cfg(feature = \"serde_derive\")]\ninclude!(\"m...
rust
edit
0
0
apache-2.0
bdba6fc5b08397d7647046d037dd9f991532bef3
serde-rs/serde
examples/serde-syntex-example/src/main.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n#![feature(phase)]\n#![crate_type=\"staticlib\"]\n#![no_std]\n\nextern crate core;\nextern crate zinc;\n\nuse core::option::Some;\nuse zinc::hal::k20::pin;\nuse zinc::hal::pin::GPIO;\nuse zinc::hal::cortex_m4::systick;\n\n/// Wait the given n...
rust
edit
0
3
apache-2.0
667ea065d58b381d5de4bcf5643143ba4280b40d
hackndev/zinc,mcoffin/zinc,farcaller/zinc,troplin/zinc,phil-opp/zinc,posborne/zinc,0xc0170/zinc,ryankurte/zinc,phil-opp/zinc,troplin/zinc,dirvine/zinc,farcaller/zinc,dirvine/zinc,dirvine/zinc,dirvine/zinc,hackndev/zinc,gapry/zinc,ntwyman/zinc,flxo/zinc,hugwijst/zinc,ryankurte/zinc,ntwyman/zinc,tempbottle/zinc,hackndev/...
apps/app_blink_k20.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\npub trait PerfLogger: Send + Sync {\n type ...
rust
edit
0
2
mit
3cd05797c4cc3324f28cc21ff34d3682aea9641f
kassens/relay,xuorig/relay,josephsavona/relay,atxwebs/relay,atxwebs/relay,wincent/relay,xuorig/relay,voideanvalue/relay,facebook/relay,voideanvalue/relay,kassens/relay,atxwebs/relay,kassens/relay,atxwebs/relay,wincent/relay,wincent/relay,facebook/relay,yungsters/relay,kassens/relay,xuorig/relay,josephsavona/relay,faceb...
compiler/crates/common/src/perf_logger.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
0
apache-2.0
21e53319a3ef1719dfda85023e082c0e9d749205
edunham/regex,golddranks/regex,rust-lang-nursery/regex,rust-lang/regex,SeanRBurton/regex,rust-lang/regex,rust-lang/regex,golddranks/regex,rust-lang-nursery/regex,rust-lang-nursery/regex,bluss/regex,SeanRBurton/regex,edunham/regex,SeanRBurton/regex,rust-lang/regex,golddranks/regex,rust-lang-nursery/regex,rust-lang/regex...
regex_macros/tests/test_dynamic.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n//! Intrinsics for panic handling\n\nuse interrupt;\n\n#[lang = \"eh_personality\"]\npub extern \"C\" fn eh_personality() {}\n\n/// Required to handle panics\n#[lang = \"panic_fmt\"]\n#[no_mangle]\npub extern \"C\" fn rust_begin_unwind(fmt: :...
rust
edit
1
1
mit
eadade4c0f4ba4e4aebe6b298f5470af1cecc64f
redox-os/kernel,redox-os/kernel,AleVul/kernel,redox-os/kernel,AleVul/kernel
src/panic.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
null
null
apache-2.0
db726faf324c9258c3e93f15d41ada4f9d008f66
philyoon/rust,TheNeikos/rust,pelmers/rust,zachwick/rust,jashank/rust,GBGamer/rust,pelmers/rust,GBGamer/rust,ruud-v-a/rust,victorvde/rust,KokaKiwi/rust,sae-bom/rust,carols10cents/rust,zachwick/rust,kwantam/rust,andars/rust,andars/rust,AerialX/rust-rt-minimal,graydon/rust,dwillmer/rust,vhbit/rust,nwin/rust,miniupnp/rust,...
src/test/parse-fail/obsolete-proc.rs
rejected_syntax
Syntax error detected by tree-sitter
false
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse std::collections::HashMap;\n\nuse juniper::{self, InputValue, ToInputValue, GraphQLType, FromInputValue};\n\n#[derive(GraphQLEnum, Debug, PartialEq)]\n#[graphql(name=\"Some\", description=\"enum descr\")]\nenum SomeEnum {\n Regular,\n\n ...
rust
edit
1
1
bsd-2-clause
359b348b973721cb62da63c3c210e687e237fe48
mhallin/juniper,graphql-rust/juniper
juniper_tests/src/codegen/enums.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\npub enum Direction {\n Forward,\n Backward,\n}\n\npub fn transform(data: &mut [f64], _: Direction) {\n let n = data.len();\n if n < 2 || n & (n - 1) != 0 {\n panic!(\"the data size should be a power of two\");\n }\n}\n\n...
rust
edit
0
11
mit
c47196e3e91382faa62200487f07c4014daa7065
warricksothr/dft,stainless-steel/fft
src/lib.rs
rejected_complexity
Cyclomatic complexity too high: 11
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n// check-pass\n\n// This test exhibits undefined behavior, but it is impossible to prevent generally during\n// const eval, even if possible to prevent in the cases here. The reason it's impossible in general\n// is that we run into query cyc...
rust
edit
9
1
apache-2.0
a6c60bbe5de9a090c8da30d5edbd27582f6b19e6
aidancully/rust,graydon/rust,aidancully/rust,graydon/rust,aidancully/rust,graydon/rust,graydon/rust,aidancully/rust,graydon/rust,aidancully/rust,graydon/rust,aidancully/rust
src/test/ui/consts/const-eval/double_check2.rs
rejected_lint
Too many lint violations: 9
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n#[derive(Copy, Clone, Debug)]\npub struct Score {\n /// The computed score value\n pub value: f32\n}\n\nimpl Score {\n /// Creates a new Score with the provided value\n ///\n /// # Examples\n ///\n /// ```\n /// let sc...
rust
edit
1
1
mit
5874d6bdb74c52ef375ebebf06d995e2e2cff7a5
stewart/rff,stewart/rff
src/fuzzy/score.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse std::libc;\n\nextern {\n pub unsafe fn free(p: *libc::c_void);\n}\n\npub fn main() {\n}\n\n```\n\nApply this change: Fix test failure on windows\n\nThis patch ensures that the multiple extern definitions of `free` in the\nrun-pass test...
rust
edit
null
null
apache-2.0
f8ae3cdcaacb29c7b56e546a9ddab1396b615f8f
dwillmer/rust,GBGamer/rust,nham/rust,GBGamer/rust,ruud-v-a/rust,ruud-v-a/rust,LeoTestard/rust,barosl/rust,XMPPwocky/rust,mihneadb/rust,mihneadb/rust,XMPPwocky/rust,zachwick/rust,aneeshusa/rust,gifnksm/rust,aturon/rust,Ryman/rust,sae-bom/rust,quornian/rust,j16r/rust,ktossell/rust,andars/rust,nham/rust,mahkoh/rust,carols...
src/test/run-pass/extern-pub.rs
rejected_syntax
Syntax error detected by tree-sitter
false
[ { "role": "user", "content": "Here is the current file:\n```rust\n// compile-flags: -O\n// ignore-debug: the debug assertions get in the way\n#![crate_type = \"lib\"]\n#![feature(shrink_to)]\n\n// Make sure that `Vec::shrink_to_fit` never emits panics via `RawVec::shrink_to_fit`,\n// \"Tried to shrink to a ...
rust
edit
1
1
apache-2.0
899d9b9bd505d5dbd39e22f1c6d04d516e75c769
graydon/rust,graydon/rust,aidancully/rust,aidancully/rust,aidancully/rust,aidancully/rust,graydon/rust,graydon/rust,aidancully/rust,graydon/rust,aidancully/rust,graydon/rust
src/test/codegen/vec-shrink-panic.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nextern crate bindgen;\nextern crate cc;\n\nuse std::env;\nuse std::path::PathBuf;\n\nfn main() {\n cc::Build::new()\n .flag(\"-std=c11\")\n .flag(\"-march=native\")\n .flag(\"-O3\")\n .file(\"CRoaring/roaring.c\...
rust
edit
0
1
apache-2.0
dbf54c0a84221af6704c9c76ad4511c30bb7299b
saulius/croaring-rs,saulius/croaring-rs,saulius/croaring-rs
croaring-sys/build.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse std::ops::{Add, AddAssign, Sub};\n\npub struct Vec3 {\n pub i : f64,\n pub j : f64,\n pub k : f64,\n}\n\nimpl Vec3 {\n pub fn length(&self) -> f64 {\n (self.i * self.i + self.j * self.j + self.k * self.k).sqrt()\n }\n}\n\nimpl Add...
rust
edit
0
1
mit
422cacd07f05c4572cea5509ed6d9248ef1d35d8
corragon/rust-raytracer
src/vector.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nextern crate alfred;\n\nuse config::Config;\nuse jira_api::SearchIssue;\nuse jira_client;\nuse search_response::SearchResponse;\nuse std::io::{self};\n\npub struct SearchCommand {\n pub config: Config,\n}\n\nimpl SearchCommand {\n pub f...
rust
edit
0
3
mit
14bd86a7fba8c94ddad9f8bf2cd154df250ef950
dorayakikun/alfred_jira_workflow
src/search_command.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n#[derive(Copy, Clone, Debug)]\npub enum Style {\n Default,\n Selection,\n Hint,\n StatusBar,\n InputLine,\n MenuShortcut,\n MenuEntry,\n MenuTitle\n}\n\n#[derive(Copy, Clone, Debug)]\npub enum KeyPress {\n Key(char)...
rust
edit
0
0
apache-2.0
a2da69df3a8c88b26a4c1b65caac3c80c1cdf248
dbrodie/rex
src/frontend/frontend_trait.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse std::io::{self, Read};\n\nuse views::Counter;\n\n/// Wrapper around a `Read` that reports the progress made.\n///\n/// Used to monitor a file downloading or other slow IO task\n/// in a progress bar.\npub struct ProgressReader<R: Read> {\...
rust
edit
null
null
mit
db9df3dfc93b6486bf8ba1199a12e7fefc7524cd
ConnyOnny/Cursive-Break,Gyscos/Cursive
src/utils/reader.rs
rejected_syntax
Syntax error detected by tree-sitter
false
[ { "role": "user", "content": "Here is the current file:\n```rust\nextern crate tango;\nextern crate lalrpop;\n\nfn main() {\n // I do not want lalrpop and tango to step on each others toes.\n // So we will segregate the two source trees.\n\n // lalrpop::process_root().unwrap();\n tango::process_...
rust
edit
0
1
apache-2.0
e7896eb4ff650089df5526f12e61745783752f50
pnkfelix/mon-artiste
tango-build.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse ::handle::Handle;\n\n/// A libudev context.\npub struct Context {\n udev: *mut ::ffi::udev,\n}\n\nimpl Clone for Context {\n /// Increments reference count of `libudev` context.\n fn clone(&self) -> Self {\n Context {\n ...
rust
edit
0
1
mit
996d10a1780266bbeabbb6d8860c2b5604d708ce
dcuddeback/libudev-rs
src/context.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n#[cfg(test)]\nmod tests {\n #[test]\n fn it_works() {\n }\n}\n\n```\n\nApply this change: Implement basic Rotor type with substitutions" }, { "role": "assistant", "content": "use std::ascii::AsciiExt;\n\nstruct Rotor<'a> ...
rust
edit
2
3
mit
58a4ae3131b7c219b2945a9f5f406533156ad02b
iKevinY/ultra
src/lib.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\npub mod session_handler {\n pub fn create(pName: &str) {\n println!(\"Creating session for profile \\\"{}\\\"...\", pName);\n }\n\n pub fn show() {\n println!(\"Showing sessions...\");\n }\n\n pub fn refresh() {\n...
rust
edit
1
2
mit
f8e08e75b7933ede962fce741ec1de672993cd99
amongil/bluenine
src/lib.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n//! Key algorithms used in Matrix spec.\n\n#[cfg(feature = \"serde\")]\nuse serde::{Deserialize, Serialize};\n\nuse strum::{AsRefStr, Display, EnumString};\n\n/// The basic key algorithms in the specification.\n#[derive(Clone, Copy, Debug, Pa...
rust
edit
0
0
mit
75ea42961fd3c1dcf57ea90bac7a64570900ea32
ruma/ruma
ruma-identifiers/src/key_algorithms.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n// Copyright 2016 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
365ea800bdb95ed91ac92697e5820ef4a5d7104f
GBGamer/rust,aidancully/rust,GBGamer/rust,aidancully/rust,GBGamer/rust,graydon/rust,GBGamer/rust,graydon/rust,GBGamer/rust,aidancully/rust,graydon/rust,graydon/rust,graydon/rust,GBGamer/rust,graydon/rust,aidancully/rust,GBGamer/rust,GBGamer/rust,aidancully/rust,aidancully/rust
src/librustc_back/target/armv5te_unknown_linux_gnueabi.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse core::iterator::{ IteratorUtil };\n\nuse common::extvec;\nuse common::prime::{ Prime, factors_to_uint };\nuse common::monoid::{ mergei_as, Max };\nuse common::problem::{ Problem };\n\npub static problem: Problem<'static> = Problem {\n ...
rust
edit
null
null
mit
0cb1dbb18610f64a7f90319333030eafcc639f72
tempbottle/ProjectEulerRust,gifnksm/ProjectEulerRust
prob0001_0050/prob0005.rs
rejected_syntax
Syntax error detected by tree-sitter
false
[ { "role": "user", "content": "Here is the current file:\n```rust\n// Copyright 2019 Google LLC\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// https://www.ap...
rust
edit
1
0
apache-2.0
c7a0efc6228c90cdd31e78ca87ff54b686fbc360
google/tock-on-titan,google/tock-on-titan,google/tock-on-titan
userspace/h1b_tests/src/hil/flash/mod.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n// xfail-test\n\nconst c_x: &blk/int = 22; //~ ERROR only the static region is allowed here\nconst c_y: &static/int = &22; //~ ERROR only the static region is allowed here\n\nfn main() {\n}\n```\n\nApply this change: Update error message and ...
rust
edit
null
null
apache-2.0
2fd2a56063637c4051ee95cf5cb49c629b900aa7
zaeleus/rust,kwantam/rust,omasanori/rust,ruud-v-a/rust,zubron/rust,nham/rust,rprichard/rust,dinfuehr/rust,pelmers/rust,vhbit/rust,krzysz00/rust,jbclements/rust,barosl/rust,seanrivera/rust,bombless/rust,zachwick/rust,omasanori/rust,hauleth/rust,erickt/rust,GBGamer/rust,zachwick/rust,seanrivera/rust,pshc/rust,pczarn/rust...
src/test/compile-fail/regions-in-consts.rs
rejected_syntax
Syntax error detected by tree-sitter
false
[ { "role": "user", "content": "Here is the current file:\n```go\n/*\nCopyright 2021 The Kubernetes Authors All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n ...
go
edit
0
0
apache-2.0
8e94c930ee93b2f29d52ad2c7f019ca333d7d2e7
kubernetes/node-problem-detector,kubernetes/node-problem-detector
pkg/healthchecker/types/types_linux.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n// Copyright 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 or\n//...
rust
edit
1
1
apache-2.0
4fe167adba47478e1a443c7b82e67e020253eac8
GBGamer/rust,aidancully/rust,GBGamer/rust,aidancully/rust,aidancully/rust,GBGamer/rust,GBGamer/rust,graydon/rust,GBGamer/rust,graydon/rust,graydon/rust,GBGamer/rust,graydon/rust,aidancully/rust,aidancully/rust,graydon/rust,GBGamer/rust,aidancully/rust,graydon/rust,GBGamer/rust
src/librustc_back/target/cloudabi_base.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n// src/common/api_result.rs\n\n/// API Result\n/// Represents an API result\n/// Value types include Success, Error, Failure\n\n//Import modules\nuse ::rustc_serialize::{Encodable, json};\nuse ::common::validation::validation_result::Validati...
rust
edit
1
2
apache-2.0
008721c7a68b50c9897885affdc76d0273705a58
bpowers1215/MoneyMap,bpowers1215/MoneyMap,bpowers1215/MoneyMap,bpowers1215/MoneyMap
src/common/api_result.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n#![allow(non_upper_case_globals)]\n#![allow(non_camel_case_types)]\n#![allow(non_snake_case)]\n\ninclude!(concat!(env!(\"OUT_DIR\"), \"/bindings.rs\"));\n\npub unsafe fn mlirStringRefCreateFromStr(s: impl AsRef<str>) -> MlirStringRef {\n l...
rust
edit
0
1
apache-2.0
b21749f57d58706a2364200deefe51436afe46e0
fabianschuiki/moore,fabianschuiki/moore,fabianschuiki/moore,fabianschuiki/moore,fabianschuiki/moore
src/circt-sys/src/lib.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n#![cfg(thiserror_nightly_testing)]\n#![feature(backtrace)]\n\nuse std::backtrace::Backtrace;\nuse thiserror::Error;\n\n#[derive(Error, Debug)]\n#[error(\"...\")]\npub struct OptSourceNoBacktraceStruct {\n #[source]\n source: Option<anyh...
rust
edit
0
0
apache-2.0
d9ed0fba49d6ac3f804d41d0dc3fdff4f0d87671
dtolnay/thiserror
tests/test_option.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse std::{io, mem};\n\nuse super::cvt;\nuse super::libc::{c_ushort, ioctl, STDOUT_FILENO, TIOCGWINSZ};\n\n#[repr(C)]\nstruct TermSize {\n row: c_ushort,\n col: c_ushort,\n _x: c_ushort,\n _y: c_ushort,\n}\n/// Get the size of the ...
rust
edit
0
2
mit
0837ad5ab1804732e441d89161a97ad9a7d87f6c
Ticki/libterm,ticki/termion
src/sys/unix/size.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\n/*\nhttperr defines a simple HTTP error which has a message and status code. This \ncan be useful for returning errors with relevant HTTP status codes, which the\nstandard errors package allow for.\n\nExample:\n\tfunc Foo() httperr.Error {\n\t ...
go
edit
0
1
mit
63e77c6afcda92ed8ce1603b92855758d38ae63b
joshheinrichs/httperr
httperr.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n// Verifies that no_sanitze attribute can be used to\n// selectively disable sanitizer instrumentation.\n//\n// needs-sanitizer-address\n// compile-flags: -Zsanitizer=address\n\n#![crate_type=\"lib\"]\n#![feature(no_sanitize)]\n\n// CHECK-LAB...
rust
edit
0
1
apache-2.0
5ab1602a1772320758c6d9dedd8fd1cc82eff119
graydon/rust,graydon/rust,aidancully/rust,graydon/rust,aidancully/rust,graydon/rust,graydon/rust,graydon/rust,aidancully/rust,aidancully/rust,aidancully/rust,aidancully/rust
src/test/codegen/sanitizer-no-sanitize.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n// run-pass\n// only-linux - pidfds are a linux-specific concept\n\n#![feature(linux_pidfd)]\nuse std::os::linux::process::{CommandExt, ChildExt};\nuse std::process::Command;\n\nfn main() {\n // We don't assert the precise value, since the...
rust
edit
0
2
apache-2.0
4a832d32f232a68acdabfd29e526d2a4b6366a1c
aidancully/rust,graydon/rust,graydon/rust,graydon/rust,graydon/rust,aidancully/rust,aidancully/rust,graydon/rust,graydon/rust,aidancully/rust,aidancully/rust,aidancully/rust
src/test/ui/command/command-create-pidfd.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\npub trait Summarizable {\n fn summary(&self) -> String;\n}\n\npub struct NewsArticle {\n pub headline: String,\n pub location: String,\n pub author: String,\n pub content: String,\n}\n\nimpl Summarizable for NewsArticle {\n ...
rust
edit
0
1
mit
8b67dd94c9c90a0633f3eebc6f3611bb0bb01e0e
pgrzesik/learning-rust
traits/src/lib.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
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse protobuf::*;\n\nuse super::test_tokio_bytes_default_value_pb::*;\n\n#[test]\nfn test_default_values() {\n assert_eq!(\n \"sss\",\n TestTokioBytesDefaultValues::default_instance().get_s()\n );\n assert_eq!(\n ...
rust
edit
0
1
mit
c024251a956eb82a1d76d4ac9d8d96c79b09964e
stepancheg/rust-protobuf,stepancheg/rust-protobuf,stepancheg/rust-protobuf
protobuf-test/src/v2/test_tokio_bytes_default_value.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse crate::{error::{Error,\n Result},\n os::system::Uname};\nuse errno::errno;\nuse libc;\nuse std::{ffi::CStr,\n mem};\n\npub fn uname() -> Result<Uname> { unsafe { uname_libc() } }\n\nunsafe fn uname_l...
rust
edit
1
2
apache-2.0
9f7d4a529e190195ebb7f23238d3942616ff68b6
rsertelon/habitat,rsertelon/habitat,rsertelon/habitat,habitat-sh/habitat,rsertelon/habitat,habitat-sh/habitat,rsertelon/habitat,habitat-sh/habitat,habitat-sh/habitat,habitat-sh/habitat,habitat-sh/habitat,rsertelon/habitat,rsertelon/habitat,habitat-sh/habitat,habitat-sh/habitat
components/core/src/os/system/linux.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nmacro_rules! toml_template {\n ($name: expr) => {\nformat_args!(r##\"\n[package]\nname = \"{0}-fuzz\"\nversion = \"0.0.1\"\nauthors = [\"Automatically generated\"]\npublish = false\n\n[package.metadata]\ncargo-fuzz = true\n\n[dependencies....
rust
edit
4
0
apache-2.0
216eecc18e47ec6290453d7bd26e67b524cc5162
rust-fuzz/cargo-fuzz
src/templates.rs
rejected_duplicate
Near-duplicate of sample 119821
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse rand::{thread_rng, Rng};\n\n#[derive(Debug, Copy, Clone)]\npub enum TerrainType {\n\tWater,\n\tGrass,\n\tTallGrass,\n\tSand,\n\tSnow,\n\tTundra\n}\n\n#[derive(Debug)]\npub struct Tile {\n\ttyp:TerrainType,\n}\n\npub struct Terrain {\n\tda...
rust
edit
0
2
mit
db23f7db4d058e5afe150bfcef771dcc20a7149c
ThomasColliers/age-of-rust
src/world/terrain.rs
accepted
null
true