jiebi/CodeConvo huggingface dataset:
<ins> error[E0433]: failed to resolve: expected type, found function `channel` in `mpsc` --> $DIR/issue-71406.rs:4:26 | LL |     let (tx, rx) = mpsc::channel::new(1); |                          ^^^^^^^ expected type, found function `channel` in `mpsc` error: aborting due to previous error For more information about this error, try `rustc --explain E0433`. </ins>
&b.item_def_id, ))) } else { <del> let ty = relation.relate(&a.ty, &b.ty)?; let substs = relation.relate(&a.substs, &b.substs)?; </del> <ins> let ty = relation.relate_with_variance(ty::Invariant, &a.ty, &b.ty)?; let substs = relation.relate_with_variance(ty::Invariant, &a.substs, &b.substs)?; </ins> Ok(ty::ExistentialProjection { item_def_id: a.item_def_id, substs, ty }) } }
LL |     let _ = Box::new(|x| (x as u8)): Box<dyn Fn(i32) -> _>; |             ^^^^^^^^^^^^^^^^^^^^^^^ expected trait object `dyn std::ops::Fn`, found closure | <del> = note: expected struct `std::boxed::Box<dyn std::ops::Fn(i32) -> _>` </del> <ins> = note: expected struct `std::boxed::Box<dyn std::ops::Fn(i32) -> u8>` </ins> found struct `std::boxed::Box<[closure@$DIR/coerce-expect-unsized-ascribed.rs:26:22: 26:35]>` error: aborting due to 14 previous errors
<del> error[E0277]: the size for values of type `dyn std::iter::Iterator<Item = &mut u8>` cannot be known at compilation time </del> <ins> error[E0277]: the size for values of type `dyn std::iter::Iterator<Item = &'a mut u8>` cannot be known at compilation time </ins> --> $DIR/issue-20605.rs:2:17 | LL |     for item in *things { *item = 0 } |                 ^^^^^^^ doesn't have a size known at compile-time | <del> = help: the trait `std::marker::Sized` is not implemented for `dyn std::iter::Iterator<Item = &mut u8>` </del> <ins> = help: the trait `std::marker::Sized` is not implemented for `dyn std::iter::Iterator<Item = &'a mut u8>` </ins> = note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait> = note: required by `std::iter::IntoIterator::into_iter`
<ins> error: lifetime may not live long enough --> $DIR/variance-associated-types2.rs:13:12 | LL | fn take<'a>(_: &'a u32) { |         -- lifetime `'a` defined here LL |     let _: Box<dyn Foo<Bar = &'a u32>> = make(); |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^ type annotation requires that `'a` must outlive `'static` | = help: consider replacing `'a` with `'static` error: aborting due to previous error </ins>
<ins> // Test that dyn Foo<Bar = T> is invariant with respect to T. // Failure to enforce invariance here can be weaponized, see #71550 for details. trait Foo { type Bar; } fn make() -> Box<dyn Foo<Bar = &'static u32>> { panic!() } fn take<'a>(_: &'a u32) { let _: Box<dyn Foo<Bar = &'a u32>> = make(); //~^ ERROR mismatched types [E0308] } fn main() {} </ins>
<ins> error[E0308]: mismatched types --> $DIR/variance-associated-types2.rs:13:42 | LL |     let _: Box<dyn Foo<Bar = &'a u32>> = make(); |                                          ^^^^^^ lifetime mismatch | = note: expected trait object `dyn Foo<Bar = &'a u32>` found trait object `dyn Foo<Bar = &'static u32>` note: the lifetime `'a` as defined on the function body at 12:9... --> $DIR/variance-associated-types2.rs:12:9 | LL | fn take<'a>(_: &'a u32) { |         ^^ = note: ...does not necessarily outlive the static lifetime error: aborting due to previous error For more information about this error, try `rustc --explain E0308`. </ins>
printf("Available features for this target:n"); for (auto &Feature : FeatTable) printf("    %-*s - %s.n", MaxFeatLen, Feature.Key, Feature.Desc); <ins> printf("nRust-specific features:n"); printf("    %-*s - %s.n", MaxFeatLen, "crt-static", "Enables libraries with C Run-time Libraries(CRT) to be statically linked" ); </ins> printf("n"); printf("Use +feature to enable a feature, or -feature to disable it.n"
// We can still be zero-sized in this branch, in which case we have to // return `None`. <del> if size.bytes() == 0 { // We may be reading from a static. // In order to ensure that `static FOO: Type = FOO;` causes a cycle error // instead of magically pulling *any* ZST value from the ether, we need to // actually access the referenced allocation. The caller is likely // to short-circuit on `None`, so we trigger the access here to // make sure it happens. self.get_raw(ptr.alloc_id)?; None } else { Some(ptr) } </del> <ins> if size.bytes() == 0 { None } else { Some(ptr) } </ins> } }) }
{ Some(ptr) => ptr, None => { <ins> if let Scalar::Ptr(ptr) = mplace.ptr { // We may be reading from a static. // In order to ensure that `static FOO: Type = FOO;` causes a cycle error // instead of magically pulling *any* ZST value from the ether, we need to // actually access the referenced allocation. self.memory.get_raw(ptr.alloc_id)?; } </ins> return Ok(Some(ImmTy { // zero-sized type imm: Scalar::zst().into(),
<ins> // check-pass // This is a regression test for ICEs from // https://github.com/rust-lang/rust/issues/71612 // and // https://github.com/rust-lang/rust/issues/71709 #[derive(Copy, Clone)] pub struct Glfw; static mut GLFW: Option<Glfw> = None; pub fn new() -> Glfw { unsafe { if let Some(glfw) = GLFW { return glfw; } else { todo!() } }; } extern "C" { static _dispatch_queue_attr_concurrent: [u8; 0]; } static DISPATCH_QUEUE_CONCURRENT: &'static [u8; 0] = unsafe { &_dispatch_queue_attr_concurrent }; fn main() { *DISPATCH_QUEUE_CONCURRENT; new(); } </ins>
if (!next) { return; } <del> if (next.getElementsByClassName("method").length > 0 && hasClass(e, "impl")) { </del> <ins> if (hasClass(e, "impl") && (next.getElementsByClassName("method").length > 0 || next.getElementsByClassName("associatedconstant").length > 0)) { </ins> insertAfter(toggle.cloneNode(true), e.childNodes[e.childNodes.length - 1]); } };
use crate::middle::cstore::{ExternCrate, ExternCrateSource}; <del> use crate::mir::interpret::{sign_extend, truncate, AllocId, ConstValue, Pointer, Scalar}; </del> <ins> use crate::mir::interpret::{ sign_extend, truncate, AllocId, ConstValue, GlobalAlloc, Pointer, Scalar, }; </ins> use crate::ty::layout::IntegerExt; use crate::ty::subst::{GenericArg, GenericArgKind, Subst}; use crate::ty::{self, DefIdTree, ParamConst, Ty, TyCtxt, TypeFoldable};
}, _, ), <del> ) => { let byte_str = self .tcx() .global_alloc(ptr.alloc_id) .unwrap_memory() .get_bytes(&self.tcx(), ptr, Size::from_bytes(*data)) .unwrap(); p!(pretty_print_byte_str(byte_str)); } </del> <ins> ) => match self.tcx().get_global_alloc(ptr.alloc_id) { Some(GlobalAlloc::Memory(alloc)) => { if let Ok(byte_str) = alloc.get_bytes(&self.tcx(), ptr, Size::from_bytes(*data)) { p!(pretty_print_byte_str(byte_str)) } else { p!(write("<too short allocation>")) } } // FIXME: for statics and functions, we could in principle print more detail. Some(GlobalAlloc::Static(def_id)) => p!(write("<static({:?})>", def_id)), Some(GlobalAlloc::Function(_)) => p!(write("<function>")), None => p!(write("<dangling pointer>")), }, </ins> // Bool (Scalar::Raw { data: 0, .. }, ty::Bool) => p!(write("false")), (Scalar::Raw { data: 1, .. }, ty::Bool) => p!(write("true")),
)?; } (Scalar::Ptr(ptr), ty::FnPtr(_)) => { <ins> // FIXME: this can ICE when the ptr is dangling or points to a non-function. // We should probably have a helper method to share code with the "Byte strings" // printing above (which also has to handle pointers to all sorts of things). </ins> let instance = self.tcx().global_alloc(ptr.alloc_id).unwrap_fn(); self = self.typed_value( |this| this.print_value_path(instance.def_id(), instance.substs),
} debug!("note_type_err(diag={:?})", diag); <ins> enum Mismatch<'a> { Variable(ty::error::ExpectedFound<Ty<'a>>), Fixed(&'static str), } </ins> let (expected_found, exp_found, is_simple_error) = match values { <del> None => (None, None, false), </del> <ins> None => (None, Mismatch::Fixed("type"), false), </ins> Some(values) => { let (is_simple_error, exp_found) = match values { ValuePairs::Types(exp_found) => {
) .report(diag); <del> (is_simple_err, Some(exp_found)) </del> <ins> (is_simple_err, Mismatch::Variable(exp_found)) </ins> } <del> _ => (false, None), </del> <ins> ValuePairs::TraitRefs(_) => (false, Mismatch::Fixed("trait")), _ => (false, Mismatch::Fixed("type")), </ins> }; let vals = match self.values_str(&values) { Some((expected, found)) => Some((expected, found)),
} }; if let Some((expected, found)) = expected_found { <del> let expected_label = exp_found.map_or("type".into(), |ef| ef.expected.prefix_string()); let found_label = exp_found.map_or("type".into(), |ef| ef.found.prefix_string()); </del> <ins> let expected_label = match exp_found { Mismatch::Variable(ef) => ef.expected.prefix_string(), Mismatch::Fixed(s) => s.into(), }; let found_label = match exp_found { Mismatch::Variable(ef) => ef.found.prefix_string(), Mismatch::Fixed(s) => s.into(), }; let exp_found = match exp_found { Mismatch::Variable(exp_found) => Some(exp_found), Mismatch::Fixed(_) => None, }; </ins> match (&terr, expected == found) { (TypeError::Sorts(values), extra) => { let sort_string = |ty: Ty<'tcx>| match (extra, &ty.kind) {
<ins> error[E0308]: mismatched types --> $DIR/E0308-2.rs:9:6 | LL | impl Eq for &dyn DynEq {} |      ^^ lifetime mismatch | = note: expected trait `std::cmp::PartialEq` found trait `std::cmp::PartialEq` note: the lifetime `'_` as defined on the impl at 9:13... --> $DIR/E0308-2.rs:9:13 | LL | impl Eq for &dyn DynEq {} |             ^ = note: ...does not necessarily outlive the static lifetime error: aborting due to previous error For more information about this error, try `rustc --explain E0308`. </ins>
// check that a comma comes after every field if !ate_comma { <del> let err = ExpectedCommaAfterPatternField { span: self.token.span } </del> <ins> let mut err = ExpectedCommaAfterPatternField { span: self.token.span } </ins> .into_diagnostic(&self.sess.span_diagnostic); if let Some(mut delayed) = delayed_err { delayed.emit(); } <ins> self.recover_misplaced_pattern_modifiers(&fields, &mut err); </ins> return Err(err); } ate_comma = false;
Ok((fields, etc)) } <ins> /// If the user writes `S { ref field: name }` instead of `S { field: ref name }`, we suggest /// the correct code. fn recover_misplaced_pattern_modifiers( &self, fields: &ThinVec<PatField>, err: &mut DiagnosticBuilder<'a, ErrorGuaranteed>, ) { if let Some(last) = fields.iter().last() && last.is_shorthand && let PatKind::Ident(binding, ident, None) = last.pat.kind && binding != BindingAnnotation::NONE && self.token == token::Colon // We found `ref mut? ident:`, try to parse a `name,` or `name }`. && let Some(name_span) = self.look_ahead(1, |t| t.is_ident().then(|| t.span)) && self.look_ahead(2, |t| { t == &token::Comma || t == &token::CloseDelim(Delimiter::Brace) }) { let span = last.pat.span.with_hi(ident.span.lo()); // We have `S { ref field: name }` instead of `S { field: ref name }` err.multipart_suggestion( "the pattern modifiers belong after the `:`", vec![ (span, String::new()), (name_span.shrink_to_lo(), binding.prefix_str().to_string()), ], Applicability::MachineApplicable, ); } } </ins> /// Recover on `...` or `_` as if it were `..` to avoid further errors. /// See issue #46718. fn recover_bad_dot_dot(&self) {
<ins> // run-rustfix struct S { field_name: (), } fn main() { match (S {field_name: ()}) { S {field_name: ref _foo} => {} //~ ERROR expected `,` } match (S {field_name: ()}) { S {field_name: mut _foo} => {} //~ ERROR expected `,` } match (S {field_name: ()}) { S {field_name: ref mut _foo} => {} //~ ERROR expected `,` } // Verify that we recover enough to run typeck. let _: usize = 3usize; //~ ERROR mismatched types } </ins>
<ins> // run-rustfix struct S { field_name: (), } fn main() { match (S {field_name: ()}) { S {ref field_name: _foo} => {} //~ ERROR expected `,` } match (S {field_name: ()}) { S {mut field_name: _foo} => {} //~ ERROR expected `,` } match (S {field_name: ()}) { S {ref mut field_name: _foo} => {} //~ ERROR expected `,` } // Verify that we recover enough to run typeck. let _: usize = 3u8; //~ ERROR mismatched types } </ins>
<ins> error: expected `,` --> $DIR/incorrect-placement-of-pattern-modifiers.rs:8:26 | LL |         S {ref field_name: _foo} => {} |         -                ^ |         | |         while parsing the fields for this pattern | help: the pattern modifiers belong after the `:` | LL -         S {ref field_name: _foo} => {} LL +         S {field_name: ref _foo} => {} | error: expected `,` --> $DIR/incorrect-placement-of-pattern-modifiers.rs:11:26 | LL |         S {mut field_name: _foo} => {} |         -                ^ |         | |         while parsing the fields for this pattern | help: the pattern modifiers belong after the `:` | LL -         S {mut field_name: _foo} => {} LL +         S {field_name: mut _foo} => {} | error: expected `,` --> $DIR/incorrect-placement-of-pattern-modifiers.rs:14:30 | LL |         S {ref mut field_name: _foo} => {} |         -                    ^ |         | |         while parsing the fields for this pattern | help: the pattern modifiers belong after the `:` | LL -         S {ref mut field_name: _foo} => {} LL +         S {field_name: ref mut _foo} => {} | error[E0308]: mismatched types --> $DIR/incorrect-placement-of-pattern-modifiers.rs:17:20 | LL |     let _: usize = 3u8; |            -----   ^^^ expected `usize`, found `u8` |            | |            expected due to this | help: change the type of the numeric literal from `u8` to `usize` | LL |     let _: usize = 3usize; |                     ~~~~~ error: aborting due to 4 previous errors For more information about this error, try `rustc --explain E0308`. </ins>
self.suggest_remove_reference(&obligation, &mut err, &trait_ref); self.suggest_semicolon_removal(&obligation, &mut err, span, &trait_ref); self.note_version_mismatch(&mut err, &trait_ref); <del> self.suggest_await_before_try(&mut err, &obligation, &trait_ref, span); </del> <ins> if Some(trait_ref.def_id()) == tcx.lang_items().try_trait() { self.suggest_await_before_try(&mut err, &obligation, &trait_ref, span); } </ins> if self.suggest_impl_trait(&mut err, span, &obligation, &trait_ref) { err.emit(); return;
<ins> // edition:2018 // compile-flags:-Cincremental=tmp/issue-72442 use std::fs::File; use std::future::Future; use std::io::prelude::*; fn main() -> Result<(), Box<dyn std::error::Error>> { block_on(async { { let path = std::path::Path::new("."); let mut f = File::open(path.to_str())?; //~^ ERROR the trait bound let mut src = String::new(); f.read_to_string(&mut src)?; Ok(()) } }) } fn block_on<F>(f: F) -> F::Output where F: Future<Output = Result<(), Box<dyn std::error::Error>>>, { Ok(()) } </ins>
<ins> error[E0277]: the trait bound `std::option::Option<&str>: std::convert::AsRef<std::path::Path>` is not satisfied --> $DIR/issue-72442.rs:12:36 | LL |             let mut f = File::open(path.to_str())?; |                                    ^^^^^^^^^^^^^ the trait `std::convert::AsRef<std::path::Path>` is not implemented for `std::option::Option<&str>` | ::: $SRC_DIR/libstd/fs.rs:LL:COL | LL |     pub fn open<P: AsRef<Path>>(path: P) -> io::Result<File> { |                    ----------- required by this bound in `std::fs::File::open` error: aborting due to previous error For more information about this error, try `rustc --explain E0277`. </ins>
return Some(*c); } <del> let mut dist = dist.unwrap_or_else(|| cmp::max(lookup.len(), 3) / 3); </del> <ins> // `fn edit_distance()` use `chars()` to calculate edit distance, so we must // also use `chars()` (and not `str::len()`) to calculate length here. let lookup_len = lookup.chars().count(); let mut dist = dist.unwrap_or_else(|| cmp::max(lookup_len, 3) / 3); </ins> let mut best = None; // store the candidates with the same distance, only for `use_substring_score` current. let mut next_candidates = vec![];
fn default() -> Self; } <del> /// Return the default value of a type according to the `Default` trait. /// /// The type to return is inferred from context; this is equivalent to /// `Default::default()` but shorter to type. /// /// For example: /// ``` /// #![feature(default_free_fn)] /// /// use std::default::default; /// /// #[derive(Default)] /// struct AppConfig { ///     foo: FooConfig, ///     bar: BarConfig, /// } /// /// #[derive(Default)] /// struct FooConfig { ///     foo: i32, /// } /// /// #[derive(Default)] /// struct BarConfig { ///     bar: f32, ///     baz: u8, /// } /// /// fn main() { ///     let options = AppConfig { ///         foo: default(), ///         bar: BarConfig { ///             bar: 10.1, ///             ..default() ///         }, ///     }; /// } /// ``` #[unstable(feature = "default_free_fn", issue = "73014")] #[must_use] #[inline] pub fn default<T: Default>() -> T { Default::default() } </del> /// Derive macro generating an impl of the trait `Default`. #[rustc_builtin_macro(Default, attributes(default))] #[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
<del> # `default_free_fn` The tracking issue for this feature is: [#73014] [#73014]: https://github.com/rust-lang/rust/issues/73014 ------------------------ Adds a free `default()` function to the `std::default` module.  This function just forwards to [`Default::default()`], but may remove repetition of the word "default" from the call site. [`Default::default()`]: ../../std/default/trait.Default.html#tymethod.default Here is an example: ```rust #![feature(default_free_fn)] use std::default::default; #[derive(Default)] struct AppConfig { foo: FooConfig, bar: BarConfig, } #[derive(Default)] struct FooConfig { foo: i32, } #[derive(Default)] struct BarConfig { bar: f32, baz: u8, } fn main() { let options = AppConfig { foo: default(), bar: BarConfig { bar: 10.1, ..default() }, }; } ``` </del>
<del> error[E0425]: cannot find function `default` in this scope --> $DIR/issue-2356.rs:31:5 | LL |     default(); |     ^^^^^^^ | help: you might have meant to call the associated function | LL |     Self::default(); |     ~~~~~~~~~~~~~ help: consider importing this function | LL + use std::default::default; | </del> error[E0425]: cannot find value `whiskers` in this scope --> $DIR/issue-2356.rs:39:5 |
LL |     clone(); |     ^^^^^ help: you might have meant to call the method: `self.clone` <ins> error[E0425]: cannot find function `default` in this scope --> $DIR/issue-2356.rs:31:5 | LL |     default(); |     ^^^^^^^ help: you might have meant to call the associated function: `Self::default` </ins> error[E0425]: cannot find function `shave` in this scope --> $DIR/issue-2356.rs:41:5 |
use rustc_hir::lang_items::{ FutureTraitLangItem, PinTypeLangItem, SizedTraitLangItem, VaListTypeLangItem, }; <del> use rustc_hir::{ExprKind, GenericArg, HirIdMap, Item, ItemKind, Node, PatKind, QPath}; </del> <ins> use rustc_hir::{ExprKind, GenericArg, HirIdMap, ItemKind, Node, PatKind, QPath}; </ins> use rustc_index::bit_set::BitSet; use rustc_index::vec::Idx; use rustc_infer::infer;
"packed type cannot transitively contain a `#[repr(align)]` type" ); <del> let hir = tcx.hir(); let hir_id = hir.as_local_hir_id(def_spans[0].0.expect_local()); if let Node::Item(Item { ident, .. }) = hir.get(hir_id) { err.span_note( tcx.def_span(def_spans[0].0), &format!("`{}` has a `#[repr(align)]` attribute", ident), ); } </del> <ins> err.span_note( tcx.def_span(def_spans[0].0), &format!( "`{}` has a `#[repr(align)]` attribute", tcx.item_name(def_spans[0].0) ), ); </ins> if def_spans.len() > 2 { let mut first = true; for (adt_def, span) in def_spans.iter().skip(1).rev() { <del> let hir_id = hir.as_local_hir_id(adt_def.expect_local()); if let Node::Item(Item { ident, .. }) = hir.get(hir_id) { err.span_note( *span, &if first { format!( "`{}` contains a field of type `{}`", tcx.type_of(def.did), ident ) } else { format!("...which contains a field of type `{}`", ident) }, ); first = false; } </del> <ins> let ident = tcx.item_name(*adt_def); err.span_note( *span, &if first { format!( "`{}` contains a field of type `{}`", tcx.type_of(def.did), ident ) } else { format!("...which contains a field of type `{}`", ident) }, ); first = false; </ins> } }
<ins> error[E0588]: packed type cannot transitively contain a `#[repr(align)]` type --> $DIR/issue-73112.rs:9:5 | LL | /     struct SomeStruct { LL | | LL | |         page_table: PageTable, LL | |     } | |_____^ | note: `PageTable` has a `#[repr(align)]` attribute --> $DIR/auxiliary/issue-73112.rs:8:1 | LL | / pub struct PageTable { LL | |     entries: [PageTableEntry; 512], LL | | } | |_^ error: aborting due to previous error For more information about this error, try `rustc --explain E0588`. </ins>
/// but shebang isn't a part of rust syntax. pub fn strip_shebang(input: &str) -> Option<usize> { // Shebang must start with `#!` literally, without any preceding whitespace. <del> if input.starts_with("#!") { let input_tail = &input[2..]; // Shebang must have something non-whitespace after `#!` on the first line. let first_line_tail = input_tail.lines().next()?; if first_line_tail.contains(|c| !is_whitespace(c)) { // Ok, this is a shebang but if the next non-whitespace token is `[` or maybe // a doc comment (due to `TokenKind::(Line,Block)Comment` ambiguity at lexer level), // then it may be valid Rust code, so consider it Rust code. let next_non_whitespace_token = tokenize(input_tail).map(|tok| tok.kind).find(|tok| !matches!(tok, TokenKind::Whitespace | TokenKind::LineComment | TokenKind::BlockComment { .. }) ); if next_non_whitespace_token != Some(TokenKind::OpenBracket) { // No other choice than to consider this a shebang. return Some(2 + first_line_tail.len()); } </del> <ins> // For simplicity we consider any line starting with `#!` a shebang, // regardless of restrictions put on shebangs by specific platforms. if let Some(input_tail) = input.strip_prefix("#!") { // Ok, this is a shebang but if the next non-whitespace token is `[` or maybe // a doc comment (due to `TokenKind::(Line,Block)Comment` ambiguity at lexer level), // then it may be valid Rust code, so consider it Rust code. let next_non_whitespace_token = tokenize(input_tail).map(|tok| tok.kind).find(|tok| !matches!(tok, TokenKind::Whitespace | TokenKind::LineComment | TokenKind::BlockComment { .. }) ); if next_non_whitespace_token != Some(TokenKind::OpenBracket) { // No other choice than to consider this a shebang. return Some(2 + input_tail.lines().next().unwrap_or_default().len()); </ins> } } None
generics: &Generics, fields: &[@struct_field], visitor: ResolveVisitor) { <ins> let mut ident_map = HashMap::new::<ast::ident, @struct_field>(); for fields.iter().advance |&field| { match field.node.kind { named_field(ident, _) => { match ident_map.find(&ident) { Some(&prev_field) => { let ident_str = self.session.str_of(ident); self.session.span_err(field.span, fmt!("field `%s` is already declared", ident_str)); self.session.span_note(prev_field.span, "Previously declared here"); }, None => { ident_map.insert(ident, field); } } } _ => () } } </ins> // If applicable, create a rib for the type parameters. do self.with_type_parameter_rib(HasTypeParameters (generics, id, 0,
<ins> // Copyright 2013 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. struct BuildData { foo: int, foo: int, //~ ERROR field `foo` is already declared } fn main() { } </ins>