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\nenum Node<T> {\n One(T),\n Many(uint, T)\n}\n\nfn pack<T: Clone+Eq>(list: &[T]) -> ~[~[T]] {\n let mut it = list.iter();\n let mut result = ~[];\n let mut l = 1;\n loop {\n match it.nth(l - 1) {\n Some(e) =... | rust | edit | null | null | cc0-1.0 | e8ff455dbce28e641cbcae19596562fe0631a8f7 | Armavica/99-Problems-Rust | 01-10/p10.rs | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\npub trait Key: Copy + PartialEq + Ord + Default {\n type Bytes: AsRef<[u8]>;\n fn into_bytes(self) -> Self::Bytes;\n fn from_bytes(bytes: Self::Bytes) -> Self;\n}\n\n\nmacro_rules! impl_key {\n ($type:ident, $size:expr) => {\n ... | rust | edit | 0 | 2 | apache-2.0 | 455bdbba70613201cac16828d87db806d61126cb | adevore/rudy | src/key.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n// Copyright 2014 Tyler Neely\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.apache... | rust | edit | 0 | 1 | apache-2.0 | 9108205a6d58e60cb666dfaf530566c0565c3838 | spacejam/rust-rocksdb,spacejam/rust-rocksdb,spacejam/rust-rocksdb | tests/test_rocksdb_options.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nextern crate hyper;\nextern crate pbr;\nextern crate ansi_term;\n\nuse std::sync::{Arc, Mutex};\n\n#[macro_use]\npub mod logs;\n\npub mod authorization;\npub mod cargo_helper;\npub mod client;\npub mod contentlength;\npub mod download;\npub m... | rust | edit | 1 | 0 | mit | 67b386bad03d8550a5b651076d20813b9c52cebb | k0pernicus/zou | src/lib.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nuse std::cell::Cell;\n\npub trait Incrementor {\n fn increment(&self);\n}\n\nimpl Incrementor for Cell<u8> {\n fn increment(&self) {\n self.set(self.get() + 1);\n }\n}\n\nimpl Incrementor for Cell<u16> {\n fn increment(&sel... | rust | edit | 0 | 2 | mit | c430364450f395343b7fdebf3db28070eabdadc8 | murphm8/zaty | src/extensions.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nextern crate r2d2;\nextern crate postgres;\n\nuse postgres::{PostgresConnection, PostgresConnectParams, IntoConnectParams, SslMode};\nuse postgres::error::PostgresConnectError;\n\npub struct PostgresPoolManager {\n params: PostgresConnectP... | rust | edit | null | null | mit | 35356865cc090fa504afb3b6f9dc5e38b182f755 | alexcrichton/r2d2-postgres,sfackler/r2d2-postgres | src/lib.rs | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n#![feature(slice_concat_ext)]\n\nuse unicode_segmentation::UnicodeSegmentation;\nuse std::slice::SliceConcatExt;\n\nextern crate unicode_segmentation;\n\npub fn normalize_tag(tag: &str) -> Result<String, &'static str> {\n\n if tag.is_empty... | rust | edit | 0 | 3 | mit | 096030bccc15c591962758d6c94ceca8baa6d955 | mneumann/normalize-tag-rs | src/lib.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n//\n// SOS: the Stupid Operating System\n// by Hawk Weisman (<EMAIL>)\n//\n// Copyright (c) 2015 Hawk Weisman\n// Released under the terms of the MIT license. See `LICENSE` in the root\n// directory of this repository for more informatio... | rust | edit | null | null | apache-2.0 | d74bd6f90330389ce90341ff6c72fc1fc40425de | rachlmac/sos-kernel,hawkw/sos-kernel,hawkw/sos-kernel,rachlmac/sos-kernel,rachlmac/sos-kernel,hawkw/sos-kernel | src/io/mod.rs | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n// edition:2018\n// check-pass\n#![allow(unused)]\n#![deny(rust_2021_prelude_collisions)]\n\nstruct S;\n\nimpl S {\n fn try_into(self) -> S {\n S\n }\n}\n\n// See https://github.com/rust-lang/rust/issues/86633\nfn main() {\n l... | rust | edit | 0 | 2 | apache-2.0 | f77dd5ac9371897d30dd3a8c43023e14f86dd0bf | aidancully/rust,graydon/rust,graydon/rust,aidancully/rust,aidancully/rust,aidancully/rust,aidancully/rust,aidancully/rust,graydon/rust,graydon/rust,graydon/rust,graydon/rust | src/test/ui/rust-2021/future-prelude-collision-unneeded.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nuse std::fs::File;\nuse std::io::Read;\nuse std::path::Path;\nuse toml::Value as Toml;\n\nuse error::PackageError;\nuse package::Package;\n\n/// The struct which represents the repos.\n#[derive(Deserialize)]\npub struct Repository {\n url:... | rust | edit | 0 | 5 | bsd-3-clause | 4dfc53454ac7f8253f1ea538dd79194f7331b93e | hch12907/wiz | src/repository.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nuse std::io::{self, Write};\n\nconst CHARS_PER_LINE: usize = 78;\nconst SPACE: u8 = 32;\nconst LF: u8 = 10;\n\n// This is a *very* naive algorithm. It assumes the cursor is\n// currently at column 0, and that the string to be printed is\n// A... | rust | edit | 0 | 7 | unlicense | 5663a50ed6d36538efca048c5f4832ddbd8e7a0a | toolness/werewolves-and-wanderer-rs,toolness/werewolves-and-wanderer-rs,toolness/werewolves-and-wanderer-rs,toolness/werewolves-and-wanderer-rs | src/platform/word_wrap.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n#[macro_use]\nextern crate serde_elm;\n\nuse std::env;\nuse std::fs::File;\nuse std::io::{Read, Error};\nuse std::path::Path;\n\n#[allow(dead_code)]\n#[derive(Elm)]\nstruct Simple {\n name: String\n}\n\n#[test]\nfn should_assert_elm_genera... | rust | edit | 0 | 3 | mit | 31a18ab00ab50758ce7e731efe84d1409806a61e | mijnadres/serde_elm | tests/struct_derive.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nextern crate gcc;\n\nuse std::path::Path;\nuse std::process::Command;\n\nstruct Perl {\n bin: String,\n}\n\nimpl Perl {\n fn new() -> Perl {\n Perl {\n bin: std::env::var(\"PERL\").unwrap(),\n }\n }\n\n fn... | rust | edit | 0 | 2 | bsd-2-clause | e857d14808b0fdfd1ad2a47bcf3b3e628aadb14b | vickenty/perl-sys,vickenty/perl-sys | build/build.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n#![feature(plugin_registrar, quote)]\nextern crate rustc;\nextern crate syntax;\n\nuse rustc::plugin::Registry;\nuse syntax::ast::TokenTree;\nuse syntax::codemap::Span;\nuse syntax::ext::base::{ExtCtxt, MacItems, MacResult};\nuse syntax::pars... | rust | edit | 1 | 1 | apache-2.0 | 2ec85b4c7ba202894b037ddbae2f130f5d2b91d6 | cmr/speculate.rs | src/lib.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nuse proc_macro_srv::cli;\n\nfn main() {\n cli::run().unwrap();\n}\n\n```\n\nApply this change: Add doc comment to pass tidy check"
},
{
"role": "assistant",
"content": "//! A standalone binary for `proc-macro-srv`.\n\nuse proc_... | rust | edit | 0 | 1 | apache-2.0 | fba6adfae48d55984934872a81d533dc405b7cd3 | rust-analyzer/rust-analyzer,rust-analyzer/rust-analyzer,rust-analyzer/rust-analyzer,rust-analyzer/rust-analyzer,rust-analyzer/rust-analyzer | crates/proc-macro-srv-cli/src/main.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nuse model::Model;\n\n\npub struct Classifier {\n models: Vec<(String, Model)>\n}\n\n\nimpl Classifier {\n pub fn new() -> Classifier {\n Classifier { models: Vec::new() }\n }\n\n pub fn train(&mut self, text: &str, name: &s... | rust | edit | 0 | 2 | apache-2.0 | 193d403d41492e4f21e90d0a15a51148fe6de4bc | despawnerer/langid-rs | src/classifier.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nfn wants_box(x: @str) { }\nfn wants_uniq(x: ~str) { }\nfn wants_three(x: str/3) { }\n\nfn has_box(x: @str) {\n wants_box(x);\n wants_uniq(x); //~ ERROR str storage differs: expected ~ but found @\n wants_three(x); //~ ERROR str storage ... | rust | edit | null | null | apache-2.0 | 837875711a8724784e401ee5ef2fecad006a0ca6 | vhbit/rust,SiegeLord/rust,michaelballantyne/rust-gpu,kimroen/rust,AerialX/rust-rt-minimal,rohitjoshi/rust,cllns/rust,stepancheg/rust-ide-rust,j16r/rust,sarojaba/rust-doc-korean,pczarn/rust,erickt/rust,Ryman/rust,0x73/rust,dinfuehr/rust,KokaKiwi/rust,aepsil0n/rust,arthurprs/rand,l0kod/rust,rprichard/rust,mdinger/rust,mi... | src/test/compile-fail/estr-subtyping.rs | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n// Issue #3656\n// Incorrect struct size computation in the FFI, because of not taking\n// the alignment of elements into account.\n\nuse libc::*;\n\nstruct KEYGEN {\n hash_algorithm: [c_uint]/2,\n count: uint32_t,\n salt: *c_void,\n... | rust | edit | null | null | apache-2.0 | 8a8fbe3dce7120e476edfa7ca4c0a40671b61cb6 | quornian/rust,mvdnes/rust,jroesch/rust,cllns/rust,XMPPwocky/rust,zachwick/rust,nwin/rust,carols10cents/rust,SiegeLord/rust,kmcallister/rust,huonw/rand,aneeshusa/rust,aturon/rust,erickt/rust,TheNeikos/rust,jbclements/rust,mdinger/rust,GBGamer/rust,LeoTestard/rust,waynenilsen/rand,hauleth/rust,mahkoh/rust,seanrivera/rust... | src/test/run-pass/issue-3656.rs | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n// test4.rs\n// This test covers the sections:\n// - Modules\n// - Macros\n\n// Write a macro that passes the test! No hints this time, you can do it!\n\n// I AM NOT DONE\n\n#[cfg(test)]\nmod tests {\n use super::*;\n\n #[test]\n fn ... | rust | edit | 0 | 1 | mit | a45486f2d05ce1081fab5709f629ae765368509b | carols10cents/rustlings,carols10cents/rustlings | exercises/test4.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nuse query_builder::{QueryBuilder, BuildQueryResult};\nuse query_source::QuerySource;\n\npub trait AsChangeset {\n type Changeset: Changeset;\n\n fn as_changeset(self) -> Self::Changeset;\n}\n\npub trait Changeset {\n type Target: Que... | rust | edit | null | null | apache-2.0 | a19f7126b5452a9185da747b960225863b94f733 | diesel-rs/diesel,mcasper/diesel,diesel-rs/diesel,SoftwareWarlock/diesel,sgrif/diesel,SoftwareWarlock/diesel,sgrif/diesel,tohou/diesel,mcasper/diesel,tohou/diesel,cascalheira/diesel,cascalheira/diesel | yaqb/src/query_builder/update_statement/changeset.rs | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n// It's OK to destroy a heap when some GcRefs still exist. (!)\n//\n// Rust's safety rules ensure that the GcRefs won't still be accessible\n// afterwards, so if this happens, it means the values were leaked.\n\nextern crate cell_gc;\n\nuse c... | rust | edit | 0 | 1 | mit | 7f0a1fbdce1e1b598f409fc024d5efd078cffe6a | jorendorff/cell-gc,jorendorff/cell-gc | tests/leaks.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n#[macro_use]\nextern crate log;\n\n#[cfg(unix)]\nextern crate libc;\n\nextern crate net2;\nextern crate futures;\n\n#[cfg(target_pointer_width = \"32\")]\nmacro_rules! word_len {\n () => { 4 }\n}\n\n#[cfg(target_pointer_width = \"64\")]\nm... | rust | edit | 3 | 2 | apache-2.0 | f2146fef85126dee1692291779f0540759e82c33 | agemocui/ruyi | src/lib.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n// ignore-tidy-linelength\n\npub mod internal {\n pub struct r#mod;\n\n /// See [name], [other name]\n ///\n /// [name]: mod\n /// [other name]: ../internal/struct.mod.html\n // @has 'raw_ident_eliminate_r_hashtag/internal/s... | rust | edit | 1 | 0 | apache-2.0 | ecfeac58aae332b5f88388624d9656ec6750e011 | graydon/rust,aidancully/rust,aidancully/rust,graydon/rust,aidancully/rust,graydon/rust,aidancully/rust,graydon/rust,graydon/rust,graydon/rust,aidancully/rust,aidancully/rust | src/test/rustdoc/raw-ident-eliminate-r-hashtag.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n//! Git repository representation for git-global.\n\nuse std::fmt;\n\nuse git2;\n\n/// A git repository, represented by the full path to its base directory.\n#[derive(PartialEq, Eq, Hash, Clone)]\npub struct Repo {\n path: String,\n}\n\nim... | rust | edit | 1 | 1 | mit | 002e549a9b8ec005640359d76ae28679cb2d28f1 | peap/git-global | src/repo.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nuse anyhow::{bail, Result};\nuse std::process::{Child, Command};\n\nuse crate::task_handler::ProcessAction;\nuse log::info;\n\npub fn compile_shell_command(command_string: &str) -> Command {\n // Chain two `powershell` commands, one that s... | rust | edit | 0 | 2 | mit | 12b528651f408d144e46edaff4dba8b5c5f95b9f | Nukesor/Pueue,Nukesor/Pueuew | daemon/platform/windows/process_helper.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n\nuse super::*;\n\n//\n\ntests_impls!\n{\n fn basic_no_args()\n {\n let path = std::ffi::OsStr::new( \"../../../target/debug/wpublisher\" );\n let proc = std::process::Command::new( path ).output().unwrap();\n assert!( !proc.status... | rust | edit | 0 | 1 | mit | 6d4d916e8bd6aecabc554e5270b6f3402bf7a0a8 | Wandalen/wTools,Wandalen/wTools | rust/test/publisher/inc/publisher_test.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nuse std::fmt;\n\n/// An error encountered while working with structured data.\n#[derive(Clone, Debug)]\npub struct Error {\n msg: &'static str,\n}\n\nimpl Error {\n /// Create an error from the given message.\n pub fn msg(msg: &'stat... | rust | edit | 0 | 2 | apache-2.0 | e81509fab170bfdefcdd8dea4ef21c69a99159ae | rust-lang/log | src/kv/error.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nuse std::env;\nuse std::fs::{copy, create_dir_all, read_dir};\nuse std::path::{Path, PathBuf};\nuse std::io;\n\nfn main() {\n let res_dir_source = Path::new(&env::var(\"CARGO_MANIFEST_DIR\").unwrap()).join(\"resources/\");\n let res_dir... | rust | edit | 3 | 7 | mit | 8ac39e56f9ce785570d5c9b0e26ce30b8f200f0c | aochagavia/rocket | build.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n\n#![feature(io, os)]\n\nuse std::... | rust | edit | 2 | 1 | bsd-3-clause | d60e6753b2b23b3b4ff787b505da56cfad0335c9 | larsbergstrom/skia,vvuk/skia,vvuk/skia,akiss77/skia,larsbergstrom/skia,akiss77/skia,akiss77/skia,nox/skia,larsbergstrom/skia,larsbergstrom/skia,nox/skia,akiss77/skia,mmatyas/skia,vvuk/skia,mmatyas/skia,mmatyas/skia,mmatyas/skia,nox/skia,nox/skia,nox/skia,mmatyas/skia,akiss77/skia,akiss77/skia,nox/skia,nox/skia,nox/skia... | build.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n// run-pass\n\n#![allow(dead_code)]\n// Static recursion check shouldn't fail when given a foreign item (#18279)\n\n// aux-build:check_static_recursion_foreign_helper.rs\n// ignore-wasm32-bare no libc to test ffi with\n\n// pretty-expanded FI... | rust | edit | 0 | 1 | apache-2.0 | acd68b503d033e0fc94fb5e68cb06ce369b6bd63 | aidancully/rust,aidancully/rust,aidancully/rust,graydon/rust,graydon/rust,aidancully/rust,graydon/rust,aidancully/rust,aidancully/rust,graydon/rust,graydon/rust,graydon/rust | src/test/ui/check-static-recursion-foreign.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nuse model::Model;\n\n\npub struct Classifier {\n models: Vec<(String, Model)>\n}\n\n\nimpl Classifier {\n pub fn new() -> Classifier {\n Classifier { models: Vec::new() }\n }\n\n pub fn train(&mut self, text: &str, name: &s... | rust | edit | 0 | 2 | apache-2.0 | 9bc940c11d385065d7b77dc20f63a640afe650fc | despawnerer/langid-rs | src/classifier.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 | 0 | 1 | apache-2.0 | 6f9ec0615c29a6c7b45bc0db675ce99d90d61eab | robertg/rust,omasanori/rust,KokaKiwi/rust,andars/rust,XMPPwocky/rust,victorvde/rust,miniupnp/rust,nwin/rust,seanrivera/rust,XMPPwocky/rust,gifnksm/rust,andars/rust,l0kod/rust,aidancully/rust,dwillmer/rust,sae-bom/rust,zachwick/rust,victorvde/rust,ejjeong/rust,zubron/rust,mdinger/rust,mdinger/rust,cllns/rust,gifnksm/rus... | src/test/compile-fail/issue-22560.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nclass c { //~ ERROR a class must have at least one field\n new() { }\n}\n\nfn main() {\n let a = c();\n let x = ~[a];\n let _y = x[0];\n}\n\n```\n\nApply this change: Fix sub-breakage due to the changed error message."
},
{
... | rust | edit | null | null | apache-2.0 | b8845f0e258a983514fcf9777202720705341446 | mihneadb/rust,j16r/rust,rprichard/rust,bombless/rust,erickt/rust,nwin/rust,kwantam/rust,j16r/rust,andars/rust,aidancully/rust,GrahamDennis/rand,krzysz00/rust,SiegeLord/rust,0x73/rust,sae-bom/rust,aturon/rust,P1start/rust,mahkoh/rust,nwin/rust,bombless/rust,mahkoh/rust,kimroen/rust,dinfuehr/rust,dwillmer/rust,jashank/ru... | src/test/compile-fail/issue-2509-a.rs | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"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//! # Examples\n//!\n//! Basic decoding from a file.\n//!\n//! ```\n//! use flac::{Stream, ReadStream};\n//! use std::fs::File;\n//... | rust | edit | 1 | 0 | bsd-3-clause | 1e12385bea7441659e7d3b0717e9301221ca8354 | sourrust/flac | src/lib.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n//! A thin wrapper around `ThreadPool` to make sure that we join all things\n//! properly.\nuse crossbeam_channel::Sender;\n\npub(crate) struct TaskPool<T> {\n sender: Sender<T>,\n inner: threadpool::ThreadPool,\n}\n\nimpl<T> TaskPool<T... | rust | edit | 0 | 3 | apache-2.0 | 0b9cd8a468d63ebda3d7955faf92296d1abcdac0 | rust-analyzer/rust-analyzer,rust-analyzer/rust-analyzer,rust-analyzer/rust-analyzer,rust-analyzer/rust-analyzer,rust-analyzer/rust-analyzer | crates/rust-analyzer/src/task_pool.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n// Copyright 2014 The Rust Project Developers. See the COPYRIGHT\n// file at the top-level directory of this distribution and at\n// http://rust-lang.org/COPYRIGHT.\n//\n// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or\n//... | rust | edit | null | null | apache-2.0 | b2e93e276773edaa497989064181cbc706c4ecc1 | mahkoh/rust,mdinger/rust,richo/rust,nwin/rust,gifnksm/rust,richo/rust,jashank/rust,AerialX/rust-rt-minimal,avdi/rust,victorvde/rust,vhbit/rust,carols10cents/rust,dwillmer/rust,carols10cents/rust,robertg/rust,rprichard/rust,vhbit/rust,seanrivera/rust,robertg/rust,untitaker/rust,miniupnp/rust,GBGamer/rust,jashank/rust,mi... | src/test/compile-fail-fulldeps/issue-18986.rs | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n#![feature(zero_one, box_syntax)]\n\nextern crate asexp;\n\npub mod num_expr;\npub mod cond;\n\nuse std::fmt::Debug;\nuse std::cmp::{PartialEq, PartialOrd};\n\n#[derive(Debug, Eq, PartialEq)]\npub enum ExpressionError {\n /// In case of di... | rust | edit | 1 | 0 | mit | db23b9ec7387b6b5e7caf880e5ef95eb49789a45 | mneumann/expression-rs | src/lib.rs | rejected_duplicate | Near-duplicate of sample 120090 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nimport std::generic_os::setenv;\nimport std::generic_os::getenv;\nimport std::option;\n\n#[test]\nfn test_setenv() {\n setenv(\"NAME\", \"VALUE\");\n assert getenv(\"NAME\") == option::some(\"VALUE\");\n}\n\n#[test]\nfn test_setenv_over... | rust | edit | null | null | apache-2.0 | 1c780b420308cc9f57a5cb5b9619d43c1a4e6f44 | vhbit/rust,emk/rust,jashank/rust,Ryman/rust,pelmers/rust,huonw/rand,aepsil0n/rust,jroesch/rust,reem/rust,untitaker/rust,rohitjoshi/rust,andars/rust,kmcallister/rust,zubron/rust,nham/rust,0x73/rust,untitaker/rust,philyoon/rust,aturon/rust,gifnksm/rust,sarojaba/rust-doc-korean,jashank/rust,kwantam/rust,erickt/rust,stepan... | src/test/stdtest/os.rs | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n// Generic AArch64 target for bare-metal code - Floating point enabled\n//\n// Can be used in conjunction with the `target-feature` and\n// `target-cpu` compiler flags to opt-in more hardware-specific\n// features.\n//\n// For example, `-C ta... | rust | edit | 0 | 1 | apache-2.0 | 3a1879299e8742e9193569152bef3f997c51e0ea | graydon/rust,aidancully/rust,graydon/rust,graydon/rust,graydon/rust,graydon/rust,aidancully/rust,graydon/rust,aidancully/rust,aidancully/rust,aidancully/rust,aidancully/rust | compiler/rustc_target/src/spec/aarch64_unknown_none.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nmod score;\npub mod consts;\n\npub use self::score::*;\n\n/// Compares two characters case-insensitively\n///\n/// # Examples\n///\n/// ```\n/// assert!(rff::fuzzy::eq('a', 'A'));\n/// ```\npub fn eq(a: char, b: char) -> bool {\n a.to_uppe... | rust | edit | 4 | 9 | mit | ccfecfaefe286ea5b3663b0d1e5db88d3b237c3b | stewart/rff,stewart/rff | src/fuzzy/mod.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n// Copyright 2015 The Noise-rs 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 | 0 | 1 | apache-2.0 | 7d9aa18326fce7ba258ad78a113c122fc851aab4 | Razaekel/noise-rs,amaranth/noise-rs,bjz/noise-rs,brendanzab/noise-rs | examples/perlin.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nextern crate alfred;\n\nuse config::Config;\nuse jira_api::SearchIssue;\nuse jira_client;\nuse search_response::SearchResponse;\n\nstruct SearchCommand {\n pub config: Config,\n}\n\nimpl SearchCommand {\n pub fn run(&self, keyword: &Str... | rust | edit | 0 | 2 | mit | 531d106de01c7837703b78709899bf8e92e34d1f | dorayakikun/alfred_jira_workflow | src/search_command.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n//! Definition of various types related to connexions\n\n/// Type of the ether_type\npub type EtherType = u16;\n/// Type that represent a protocol id\npub type ProtocolIdType = u8;\n/// Type that represent a port\npub type PortType = u16;\n\n... | rust | edit | 0 | 0 | mit | ccc0f3014aa514803a27c1bde25b54c165c1ae87 | uni-rs/uni.rs | src/net/conn/defs.rs | accepted | null | true |
[
{
"role": "user",
"content": "Write rust code for the following: Add p macro for tests"
},
{
"role": "assistant",
"content": "extern crate native_tls;\n\npub use native_tls::*;\n\n\nmacro_rules! p {\n ($e:expr) => {\n match $e {\n Ok(r) => r,\n Err(e) => panic!(\"... | rust | new_file | 0 | 0 | apache-2.0 | ed0db25ac3e82affea28cd6a5ef7391d2e8a4135 | sfackler/rust-native-tls | tests-ios/prelude.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nuse cargo_test_support::compare::assert_ui;\nuse cargo_test_support::curr_dir;\nuse cargo_test_support::CargoCommand;\nuse cargo_test_support::Project;\nuse cargo_test_support::TestEnv;\n\nuse crate::cargo_remove::init_registry;\n\n#[cargo_te... | rust | edit | 0 | 1 | apache-2.0 | 40a387c4bd9f4d0e3e6875001d69d456f554a9ca | rust-lang/cargo,rust-lang/cargo,eminence/cargo,rustyhorde/cargo,eminence/cargo,eminence/cargo,eminence/cargo,rust-lang/cargo,rustyhorde/cargo,rust-lang/cargo,rustyhorde/cargo,rustyhorde/cargo | tests/testsuite/cargo_remove/offline/mod.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n#![no_main]\n#[macro_use] extern crate libfuzzer_sys;\nextern crate image;\n\nfuzz_target!(|data: &[u8]| {\n let _ = image::load_from_memory_with_format(data, image::ImageFormat::Tga);\n});\n\n```\n\nApply this change: Update fuzzer script... | rust | edit | 0 | 4 | mit | 8598503900db739b4bf1a87ad4cab3f7545a6255 | PistonDevelopers/image,PistonDevelopers/image | fuzz/fuzzers/fuzzer_script_tga.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n// This whole file is strongly inspired by: https://github.com/jeaye/q3/blob/master/src/client/ui/ttf/glyph.rs\n// available under the BSD-3 licence.\n// It has been modified to work with gl-rs, nalgebra, and rust-freetype\n\nuse na::Vec2;\n\... | rust | edit | 5 | 1 | bsd-3-clause | 1ea20ecbded69322fec5bb2ae847df42e77ed68e | tempbottle/kiss3d,drewet/kiss3d,sebcrozet/kiss3d,jaredly/kiss3d,wackywendell/kiss3d,beni55/kiss3d,huonw/kiss3d | src/text/glyph.rs | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n#![feature(const_fn)]\n#![feature(extern_types)]\n#![feature(or_patterns)]\n\n#[cfg(test)]\n#[macro_use]\nextern crate quickcheck;\n\n#[macro_use]\nmod dbg;\n\n#[macro_use]\nmod paging;\n\npub mod cpu;\n\npub mod js_api;\npub mod profiler;\n\... | rust | edit | 2 | 0 | bsd-2-clause | 72096ad98640fe3f4eadd7710f24c90c89779c18 | copy/v86,copy/v86,copy/v86,copy/v86,copy/v86,copy/v86,copy/v86 | src/rust/lib.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n// ignore-tidy-linelength\n\n#![feature(const_generics)]\n\n#![crate_name = \"foo\"]\n\npub enum Order {\n Sorted,\n Unsorted,\n}\n\n// @has foo/struct.VSet.html '//pre[@class=\"rust struct\"]' 'pub struct VSet<T, const ORDER: Order>'\n... | rust | edit | 0 | 1 | apache-2.0 | 9f788f3a2b7626318d0bdedca38986fc283f481f | aidancully/rust,aidancully/rust,graydon/rust,graydon/rust,graydon/rust,graydon/rust,aidancully/rust,aidancully/rust,aidancully/rust,aidancully/rust,graydon/rust,graydon/rust | src/test/rustdoc/const-generics/const-impl.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nextern crate randomorg;\n\nfn main() {\n use randomorg::Random;\n\n let r = Random::new(\"API KEY HERE\");\n println!(\"Result: {:?}\", r.generate_integers(-100, 100, 15, true));\n}\n\n```\n\nApply this change: Use environment variab... | rust | edit | 0 | 1 | mit | 1825de8fbbda764a2a3f4853816ae2e87428856c | vityafx/randomorg | examples/generate_integers.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n// Copyright 2018 The Rust Project Developers. See the COPYRIGHT\n// file at the top-level directory of this distribution and at\n// http://rust-lang.org/COPYRIGHT.\n//\n// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or\n//... | rust | edit | 0 | 1 | apache-2.0 | 933efd755b1cad9ec5046f315ac4e1f95ab9baba | graydon/rust,aidancully/rust,aidancully/rust,graydon/rust,graydon/rust,aidancully/rust,graydon/rust,aidancully/rust,aidancully/rust,graydon/rust,aidancully/rust,graydon/rust | src/test/run-pass/issues/issue-18804/main.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nextern crate pkg_config;\n\nfn main() {\n println!(\"cargo:rerun-if-changed=build.rs\");\n pkg_config::probe_library(\"cfitsio\").unwrap();\n}\n\n```\n\nApply this change: Handle missing cfitsio on pkg-config path"
},
{
"role": ... | rust | edit | 0 | 3 | apache-2.0 | cc5d8bfceb33efdb3481810b5c450398b6b2a9ac | mindriot101/rust-fitsio,mindriot101/rust-cfitsio,mindriot101/rust-fitsio,mindriot101/rust-cfitsio,mindriot101/rust-fitsio,mindriot101/rust-fitsio,mindriot101/rust-fitsio | fitsio-sys/build.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nuse proc_macro::{LineColumn, Punct};\n\npub fn test() {\n test_line_column_ord();\n test_punct_eq();\n}\n\nfn test_line_column_ord() {\n let line0_column0 = LineColumn { line: 0, column: 0 };\n let line0_column1 = LineColumn { lin... | rust | edit | 0 | 1 | apache-2.0 | faad7e209deee6d09d335ca00c06d9f41bc040b5 | graydon/rust,aidancully/rust,graydon/rust,aidancully/rust,graydon/rust,graydon/rust,graydon/rust,aidancully/rust,graydon/rust,aidancully/rust,aidancully/rust,aidancully/rust | src/test/ui/proc-macro/auxiliary/api/cmp.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n#![feature(plugin_registrar, rustc_private)]\n\nextern crate serde_codegen;\nextern crate rustc;\n\n#[plugin_registrar]\n#[doc(hidden)]\npub fn plugin_registrar(reg: &mut rustc::plugin::Registry) {\n serde_codegen::register(reg);\n}\n\n```... | rust | edit | 0 | 1 | apache-2.0 | 09822c99ccae015553e8d5ca816cfbb8536c597b | oli-obk/rust-serde,serde-rs/serde,JohnHeitmann/serde,csmulhern/serde,thorbenk/serde,erickt/serde | serde_macros/src/lib.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n// Copyright 2012 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 | 7 | 0 | apache-2.0 | cf14b1760f747d94b1bfed2e5f937ce26320b987 | GBGamer/rust,GBGamer/rust,graydon/rust,GBGamer/rust,GBGamer/rust,GBGamer/rust,aidancully/rust,graydon/rust,graydon/rust,aidancully/rust,GBGamer/rust,aidancully/rust,GBGamer/rust,graydon/rust,GBGamer/rust,graydon/rust,graydon/rust,aidancully/rust,aidancully/rust,aidancully/rust | src/test/parse-fail/tag-variant-disr-non-nullary.rs | rejected_lint | Too many lint violations: 7 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n// rustc overflows when compiling this see:\n// https://github.com/rust-lang/rust/issues/55779\nextern crate serde;\n\nuse ruma_events::StateEventContent;\nuse ruma_events_macros::Event;\n\n/// State event.\n#[derive(Clone, Debug, Event)]\npu... | rust | edit | 0 | 1 | mit | 367f4ac0e617ec67f9f5d6493e1839df82d2840b | ruma/ruma | crates/ruma-events/tests/ui/04-event-sanity-check.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nuse probability::prelude::*;\nuse test::{Bencher, black_box};\n\n#[bench]\nfn cdf(bencher: &mut Bencher) {\n let mut source = random::default();\n let gaussian = Gaussian::new(0.0, 1.0);\n let x = Independent(&gaussian, &mut source).... | rust | edit | 0 | 2 | mit | b608f9b437fdd72e71b83f844dc1cded86b6c85f | runarberg/probability,achanda/probability | benches/distribution/gaussian.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n#!/usr/bin/env rustx\n// pp-exact\n\nuse io::println;\n\nfn main() { io::println(~\"Hello World\"); }\n\n```\n\nApply this change: Remove 'use' line that's confusing pp-exact during use/import transition."
},
{
"role": "assistant",
... | rust | edit | 0 | 1 | apache-2.0 | 15b4734d0c1b6e8689d6715ef8b808f5ce6f546c | zubron/rust,pythonesque/rust,michaelballantyne/rust-gpu,mitsuhiko/rust,aidancully/rust,bombless/rust,aidancully/rust,jroesch/rust,pshc/rust,AerialX/rust-rt-minimal,philyoon/rust,andars/rust,mvdnes/rust,dwillmer/rust,michaelballantyne/rust-gpu,TheNeikos/rust,ktossell/rust,carols10cents/rust,nwin/rust,shepmaster/rand,Sie... | src/test/run-pass/shebang.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n// Copyright (c) The Diem Core Contributors\n// SPDX-License-Identifier: Apache-2.0\n\nuse generate_format::Corpus;\nuse std::{fs::File, io::Write};\nuse structopt::StructOpt;\n\n#[derive(Debug, StructOpt)]\n#[structopt(\n name = \"Diem fo... | rust | edit | 0 | 3 | apache-2.0 | 426616cfcc64c280294d2d2b0b1d1ff2b9f9ef17 | aptos-labs/aptos-core,aptos-labs/aptos-core,aptos-labs/aptos-core,aptos-labs/aptos-core,libra/libra,aptos-labs/aptos-core,aptos-labs/aptos-core,libra/libra,aptos-labs/aptos-core,libra/libra,libra/libra,libra/libra | testsuite/generate-format/src/compute.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nuse std::io::{self, stdin, stdout, Write};\n\n// TODO(tsion): Use the readline library.\nfn prompt(line: &mut String) -> io::Result<usize> {\n let current_dir = try!(std::env::current_dir());\n print!(\"{}> \", current_dir.display());\n... | rust | edit | null | null | isc | 7d251b295f81abc47ac1dfb8c989c6ef7abcc153 | tsion/shroom | src/main.rs | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nuse std::fs::File;\nuse std::io;\nuse std::ops::Deref;\n\nuse crate::owning_ref::StableAddress;\n\n/// A trivial wrapper for [`memmap2::Mmap`] that implements [`StableAddress`].\n#[cfg(not(target_arch = \"wasm32\"))]\npub struct Mmap(memmap2:... | rust | edit | 0 | 2 | apache-2.0 | bda6d1f158a71efe84d86da2011eac0c45a232c5 | aidancully/rust,graydon/rust,aidancully/rust,aidancully/rust,graydon/rust,graydon/rust,aidancully/rust,graydon/rust,graydon/rust,aidancully/rust,graydon/rust,aidancully/rust | compiler/rustc_data_structures/src/memmap.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n// @generated by autocargo\nuse std::env;\nuse std::fs;\nuse std::path::Path;\n\nuse thrift_compiler::Config;\n\n#[rustfmt::skip]\nfn main() {\n let out_dir = env::var_os(\"OUT_DIR\").expect(\"OUT_DIR env not provided\");\n let out_dir:... | rust | edit | 0 | 2 | apache-2.0 | 31d7b90e30de5f90891e4a845f6704e4c13748df | facebook/fbthrift,facebook/fbthrift,facebook/fbthrift,facebook/fbthrift,facebook/fbthrift,facebook/fbthrift,facebook/fbthrift,facebook/fbthrift,facebook/fbthrift | thrift/lib/rust/src/dep_tests/cargo_thrift/thrift_build.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nuse cocoa::base::id;\n\npub struct RenderCommandEncoder(id);\n\nimpl_from_into_raw!(RenderCommandEncoder, of protocol \"MTLRenderCommandEncoder\");\n\n```\n\nApply this change: Add some work on RenderCommandEncoder"
},
{
"role": "assi... | rust | edit | 12 | 1 | apache-2.0 | 7b82df165c7b2751608998ec5755c1248aea29db | burtonageo/metl | src/render_command_encoder.rs | rejected_lint | Too many lint violations: 12 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nextern crate pkg_config;\n\nfn main () {\n pkg_config::probe_library(\"fuse\").unwrap();\n}\n\n```\n\nApply this change: Use recommended pkg-config method to discover libfuse"
},
{
"role": "assistant",
"content": "extern crate ... | rust | edit | 0 | 1 | mit | 82208d3a054a2a0f31725d0165968a84aa4d8d93 | zargony/rust-fuse | build.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n// edition:2018\n// check-pass\n#![allow(unused)]\n#![deny(rust_2021_prelude_collisions)]\n\nstruct S;\n\nimpl S {\n fn try_into(self) -> S {\n S\n }\n}\n\nstruct X;\n\ntrait Hey {\n fn from_iter(_: i32) -> Self;\n}\n\nimpl He... | rust | edit | 0 | 2 | apache-2.0 | 10d6b34d32e377798868586d2d8e25d972cbeb0d | aidancully/rust,graydon/rust,graydon/rust,aidancully/rust,aidancully/rust,graydon/rust,graydon/rust,graydon/rust,aidancully/rust,aidancully/rust,graydon/rust,aidancully/rust | src/test/ui/rust-2021/future-prelude-collision-unneeded.rs | accepted | null | true |
[
{
"role": "user",
"content": "Write rust code for the following: Add failure tests for moving out of unboxed closure environments"
},
{
"role": "assistant",
"content": "// Copyright 2014 The Rust Project Developers. See the COPYRIGHT\n// file at the top-level directory of this distribution and a... | rust | new_file | null | null | apache-2.0 | fdd69accd0c9366b882a0e0d93ddb94eee307431 | andars/rust,AerialX/rust,pshc/rust,bombless/rust,robertg/rust,gifnksm/rust,seanrivera/rust,l0kod/rust,cllns/rust,aneeshusa/rust,mdinger/rust,rohitjoshi/rust,barosl/rust,jashank/rust,avdi/rust,gifnksm/rust,krzysz00/rust,emk/rust,mihneadb/rust,mdinger/rust,pelmers/rust,aepsil0n/rust,pelmers/rust,ruud-v-a/rust,reem/rust,v... | src/test/compile-fail/unboxed-closure-illegal-move.rs | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nuse clap::{app_from_crate, arg};\n\nfn main() {\n let matches = app_from_crate!()\n .arg(\n arg!(<PORT>)\n .help(\"Network port to use\")\n .validator(|s| s.parse::<usize>()),\n )\n ... | rust | edit | 0 | 1 | apache-2.0 | 7c60180e243a1432e8a0522de226a2188ff166c8 | clap-rs/clap,clap-rs/clap,clap-rs/clap | examples/tutorial_builder/04_02_validate.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nextern crate uosql;\n\nuse uosql::storage::*;\n\nfn main() {\n\n //let db = Database::create(\"storage_team\").unwrap();\n let db = Database::load(\"storage_team\").unwrap();\n\n let mut cols = Vec::new();\n cols.push(Column { nam... | rust | edit | 0 | 1 | mit | c562346192bbf0790338adf94f9590a2396c5d41 | tempbottle/uosql-server,tempbottle/uosql-server,OsnaCS/uosql-server,tempbottle/uosql-server,OsnaCS/uosql-server,OsnaCS/uosql-server | src/bin/table_test.rs | accepted | null | true |
[
{
"role": "user",
"content": "Write rust code for the following: testsuite: Add an xfailed test case for the new `extern mod` syntax"
},
{
"role": "assistant",
"content": "// Copyright 2013 The Rust Project Developers. See the COPYRIGHT\n// file at the top-level directory of this distribution an... | rust | new_file | null | null | apache-2.0 | 60126e9365e86f9697508455290850564ac9186e | pshc/rust,philyoon/rust,fabricedesre/rust,ruud-v-a/rust,mihneadb/rust,AerialX/rust,mdinger/rust,retep998/rand,andars/rust,ktossell/rust,carols10cents/rust,pythonesque/rust,zaeleus/rust,jroesch/rust,arthurprs/rand,sarojaba/rust-doc-korean,Ryman/rust,emk/rust,zubron/rust,aturon/rust,j16r/rust,l0kod/rust,jashank/rust,vhbi... | src/test/run-pass/extern-mod-url.rs | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n//! Furry Fiesta is a library for poker.\n//! It's mostly meant for Holdem games, however the core functionality\n//! should work for all game types.\n//!\n//! # Implemented:\n//! Currently Furry Fiesta supports:\n//!\n//! * Hand Iteration.\n... | rust | edit | 1 | 0 | apache-2.0 | c22ea027ff33663edcb9043d8de219067dc39ae7 | elliottneilclark/rs-poker,elliottneilclark/furry-fiesta | src/lib.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n//! Endpoint to receive metadata about implemented matrix versions.\n\npub mod msc3723 {\n //! [GET /_matrix/federation/versions](https://github.com/matrix-org/matrix-doc/pull/3723)\n\n use ruma_common::api::ruma_api;\n\n ruma_api! {... | rust | edit | 0 | 1 | mit | c11dfb6b10254318ba0e157866480fcc877f7685 | ruma/ruma | crates/ruma-federation-api/src/discovery/get_server_versions.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nuse cocoa::base::id;\nuse std::mem;\nuse std::ops::{Deref, DerefMut};\nuse {CommandEncoder, StoreAction, RenderCommandEncoder};\n\n#[derive(Debug)]\npub struct ParallelRenderCommandEncoder(id);\n\nunsafe impl Send for ParallelRenderCommandEnc... | rust | edit | 3 | 1 | apache-2.0 | c8c2782c48a28ff8b7f0004601b6682e747a5531 | burtonageo/metl | src/parallel_render_command_encoder.rs | accepted | null | true |
[
{
"role": "user",
"content": "Write rust code for the following: Add a C ABI compatible struct for use when performing"
},
{
"role": "assistant",
"content": "static IFNAMSIZ: uint = 16;\nstatic PADDINGSIZE: uint = 22;\nstatic IFF_TAP: u16 = 2;\nstatic IFF_NO_PI: u16 = 0x1000;\n\n\n// An enum rep... | rust | new_file | null | null | mit | 36db20dd946e7bc14281c5b732ca4494837dc7d8 | graememcc/netStack,graememcc/netStack | src/ioctl/ioctl_structs.rs | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Write rust code for the following: Add basic `BezNode` and `BezQuad`."
},
{
"role": "assistant",
"content": "use std::ops::Index;\nuse std::convert::Into;\n\n#[derive(Debug, Clone, Copy)]\npub enum BezNode {\n Point {\n x: f32,\n y: f32\n },\n\n ... | rust | new_file | 0 | 2 | apache-2.0 | dfe9423db6aeccd4a25bd5982f6dbe97afda8644 | Osspial/nbez-rs,Osspial/bev-rs | src/lib.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nuse crate::spec::{LinkerFlavor, Target, TargetResult};\n\npub fn target() -> TargetResult {\n let mut base = super::freebsd_base::opts();\n base.cpu = \"pentium4\".to_string();\n base.max_atomic_width = Some(64);\n base.pre_link_a... | rust | edit | 0 | 1 | apache-2.0 | de388032555b697d1b0ef197241886ab90ac39b2 | aidancully/rust,aidancully/rust,graydon/rust,aidancully/rust,graydon/rust,graydon/rust,graydon/rust,aidancully/rust,graydon/rust,aidancully/rust,aidancully/rust,graydon/rust | src/librustc_target/spec/i686_unknown_freebsd.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\nextern crate rustc_serialize;\nextern crate docopt;\n\nmod display;\nmod world;\n\nuse docopt::Docopt;\nuse std::thread::sleep_ms;\n\nstatic USAGE: &'static str = \"\nUsage:\n golr [options]\n\nOptions:\n -h <height>, --height <height> ... | rust | edit | 5 | 1 | mit | 4cf31689c587daf4667c9caa143b20dcee1eaa45 | pillserg/golr | src/main.rs | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Write rust code for the following: Add tests for Visibility parsing\n\nThese test both general `Visibility` usage, as well as specific failure cases\nfixed by the other two patches in this series."
},
{
"role": "assistant",
"content": "mod features;\n\nuse proc_macr... | rust | new_file | 1 | 3 | apache-2.0 | e53f215908abff3fa70d92c4061afd55ed408877 | dtolnay/syn | tests/test_visibility.rs | accepted | null | true |
[
{
"role": "user",
"content": "Write rust code for the following: Add ui test with explicit Unpin impl"
},
{
"role": "assistant",
"content": "use std::marker::Unpin;\n\n#[cxx::bridge]\nmod ffi {\n extern \"C++\" {\n type Opaque;\n }\n}\n\nimpl Unpin for ffi::Opaque {}\n\nfn main() {}... | rust | new_file | 0 | 1 | apache-2.0 | 0fe6ca2c444c4134d76382e8315173d0d001d83d | dtolnay/cxx,dtolnay/cxx,dtolnay/cxx,dtolnay/cxx | tests/ui/unpin_impl.rs | accepted | null | true |
[
{
"role": "user",
"content": "Write rust code for the following: Add a rustdoc test for future rustc_deprecated attributes"
},
{
"role": "assistant",
"content": "#![feature(staged_api)]\n\n#![stable(feature = \"rustc_deprecated-future-test\", since = \"1.0.0\")]\n\n// @has rustc_deprecated_futur... | rust | new_file | 1 | 0 | apache-2.0 | 01df8fe8ff4d57336ec84ac475988cc7403308a8 | graydon/rust,aidancully/rust,aidancully/rust,graydon/rust,aidancully/rust,graydon/rust,aidancully/rust,graydon/rust,aidancully/rust,aidancully/rust,graydon/rust,graydon/rust | src/test/rustdoc/rustc_deprecated-future.rs | accepted | null | true |
[
{
"role": "user",
"content": "Write rust code for the following: Add Arc test, triggering an unusual bug.\n\nWeird stuff. Ain't high, ain't drunk, but shit's happening, and it is fucked up. I can smell rainbows."
},
{
"role": "assistant",
"content": "//! This test is a more subtle one. It is one... | rust | new_file | 0 | 3 | mit | 96acdffac8bc14d967f042fc92b3a3ef2167ff0a | redox-os/ralloc | tests/arc.rs | accepted | null | true |
[
{
"role": "user",
"content": "Write rust code for the following: utils: Add tests for the `align_blocks` helper in utils."
},
{
"role": "assistant",
"content": "extern crate clippy_lints;\n\nuse clippy_lints::utils::align_snippets;\n\n#[test]\nfn test_align_snippets_single_line() {\n assert_e... | rust | new_file | null | null | apache-2.0 | a0997481133e02ec0034991e913d69b8b21bba64 | aidancully/rust,graydon/rust,graydon/rust,aidancully/rust,graydon/rust,graydon/rust,aidancully/rust,graydon/rust,aidancully/rust,aidancully/rust,graydon/rust,aidancully/rust | tests/test_align_snippets.rs | rejected_code_smell | Internal duplication: ~147% of the file is inside repeated 12+ line blocks | null |
[
{
"role": "user",
"content": "Write rust code for the following: Add example for R function call"
},
{
"role": "assistant",
"content": "extern crate libr;\n\nuse std::env;\nuse std::ffi::CString;\n\nuse libr::ffi::embedded;\nuse libr::ffi::internals::*;\n\nfn main() {\n if let Err(_) = env::v... | rust | new_file | 0 | 2 | mit | a004430a25de3f68f07c1994fed0bc009b241755 | zitsen/libr.rs,zitsen/libr.rs | examples/01-embedded-print.rs | accepted | null | true |
[
{
"role": "user",
"content": "Write rust code for the following: Add example for implementing a custom widget"
},
{
"role": "assistant",
"content": "extern crate tui;\n\nuse tui::Terminal;\nuse tui::widgets::Widget;\nuse tui::buffer::Buffer;\nuse tui::layout::Rect;\nuse tui::style::Color;\n\nstr... | rust | new_file | 0 | 1 | mit | d42dfaa71081ef8d4fbbd4f378b23919594a5a62 | fdehau/tui-rs | examples/custom_widget.rs | accepted | null | true |
[
{
"role": "user",
"content": "Write rust code for the following: Test that bounds checks are elided for indexing after .[r]position()"
},
{
"role": "assistant",
"content": "// min-llvm-version: 11.0.0\n// compile-flags: -O\n// ignore-debug: the debug assertions get in the way\n#![crate_type = \"... | rust | new_file | 0 | 2 | apache-2.0 | 0f1d25e5564b6f497417e00ed417234a0df7a227 | aidancully/rust,graydon/rust,graydon/rust,aidancully/rust,aidancully/rust,graydon/rust,graydon/rust,graydon/rust,graydon/rust,aidancully/rust,aidancully/rust,aidancully/rust | src/test/codegen/issue-73396-bounds-check-after-position.rs | accepted | null | true |
[
{
"role": "user",
"content": "Write rust code for the following: Add Automorphic number in Rust"
},
{
"role": "assistant",
"content": "// In mathematics an automorphic number (sometimes referred to as a circular number)\n// is a number whose square \"ends\" in the same digits as the number itsel... | rust | new_file | 0 | 1 | cc0-1.0 | d78677ddbdb7fe1fbc2fe28423d2a28ca4953620 | ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovs... | math/automorphic_numbers/Rust/automorphic_number.rs | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```rust\n// Copyright 2014 The Rust Project Developers. See the COPYRIGHT\n// file at the top-level directory of this distribution and at\n// http://rust-lang.org/COPYRIGHT.\n//\n// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or\n//... | rust | edit | 0 | 1 | apache-2.0 | 155faafb04edca61ea559f89818b77a356f98343 | aidancully/rust,aidancully/rust,GBGamer/rust,graydon/rust,GBGamer/rust,graydon/rust,graydon/rust,GBGamer/rust,graydon/rust,aidancully/rust,aidancully/rust,graydon/rust,aidancully/rust,graydon/rust,GBGamer/rust,GBGamer/rust,GBGamer/rust,GBGamer/rust,aidancully/rust,GBGamer/rust | src/librustc_back/target/armv7_linux_androideabi.rs | accepted | null | true |
[
{
"role": "user",
"content": "Write rust code for the following: Add rust code for custom-set case\n\nIt passed all test cases"
},
{
"role": "assistant",
"content": "use std::collections::HashSet;\nuse std::hash::Hash;\n\n#[derive(Debug, PartialEq)]\npub struct CustomSet<T: Hash + Eq> {\n sto... | rust | new_file | 0 | 2 | bsd-2-clause | 6847820e3db58165757fcb3de03021845738ccfa | gyn/exercism,gyn/exercism,gyn/exercism,gyn/exercism | rust/custom-set/src/lib.rs | accepted | null | true |
[
{
"role": "user",
"content": "Write rust code for the following: Test case to make sure typestate checks the body of class constructors"
},
{
"role": "assistant",
"content": "// error-pattern:unsatisfied precondition\nclass cat {\n priv {\n let mutable meows : uint;\n }\n\n let how_hungry ... | rust | new_file | null | null | apache-2.0 | 52f2a9a1c9fe705aa4ef5a4d7d7d4018b40b1f3a | ktossell/rust,barosl/rust,mitsuhiko/rust,mahkoh/rust,barosl/rust,0x73/rust,nham/rust,kimroen/rust,dinfuehr/rust,michaelballantyne/rust-gpu,0x73/rust,l0kod/rust,jroesch/rust,seanrivera/rust,TheNeikos/rust,ktossell/rust,aidancully/rust,fabricedesre/rust,aneeshusa/rust,omasanori/rust,kmcallister/rust,carols10cents/rust,mi... | src/test/compile-fail/ctor-uninit-var.rs | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Write rust code for the following: Add skeleton code for FilterExec."
},
{
"role": "assistant",
"content": "use common::types::Ty;\nuse driver::DriverContext;\nuse super::{Executor, ExecutorFactory};\n\npub struct FilterExecFactory\n{\n\ttypes: Vec<Ty>\n}\n\nimpl Fi... | rust | new_file | 0 | 1 | apache-2.0 | 2cd6978af0f702502ef4758f24c4d757b3e5c787 | hyunsik/tokamak,hyunsik/tokamak,hyunsik/tokamak,hyunsik/tokamak,hyunsik/tokamak,hyunsik/tokamak | exec/filter.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 | 3636ce7875dc71d907789a779c1c1cb5973e021f | GBGamer/rust,GBGamer/rust,aidancully/rust,aidancully/rust,graydon/rust,aidancully/rust,GBGamer/rust,graydon/rust,graydon/rust,aidancully/rust,GBGamer/rust,graydon/rust,aidancully/rust,GBGamer/rust,graydon/rust,graydon/rust,aidancully/rust,GBGamer/rust,GBGamer/rust,GBGamer/rust | src/test/compile-fail/expanded-cfg.rs | accepted | null | true |
[
{
"role": "user",
"content": "Write rust code for the following: [rust] Address of two struct must be different even the struct is empty struct(size is zero)."
},
{
"role": "assistant",
"content": "struct EmptyStruct;\n\nfn main() {\n let e1 = EmptyStruct;\n let e2 = EmptyStruct;\n prin... | rust | new_file | 2 | 1 | bsd-2-clause | 2f7fba8ae1ae13823b6bdc8d00b4513e22d83bb8 | sgkim126/snippets,sgkim126/snippets,sgkim126/snippets,sgkim126/snippets,sgkim126/snippets,sgkim126/snippets,sgkim126/snippets,sgkim126/snippets,sgkim126/snippets,sgkim126/snippets,sgkim126/snippets,sgkim126/snippets | rust/address_of_struct.rs | accepted | null | true |
[
{
"role": "user",
"content": "Write rust code for the following: Add test for `has_test_signature` for explicit return"
},
{
"role": "assistant",
"content": "// Copyright 2015 The Rust Project Developers. See the COPYRIGHT\n// file at the top-level directory of this distribution and at\n// http:... | rust | new_file | 0 | 1 | apache-2.0 | fd029209ec4901580b1cc0180098e0b4024bee5b | untitaker/rust,mdinger/rust,ruud-v-a/rust,GBGamer/rust,avdi/rust,aneeshusa/rust,pelmers/rust,ejjeong/rust,dwillmer/rust,mihneadb/rust,graydon/rust,jashank/rust,GBGamer/rust,aneeshusa/rust,miniupnp/rust,aidancully/rust,robertg/rust,reem/rust,pshc/rust,jroesch/rust,dwillmer/rust,XMPPwocky/rust,miniupnp/rust,hauleth/rust,... | src/test/run-pass/test-fn-signature-verification-for-explicit-return-type.rs | accepted | null | true |
[
{
"role": "user",
"content": "Write rust code for the following: Add test for compiler reexports removal"
},
{
"role": "assistant",
"content": "// compile-flags: --no-defaults\n\n#![crate_name = \"foo\"]\n\n// @has 'foo/index.html' '//code' 'extern crate std;'\n// @!has 'foo/index.html' '//code'... | rust | new_file | 0 | 0 | apache-2.0 | 0faaa499ccc9fb4835251845cf457bae385f07f5 | graydon/rust,graydon/rust,aidancully/rust,aidancully/rust,aidancully/rust,graydon/rust,graydon/rust,aidancully/rust,aidancully/rust,graydon/rust,graydon/rust,aidancully/rust | src/test/rustdoc/no-compiler-reexport.rs | accepted | null | true |
[
{
"role": "user",
"content": "Write rust code for the following: Add test for constant pattern diagnostics"
},
{
"role": "assistant",
"content": "// 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.... | rust | new_file | 0 | 1 | apache-2.0 | 9be0ba5cc0e27e32e4d55332118f9891e97e5423 | graydon/rust,graydon/rust,GBGamer/rust,GBGamer/rust,aidancully/rust,graydon/rust,GBGamer/rust,aidancully/rust,graydon/rust,graydon/rust,GBGamer/rust,aidancully/rust,aidancully/rust,aidancully/rust,GBGamer/rust,graydon/rust,GBGamer/rust,GBGamer/rust,aidancully/rust,GBGamer/rust | src/test/compile-fail/const-pattern-irrefutable.rs | accepted | null | true |
[
{
"role": "user",
"content": "Write rust code for the following: Add moc test (not testing result)"
},
{
"role": "assistant",
"content": "\nextern crate ndarray;\nextern crate ndarray_linalg as linalg;\n\nuse ndarray::prelude::*;\nuse linalg::SquareMatrix;\n\n#[test]\nfn test_eigh() {\n let a... | rust | new_file | 0 | 1 | mit | 0a1563eb5de0d85a5b80c0cb7ae603cac2df050e | termoshtt/ndarray-linalg | tests/eigh.rs | accepted | null | true |
[
{
"role": "user",
"content": "Write rust code for the following: Add some simple should_parse tests"
},
{
"role": "assistant",
"content": "//! This module contains some simple tests where we can write strings which we \n\nextern crate syn;\n\nmacro_rules! should_parse {\n ($name:ident, { $($i... | rust | new_file | 0 | 1 | apache-2.0 | 25231e85d78c9d0222a1b771136757a109f6182e | dtolnay/syn | tests/test_should_parse.rs | accepted | null | true |
[
{
"role": "user",
"content": "Write rust code for the following: Implement a data Reader utility"
},
{
"role": "assistant",
"content": "use std::str;\nuse object_id;\nuse object_id::ObjectId;\n\npub struct Reader<'a> {\n position: uint,\n data: &'a [u8]\n}\n\nimpl<'a> Reader<'a> {\n pub... | rust | new_file | null | null | mit | c13d8813aa8b2742103ec56bc9ac627bb3ddc4d8 | kaisellgren/rust_git | src/reader.rs | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Write rust code for the following: Add an example with at least 2 arguments"
},
{
"role": "assistant",
"content": "#[macro_use]\nextern crate structopt;\n\nuse structopt::StructOpt;\n\n#[derive(StructOpt, Debug)]\nstruct Opt {\n #[structopt(raw(required = \"true\... | rust | new_file | 0 | 1 | apache-2.0 | 73b6b672cae13740c90c1ca2aab0a891c7b8380d | clap-rs/clap,clap-rs/clap,clap-rs/clap | examples/at_least_two.rs | accepted | null | true |
[
{
"role": "user",
"content": "Write rust code for the following: Add crypto coin ticker lookup functionality"
},
{
"role": "assistant",
"content": "use std::io::Read;\n\nuse serde_json;\nuse reqwest;\nuse reqwest::Method;\nuse regex::Regex;\n\nuse ::bot::{Bot, Node, RoomEvent};\n\n\npub struct C... | rust | new_file | 2 | 4 | mit | bc7b2b8d4ba4b80026bffe7619fba73201018855 | jpypi/rustix | src/services/crypto_coin.rs | accepted | null | true |
[
{
"role": "user",
"content": "Write rust code for the following: Add the generic GObject wrapper struct"
},
{
"role": "assistant",
"content": "// Copyright 2015, The Rust-GNOME Project Developers.\n// See the COPYRIGHT file at the top-level directory of this distribution.\n// Licensed under the ... | rust | new_file | 0 | 1 | mit | b1518a93e3f245c6e2b7632d1d56474ed1f045ba | gkoz/gtk-rs-gtk,daa84/gtk,EPashkin/rust-gnome-gtk,Susurrus/gtk,daa84/gtk,rust-gnome/gtk,gkoz/gtk-rs-gtk,gkoz/rust-gnome-gtk,gkoz/rust-gnome-gtk,Susurrus/gtk,EPashkin/rust-gnome-gtk,rust-gnome/gtk | src/object.rs | accepted | null | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.