messages
listlengths
2
2
language
stringclasses
8 values
prompt_type
stringclasses
2 values
lint_errors
int64
0
129
⌀
cyclomatic_complexity
int64
0
32
⌀
license
stringclasses
7 values
commit
stringlengths
40
40
repos
stringlengths
5
116k
new_file
stringlengths
4
220
status
stringclasses
6 values
error
stringlengths
26
74
⌀
is_valid_syntax
bool
2 classes
[ { "role": "user", "content": "Here is the current file:\n```rust\n#![feature(associated_consts)]\n#![feature(use_extern_macros)]\n\n#[macro_use]\nextern crate tapioca;\n\ninfer_api!(httpbin, \"https://raw.githubusercontent.com/OJFord/tapioca/master/tests/schemata/httpbin.yml\");\n\n\nfn main() {\n let au...
rust
edit
0
5
mit
2367b6156634cdf161eb107e5918b6d6249ac45d
OJFord/tapioca
examples/httpbin.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse docopt::{self, Docopt, ArgvMap};\n\nconst USAGE: &'static str = \"\nmprovision\nA tool that helps iOS developers to manage mobileprovision files.\n\nUsage:\n mprovision list [--filter <text>] [--expires-in-days <days>] [<directory>]\n\nO...
rust
edit
1
2
mit
58b54dffbafd14a26ae4f3a8bd51b3f230fc1af4
zummenix/mprovision
src/bin/cli.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n#![crate_name = \"foo\"]\n\n// @has foo/fn.foo.html\n// !@has - '//a[@href=\"http://a.a\"]'\n// @has - '//a[@href=\"#implementing-stuff-somewhere\"]' 'Implementing stuff somewhere'\n// @has - '//a[@href=\"#another-one-urg\"]' 'Another one urg...
rust
edit
0
1
apache-2.0
298e8ad5dc79ecb9b5b6140499e950d6ac5f09b1
graydon/rust,aidancully/rust,graydon/rust,aidancully/rust,graydon/rust,graydon/rust,aidancully/rust,aidancully/rust,graydon/rust,graydon/rust,aidancully/rust,aidancully/rust
src/test/rustdoc/remove-url-from-headings.rs
rejected_duplicate
Near-duplicate of sample 121319
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
2
1
apache-2.0
bfa34332833962e4991f508ac3ab4958fd9b64cd
GBGamer/rust,aidancully/rust,graydon/rust,graydon/rust,aidancully/rust,GBGamer/rust,GBGamer/rust,graydon/rust,graydon/rust,GBGamer/rust,aidancully/rust,graydon/rust,GBGamer/rust,aidancully/rust,GBGamer/rust,GBGamer/rust,aidancully/rust,aidancully/rust,graydon/rust,GBGamer/rust
src/test/compile-fail/issue-31109.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse crate::spec::{Target, TargetOptions};\n\npub fn target() -> Target {\n let mut base = super::linux_musl_base::opts();\n base.max_atomic_width = Some(128);\n\n Target {\n llvm_target: \"aarch64-unknown-linux-musl\".to_strin...
rust
edit
0
1
apache-2.0
bd287fa5084f2e153c1044632f9f3d190f090d69
aidancully/rust,graydon/rust,aidancully/rust,graydon/rust,graydon/rust,aidancully/rust,graydon/rust,aidancully/rust,aidancully/rust,aidancully/rust,graydon/rust,graydon/rust
compiler/rustc_target/src/spec/aarch64_unknown_linux_musl.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n// Copyright:: Copyright (c) 2015-2016 The Habitat Maintainers\n//\n// The terms of the Evaluation Agreement (Habitat) between Chef Software Inc.\n// and the party accessing this file (\"Licensee\") apply to Licensee's use of\n// the Software...
rust
edit
7
1
apache-2.0
53a6c25c774b52f7540ddb6c4b0bc0125514709b
habitat-sh/habitat,habitat-sh/habitat,rsertelon/habitat,habitat-sh/habitat,rsertelon/habitat,rsertelon/habitat,habitat-sh/habitat,rsertelon/habitat,rsertelon/habitat,habitat-sh/habitat,rsertelon/habitat,habitat-sh/habitat,rsertelon/habitat,habitat-sh/habitat,habitat-sh/habitat
src/fs.rs
rejected_lint
Too many lint violations: 7
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nextern crate arguments;\nextern crate hiredis;\nextern crate mcpat;\nextern crate sql;\nextern crate sqlite;\n\n#[macro_use]\nextern crate log;\n\n/// Raise an error.\n#[macro_export]\nmacro_rules! raise(\n ($message:expr) => (return Err($...
rust
edit
1
0
mit
307aed56f8cd203d554ac4c4c6aa3e5cc60de44e
learning-on-chip/recorder
src/lib/recorder.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n//! Collection Utility\n\n/// Clone a vector consisting of item references to \n/// a new vector owning cloned items.\n#[inline]\npub fn to_owned_vec<T: Clone>(v: &Vec<&T>) -> Vec<T> \n{\n v.iter().map(|e| (*e).clone()).collect::<Vec<T>>()\n...
rust
edit
0
1
apache-2.0
2740cd97abefaf8390644a100d7e7a1fb44c9bff
hyunsik/tokamak,hyunsik/tokamak,hyunsik/tokamak,hyunsik/tokamak,hyunsik/tokamak,hyunsik/tokamak
util/collection.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse encoding::EncodingRef;\nuse encoding::all::UTF_8;\nuse loirc::{MonitorSettings, ReconnectionSettings};\n\n/// Settings for the dispatcher.\npub struct Settings<'a> {\n /// Address of the irc server.\n pub addr: &'a str,\n /// Pre...
rust
edit
2
1
mit
c6ae4a50b9b3a0a8d9f39a3c23d8ae97fcd6be0b
SBSTP/hiirc,SBSTP/hiirc
src/settings.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
1
1
apache-2.0
6b3edc2f8933a987ed956b4d720be1be9b02e036
graydon/rust,graydon/rust,graydon/rust,graydon/rust,GBGamer/rust,graydon/rust,aidancully/rust,aidancully/rust,GBGamer/rust,aidancully/rust,aidancully/rust,GBGamer/rust,graydon/rust,aidancully/rust,GBGamer/rust,GBGamer/rust,GBGamer/rust,aidancully/rust,GBGamer/rust,GBGamer/rust
src/test/compile-fail/expanded-cfg.rs
rejected_duplicate
Near-duplicate of sample 120200
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n//! Defines the DifferentialGeometry type which is used to pass information\n//! about the hit piece of geometry back from the intersection to the shading\n\nuse linalg::{Point, Normal};\nuse geometry::{Geometry, Instance};\n\n/// Stores info...
rust
edit
2
1
mit
a25d25278f4eee560d0658c594653e75633f88b1
Twinklebear/tray_rust,voidException/tray_rust,GuzTech/tray_rust
src/geometry/differential_geometry.rs
rejected_duplicate
Near-duplicate of sample 120055
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n\n\n// -*- rust -*-\nuse std;\nimport std::rand;\nimport std::str;\n\n#[test]\nfn test() {\n let r1: rand::rng = rand::mk_rng();\n log r1.next();\n log r1.next();\n {\n let r2 = rand::mk_rng();\n log r1.next();\n ...
rust
edit
null
null
apache-2.0
2aba6bd6735c828306ad199215a6f5c72c7864b0
rust-lang/rand
src/test/stdtest/rand.rs
rejected_syntax
Syntax error detected by tree-sitter
false
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse cocoa::base::id;\n\npub trait MTLCommandBuffer {\n\n}\n\nimpl MTLCommandBuffer for id {\n\n}\n\n```\n\nApply this change: Add MTLCommandBuffer::renderCommandEncoderWithDescriptor to MTLCommandBuffer trait def" }, { "role": "assist...
rust
edit
0
2
apache-2.0
e06b714bce89f2ba2f389cc07699fcc3e9f58524
burtonageo/metl
metal-sys/src/protocols/mtl_command_buffer.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n// not_tested\n\nuse std::iter::range_step;\n\nfn main() {\n let order = 4u;\n let height = 1u << order;\n let mut state = Vec::from_elem(height + 1, true);\n\n // Compute the triangle line-by-line by viewing it as Pascal's triang...
rust
edit
null
null
unlicense
1c65e28e1b36bc420ce221a3e239abf2bb33f044
Hoverbear/rust-rosetta,pfalabella/rust-rosetta,crr0004/rust-rosetta,magum/rust-rosetta,crespyl/rust-rosetta,sakeven/rust-rosetta,ZoomRmc/rust-rosetta,magum/rust-rosetta,JIghtuse/rust-rosetta,ghotiphud/rust-rosetta
src/sierpinski_triangle.rs
rejected_syntax
Syntax error detected by tree-sitter
false
[ { "role": "user", "content": "Here is the current file:\n```rust\n\nuse super::IndexBufferHandle;\nuse super::VertexBufferHandle;\n\npub enum AttributeType {\n AttributeByte,\n AttributeUnsignedByte,\n AttributeShort,\n AttributeUnsignedShort,\n AttributeInt,\n AttributeUnsignedInt,\n A...
rust
edit
1
1
apache-2.0
bf9d02087410d79db8ebefd311ab96c2ae444eac
irauta/htgl
src/vertexarray.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\npub trait Store {\n type Algorithm: ?Sized;\n\n fn get(&self, key_id: &str) -> Option<&Self::Algorithm>;\n}\n\n```\n\nApply this change: Implement Store for all Index types that take in strings" }, { "role": "assistant", "co...
rust
edit
0
4
mit
97a405600fb97eba4532ca318e255c709ae01a2f
mikkyang/rust-jwt
src/algorithm/store.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n#![feature(libc)]\n\nextern crate libc;\nextern crate \"glib-2_0-sys\" as glib;\nextern crate \"gobject-2_0-sys\" as gobject;\n\npub mod notification;\n\npub use notification::*;\n\nuse libc::{\n c_char\n};\n\nuse glib::types::{\n gbool...
rust
edit
null
null
mit
001a3ec9d984824365cc474274d45eb764a66060
crumblingstatue/rust-libnotify-sys
src/lib.rs
rejected_syntax
Syntax error detected by tree-sitter
false
[ { "role": "user", "content": "Here is the current file:\n```rust\n//! RA Proc Macro Server\n//!\n//! This library is able to call compiled Rust custom derive dynamic libraries on arbitrary code.\n//! The general idea here is based on https://github.com/fedochet/rust-proc-macro-expander.\n//!\n//! But we cha...
rust
edit
0
1
apache-2.0
4f70162f54ceaa4ff68a5ab74e31b5dda7ac9444
rust-analyzer/rust-analyzer,rust-analyzer/rust-analyzer,rust-analyzer/rust-analyzer,rust-analyzer/rust-analyzer,rust-analyzer/rust-analyzer
crates/ra_proc_macro_srv/src/lib.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n#[macro_use]\nmod lib;\n\nmod command;\nmod constant;\n\nuse constant::*;\nuse std::env;\n\nfn main() {\n if let Some(message) = validate_at_first() {\n return println!(\"{}\", message);\n }\n\n let args = env::args()\n ...
rust
edit
3
2
mit
56f1217f505fc997106ce0853cef622566326db4
ttokutake/kic,ttokutake/kic,ttokutake/kic
src/main.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n#![cfg(not(test))]\n\n#[lang = \"eh_personality\"]\n#[no_mangle]\npub extern \"C\" fn eh_personality() {}\n\n#[lang = \"eh_unwind_resume\"]\n#[no_mangle]\npub extern \"C\" fn rust_eh_unwind_resume() {}\n\n#[no_mangle]\npub extern \"C\" fn __u...
rust
edit
1
1
mit
edc87b12ed9c158fd45fcd9223c117d281dd3a08
iankronquist/rustyvisor,iankronquist/rustyvisor,iankronquist/rustyvisor
src/runtime.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\npub const POMBASE_ANN_EXT_TERM_CV_NAME: &'static str = \"PomBase annotation extension terms\";\npub const ANNOTATION_EXT_REL_PREFIX: &'static str = \"annotation_extension_relation-\";\n\npub enum FeatureRelAnnotationType {\n Interaction,\n...
rust
edit
3
0
mit
5e0e665e16fca918977163df6b3bc612f4d86081
pombase/pombase-chado-json,pombase/pombase-chado-json
src/pombase/web/config.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n#![crate_type=\"lib\"]\n\npub trait Remote {\n fn foo(&self) { }\n}\n\npub trait Remote1<T> {\n fn foo(&self, t: T) { }\n}\n\npub trait Remote2<T, U> {\n fn foo(&self, t: T, u: U) { }\n}\n\npub struct Pair<T,U>(T,U);\n\n```\n\nApply ...
rust
edit
0
1
apache-2.0
3ee292021d00857586af0d2ef1fa6c31f74181ce
aidancully/rust,aidancully/rust,graydon/rust,graydon/rust,graydon/rust,graydon/rust,aidancully/rust,graydon/rust,graydon/rust,aidancully/rust,aidancully/rust,aidancully/rust
src/test/ui/coherence/auxiliary/coherence_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
8aafc62cb3ac71d33c20d4ecf118f4701ef0d59e
sourrust/flac
src/lib.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse std::{fmt, error, io};\n\nuse regex;\n\npub struct Error;\n\nimpl fmt::Display for Error {\n fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {\n f.write_str(\"Internal error\")\n }\n}\n\nimpl fmt::Debug for Error {\n ...
rust
edit
2
1
mit
0489d8e46b7fe8c7ffd15b5d9d4cb64888ab59ac
jhbabon/scout
src/scout/errors.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n#[macro_use]\nextern crate nom;\n\npub mod metadata;\nmod frame;\nmod utility;\n\nuse metadata::metadata_parser;\n\npub struct Stream {\n pub info: metadata::StreamInfo,\n pub metadata: Vec<metadata::Block>,\n pub frames: Vec<frame::Frame>...
rust
edit
null
null
bsd-3-clause
e11fcf329ad86f1ae327bbda7177a193594094a0
sourrust/flac
src/lib.rs
rejected_syntax
Syntax error detected by tree-sitter
false
[ { "role": "user", "content": "Here is the current file:\n```rust\n// error-pattern:the size for value values of type `str` cannot be known at compilation time\n#[macro_use]\nextern crate lazy_static_compiletest as lazy_static;\n\nlazy_static! {\n pub static ref FOO: str = panic!();\n}\n\n\nfn main() {\n}...
rust
edit
0
1
apache-2.0
7c4490d87a52c0d77a233f7b83e1a594f2465ee8
rust-lang-nursery/lazy-static.rs,Kimundi/lazy-static.rs
compiletest/tests/compile-fail/static_is_sized.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse byteorder;\nuse std::{fmt, io, string};\n\npub enum OscError {\n StringError(string::FromUtf8Error),\n ReadError(io::Error),\n ByteOrderError(byteorder::Error),\n BadOscPacket(String),\n BadOscAddress(String),\n BadOscMe...
rust
edit
1
2
apache-2.0
47c1fab1a3ce7f28375bee3098050945bfcfcb9e
klingtnet/rosc
src/errors.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse std::thread;\n\n#[no_mangle]\nfn process() {\n let handles: Vec<_> = (0..10).map(|_| {\n thread::spawn(|| {\n let mut x = 0;\n for _ in (0..5_000_000) {\n x += 1\n }\n x\n ...
rust
edit
2
4
mit
19109189e431870dba5766fc6f82f38a19d79def
juliangrosshauser/embed,juliangrosshauser/embed,juliangrosshauser/embed,juliangrosshauser/embed
src/lib.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse std::num::Zero;\nuse traits::division_ring::DivisionRing;\nuse traits::workarounds::scalar_op::{ScalarMul, ScalarDiv};\n\n/// Trait of elements of a vector space. A vector space is an algebraic\n/// structure, the elements of which have a...
rust
edit
0
0
bsd-3-clause
fb20ffdf8b545668055b1deac13226229ea72038
sebcrozet/nalgebra,tikue/nalgebra,ProtectedMode/nalgebra,tempbottle/nalgebra,sebcrozet/nalgebra,tomaka/nalgebra,jaredly/nalgebra,mbStavola/nalgebra
src/traits/vector_space.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n#![feature(proc_macro_hygiene, decl_macro)]\n\n#[macro_use]\nextern crate rocket;\n\n#[macro_use]\nextern crate rocket_contrib;\n\n// #[macro_use]\nextern crate diesel;\n\nmod schema;\n// mod models;\n\nuse rocket_contrib::databases::diesel::...
rust
edit
0
1
mit
221f196684173326af5954f3263f4c6d42484bb8
ghotiphud/rust-web-starter,ghotiphud/rust-web-starter,ghotiphud/rust-web-starter,ghotiphud/rust-web-starter
api_server/src/main.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nmod callbacks;\nmod channel;\nmod parsers;\nmod types;\nmod utils;\n\n// Re-export public interfaces.\npub use channel::Channel;\npub use parsers::{\n parse_a_result,\n parse_aaaa_result,\n};\npub use types::{\n AresError,\n AResu...
rust
edit
1
0
mit
90d71f4ac2a8803b04c65943bed41f89c9844065
CJTozer/rust-c-ares,dimbleby/rust-c-ares,dimbleby/rust-c-ares,CJTozer/rust-c-ares,dimbleby/rust-c-ares
src/lib.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\npub fn puzzle(input: &str) -> u8 {\n 1\n}\n\n#[cfg(test)]\nmod test {\n use super::*;\n}\n\n```\n\nApply this change: Set up keypad/key abstraction and relationships\n\nThis was a lot of manual typing... but should only need to be done ...
rust
edit
3
1
mit
35c4879853202fb9152e50d61d71281c16427d9e
carols10cents/adventofcode-rs
src/lib.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n#[macro_use] extern crate bitflags;\nextern crate gl as gl_lib;\n#[cfg(feature = \"cgmath\")] extern crate cgmath as cgmath_lib;\n#[cfg(feature = \"image\")] extern crate image as image_lib;\n\nmod ref_into;\n\n#[macro_use] mod macros;\nmod c...
rust
edit
15
0
apache-2.0
22116f3c0821e532ce7bc81e201d75a71a43f262
kylewlacy/glitter,kylewlacy/glitter
src/lib.rs
rejected_lint
Too many lint violations: 15
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse metadata::{Metadata, StreamInfo, metadata_parser};\nuse frame::{frame_parser, Frame};\n\npub struct Stream {\n pub info: StreamInfo,\n pub metadata: Vec<Metadata>,\n pub frames: Vec<Frame>,\n}\n\nnamed!(pub stream_parser <&[u8], Stream...
rust
edit
null
null
bsd-3-clause
33e9e09be5a39f136720d39808026ddd18964eec
sourrust/flac
src/stream.rs
rejected_syntax
Syntax error detected by tree-sitter
false
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse protobuf::MessageFull;\n\nuse super::test_optional_pb::*;\n\n#[test]\nfn test() {\n let _message = TestOptionalProto3::new();\n}\n\n#[test]\nfn reflect_all_oneofs() {\n let descriptor = TestOptionalProto3::descriptor_static();\n ...
rust
edit
0
2
mit
ddb5e53c085c6b1e55b733d993c351d5c091c081
stepancheg/rust-protobuf,stepancheg/rust-protobuf,stepancheg/rust-protobuf
test-crates/protobuf-test/src/v3/test_optional.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n#![feature(libc)]\nextern crate libc;\n\npub fn readline() -> Option<String> {\n // Buffer to hold readline input\n let buffer = String::new();\n\n let isatty = unsafe { libc::isatty(libc::STDIN_FILENO as i32) } != 0; \n if isatty...
rust
edit
0
2
mit
30985523b35df85d3454060e2167b51a7f402474
kkawakam/rustyline,dubrowgn/rustyline,dubrowgn/rustyline,gwenn/rustyline,cavedweller/rustyline
src/lib.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n#![allow(clippy::unreadable_literal)]\n\n//! This crate contains parsers and readers for Pcap and Pcapng files.\n//! It also contains a writer for Pcap files.\n//!\n//! For Pcap files see\n//! [PcapReader](struct.PcapReader.html), [PcapParser...
rust
edit
3
0
mit
9cf9119bc58ba5e3293eb26f1d6ed57669ca0e23
courvoif/pcap-file
src/lib.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse crate::{Error, ErrorKind, Result};\nuse objc::{class, msg_send, runtime::Object, sel, sel_impl};\n\n/// Deal with opening of browsers on iOS\n#[inline]\npub fn open_browser_internal(\n _browser: Browser,\n url: &str,\n _options: ...
rust
edit
0
4
apache-2.0
3ee22d335eafa75e23261e07d05eebfb70caa26e
amodm/webbrowser-rs,amodm/webbrowser-rs,amodm/webbrowser-rs,amodm/webbrowser-rs,amodm/webbrowser-rs
src/ios.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse super::utils::types::*;\n\npub struct RecentPropserRecord {\n pub index: u32, // TODO: make u24\n pub randao_commitment: Sha256Digest,\n pub balance_delta: u32, // TODO: make u24\n}\n\nimpl RecentPropserRecord {\n pub fn n...
rust
edit
3
1
apache-2.0
909d62473008f0c6a389e1e0607528a46a924168
sigp/lighthouse,sigp/lighthouse,sigp/lighthouse,sigp/lighthouse
src/state/recent_proposer_record.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n#![feature(const_generics)]\n#![allow(incomplete_features)]\n\npub struct Struct<const N: usize>(());\n\nimpl<const N: usize> Struct<N> {\n pub fn new() -> Self {\n Struct(())\n }\n\n pub fn same_ty<const M: usize>(&self) -> (...
rust
edit
0
2
apache-2.0
5e188f5803bdbfdf3ff000e8b7e266405531c8d7
aidancully/rust,aidancully/rust,graydon/rust,graydon/rust,graydon/rust,aidancully/rust,aidancully/rust,graydon/rust,graydon/rust,graydon/rust,aidancully/rust,aidancully/rust
src/test/ui/const-generics/type-dependent/auxiliary/type_dependent_lib.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nextern crate assert;\nextern crate fft;\n\nmod fixtures;\n\n#[test]\nfn forward() {\n let mut data = fixtures::TIME_DATA.to_vec();\n fft::forward(&mut data);\n assert::close(&data, &fixtures::FREQUENCY_DATA[..], 1e-13);\n}\n\n#[test]...
rust
edit
0
1
mit
3309618c10fc60ec2899826776c415141c4b20cb
warricksothr/dft,stainless-steel/fft
tests/lib.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse futures::stable::block_on_stable;\nuse futures::prelude::*;\n\n#[async]\nfn foo() -> Result<i32, i32> {\n Ok(1)\n}\n\n#[async]\nfn bar(x: &i32) -> Result<i32, i32> {\n Ok(*x)\n}\n\n#[async]\nfn baz(x: i32) -> Result<i32, i32> {\n ...
rust
edit
0
2
apache-2.0
92710890d9aa6db1be0ff5f679c14397f678e6f3
alexcrichton/futures-rs
futures/tests/async_await/pinned.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse std::path::PathBuf;\n\nuse anyhow::{Context, Result};\n\nuse pueue_lib::settings::Settings;\n\n/// From 0.12.2 on, we aim to have full backward compatibility.\n/// For this reason, an old v0.12.2 serialized state has been checked in.\n///...
rust
edit
1
2
mit
64105e9ffbd5ed37d63a08f065edfaaa48a42e59
Nukesor/Pueue,Nukesor/Pueuew
tests/settings_backward_compatibility.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse std::io::{Read, Write};\nuse std::net::{TcpListener, TcpStream};\nuse std::sync::mpsc::channel;\nuse std::thread;\n\nfn main() {\n let listener = TcpListener::bind(\"127.0.0.1:8080\").unwrap();\n\n // accept connections and process ...
rust
edit
1
4
mit
d549150ee16818509688762cdd6c0f16eb5e3b4c
kevinwilde/chat_server
src/main.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse gfx;\nuse std::sync::mpsc;\n\n#[derive(Debug)]\npub struct EncoderQueue<D: gfx::Device> {\n pub sender: mpsc::Sender<gfx::Encoder<D::Resources, D::CommandBuffer>>,\n pub receiver: mpsc::Receiver<gfx::Encoder<D::Resources, D::CommandBuff...
rust
edit
1
2
apache-2.0
2eee12e802fd6d507fca8d0df84a200fda816b54
Laastine/zombie-shooter,Laastine/zombie-shooter
src/gfx_app/renderer.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n#[cfg(feature=\"pkg-config\")]\nextern crate pkg_config;\n\nfn main() {\n if !build_pkgconfig() {\n let target = ::std::env::var(\"TARGET\").expect(\"Cargo build scripts always have TARGET\");\n let target_os = target.splitn(...
rust
edit
0
5
mit
761a260e5940591df2388733e8c5d90a46faba13
Cobrand/rust-sdl2,Rust-SDL2/rust-sdl2,Rust-SDL2/rust-sdl2,Rust-SDL2/rust-sdl2,Cobrand/rust-sdl2,Cobrand/rust-sdl2,AngryLawyer/rust-sdl2
sdl2-sys/build.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nextern crate sonos_discovery;\n\nuse sonos_discovery::Discover;\n\nfn main() {\n let discovery = Discover::new().unwrap();\n let devices = discovery.start(None, Some(3)).unwrap();\n for device in devices {\n println!(\"{:?}\",...
rust
edit
0
2
mit
7fae10b266bc620a04a03dc8ffb5fd71170e13b3
Chabare/sonos_discovery
src/main.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse gobjects::*;\nuse library::*;\n\npub struct StatusedTypeId{\n pub type_id: TypeId,\n pub name: String,\n pub status: GStatus,\n}\n\npub fn widget_tid(library: &Library) -> TypeId {\n library.find_type(0, \"Gtk.Widget\").unwrap...
rust
edit
0
2
mit
b6ba5eac46f1604af46e9f0812713f3df4236dab
GuillaumeGomez/gir,EPashkin/gir,gkoz/gir,gkoz/gir,gtk-rs/gir,gtk-rs/gir,GuillaumeGomez/gir,insanebits/gir,GuillaumeGomez/gir,gtk-rs/gir,EPashkin/gir,insanebits/gir
src/analysis/general.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nextern crate vagment;\n\nuse std::env;\nuse vagment::logger;\n\nfn main() {\n let version = env!(\"CARGO_PKG_VERSION\");\n let command = env::args().nth(1);\n\n if command.is_none() {\n logger::error(\"Please provide a command...
rust
edit
0
3
mit
1de9efbc6970f4a241ce53d92b7767202794e6f9
mickaelvieira/vagment,mickaelvieira/vagment
src/main.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\npub mod control_regs;\npub mod descriptor;\npub mod dtables;\npub mod io;\npub mod irq;\npub mod msr;\npub mod paging;\npub mod flags;\npub mod segmentation;\npub mod task;\npub mod tlb;\n\n#[derive(Copy, Clone, PartialEq, Eq)]\n#[repr(u8)]\n...
rust
edit
1
1
mit
5e40510164b468584b284d705ab6d7f6e7b45c20
phil-opp/rust-x86_64,gz/rust-x86,gz/rust-x86
src/shared/mod.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n#[macro_use]\nextern crate clap;\nextern crate ultra;\n\nuse ultra::enigma::Enigma;\n\nfn main() {\n let app = clap_app!(ultra =>\n (version: crate_version!())\n (@setting ArgRequiredElseHelp)\n (@setting ColoredHelp)\...
rust
edit
0
6
mit
e5b6ee2533cd2c32faaab6f14a70551135dd8099
iKevinY/ultra
src/main.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nextern crate env_logger;\nextern crate futures;\nextern crate tokio_minihttp;\nextern crate tokio_proto;\nextern crate tokio_service;\n\nuse std::io;\n\nuse futures::future;\nuse tokio_minihttp::{Request, Response, Http};\nuse tokio_proto::Tc...
rust
edit
0
2
mit
4103c29104d4f0824a0e905be0a8c7220f784f07
singulared/replicate
src/main.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse ll::stylesheet::css_fixed;\n\npub fn css_fixed_to_float(f: css_fixed) -> float {\n const before: i32 = 10;\n f as float * 1.0f / ((1i32 << before) as float)\n}\n\n```\n\nApply this change: Add VoidPtrLike trait for converting betwee...
rust
edit
null
null
apache-2.0
afbd1fdcaaba1bd82b38d30dbc93272122e2fc7c
servo/rust-netsurfcss
util.rs
rejected_syntax
Syntax error detected by tree-sitter
false
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse std::env;\n\nextern crate zwreec;\n\n\nfn main() {\n println!(\"#main started\");\n\n // handling commandline parameters\n let args: Vec<String> = env::args().collect();\n\n let mut input_file_name: &str;\n let mut output_f...
rust
edit
0
2
bsd-2-clause
5c0e6671f79cab8959822116bafc142bd3cbd985
Drakulix/zwreec,Drakulix/zwreec
src/main.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse crate::colour::Colour;\nuse crate::graph::{Graph, Position};\nuse crate::grid::Grid;\n\npub enum GameState {\n Solving,\n Solved,\n}\n\npub struct Game {\n pub state: GameState,\n pub graph: Graph,\n number_of_clicks: u32,\...
rust
edit
0
1
mit
1ba6178ee82038be8cc49eba55bc242bdad60ec6
yzhs/flood-it
src/game.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!(\"Guess the number!\");\n\n let secret_number = rand::thread_rng().gen_range(1, 101);\n\n println!(\"The secret number ...
rust
edit
0
2
mit
dd488f791fdd83e6dd40d852e576ee8b574f2894
juliangrosshauser/guessing_game
src/main.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n//\n// Copyright (C) 2021 Rafael Caricio <<EMAIL>>\n//\n// This Source Code Form is subject to the terms of the Mozilla Public License, v2.0.\n// If a copy of the MPL was not distributed with this file, You can obtain one at\n// <https://mozi...
rust
edit
1
2
apache-2.0
58322bcc962edfc0f772275f03bea5a2419476b6
sdroege/rsplugin,sdroege/rsplugin
net/hlssink3/src/lib.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\npub struct PascalsTriangle;\n\nimpl PascalsTriangle {\n pub fn new(row_count: u32) -> Self {\n unimplemented!();\n }\n\n pub fn rows(&self) -> Vec<Vec<u32>> {\n unimplemented!();\n }\n}\n\n```\n\nApply this change: A...
rust
edit
0
2
bsd-2-clause
1eef71dab7610fceea009c81a86e10a7084cd1e0
gyn/exercism,gyn/exercism,gyn/exercism,gyn/exercism
rust/pascals-triangle/src/lib.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nextern crate iron;\nextern crate rustc_serialize;\nextern crate queryst;\n\nuse rustc_serialize::json::{self, Json};\nuse iron::prelude::*;\nuse iron::status;\nuse queryst::parse;\n\n#[derive(RustcEncodable)]\npub struct PadJson {\n str: S...
rust
edit
0
1
mit
767f9e57ac43020cdcd44677c6a1aba13c0c9e4d
melonmanchan/left-pad-services,melonmanchan/left-pad-services,melonmanchan/left-pad-services,melonmanchan/left-pad-services,melonmanchan/left-pad-services,melonmanchan/left-pad-services,melonmanchan/left-pad-services,melonmanchan/left-pad-services
rust/leftpad/src/main.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse std::env;\n\nextern crate git2;\nextern crate tiny_http;\n\n\nstatic INDEX_GIT_URL: &'static str = \"https://github.com/rust-lang/crates.io-index\";\n\nfn main() {\n git2::Repository::clone(INDEX_GIT_URL, \"crates.io-index\").unwrap();...
rust
edit
0
3
apache-2.0
43309decf65bd9b5a1856b31cbde6dcbe10136c5
frewsxcv/crate-deps
src/main.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nmod vm;\nmod command;\nmod parse;\nmod program;\n\nuse vm::VM;\nuse program::Program;\nuse std::io::Write;\n\nfn main() {\n let mut vm = VM::new();\n let mut program = Program::new();\n loop {\n print!(\"{}\", if program.is_se...
rust
edit
1
4
mit
8c58e6a468f4a4aa368a5cd4b4753eee8c3ffa29
nafarlee/thoughtfuck
src/main.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse std::env;\n\n#[macro_use]\npub mod utils;\n\nextern crate zwreec;\n\n\nfn main() {\n log_info!(\"main started\");\n\n // handling commandline parameters\n let args: Vec<String> = env::args().collect();\n\n let mut input_file_n...
rust
edit
0
2
bsd-2-clause
fac58b7695b004af77291ef1fa87e4849bc08694
Drakulix/zwreec,Drakulix/zwreec
src/main.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n#![feature(rustc_attrs, rustc_private, step_trait)]\n\n#[macro_use] extern crate rustc_data_structures;\nextern crate rustc_serialize;\n\nuse rustc_data_structures::indexed_vec::Idx;\n\nnewtype_index!(struct MyIdx { MAX = 0xFFFF_FFFA });\n\nu...
rust
edit
0
1
apache-2.0
c4a850078cbcc8cd3d79483b51767f1171d81f88
GBGamer/rust,aidancully/rust,GBGamer/rust,graydon/rust,GBGamer/rust,aidancully/rust,graydon/rust,GBGamer/rust,aidancully/rust,aidancully/rust,aidancully/rust,graydon/rust,graydon/rust,GBGamer/rust,GBGamer/rust,GBGamer/rust,graydon/rust,GBGamer/rust,graydon/rust,aidancully/rust
src/test/run-pass-fulldeps/newtype_index.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n#![cfg_attr(feature = \"nightly\", feature(lang_items, core_intrinsics, panic_implementation))]\n#![cfg_attr(feature = \"nightly\", no_std)]\n#![cfg_attr(feature = \"nightly\", no_main)]\n\n// Pull in the system libc library for what crt0.o l...
rust
edit
0
1
mit
765768d10c96cc09f3a0ccf169cea98cd283465c
gz/rust-cpuid
tests/no_std_build.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n// Crypto challenge Set1 / Challenge 3\n// Decrypt single XOR chiffre\n\nextern crate codec;\nextern crate challenge3;\n\n#[cfg(not(test))]\nfn main() {\n let args = std::os::args();\n \n if args.len() != 2 {\n println!(\"USAG...
rust
edit
0
4
unlicense
ddb779ea652678ea755017420d2d0ab72cac09b1
imhof/matsano-crypto
set1/challenge3/src/main.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n// Parts of this are based on the work on alexcrichton, here:\n// https://github.com/alexcrichton/git2-rs/blob/master/libgit2-sys/build.rs\n//\n// This has been tested on Ubuntu and it assumes that CMake is available.\n// Patches are welcome ...
rust
edit
0
4
unlicense
e80234a19a780228977d39eaebe58a8e1907897f
emk/rust-uchardet
uchardet-sys/build.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse std::fmt;\n\n#[derive(PartialEq)]\npub struct Clock {\n hours: i32,\n minutes: i32,\n}\n\nimpl Clock {\n pub fn new(hours: i32, minutes: i32) -> Self {\n return Clock { hours, minutes };\n }\n\n pub fn add_minutes(&s...
rust
edit
0
5
mit
05fff7e9883c58188b9f113b20a5afc2e475ceb7
rootulp/exercism,rootulp/exercism,rootulp/exercism,rootulp/exercism,rootulp/exercism,rootulp/exercism,rootulp/exercism,rootulp/exercism
rust/clock/src/lib.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse super::validator_record::ValidatorRecord;\nuse super::crosslink_record::CrosslinkRecord;\nuse super::shard_and_committee::ShardAndCommittee;\nuse super::Hash256;\n\n\npub struct CrystallizedState {\n pub validator_set_change_slot: u64,...
rust
edit
0
0
apache-2.0
bb75e30ff2e9adc3f58a0a9bcd5e36d6aceecc0d
sigp/lighthouse,sigp/lighthouse,sigp/lighthouse,sigp/lighthouse
beacon_chain/types/src/crystallized_state.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n// Copyright 2015 Pierre Talbot (IRCAM)\n\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n\n// http://...
rust
edit
0
0
apache-2.0
985498810af8cc3f01d682568ed4720d680d3cba
ptal/rust-interval
src/libinterval/ops.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nextern crate z80emulib;\n\n#[cfg(test)]\nmod test_zex {\n use z80emulib::memory::*;\n use z80emulib::cpu::*;\n\n static ZEXDOC: &'static [u8] = include_bytes!(\"zexdoc.com\");\n\n #[test]\n fn test_zexdoc() {\n let mut d...
rust
edit
0
2
mit
04acdb4584cbd49ddd950dcb15b828d124782d5a
Daedrus/rustz80emu
tests/zex.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse std::time;\nuse ::{CANSocket, ShouldRetry};\n\n#[test]\nfn test_nonexistant_device() {\n assert!(CANSocket::open(\"invalid\").is_err());\n}\n\n#[test]\n#[cfg(feature = \"vcan_tests\")]\nfn vcan0_timeout() {\n let cs = CANSocket::ope...
rust
edit
1
1
mit
03968527c0d7da7108976bb2dc7a31bebae93cc4
marcelbuesing/socketcan-rs,marcelbuesing/socketcan-rs
src/tests.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse super::*;\n\n#[derive(Debug, Clone, Eq, PartialEq)]\npub struct Crate {\n attrs: Vec<Attribute>,\n items: Vec<Item>,\n}\n\n#[cfg(feature = \"parsing\")]\npub mod parsing {\n use super::*;\n use attr::parsing::inner_attr;\n ...
rust
edit
0
3
apache-2.0
d73dba21b041df8742980bdf2ab3ee2aa384cdf2
dtolnay/syn
src/krate.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse std::string::String;\nuse std::slice::Iter;\n\npub struct MessageList {\n messages: Vec<Message>,\n}\n\npub enum MessageType {\n Info,\n Error,\n}\n\npub struct Message {\n text: String,\n ty: MessageType,\n}\n\nimpl Messag...
rust
edit
0
1
bsd-3-clause
05b4a22a7cd27dd202465c5b231ca38ce82fe43c
jgilchrist/rslike
src/engine/messages.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nextern crate systray;\n\n//#[cfg(target_os = \"windows\")]\nfn main() {\n let mut app;\n match systray::Application::new() {\n Ok(w) => app = w,\n Err(e) => panic!(\"Can't create window!\")\n }\n // w.set_icon_from_f...
rust
edit
0
2
bsd-3-clause
9830ae079f9e1bdb6ad6cb3e88093d6882322921
qdot/systray-rs,qdot/systray-rs
examples/systray-example.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nfn largest<T>(list: &[T]) -> T {\n let mut largest = list[0];\n\n for &item in list.iter() {\n if item > largest {\n largest = item;\n }\n }\n\n largest\n}\n\nstruct Point<T> {\n x: T,\n y: T,\n}\n\n...
rust
edit
0
3
mit
c98e96b8dd1795ded4adff6842f5caa89240ce54
pgrzesik/learning-rust
21_generics/src/main.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse std::str;\n\nuse interpreter::Interpretable;\nuse result::BfResult;\n\npub const FACTOR_SRC: &'static [u8] = include_bytes!(\"../bf/factor.bf\");\n\npub const HELLO_WORLD_SRC: &'static [u8] =\n b\"++++++[>++++++++++++<-]>.\\\n >++...
rust
edit
2
2
mit
69d161d5e262f3a9724510670e8d95e4cbc8195e
tov/bf-rs,tov/bf-rs,tov/bf-rs
src/test_helpers.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n#![feature(custom_attribute)]\n#![allow(dead_code, unused_attributes)]\n\n#[miri_run]\nfn overwriting_part_of_relocation_makes_the_rest_undefined() -> i32 {\n let mut p: *const i32 = &42;\n unsafe {\n let ptr = &mut p as *mut *co...
rust
edit
0
1
apache-2.0
2d5196147fed8bc1b84725bcdf8e3744fd806819
rust-lang/miri,rust-lang/miri,aidancully/rust,GBGamer/rust,GBGamer/rust,GBGamer/rust,aidancully/rust,aidancully/rust,graydon/rust,tsion/miri,graydon/rust,GBGamer/rust,graydon/rust,GBGamer/rust,graydon/rust,graydon/rust,GBGamer/rust,GBGamer/rust,graydon/rust,aidancully/rust,GBGamer/rust,rust-lang/miri,aidancully/rust,ai...
test/errors.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n#![no_main]\n\nuse libfuzzer_sys::fuzz_target;\n\nfuzz_target!(|data: &[u8]| {\n if data == b\"banana!\" {\n panic!(\"success!\");\n }\n});\n\n```\n\nApply this change: Change example to use `str::as_bytes` instead of array compa...
rust
edit
0
0
apache-2.0
1aa53e00a18b953caa5ea57b19ca2d1e70515c68
rust-fuzz/libfuzzer,rust-fuzz/libfuzzer,rust-fuzz/libfuzzer,rust-fuzz/libfuzzer,rust-fuzz/libfuzzer
example/src/main.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n#[derive(Deserialize, Debug)]\npub struct AuthResponse {\n pub session: SessionResponse\n}\n\n#[derive(Deserialize, Debug, Clone)]\npub struct SessionResponse {\n pub key: String,\n pub subscriber: i64,\n pub name: String\n}\n\n#[...
rust
edit
null
null
mit
31399e2090180de7b58d12d59123d0935bbf28cc
bobbo/rustfm-scrobble
src/dto.rs
rejected_syntax
Syntax error detected by tree-sitter
false
[ { "role": "user", "content": "Here is the current file:\n```rust\n// Copyright 2013 The Servo Project Developers. See the COPYRIGHT\n// file at the top-level directory of this distribution.\n//\n// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or\n// http://www.apache.org/licenses/LICENSE-2...
rust
edit
1
0
apache-2.0
6f43c9c253ee5f09434a321e21d610b7e2b543eb
mbrubeck/rust-geom,ruud-v-a/rust-geom,servo/rust-geom
lib.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse std::fs::File;\nuse std::io::prelude::*;\nuse std::io::BufReader;\n\npub fn taxicab(file: &str) -> i64 {\n let input = File::open(file).expect(\"File open fail.\");\n let reader = BufReader::new(input);\n\n let cur_dir = Directio...
rust
edit
1
2
mit
7dafc8f681e28a9e43ef94af9d308191530b807e
nathanjent/adventofcode-rust
src/day01_2016.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n//#![crate_type = \"dylib\"] // FIXME this fails with regular rust-crypto, since just builds rlibs by default. TODO PR to fix that\n#![crate_type = \"rlib\"]\n\n#![feature(phase)]\n#[phase(plugin, link)] extern crate log;\nextern crate debug;...
rust
edit
null
null
mit
499f36cdd720a2387680236677e545dfee7708b9
ehsanul/rust-ws,tempbottle/rust-ws
src/ws/lib.rs
rejected_syntax
Syntax error detected by tree-sitter
false
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse std::borrow::Borrow;\n\nuse oauth::Credentials;\n\n/// An OAuth token used to log into Twitter.\n#[derive(Copy, Clone, Debug)]\npub struct Token<C = String, T = String> {\n pub client: Credentials<C>,\n pub token: Credentials<T>,\n}...
rust
edit
0
1
mit
00ce4bf3373663c6d25cedd34cb03a0a1944c95e
d12i/twitter-streams-rs,dmizuk/twitter-stream-rs,d12i/twitter-stream-rs
src/token.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n#![feature(custom_attribute)]\n#![allow(dead_code, unused_attributes)]\n\n#[miri_run]\nfn make_vec() -> Vec<i32> {\n let mut v = Vec::with_capacity(4);\n v.push(1);\n v.push(2);\n v\n}\n\n#[miri_run]\nfn make_vec_macro() -> Vec<i3...
rust
edit
0
1
apache-2.0
11c78fbdc8289e31b11a4ebda9f4930794de16bb
rust-lang/miri,aidancully/rust,graydon/rust,aidancully/rust,graydon/rust,aidancully/rust,GBGamer/rust,tsion/miri,aidancully/rust,graydon/rust,aidancully/rust,rust-lang/miri,GBGamer/rust,GBGamer/rust,graydon/rust,GBGamer/rust,graydon/rust,aidancully/rust,graydon/rust,rust-lang/miri,GBGamer/rust,GBGamer/rust,rust-lang/mi...
test/vecs.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n// check-pass\n\n// Test several functions can be used for constants\n// 1. Vec::new()\n// 2. String::new()\n// 3. BTreeMap::new()\n// 3. BTreeSet::new()\n\n#![feature(const_btree_new)]\n\nconst MY_VEC: Vec<usize> = Vec::new();\n\nconst MY_ST...
rust
edit
1
1
apache-2.0
707cfd167236cf6bffb7bb60e98cd5eb44f678c7
aidancully/rust,graydon/rust,aidancully/rust,graydon/rust,aidancully/rust,aidancully/rust,graydon/rust,aidancully/rust,graydon/rust,graydon/rust,graydon/rust,aidancully/rust
src/test/ui/collections-const-new.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse nom::{ConsumerState, Move};\n\n\nuse metadata::{Metadata, StreamInfo, metadata_parser};\nuse frame::{frame_parser, Frame};\n\nenum ParserState {\n Marker,\n Metadata,\n Frame,\n}\n\npub struct Stream {\n pub info: StreamInfo,\n pub m...
rust
edit
null
null
bsd-3-clause
0aafd6507d3882de2ada259c71d2d8ec1dd25fd3
sourrust/flac
src/stream.rs
rejected_syntax
Syntax error detected by tree-sitter
false
[ { "role": "user", "content": "Here is the current file:\n```rust\n#[cfg(feature=\"gnustep_runtime\")]\nextern crate gcc;\n\n#[cfg(not(feature=\"gnustep_runtime\"))]\nfn compile() {\n}\n\n#[cfg(feature=\"gnustep_runtime\")]\nfn compile() {\n gcc::Config::new().flag(\"-lobjc\")\n .flag...
rust
edit
0
1
mit
f65473efcf93dd944cc1727e3cbe9e8285d06e58
ngrewe/rust-objc,ngrewe/rust-objc
build.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse std;\nuse extra::comm::DuplexStream;\n\nuse player;\n\nstruct WorldState {\n player_state: ~player::PlayerState,\n ticks: int,\n}\n\nimpl WorldState {\n pub fn new(player_state: ~player::PlayerState) -> WorldState {\n Worl...
rust
edit
null
null
bsd-2-clause
3f7b4b2a393e310c54c349347ecd0b036d91973e
brendonjustin/platformer
src/platformer/world.rs
rejected_syntax
Syntax error detected by tree-sitter
false
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse std::ffi::{CString, NulError};\nuse std::os::raw::c_char;\nuse std::path::PathBuf;\nuse libc::{c_int, uint32_t};\n\nextern {\n #[link(name = \"dyld\")]\n fn _NSGetExecutablePath(buf: *mut c_char, bufsize: *mut uint32_t) -> c_int;\n}...
rust
edit
2
3
apache-2.0
f498ad40a77772f30368a245eff5dad65c59b9f3
wesleywiser/process_path
src/macos.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n#[macro_export]\nmacro_rules! dense {\n ($elem:expr; $m:expr, $n:expr) => {\n $crate::DenseMatrix::from_vec(vec![$elem; $m*$n], $m, $n, None)\n };\n ($($($a:expr),+);+) => {\n $crate::DenseMatrix::new(&[$(vec![$(($a),)+...
rust
edit
0
0
apache-2.0
112a71998c8ce3c648ec56f9f2d17239c38381a9
mikopits/rola
src/macros.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n#![cfg(not(miri))] // FIXME: takes too long\n\nuse hashbrown::HashSet;\nuse rand::{distributions::Alphanumeric, rngs::SmallRng, Rng, SeedableRng};\n\n#[test]\nfn test_hashset_insert_remove() {\n let mut m: HashSet<Vec<char>> = HashSet::new...
rust
edit
1
5
apache-2.0
5509bb1f22cb2cbb4d751f01b80fc326707cf5db
rust-lang/hashbrown,rust-lang/hashbrown
tests/set.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n// xfail-test\n// runs forever for some reason -- investigating\nfn main() {\n let i = 0u;\n loop {\n log(error, \"a\");\n i += 1u;\n if i == 10u {\n break;\n }\n }\n assert (i == 10u);\n let is_even = false;\n loop {\n...
rust
edit
null
null
apache-2.0
d3035a1b205caef6279c91b276e672c54318838c
GBGamer/rust,pythonesque/rust,j16r/rust,dwillmer/rust,nwin/rust,rprichard/rust,pythonesque/rust,Ryman/rust,GBGamer/rust,kmcallister/rust,barosl/rust,dwillmer/rust,LeoTestard/rust,sarojaba/rust-doc-korean,gifnksm/rust,l0kod/rust,barosl/rust,barosl/rust,pshc/rust,jbclements/rust,ktossell/rust,dinfuehr/rust,quornian/rust,...
src/test/run-pass/loop-break-cont.rs
rejected_syntax
Syntax error detected by tree-sitter
false
[ { "role": "user", "content": "Here is the current file:\n```rust\npub mod control_regs;\npub mod descriptor;\npub mod dtables;\npub mod io;\npub mod irq;\npub mod msr;\npub mod paging;\npub mod flags;\npub mod segmentation;\npub mod task;\npub mod tlb;\n\n#[derive(Copy, Clone, PartialEq, Eq)]\n#[repr(u8)]\n...
rust
edit
1
1
mit
b543a78017f5733e70cb6236c22c827fbdb865c0
gz/rust-x86,gz/rust-x86,phil-opp/rust-x86_64
src/shared/mod.rs
rejected_duplicate
Near-duplicate of sample 121388
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse diesel::prelude::*;\n\nuse helpers::db::DB;\n\nuse models::user::User;\nuse models::queue::QueueEntry;\n\nuse schema::queue_entries::dsl as queue_entry_dsl;\n\nuse responses::{APIResponse, ok};\n\n/// The user needs to be logged in to acc...
rust
edit
0
2
mit
acc30cc253e4835c60407bf304369846f90becd4
Nukesor/spacesurvival,Nukesor/spacesurvival,Nukesor/spacesurvival,Nukesor/spacesurvival
server/src/api/queue/pod.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n// Tests that we correctly handle the instantiated\n// inference variable being completely unconstrained.\n//\n// check-pass\n#![feature(type_alias_impl_trait)]\n\ntype Foo = impl Copy;\n\nenum Wrapper<T> {\n First(T),\n Second\n}\n\nfn...
rust
edit
0
1
apache-2.0
61c75bdb11e782ee50ff1e4de6d29fd5ff4f0e31
graydon/rust,graydon/rust,aidancully/rust,aidancully/rust,aidancully/rust,aidancully/rust,graydon/rust,aidancully/rust,graydon/rust,aidancully/rust,graydon/rust,graydon/rust
src/test/ui/type-alias-impl-trait/fallback.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n#![no_std]\n\n#[macro_use]\nextern crate static_assertions;\n\nassert_impl!(byte; u8, Send, Sync);\nassert_impl!(slice; [u8], Send, Sync, AsRef<[u8]>);\n\n#[cfg(feature = \"failure\")]\nassert_impl!(ptr; *const u8, Send, Sync);\n\n#[test]\nfn...
rust
edit
0
1
apache-2.0
326feddbcc90fe6adf6d95a2759c56a90fc0e4c0
nvzqz/static-assertions-rs
tests/trait_impl.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\n// Copyright 2015, The Gtk-rs Project Developers.\n// See the COPYRIGHT file at the top-level directory of this distribution.\n// Licensed under the MIT license, see the LICENSE file or <http://opensource.org/licenses/MIT>\n\nuse std::marker:...
rust
edit
0
1
mit
2e60fffe123ee82365a65b77d17148ed4d56b8f0
rust-gnome/gdk,hmeyer/gdk,gkoz/gtk-rs-gdk,hmeyer/gdk,gkoz/rust-gnome-gdk,gkoz/rust-gnome-gdk,gkoz/gtk-rs-gdk,rust-gnome/gdk
src/object.rs
rejected_duplicate
Near-duplicate of sample 120209
true
[ { "role": "user", "content": "Here is the current file:\n```rust\npub fn verse(index: usize) -> String {\n match index {\n 2 => {\n \"2 bottles of beer on the wall, 2 bottles of beer.\\n\\\n Take one down and pass it around, 1 bottle of beer \\\n on the wall.\\n\...
rust
edit
0
2
bsd-2-clause
18857725519fa7974a64edebafddebf1965183f0
gyn/exercism,gyn/exercism,gyn/exercism,gyn/exercism
rust/beer-song/src/lib.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nextern crate libc;\nextern crate std;\n\nuse super::liblua;\nuse super::Index;\nuse super::Lua;\nuse super::Pushable;\nuse super::Readable;\n\nimpl<T:Pushable> Pushable for Vec<T> {\n fn push_to_lua(&self, lua: &mut Lua) {\n unimple...
rust
edit
0
2
mit
0deaf87293ab2d11caf11dcd3c8de6af8606209a
rphmeier/hlua,tempbottle/hlua,tomaka/hlua,rphmeier/hlua,tailhook/hlua,tailhook/hlua,tomaka/hlua,tempbottle/hlua,tailhook/hlua,rphmeier/hlua,tomaka/hlua,tempbottle/hlua
src/tables.rs
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```rust\nuse super::*;\nuse redox::*;\n\n/// Get the next instruction\n// TODO: Should this be an iterator instead?\npub fn next_inst(editor: &mut Editor) -> Inst {\n let mut n = 0;\n\n loop {\n if let EventOption::Key(k) = editor.window....
rust
edit
1
9
mit
ef920b64c53e66de9d303398b1ab4a667a390dbd
redox-os/sodium
parse.rs
accepted
null
true