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#![no_std]\n#![no_main]\n\nuse daedalos::println;\n\n#[no_mangle]\npub extern \"C\" fn _start() -> ! {\n println!(\"Hello, world!\");\n loop {}\n}\n\n#[cfg(not(test))]\nuse core::panic::PanicInfo;\n#[cfg(not(test))]\n#[panic_handler]\nf... | rust | edit | 0 | 1 | bsd-3-clause | a41d87d2791d588ea6efd08d2075fb407d7c2881 | bemeurer/daedalos | src/main.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nuse std::ops::{\n RangeFull,\n RangeFrom,\n RangeTo,\n Range,\n};\n\n/// **RangeArgument** is implemented by Rust's built-in range types, produced\n/// by range syntax like `..`, `a..`, `..b` or `c..d`.\npub trait RangeArgument {\... | rust | edit | 0 | 1 | apache-2.0 | 1eec0d483477393f8dfbd2eab70ffadad0a5e624 | Stebalien/arrayvec,tbu-/arrayvec,bluss/arrayvec | src/misc.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nextern crate cards;\n\nuse cards::card::{Card};\n\n//TODO: this could be an option as well\n//pub type CardSlot = Option<Card>;\n\npub enum CardSlot {\n Empty,\n Dealt(Card),\n}\n\nimpl CardSlot {\n pub fn expect_borrow(&self) -> &Ca... | rust | edit | 0 | 2 | mit | c6fb42fafb75920ebb5dcc4a8270678406885fa9 | th4t/holdem-rs | src/lib.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nuse std::thread;\nuse std::sync::mpsc::channel;\nuse std::sync::mpsc::Sender;\nuse std::sync::mpsc::Receiver;\n\n/// Create a bidirectional channel\n/// Returns two sender-receiver channel pairs\n/// One pair should be given to one thread\n//... | rust | edit | 0 | 1 | apache-2.0 | c3cd7e65006f0018879ef1763977e579ae682c97 | DanielJoyce/websocket-serial-server,DanielJoyce/websocket-serial-server | src/serial_support/common.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n//! Entry point for the dummy project.\n//! This comment block tests `rust doc`;\n//! you should be able to see it from the documentation\n//! folder after running the project's rustDoc task\n//! in Gradle.\n\n/// Prints a message to test doc... | rust | edit | 2 | 1 | mit | c907b32513359ab4b82456d399276d2bab1e0170 | jTitor/rust-gradle-plugin | src/test/dummy-project/src/main.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nstruct Index {\n path: String,\n entries: Vec<String>,\n}\n\nimpl Index {\n fn new(path: &str) -> Index {\n return Index { path: path.to_string(), entries: vec![] }\n }\n}\n\n#[test]\nfn new_creates_index_with_passed_path()... | rust | edit | 0 | 2 | mit | 2c168be2e74115730acce90a8a177d98eae7758f | jmacdonald/bloodhound | src/index.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nuse errors;\n\n// see OSC Type Tag String: http://opensoundcontrol.org/spec-1_0\n// padding: zero bytes (n*4)\n\n#[derive(Debug)]\npub enum OscType {\n Int(i32),\n Float(f32),\n String(String),\n Blob(Vec<u8>),\n Time(u32, u32)... | rust | edit | 1 | 0 | apache-2.0 | 62a74f2409b8aa8783a6d17b04bef83b4bce9450 | klingtnet/rosc | src/types.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\npub use std::collections::{HashSet, HashMap};\n\nmod graph;\nmod traversal;\nmod tree;\n\nfn main() {\n\n}\n\n```\n\nApply this change: Add some basic tests in main"
},
{
"role": "assistant",
"content": "pub use std::collections::... | rust | edit | 1 | 1 | mit | 3de703e65c6c449ba380b9c825fc95a828cb45da | nham/gymnosporangium | src/mod.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nextern crate cc;\n\nfn main() {\n let asm_path = if cfg!(target_arch = \"x86\") {\n \"src/x86.S\"\n } else if cfg!(target_arch = \"x86_64\") {\n \"src/x64.S\"\n } else {\n \"src/generic.c\"\n };\n cc::Build... | rust | edit | 0 | 4 | isc | 5f994583ba95e40b53bb06f49549b03119f78f94 | Luminarys/synapse,Luminarys/synapse,Luminarys/synapse | sha1/build.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nextern crate janeiro;\n\n#[macro_use]\nextern crate log;\nextern crate env_logger;\n\n\nuse std::str;\n\nuse janeiro::{Rio, Transport, Protocol, Reason};\n\n\nstruct HttpClientProtocol;\nimpl HttpClientProtocol {\n fn new() -> HttpClientPr... | rust | edit | 0 | 2 | bsd-3-clause | 622c03c0d29e95ce64c9f0a8889a5d00a690423f | mardiros/janeiro | examples/http_cli.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n//\n// sprocketnes/gfx.rs\n//\n// Copyright (c) 2013 Mozilla Foundation\n// Author: Patrick Walton\n//\n\nuse ppu;\n\nuse core::uint::range;\nuse sdl::sdl::{InitTimer, InitVideo};\nuse sdl::sdl;\nuse sdl::video::{DoubleBuf, HWSurface, Surface... | rust | edit | null | null | mit | b8971265c3b3722c06afc1d40a936bc26b6fa526 | steveklabnik/sprocketnes,beni55/sprocketnes,bgourlie/sprocketnes,benklebe/sprocketnes,pcwalton/sprocketnes,jonas-schievink/sprocketnes | gfx.rs | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n// Using structs to represent 2D points\n// and calculating the Euclidean distance between them\n\nmod pointutils {\n\n pub struct Point {\n pub x: f64,\n pub y: f64,\n }\n\n\n pub fn euclidean(point_a: Point, point_b: ... | rust | edit | 2 | 1 | bsd-2-clause | b41b158bc4c0e3dbf1bdee2ff18e5f7336a3e3e2 | ambidextrousTx/ToyRustPrograms | euclidean.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n// Regression test for https://github.com/servo/html5ever/issues/393\n//\n// Create a dynamic atom − causing initialization of the golbal hash map −\n// in a thread that has a small stack.\n//\n// This is a separate test program rather than a... | rust | edit | 0 | 2 | apache-2.0 | 7934bf9eb7784962d5af8f96258756fc480d4c22 | servo/string-cache | tests/small-stack.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n//! Modules and types for events in the `m.policy.rule` namespace.\n\nuse serde::{Deserialize, Serialize};\n\nuse crate::{serde::StringEnum, PrivOwnedStr};\n\npub mod room;\npub mod server;\npub mod user;\n\n/// The payload for policy rule ev... | rust | edit | 1 | 1 | mit | 63934338823ef9e7ef556bea12707531ab2600e7 | ruma/ruma | crates/ruma-common/src/events/policy/rule.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n#![feature(custom_attribute, rustc_attrs)]\n#![allow(dead_code, unused_attributes)]\n\n#[rustc_mir]\n#[miri_run]\nfn foo() -> i32 {\n let x = 1;\n let y = 2;\n x + y\n}\n\nfn main() {}\n\n```\n\nApply this change: Add more tests. Rem... | rust | edit | 0 | 1 | apache-2.0 | fbec376eedd5f6ac39ae629d9ffcd216ff37e0a6 | graydon/rust,graydon/rust,GBGamer/rust,GBGamer/rust,graydon/rust,aidancully/rust,rust-lang/miri,aidancully/rust,tsion/miri,GBGamer/rust,GBGamer/rust,aidancully/rust,aidancully/rust,GBGamer/rust,rust-lang/miri,GBGamer/rust,aidancully/rust,GBGamer/rust,aidancully/rust,rust-lang/miri,graydon/rust,graydon/rust,rust-lang/mi... | test/add.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nuse std::collections::HashMap;\nuse edge;\n\npub type Index = usize;\n\npub struct Node {\n pub identifier: String,\n pub attributes: Option<HashMap<String, String>>,\n pub first_outgoing_edge: Option<edge::Index>,\n}\n\n```\n\nApply... | rust | edit | 1 | 2 | mit | f748914b33547866dccca8569d31a890915ecbf8 | charlieegan3/graph_match | src/node.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\npub fn hamming_distance<'a, 'b>(a: &'a str, b: &'a str) -> Result<usize, &'b str> {\n if a.len() != b.len() {\n return Err(\"Length is not same\");\n }\n\n let max = a.len();\n\n let mut ai = a.chars();\n let mut bi = b.... | rust | edit | 0 | 2 | bsd-2-clause | 9b5b542bc807f7bd6370495946867efad29b541d | gyn/exercism,gyn/exercism,gyn/exercism,gyn/exercism | rust/hamming/src/lib.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nextern crate serialize;\nextern crate rustbox;\nextern crate docopt;\nextern crate rdit;\n\nuse docopt::Docopt;\n\n#[cfg(not(test))] use rdit::Editor;\n\n\nstatic USAGE: &'static str = \"\nUsage: rdit [<filename>]\n rdit --help\n\nOptio... | rust | edit | 0 | 1 | mit | 9d295f841219962d234b7fcfd217c007e9adf0c8 | jadnohra/iota,crespyl/iota,gchp/iota | src/main.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n// Copyright 2015 The Rust Project Developers. See the COPYRIGHT\n// file at the top-level directory of this distribution and at\n// http://rust-lang.org/COPYRIGHT.\n//\n// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or\n//... | rust | edit | null | null | apache-2.0 | 9510add6a3148f753776d6f6ac324690dba4a5d5 | GBGamer/rust,graydon/rust,aidancully/rust,graydon/rust,aidancully/rust,aidancully/rust,graydon/rust,GBGamer/rust,aidancully/rust,graydon/rust,aidancully/rust,GBGamer/rust,GBGamer/rust,GBGamer/rust,aidancully/rust,GBGamer/rust,GBGamer/rust,graydon/rust,GBGamer/rust,graydon/rust | src/test/rustdoc/auxiliary/rustdoc-default-impl.rs | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nextern crate lp_modeler;\n\nuse lp_modeler::operations::{LpOperations};\nuse lp_modeler::problem::{LpProblem, LpObjective};\nuse lp_modeler::solvers::*;\nuse lp_modeler::variables::{LpInteger};\n\nfn main() {\n\n\n let ref a = LpInteger::n... | rust | edit | 0 | 3 | mit | 6511e908d78f26e671770fb3150878ae13bf51fb | tvincent2/rust-lp-modeler,jcavat/rust-lp-modeler | src/main.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n// AsRef and AsMut allow for cheap reference-to-reference conversions.\n// Read more about them at https://doc.rust-lang.org/std/convert/trait.AsRef.html\n// and https://doc.rust-lang.org/std/convert/trait.AsMut.html, respectively.\n\n// I AM... | rust | edit | 0 | 1 | mit | dfdf8093ebbd4145864995627b812780de52f902 | carols10cents/rustlings,carols10cents/rustlings | exercises/conversions/as_ref_mut.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n#![feature(core)]\n#![feature(old_io)]\n#![feature(old_path)]\n\nextern crate crc64;\nuse crc64::crc64;\nuse std::env;\nuse std::old_io::{BufferedReader, File};\n\nfn main() {\n let mut args = env::args();\n let (len,_) = args.size_hint... | rust | edit | 0 | 5 | bsd-3-clause | 44d7dda61cecc2327f0a1d2c93a7337de38b78d8 | badboy/crc64-rs | src/main.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n//! Types for the *m.room.create* event.\n\nuse ruma_identifiers::UserId;\n\nstate_event! {\n /// This is the first event in a room and cannot be changed. It acts as the root of all other\n /// events.\n pub struct CreateEvent(Create... | rust | edit | 0 | 0 | mit | 2834dd4632438f8a12755fde97e0e693a38ff81c | ruma/ruma-events,ruma/ruma | src/room/create.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nuse parser::ArgumentParser;\nuse super::StoreOption;\nuse test_parser::{check_ok,check_err};\n\n#[test]\nfn test_opt() {\n let mut val = None;\n let mut ap = ArgumentParser::new();\n ap.refer(&mut val)\n .add_option([\"-s\", \"-... | rust | edit | null | null | mit | 0f966268ab459e8451ec47ffd8e3027fdafccc5d | marvelm/rust-argparse,TimNN/rust-argparse,tailhook/rust-argparse,SamuelMarks/rust-argparse | argparse/test_optional.rs | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nuse command::Command;\n\npub fn parse(s: &str) -> Vec<Command> {\n let mut vec = Vec::new();\n for c in s.chars() {\n let command = match c {\n '.' => Some(Command::Output),\n ',' => Some(Command::Input),\n ... | rust | edit | 0 | 4 | mit | 4e0903c049fd4a1ad7638a4c4c4a6ef32e11af31 | nafarlee/thoughtfuck | src/parse.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n#[derive(Clone, Copy)]\npub struct True;\n#[derive(Clone, Copy)]\npub struct False;\n\nconst TRUE: True = True;\nconst FALSE: False = False;\n\nimpl True {\n pub const fn not<'a>(&'a self) -> &'a False { &FALSE }\n pub const fn and<'a, ... | rust | edit | 0 | 1 | apache-2.0 | 98c250adcf78f14d6d901c9b966cda4cf10f1509 | nvzqz/static-assertions-rs | src/bool.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n#![feature(globs)]\n#![crate_type = \"bin\"]\nextern crate rust_js;\nuse rust_js::lexer::Lexer;\nuse rust_js::parser::{Parser, VerboseResult};\nuse rust_js::exec::{Executor, Interpreter};\nuse std::io;\n\nfn main() {\n\tlet mut engine : ~Inte... | rust | edit | null | null | mit | ddfbbc3a1902ae2efe97b1d059e48ba2c6f0952c | synlestidae/js.rs,TomBebbington/js.rs,synlestidae/js.rs,new-mind/js.rs,new-mind/js.rs,TomBebbington/js.rs | src/interactive.rs | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n// File with main method. Can be used to start the generator without\n// including it as a library from an external program.\nmod map_generator;\n\nfn main() {\n let mut height_map: Vec<int> = Vec::from_fn(1600, |_| 0);\n\n let number_of_dr... | rust | edit | 0 | 2 | mit | 7c43631cd03cb9864751e78ca063182edefe3473 | gilles-leblanc/potential-dangerzone,gilles-leblanc/potential-dangerzone | src/main.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nuse {MultiDeciderImpl, TypedDecider, ImpliedDeciderImpl, MultiDecider, Decider, Decision, Result};\n\nuse std::time::Instant;\n\nimpl Decider for Allower {}\nimpl MultiDecider for Allower {}\n\n#[derive(Copy, Clone)]\n/// The most naive imple... | rust | edit | 7 | 1 | mit | ff6ba4dca04bca8850d79b1fb453386092f4e2d8 | antifuchs/ratelimit_meter | src/example_algorithms.rs | rejected_lint | Too many lint violations: 7 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nstruct Philosopher {\n name: String\n}\n\nimpl Philosopher {\n fn new(name: &str) -> Philosopher {\n Philosopher {\n name: name.to_string()\n }\n }\n}\n\nfn main() {\n let p1 = Philosopher::new(\"Judith Bu... | rust | edit | 8 | 1 | mit | 3a8a29bfcadbc1a9d40b5977b8179e262042f96e | juliangrosshauser/dining_philosophers | src/main.rs | rejected_lint | Too many lint violations: 8 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n#[macro_use]\nextern crate diesel;\nextern crate dotenv;\n\npub mod models;\npub mod schema;\n\nuse diesel::prelude::*;\nuse dotenv::dotenv;\nuse std::env;\n\npub fn establish_connection() -> PgConnection {\n dotenv().ok();\n\n let data... | rust | edit | 1 | 1 | apache-2.0 | 8c39c51cf250a5b84552e7e1510876149bc3bc8d | diesel-rs/diesel,sgrif/diesel,sgrif/diesel,diesel-rs/diesel | examples/postgres/getting_started_step_1/src/lib.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nuse chattium_oxide_lib::json::FromJsonnable;\nuse chattium_oxide_lib::ChatMessage;\nuse hyper::server::{Request, Response};\nuse hyper::status::StatusCode;\nuse hyper::method::Method;\nuse std::io::Read;\n\n\npub fn handle_client(req: Request... | rust | edit | 0 | 4 | mit | 52447a47ad543fc215908bf20604aa60fd22318f | nabijaczleweli/chattium-oxide-server,nabijaczleweli/chattium-oxide-server,nabijaczleweli/chattium-oxide-server | src/client_handler.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nuse cards::Card;\n\n// All these functions need reverse sorted vectors of Cards\npub fn has_pair(card_vec: &Vec<&Card>) -> bool {\n let mut prev: &Card = card_vec[0];\n for card in card_vec.iter().skip(1) {\n if *card == prev {\n... | rust | edit | 0 | 4 | mit | b11e64b8f31c124104a1104a30f1c152f6c88785 | JelteF/pokers | src/combos.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nuse irc::client::prelude::*;\nuse irc::error::Error as IrcError;\n\nuse plugin::*;\n\n#[derive(PluginName, Debug)]\npub struct KeepNick;\n\nimpl KeepNick {\n pub fn new() -> KeepNick {\n KeepNick {}\n }\n\n fn check_nick(&self... | rust | edit | 0 | 4 | mit | 6ba6651cdda7528e39a94c596b5137ec4f8d32e6 | Mavulp/frippy | src/plugins/keepnick.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n//! This example shows how to transmit a request with a custom HTTP header.\n\nextern crate xmlrpc;\nextern crate reqwest;\n\nuse xmlrpc::{Request, Transport};\nuse xmlrpc::http::{build_headers, check_response};\n\nuse reqwest::{Client, Reque... | rust | edit | 0 | 3 | cc0-1.0 | e146e471b2d5f29c932d61964e0b646a7661a6c8 | jonas-schievink/xml-rpc-rs | examples/custom-header.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n#[cfg(unix)]\npub use self::unix::{\n pipe, set_nonblock, Event, EventedFd, Events, Io, Selector, SysEvent, TcpListener, TcpStream,\n UdpSocket, Waker,\n};\n\n#[cfg(unix)]\npub mod unix;\n\n#[cfg(windows)]\npub use self::windows::{\n ... | rust | edit | 0 | 0 | mit | de208b33554d720007d95db9924ca3dd3cfc5b7f | carllerche/mio,murarth/mio,carllerche/mio | src/sys/mod.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nuse compiler::Lexer;\nuse std::old_io::{BufferedReader, IoErrorKind};\nuse std::old_io::fs::File;\nuse std::os;\n\nmod compiler;\n\n#[allow(dead_code)]\nfn main() {\n let args = os::args();\n let file_name = match args.get(1) {\n ... | rust | edit | 2 | 4 | mit | 3cf0a70cb1489154eb7ac712abfc36e452107c0a | jtdowney/som-rust,jtdowney/som.rs | src/main.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n#![no_std]\n\nuse libtock_low_level_debug::{AlertCode, LowLevelDebug};\nuse libtock_platform::Syscalls;\nuse libtock_runtime::TockSyscalls;\n\n#[panic_handler]\nfn panic_handler(_info: &core::panic::PanicInfo) -> ! {\n // Signal a panic us... | rust | edit | 0 | 1 | apache-2.0 | 965abaacac115c403ab668ab9f9f1e83dc6078d2 | tock/libtock-rs | panic_handlers/small_panic/src/lib.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nextern crate rgmk;\nextern crate env_logger;\n\nfn main() {\n env_logger::init().unwrap();\n let path = std::env::args().skip(1).next().expect(\"Expected file name as argument\");\n let mut gamedata = rgmk::GameData::from_file(&path)... | rust | edit | 0 | 1 | mit | 4de130e33473e1c5e7f5cf507ce449aa1429eb9e | crumblingstatue/rgmk | src/bin/test_text_manip.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\npub struct Memory {\n addr:[u8; 0xffff]\n}\n\nimpl Memory {\n pub fn new() -> Memory {\n Memory {\n addr: [0; 0xffff]\n }\n }\n\n pub fn store(&mut self, addr: usize, data: u8) -> Result<(), &'static str> {\n if addr > 0xfff... | rust | edit | 0 | 2 | mit | edc8a714a4b5bb452f6deb2b00f5c397e039d231 | bgourlie/rs-nes,bgourlie/rs-nes,bgourlie/rs-nes | src/memory.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nuse crate::prelude::*;\n\nmod code_layout;\nmod stack2reg;\n\npub(crate) fn optimize_function<'tcx>(\n tcx: TyCtxt<'tcx>,\n #[cfg_attr(not(debug_assertions), allow(unused_variables))] instance: Instance<'tcx>,\n ctx: &mut Context,\n ... | rust | edit | 1 | 2 | apache-2.0 | 365cebf779db2baee8fed65a4f01f4f3a356a6b8 | aidancully/rust,aidancully/rust,graydon/rust,aidancully/rust,aidancully/rust,aidancully/rust,graydon/rust,graydon/rust,graydon/rust,graydon/rust,aidancully/rust,graydon/rust | src/optimize/mod.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n// xfail-test FIXME #6257\n\n// Copyright 2013 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, Versi... | rust | edit | 0 | 1 | apache-2.0 | 47fc24bd8f48032c259f3573b4836dffae048ea3 | pythonesque/rust,sae-bom/rust,nwin/rust,krzysz00/rust,dwillmer/rust,stepancheg/rust-ide-rust,pythonesque/rust,AerialX/rust,bombless/rust,rohitjoshi/rust,jashank/rust,servo/rust,miniupnp/rust,mitsuhiko/rust,rprichard/rust,AerialX/rust,Ryman/rust,GBGamer/rust,reem/rust,0x73/rust,defuz/rust,ruud-v-a/rust,nham/rust,cllns/r... | src/test/run-pass/deriving-self-lifetime-totalord-totaleq.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n//! Parse a Rust source file into a `syn::File` and print out a debug\n//! representation of the syntax tree.\n//!\n//! Use the following command from this directory to test this program by\n//! running it on its own source code:\n//!\n//! ... | rust | edit | 0 | 2 | apache-2.0 | 3f4d6ef67c7f7bc5cdf2d2b1063095be3297c7da | dtolnay/syn | examples/dump-syntax/main.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\npub fn find_saddle_points(input: &[Vec<u64>]) -> Vec<(usize, usize)> {\n let mut row_max = vec![Vec::new(); input.len()];\n let mut col_min: Vec<Vec<(usize, u64)>> = vec![Vec::new(); input[0].len()];\n\n for (row, values) in input.it... | rust | edit | 1 | 7 | mit | 947d4ddb90a334b40a00a7429e7ceb5587097436 | attilahorvath/exercism-rust | saddle-points/src/lib.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n//! TODO Documentation\n\nuse libc::c_int;\nuse std::marker::PhantomData;\n\nuse wlroots_sys::wlr_surface_state;\n\nuse Surface;\n\n/// Surface state as reported by wlroots.\n#[derive(Debug)]\npub struct SurfaceState<'surface> {\n state: *... | rust | edit | 1 | 1 | mit | 8e28c980252a701bb7891e25e3b9dce8a4dfee7b | way-cooler/wlroots-rs,way-cooler/wlroots-rs | src/types/surface/surface_state.rs | accepted | null | true |
[
{
"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\nuse httpbin::basic_auth__... | rust | edit | 0 | 6 | mit | a03f6af6dd476a8ac19496a4c0d118e16249396e | OJFord/tapioca | examples/httpbin.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nextern crate adventofcode;\nuse adventofcode::d2::{Error, Parser, Program};\nuse std::io;\nuse std::io::BufRead;\n\nfn program_for(inp: &str, v: Vec<i64>) -> Vec<i64> {\n let mut p = Program::new(Parser::parse(&inp));\n p.run(&mut v.int... | rust | edit | 0 | 3 | mit | 4b06b352ad0ef85e2a68634cc9ecae5e22d890a4 | bk2204/adventofcode-work,bk2204/adventofcode-work | 2019/src/d9.rs | accepted | null | true |
[
{
"role": "user",
"content": "Write rust code for the following: Add from/into/as raw impls for RenderPipelineState"
},
{
"role": "assistant",
"content": "use cocoa::base::id;\n\npub struct RenderPipelineState(id);\n\nimpl_from_into_raw!(RenderPipelineState, of protocol \"MTLRenderPipelineState\... | rust | new_file | 0 | 0 | apache-2.0 | 67509a4bf1acb3715fc12ee6f76b058b274e8c54 | burtonageo/metl | src/render_pipeline_state.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nuse codegen::generate_single_version_file;\nuse env::Env;\n\nmod build;\nmod cargo_toml;\npub mod ffi_type;\nmod fields;\nmod functions;\nmod lib_;\nmod statics;\nmod tests;\n\npub fn generate(env: &Env) {\n generate_single_version_file(en... | rust | edit | 1 | 1 | mit | f6a766c2de73197a5db7ed2349f2133e5c4a0b0c | GuillaumeGomez/gir,GuillaumeGomez/gir,EPashkin/gir,gtk-rs/gir,gtk-rs/gir,gtk-rs/gir,EPashkin/gir,GuillaumeGomez/gir | src/codegen/sys/mod.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nuse std::ptr;\nuse std::sync::atomic::AtomicBool;\n\nuse gobject_subclass::object::*;\n\n#[repr(C)]\npub struct ElementInstanceStruct<T: ObjectType> {\n _parent: T::GlibType,\n _imp: ptr::NonNull<T::ImplType>,\n\n _panicked: AtomicBo... | rust | edit | 0 | 2 | apache-2.0 | 1f596d414d4d94474307e14935bd6d51786680aa | sdroege/rsplugin,sdroege/rsplugin | gst-plugin/src/object.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nuse handlebars_iron::{Template, HandlebarsEngine};\n\nuse serde_json::builder::ObjectBuilder;\n\nuse serde_json::value::Value;\n\nuse iron::prelude::*;\nuse iron::status;\nuse router::Router;\n\nuse helpers::value_to_json;\nuse content;\n\npu... | rust | edit | 1 | 1 | isc | 3dbd26c18a786334a98bc81b0986bfdf2d485272 | Nightfall/MCMUCH-Rust-Website | src/pages.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nmod idt;\n\nlazy_static! {\n static ref IDT: idt::Idt = {\n let mut idt = idt::Idt::new();\n\n idt.set_handler(0, divide_by_zero_wrapper);\n\n idt\n };\n}\n\npub fn init() {\n IDT.load();\n}\n\n#[derive(Debug)]\n... | rust | edit | 1 | 1 | apache-2.0 | 71ebb23ec381c4b8275c07cb4f6e4afd7605492a | phil-opp/blog_os,phil-opp/blog_os,phil-opp/blog_os,phil-opp/blogOS,phil-opp/blogOS,phil-opp/blog_os | src/interrupts/mod.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nmod error;\npub mod load;\npub mod memory;\npub mod cpu_stat;\n\nuse std::fs;\nuse std::io;\nuse std::io::Read;\nuse std::path::Path;\nuse std::result;\n\npub use error::ProbeError;\n\npub type Result<T> = result::Result<T, error::ProbeError>... | rust | edit | null | null | mit | d1195277fe201abf236ae89b0943a0e2a2f11f07 | appsignal/probes-rs | src/lib.rs | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n#[allow(ctypes)];\n#[no_std];\n#[no_core];\n\nmod zero;\n\nenum Color {\n Black = 0,\n Blue = 1,\n Green = 2,\n Cyan = 3,\n Red = 4,\n Pink = 5,\n Brown = 6,\n LightGray ... | rust | edit | null | null | apache-2.0 | bf6b23db8b5ce4868d7ac7303519fb8f51499707 | ryanra/RustOS,RustOS-Fork-Holding-Ground/RustOS,YangFan789/fanmi-os,thesam/rOSt,thesam/rOSt,smkell/rustboot,tempbottle/rustboot,tempbottle/rustboot,charliesome/rustboot,smkell/rustboot,charliesome/rustboot | main.rs | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n//!Request handlers.\n\nuse context::Context;\nuse response::Response;\nuse std::sync::Arc;\n\n///A trait for request handlers.\npub trait Handler: Send + Sync + 'static {\n ///Handle a request from the client. Panicking within this method... | rust | edit | 0 | 1 | mit | 6afe4b94ced4e1e7353ef0ce043bf3c5253e7fbc | kvikas/rustful,kvikas/rustful | src/handler.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n// Copyright 2016 lazy-static.rs Developers\n//\n// Licensed under the Apache License, Version 2.0, <LICENSE-APACHE or\n// http://apache.org/licenses/LICENSE-2.0> or the MIT license <LICENSE-MIT or\n// http://opensource.org/licenses/MIT>, at ... | rust | edit | 2 | 3 | apache-2.0 | cdf6323451751752c69ed41a8d48018dc2d7b7cf | rust-lang-nursery/lazy-static.rs,Kimundi/lazy-static.rs | src/heap_lazy.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nuse core::intrinsics::transmute;\n\npub unsafe trait VSpaceWindow<'a> {\n fn base(&self) -> usize;\n fn size(&self) -> usize;\n unsafe fn make<T>(&self) -> &'a T {\n unimplemented!()\n }\n /* Passing in a window to descr... | rust | edit | 2 | 4 | mit | 2ac1b3d9b240b222fcf15fa11981dbfcf650fa8c | AdrianDanis/R4,AdrianDanis/R4 | src/vspace/window.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n#![feature(collections, io, path)]\n\nextern crate tcod;\n\npub mod engine;\npub mod gui;\npub mod util;\n\n```\n\nApply this change: Remove unnecessary features and add new ones\n\nRemoved:\n* io\n* path\n\nAdded:\n* std_misc"
},
{
"... | rust | edit | 1 | 0 | bsd-3-clause | b08d6efffe249f0465d96598047e942f5b326e8a | jgilchrist/rslike | src/lib.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nuse super::gl_lib as gl;\nuse super::buffer::{ArrayBufferBinder, ElementArrayBufferBinder};\n\npub struct Context {\n pub array_buffer: ArrayBufferBinder,\n pub element_array_buffer: ElementArrayBufferBinder\n}\n\nimpl Context {\n pu... | rust | edit | 0 | 1 | apache-2.0 | c3f17ba82f8680f4219293466f8185d5f8c2e4a4 | kylewlacy/glitter,kylewlacy/glitter | src/context.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nextern crate hyper;\nextern crate json;\n\nmod request;\nmod response;\n\npub use request::Request;\npub use response::Response;\npub use response::Codes;\n\npub type Result = hyper::Result<Response>;\npub type Error = hyper::error::Error;\n\... | rust | edit | 1 | 1 | mit | 4fd200e94abd33a57ac820d29b84df86b6757803 | imp/requests-rs | src/lib.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n// Copyright (c) 2017-2018 Rene van der Meer\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the \"Software\"),\n// to deal in the Software without ... | rust | edit | 2 | 0 | mit | 58f7391660e599ac9fea55a218ccaa91fa80b05f | golemparts/rppal | src/macros.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n//! Implementation of the Micro Transport Protocol.[^spec]\n//!\n//! [^spec]: http://www.bittorrent.org/beps/bep_0029.html\n\n// __________ ____ ____\n// /_ __/ __ \\/ __ \\/ __ \\\n// / / / / / / / / / / / /\n// / / / /_/ / /_/ / /_... | rust | edit | 3 | 0 | apache-2.0 | a13c747c7cbae78ac716f600df50a8a465776d57 | benjaminbollen/rust-utp,dirvine/rust-utp | src/lib.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n//! A dead-simple test helper for rust.\n//!\n//! Example\n//! --------\n//!\n//! ```rust\n//! // tests/test.rs\n//!\n//! #[test]\n//! fn do_some_test() {\n//! // Get a content of 'tests/fixtures/hello.obj'\n//! let content: String = ... | rust | edit | 0 | 1 | bsd-2-clause | e60c3d6fda5e2b9ac3ef179d4cb08f0a37a695b4 | simnalamburt/bear | 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 | 8995d57f816aa44d847814463400ab169136a65d | sourrust/flac | src/lib.rs | rejected_duplicate | Near-duplicate of sample 119795 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n#[ cfg( all( feature = \"derive_from\", feature = \"derive_into\", feature = \"derive_display\", feature = \"derive_from_str\" ) ) ]\nuse derive_tools::*;\n\nfn main()\n{\n #[ cfg( all( feature = \"derive_from\", feature = \"derive_into\", f... | rust | edit | 0 | 1 | mit | 97fc6caa6ceadca10d8f7583983d610f4574d87f | Wandalen/wTools,Wandalen/wTools | sample/rust/derive_tools_trivial_sample/src/main.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n#![deny(warnings)]\n\nextern crate cmake;\n\nuse std::env;\n\nfn main() {\n let dst = cmake::Config::new(\"src\").build();\n\n println!(\"cargo:rustc-link-search=native={}/lib\\n\\\n cargo:rustc-link-lib=static=brotli\\n\\\... | rust | edit | 0 | 3 | bsd-3-clause | b686b9e02f81bda3e382e0586cb6594520dad208 | servo/fontsan,servo/fontsan,servo/fontsan | build.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n#![feature(custom_derive, plugin)]\n#![plugin(serde_macros)]\n\nextern crate serde;\nextern crate ease;\n\nuse std::collections::HashMap;\nuse ease::RestClient;\n\n#[derive(Deserialize, Debug)]\nstruct Response {\n args: HashMap<String, St... | rust | edit | 0 | 1 | mit | d632fbb691ffe7a6d95f8ace5929df13bf2ad4e6 | SimonPersson/ease,bluss/ease | examples/json.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nuse simplepattern;\n\nuse simplepattern::SimplePattern;\n\n\n#[test]\nfn root_url_matches_only_root() {\n let p=SimplePattern::new(\"/\");\n assert!(p.matches(\"/\").is_match);\n assert!(!p.matches(\"/foo\").is_match);\n assert!(!... | rust | edit | null | null | bsd-3-clause | 8852be91539bf92e27ad13b2b3d3cb79a3d72f67 | Earlz/rustymvc,tempbottle/rustymvc | proto/simplepattern_test.rs | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\npub struct Post {\n state: Option<Box<State>>,\n content: String\n}\n\nimpl Post {\n pub fn new() -> Post {\n Post {\n state: Some(Box::new(Draft {})),\n content: String::new()\n }\n }\n\n pu... | rust | edit | 0 | 1 | mit | 8b611b0e742db771059573eb3acafc6ff6ffb384 | pgrzesik/learning-rust | blog/src/lib.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n// Copyright (c) The Libra Core Contributors\n// SPDX-License-Identifier: Apache-2.0\n\nuse executable_helpers::helpers::{\n setup_executable, ARG_CONFIG_PATH, ARG_DISABLE_LOGGING, ARG_PEER_ID,\n};\nuse signal_hook;\nuse std::sync::{\n ... | rust | edit | 1 | 3 | apache-2.0 | bca1dfc7088f85a8dfdeb87243b3fe221f7b6577 | aptos-labs/aptos-core,aptos-labs/aptos-core,aptos-labs/aptos-core,libra/libra,libra/libra,aptos-labs/aptos-core,libra/libra,libra/libra,libra/libra,aptos-labs/aptos-core,aptos-labs/aptos-core,aptos-labs/aptos-core | libra_node/src/main.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n//! Processes Twee files and builds an abstract syntax tree.\n//!\n//! The Frontend is responsible for processing a Twee file by\n//! generating a Token Stream from the input and parsing this stream to build\n//! an Abstract Syntax Tree.\n//!... | rust | edit | 1 | 0 | bsd-2-clause | f0167b331d85f9f6c37852eed0c141958e3dbb25 | Drakulix/zwreec,Drakulix/zwreec | src/zwreec/frontend/mod.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n// Ref: https://github.com/rust-lang/rust/issues/23563#issuecomment-260751672\n\npub trait LolTo<T> {\n fn convert_to(&self) -> T;\n}\n\npub trait LolInto<T>: Sized {\n fn convert_into(self) -> T;\n}\n\npub trait LolFrom<T> {\n fn fr... | rust | edit | 0 | 4 | apache-2.0 | 6fd6972e8b2ba9743b2bfffdcda07b78d67516c2 | graydon/rust,aidancully/rust,graydon/rust,aidancully/rust,aidancully/rust,graydon/rust,aidancully/rust,graydon/rust,graydon/rust,aidancully/rust,aidancully/rust,graydon/rust | src/test/ui/error-codes/e0119/auxiliary/issue-23563-a.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n\nuse std::io;\nuse std::io::{Write};\n\nconst ERR_ENCODED_DATA_NOT_UTF8 : &'static str = r#\"ERROR: Encoded data isn't printable.\n\nThe encoded data couldn't be encoded to valid utf8 and so couldn't be printed to the screen.\nUse the \"-o\"... | rust | edit | 1 | 2 | mit | a56508ee7822ad6fd474d96010fefb9200200c8a | gavynriebau/xor | src/stdout_writer.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nextern crate hyper;\n\nuse hyper::server::{Server, Request, Response};\nuse hyper::uri::RequestUri;\nuse hyper::header::ContentType;\nuse hyper::header;\n\nconst HELLO_WORLD: &'static [u8; 14] = b\"Hello, World!\\n\";\n\nfn main() {\n Serv... | rust | edit | 0 | 3 | bsd-3-clause | ef210ff468beccb6633b6a490bc43531a00d970f | zapov/FrameworkBenchmarks,kbrock/FrameworkBenchmarks,raziel057/FrameworkBenchmarks,sxend/FrameworkBenchmarks,kbrock/FrameworkBenchmarks,PermeAgility/FrameworkBenchmarks,doom369/FrameworkBenchmarks,Dith3r/FrameworkBenchmarks,knewmanTE/FrameworkBenchmarks,circlespainter/FrameworkBenchmarks,MTDdk/FrameworkBenchmarks,valya... | frameworks/Rust/hyper/src/main.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n/// `ExpectedVersion` represents the different modes of optimistic locking when writing to a stream\n/// using `WriteEventsBuilder`.\n#[derive(Debug, Copy, Clone, Eq, PartialEq)]\npub enum ExpectedVersion {\n /// No optimistic locking\n ... | rust | edit | 0 | 2 | mit | c2a7efd1b7f5e1efbe8dd67505d6bc28d69cbb2e | koivunej/eventstore-tcp,koivunej/eventstore-tcp | src/expected_version.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nextern crate robin_core;\n\n#[macro_use]\nextern crate pest;\n\n#[cfg(test)]\nmod parser_tests {\n use robin_core::parser::{ExpressionParser, Rule};\n\n #[test]\n fn parse_an_empty_list() {\n parses_to!(\n parser: E... | rust | edit | 0 | 1 | apache-2.0 | 93f04acb8ac87e54e5f12babfaf9c6b8bc3a3c92 | Willifme/robin_core,Willifme/robin_core,Willifme/robin_core | tests/list_parser_tests.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 assert_eq!(2 + 2, 4);\n }\n}\n\n```\n\nApply this change: Make Rust strprintf::fmt work for one argument"
},
{
"role": "assistant",
"content": "macro_rules! f... | rust | edit | 1 | 1 | mit | e94b2e79fe63f1fd182d8dc9c860a1d6158828a6 | newsboat/newsboat,der-lyse/newsboat,newsboat/newsboat,newsboat/newsboat,newsboat/newsboat,der-lyse/newsboat,newsboat/newsboat,der-lyse/newsboat,der-lyse/newsboat,newsboat/newsboat,der-lyse/newsboat,der-lyse/newsboat,newsboat/newsboat,der-lyse/newsboat,newsboat/newsboat,der-lyse/newsboat | rust/strprintf/src/lib.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nuse std::rc::*;\nuse std::ops::*;\n\nuse super::super::tree::*;\n\npub type PublisherRef = Box<Publisher>;\npub type ConsumerRef = Box<Consumer>;\n\n///\n/// A publisher reports changes to a tree\n///\npub trait Publisher {\n ///\n /// ... | rust | edit | 0 | 1 | apache-2.0 | 6a3a8a9e1d7f4a0ed44cd91609bea9465917ebe2 | Logicalshift/tame-tree | src/component/component.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n// FIXME: needs to be updated to provide_ref/request_ref API.\n// https://github.com/rust-lang/rust/pull/99431\n#![cfg(any())]\n\n#[rustversion::not(nightly)]\n#[ignore]\n#[test]\nfn test_backtrace() {}\n\n#[rustversion::nightly]\n#[test]\nfn... | rust | edit | 0 | 1 | apache-2.0 | 2c8f71bda431e6eb80366798ced49c7a38883725 | dtolnay/anyhow | tests/test_backtrace.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nuse gc_error::GcError;\nuse types::binding::Binding;\nuse types::js_var::{JsPtrEnum, JsVar};\n\npub trait Backend {\n fn alloc(&mut self, var: JsVar, ptr: Option<JsPtrEnum>) -> Result<Binding, GcError>;\n fn load(&self, bnd: &Binding) -... | rust | edit | 0 | 0 | mit | b5feafd4728f335c3806ef59cd5b224dd4852a45 | rustoscript/js.rs-common | src/backend.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 empty_array() -> [u16; 0] {\n []\n}\n\n#[miri_run]\nfn big_array() -> [u16; 5] {\n [5, 4, 3, 2, 1]\n}\n\n#[miri_run]\nfn array_array() -> [[u8; 2]... | rust | edit | 0 | 2 | apache-2.0 | 6f2e50caea91426f4baac282905a3ba5d64adcbd | graydon/rust,aidancully/rust,aidancully/rust,GBGamer/rust,graydon/rust,graydon/rust,GBGamer/rust,GBGamer/rust,GBGamer/rust,GBGamer/rust,aidancully/rust,GBGamer/rust,aidancully/rust,GBGamer/rust,tsion/miri,rust-lang/miri,rust-lang/miri,graydon/rust,GBGamer/rust,graydon/rust,graydon/rust,rust-lang/miri,aidancully/rust,ru... | test/arrays.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nuse std::env;\nuse std::process;\n\nextern crate fish;\n\nfn main() {\n let args: Vec<_> = env::args().collect();\n if args.len() < 2 {\n println!(\"Usage: {} <fish script>\\n\", args[0]);\n process::exit(1);\n }\n\n ... | rust | edit | 0 | 4 | mit | ae77936224fa814e9a438838d4c7a7ca548553a5 | noirotm/fishr,noirotm/fishr | src/main.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n//\n// Copyright 2016 Andrew Hunter\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// ... | rust | edit | 0 | 1 | apache-2.0 | fca2a7b7bdd1d3159b1c654655514aac53a8c6d4 | Logicalshift/concordance | src/empty_state_machine.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nextern crate regex;\n#[path=\"../src/lsb_release.rs\"]\nmod lsb_release;\n#[path=\"../src/utils.rs\"]\nmod utils;\n\nfn file() -> String {\n\"\nDistributor ID:\tDebian\nDescription:\tDebian GNU/Linux 7.8 (wheezy)\nRelease:\t7.8\nCodename:\twh... | rust | edit | 0 | 1 | mit | d3b584fd7cc9436b4e4858d84f4519a97147defc | schultyy/os_type | tests/lsb_release_test.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nuse horrorshow::prelude::*;\nuse scripts::Script;\n\npub struct MainPageHtml {\n pub html_string: String,\n}\n\nimpl MainPageHtml {\n pub fn new(scripts: Vec<Box<Script>>) -> MainPageHtml {\n MainPageHtml {\n html_stri... | rust | edit | 0 | 2 | mit | 2f5df69a39e52380cb52590f54a0a2e89af65aa9 | pingzing/articulator | src/mainpage_generator.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n// Copyright 2013-2014 The Algebra Developers.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// ... | rust | edit | 2 | 0 | apache-2.0 | 99f3e623960c43ad203a6f85cad63bcc2df2e78e | sebcrozet/alga,sebcrozet/alga | alga/src/lib.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n#![feature(pin, arbitrary_self_types, futures_api)]\n\n#[macro_use]\nextern crate futures;\n\nuse futures::executor::block_on;\nuse futures::future;\nuse futures::prelude::*;\n\n#[test]\nfn smoke() {\n let mut counter = 0;\n\n {\n ... | rust | edit | 2 | 1 | apache-2.0 | 0a5de3459b74fb698f2294a979f7a0fef9e66b6b | alexcrichton/futures-rs | futures/tests/inspect.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n/*\n * Cymbalum, Molecular Simulation in Rust\n * Copyright (C) 2015 Guillaume Fraux\n *\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file,... | rust | edit | 5 | 0 | bsd-2-clause | f5612767660bde68cb52ea840c91ab43c41f8f1d | Luthaf/cymbalum,g-bauer/lumol,g-bauer/lumol,Luthaf/cymbalum,antoinewdg/lumol,g-bauer/lumol,antoinewdg/lumol,antoinewdg/lumol | src/lib.rs | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nuse lucet_idl;\nuse std::fs::File;\nuse std::io::prelude::*;\nuse std::process::Command;\nuse tempfile::TempDir;\n\n#[test]\nfn compile_and_run() {\n let mut source = String::new();\n File::open(\"tests/example.idl\")\n .expect(\... | rust | edit | 4 | 1 | apache-2.0 | 27857a2ae6a36f96c5aba5383c93daeb38796e09 | fastly/lucet,fastly/lucet,fastly/lucet,fastly/lucet,fastly/lucet | lucet-idl/tests/example.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n#[feature(globs)];\n#[feature(managed_boxes)];\n\nuse std::str;\nuse std::io::stdout;\nuse std::io::fs::File;\nuse std::os;\nuse peg::{compile_grammar};\nuse codegen::RustWriter;\n\nmod peg;\nmod codegen;\nmod grammar;\n\nfn main() {\n\tlet a... | rust | edit | 0 | 2 | mit | 210e755ac88edf24c103c9e0c4fe232728ba772e | jsgf/rust-peg,daramos/rust-peg,tempbottle/rust-peg,loganmhb/rust-peg,a-wortman/rust-peg,tempbottle/rust-peg,kevinmehall/rust-peg,daramos/rust-peg,kevinmehall/rust-peg,loganmhb/rust-peg,a-wortman/rust-peg,jsgf/rust-peg | src/peg/main.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n//! I/O operations for Rust\n//!\n//! To be completed\n\npub mod reader;\n\npub mod writer;\n\n```\n\nApply this change: Test reading and writing signed and unsigned bytes on a Cursor<Vec<u8>>"
},
{
"role": "assistant",
"content":... | rust | edit | 1 | 1 | apache-2.0 | efe3527551ab2bd2fec6b27422b96c89953f6d45 | Techern/Netherrack | src/io/operations/mod.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nuse libc;\n#[cfg(not(target_env = \"musl\"))]\nuse crate::Result;\n#[cfg(not(target_env = \"musl\"))]\nuse crate::errno::Errno;\nuse std::mem;\nuse crate::sys::signal::SigSet;\n\n#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]\npub struct ... | rust | edit | 1 | 1 | mit | 27d39b201bb08b58e3a74600008b39657164e688 | carllerche/nix-rust,geofft/nix-rust,carllerche/nix-rust,nix-rust/nix,carllerche/nix-rust,geofft/nix-rust,asomers/nix,nix-rust/nix,geofft/nix-rust,asomers/nix | src/ucontext.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n// Copyright 2015 Ilkka Rauta\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://www.ap... | rust | edit | null | null | apache-2.0 | e5fe78a27412da808d387713782868930ab158e0 | irauta/linuxdvb,irauta/linuxdvb | src/demux/mod.rs | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n// vim: tw=80\n//#![deny(missing_docs)]\n\n//! Examples of mock objects and their generated methods.\n//!\n//! This crate only exists to document the autogenerated methods of the\n//! [`Mockall`](https://docs.rs/mockall/latest/mockall)\n//! c... | rust | edit | 0 | 0 | apache-2.0 | c15bd76f70be575cb4922be6d7b10348d9123ec3 | asomers/mockall,asomers/mockall | mockall_examples/src/lib.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nmacro_rules! toml_template {\n ($name: expr) => {\n format_args!(\n r##\"\n[package]\nname = \"{0}-fuzz\"\nversion = \"0.0.0\"\nauthors = [\"Automatically generated\"]\npublish = false\nedition = \"2018\"\n\n[package.meta... | rust | edit | 4 | 0 | apache-2.0 | c457b32bf4f234b40bd6714db8e5cdb792167e32 | rust-fuzz/cargo-fuzz | src/templates.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nuse color::PuyoColor;\n\n#[derive(Clone, Debug, PartialEq)]\npub struct ColumnPuyo {\n x: usize,\n color: PuyoColor,\n}\n\nimpl ColumnPuyo {\n pub fn new(x: usize, color: PuyoColor) -> ColumnPuyo {\n ColumnPuyo {\n ... | rust | edit | 2 | 2 | mit | d227aae8aa58f7554fd3da1d01e70251b8da9425 | mayah/rust-puyoai,mayah/rust-puyoai | puyocore/src/column_puyo.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nuse std::collections::HashMap;\n\nuse model::Model;\n\n\npub struct Classifier {\n models: HashMap<String, Model>\n}\n\n\nimpl Classifier {\n pub fn new() -> Classifier {\n Classifier { models: HashMap::new() }\n }\n\n pub ... | rust | edit | 0 | 1 | apache-2.0 | 354f4961704c23eb5ac711254e20fa3a7a4fd38a | despawnerer/langid-rs | src/classifier.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nuse std::cmp::Ordering;\n\nuse index::Index;\nuse query::Query;\nuse search::response::{SearchResponse, SearchHit};\n\n\n#[derive(Debug)]\npub struct SearchRequest {\n pub query: Query,\n pub from: usize,\n pub size: usize,\n pub ... | rust | edit | 3 | 4 | apache-2.0 | e6bd04db3c4cf7a660b0f5375362db8e73561abf | kaedroho/rusticsearch | src/search/request.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or\n// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license\n// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your\n// option. This file may not be copied, ... | rust | edit | 1 | 0 | apache-2.0 | 059a142e016393baf3f5a0b807ae61d0cd999491 | chridou/rust-metrics,cstorey/rust-metrics,waywardmonkeys/rust-metrics,chridou/rust-metrics,cstorey/rust-metrics,waywardmonkeys/rust-metrics | src/metrics/mod.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nuse alloc::boxed::Box;\nuse core::fmt::{self, Debug, Display};\n\n/// Exception thrown from an `extern \"C++\"` function.\n#[derive(Debug)]\npub struct Exception {\n pub(crate) what: Box<str>,\n}\n\nimpl Display for Exception {\n fn fmt... | rust | edit | 0 | 1 | apache-2.0 | 48c01a6978fee61a028bedc45f942eb527db28fc | dtolnay/cxx,dtolnay/cxx,dtolnay/cxx,dtolnay/cxx | src/exception.rs | accepted | null | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.