jiebi/CodeConvo huggingface dataset:
} pub fn write(&self, buf: &[u8]) -> io::Result<usize> { <ins> let len = cmp::min(buf.len(), <wrlen_t>::max_value() as usize) as wrlen_t; </ins> let ret = try!(cvt(unsafe { c::send(*self.inner.as_inner(), buf.as_ptr() as *const c_void, <del> buf.len() as wrlen_t, </del> <ins> len, </ins> 0) })); Ok(ret as usize)
pub fn recv_from(&self, buf: &mut [u8]) -> io::Result<(usize, SocketAddr)> { let mut storage: c::sockaddr_storage = unsafe { mem::zeroed() }; let mut addrlen = mem::size_of_val(&storage) as c::socklen_t; <ins> let len = cmp::min(buf.len(), <wrlen_t>::max_value() as usize) as wrlen_t; </ins> let n = try!(cvt(unsafe { c::recvfrom(*self.inner.as_inner(), buf.as_mut_ptr() as *mut c_void, <del> buf.len() as wrlen_t, 0, </del> <ins> len, 0, </ins> &mut storage as *mut _ as *mut _, &mut addrlen) })); Ok((n as usize, try!(sockaddr_to_addr(&storage, addrlen as usize)))) } pub fn send_to(&self, buf: &[u8], dst: &SocketAddr) -> io::Result<usize> { <ins> let len = cmp::min(buf.len(), <wrlen_t>::max_value() as usize) as wrlen_t; </ins> let (dstp, dstlen) = dst.into_inner(); let ret = try!(cvt(unsafe { c::sendto(*self.inner.as_inner(), <del> buf.as_ptr() as *const c_void, buf.len() as wrlen_t, </del> <ins> buf.as_ptr() as *const c_void, len, </ins> 0, dstp, dstlen) })); Ok(ret as usize)
pub fn read(&self, buf: &mut [u8]) -> io::Result<usize> { // On unix when a socket is shut down all further reads return 0, so we // do the same on windows to map a shut down socket to returning EOF. <ins> let len = cmp::min(buf.len(), i32::max_value() as usize) as i32; </ins> unsafe { <del> match c::recv(self.0, buf.as_mut_ptr() as *mut c_void, buf.len() as i32, 0) { </del> <ins> match c::recv(self.0, buf.as_mut_ptr() as *mut c_void, len, 0) { </ins> -1 if c::WSAGetLastError() == c::WSAESHUTDOWN => Ok(0), -1 => Err(last_error()), n => Ok(n as usize)
// Define the name or return the existing binding if there is a collision. pub fn try_define_child(&self, name: Name, ns: Namespace, binding: NameBinding<'a>) -> Result<(), &'a NameBinding<'a>> { <del> if self.resolutions.borrow_state() != ::std::cell::BorrowState::Unused { return Ok(()); } </del> self.update_resolution(name, ns, |resolution| { resolution.try_define(self.arenas.alloc_name_binding(binding)) })
fn update_resolution<T, F>(&self, name: Name, ns: Namespace, update: F) -> T where F: FnOnce(&mut NameResolution<'a>) -> T { <del> let mut resolution = &mut *self.resolution(name, ns).borrow_mut(); let was_known = resolution.binding().is_some(); let t = update(resolution); if !was_known { if let Some(binding) = resolution.binding() { self.define_in_glob_importers(name, ns, binding); </del> <ins> // Ensure that `resolution` isn't borrowed during `define_in_glob_importers`, // where it might end up getting re-defined via a glob cycle. let (new_binding, t) = { let mut resolution = &mut *self.resolution(name, ns).borrow_mut(); let was_known = resolution.binding().is_some(); let t = update(resolution); if was_known { return t; } match resolution.binding() { Some(binding) => (binding, t), None => return t, </ins> } <del> } </del> <ins> }; self.define_in_glob_importers(name, ns, new_binding); </ins> t }
// Add to target_module's glob_importers target_module.glob_importers.borrow_mut().push((module_, directive)); <del> for (&(name, ns), resolution) in target_module.resolutions.borrow().iter() { if let Some(binding) = resolution.borrow().binding() { if binding.defined_with(DefModifiers::IMPORTABLE | DefModifiers::PUBLIC) { let _ = module_.try_define_child(name, ns, directive.import(binding, None)); } </del> <ins> // Ensure that `resolutions` isn't borrowed during `try_define_child`, // since it might get updated via a glob cycle. let bindings = target_module.resolutions.borrow().iter().filter_map(|(name, resolution)| { resolution.borrow().binding().map(|binding| (*name, binding)) }).collect::<Vec<_>>(); for ((name, ns), binding) in bindings { if binding.defined_with(DefModifiers::IMPORTABLE | DefModifiers::PUBLIC) { let _ = module_.try_define_child(name, ns, directive.import(binding, None)); </ins> } }
<ins> // Copyright 2016 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. mod foo { pub use bar::*; pub use main as f; //~ ERROR has already been imported } mod bar { pub use foo::*; } pub use foo::*; pub use baz::*; //~ ERROR has already been imported mod baz { pub use super::*; } pub fn main() {} </ins>
<ins> // Copyright 2016 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. pub use bar::*; mod bar { pub use super::*; } pub use baz::*; //~ ERROR already been imported mod baz { pub use main as f; } pub fn main() {} </ins>
<ins> // Test to ensure that trait bounds are propertly // checked on specializable associated types #![allow(incomplete_features)] #![feature(specialization)] trait UncheckedCopy: Sized { type Output: From<Self> + Copy + Into<Self>; } impl<T> UncheckedCopy for T { default type Output = Self; //~^ ERROR: the trait bound `T: Copy` is not satisfied } fn unchecked_copy<T: UncheckedCopy>(other: &T::Output) -> T { (*other).into() } fn bug(origin: String) { // Turn the String into it's Output type... // Which we can just do by `.into()`, the assoc type states `From<Self>`. let origin_output = origin.into(); // Make a copy of String::Output, which is a String... let mut copy: String = unchecked_copy::<String>(&origin_output); // Turn the Output type into a String again, // Which we can just do by `.into()`, the assoc type states `Into<Self>`. let mut origin: String = origin_output.into(); // assert both Strings use the same buffer. assert_eq!(copy.as_ptr(), origin.as_ptr()); // Any use of the copy we made becomes invalid, drop(origin); // OH NO! UB UB UB UB! copy.push_str(" world!"); println!("{}", copy); } fn main() { bug(String::from("hello")); } </ins>
<ins> error[E0277]: the trait bound `T: Copy` is not satisfied --> $DIR/issue-33017.rs:12:5 | LL |     type Output: From<Self> + Copy + Into<Self>; |                               ---- required by this bound in `UncheckedCopy::Output` ... LL |     default type Output = Self; |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `T` | help: consider restricting type parameter `T` | LL | impl<T: std::marker::Copy> UncheckedCopy for T { |       ^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error For more information about this error, try `rustc --explain E0277`. </ins>
<ins> #![allow(incomplete_features)] #![feature(const_generics)] #![feature(const_evaluatable_checked)] #![feature(specialization)] pub trait Trait { type Type; } impl<T: ?Sized> Trait for T { default type Type = [u8; 1]; } impl<T: Trait> Trait for *const T { type Type = [u8; std::mem::size_of::<<T as Trait>::Type>()]; //~^ ERROR: unconstrained generic constant } fn main() {} </ins>
<ins> error: unconstrained generic constant --> $DIR/issue-51892.rs:15:5 | LL |     type Type = [u8; std::mem::size_of::<<T as Trait>::Type>()]; |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: try adding a `where` bound using this expression: `where [(); std::mem::size_of::<<T as Trait>::Type>()]:` error: aborting due to previous error </ins>
Ok(()) } <ins> fn document_short(w: &mut fmt::Formatter, item: &clean::Item, link: AssocItemLink) -> fmt::Result { if let Some(s) = item.doc_value() { let markdown = if s.contains('n') { format!("{} [Read more]({})", &plain_summary_line(Some(s)), naive_assoc_href(item, link)) } else { format!("{}", &plain_summary_line(Some(s))) }; write!(w, "<div class='docblock'>{}</div>", Markdown(&markdown))?; } Ok(()) } </ins> fn item_module(w: &mut fmt::Formatter, cx: &Context, item: &clean::Item, items: &[clean::Item]) -> fmt::Result { document(w, cx, item)?;
} fn doctraititem(w: &mut fmt::Formatter, cx: &Context, item: &clean::Item, <del> link: AssocItemLink, render_static: bool, is_default_item: bool, outer_version: Option<&str>) -> fmt::Result { </del> <ins> link: AssocItemLink, render_static: bool, is_default_item: bool, outer_version: Option<&str>, trait_: Option<&clean::Trait>) -> fmt::Result { </ins> let shortty = shortty(item); let name = item.name.as_ref().unwrap();
_ => panic!("can't make docs for trait item with name {:?}", item.name) } <del> if !is_default_item && (!is_static || render_static) { document(w, cx, item) } else { Ok(()) </del> <ins> if !is_static || render_static { if !is_default_item { if item.doc_value().is_some() { document(w, cx, item)?; } else { // In case the item isn't documented, // provide short documentation from the trait if let Some(t) = trait_ { if let Some(it) = t.items.iter() .find(|i| i.name == item.name) { document_short(w, it, link)?; } } } } else { document_short(w, item, link)?; } </ins> } <ins> Ok(()) </ins> } <ins> let traits = &cache().traits; let trait_ = i.trait_did().and_then(|did| traits.get(&did)); </ins> write!(w, "<div class='impl-items'>")?; for trait_item in &i.inner_impl().items { <del> doctraititem(w, cx, trait_item, link, render_header, false, outer_version)?; </del> <ins> doctraititem(w, cx, trait_item, link, render_header, false, outer_version, trait_)?; </ins> } fn render_default_items(w: &mut fmt::Formatter,
let assoc_link = AssocItemLink::GotoSource(did, &i.provided_trait_methods); doctraititem(w, cx, trait_item, assoc_link, render_static, true, <del> outer_version)?; </del> <ins> outer_version, None)?; </ins> } Ok(()) } // If we've implemented a trait, then also emit documentation for all // default items which weren't overridden in the implementation block. <del> if let Some(did) = i.trait_did() { if let Some(t) = cache().traits.get(&did) { render_default_items(w, cx, t, &i.inner_impl(), render_header, outer_version)?; } </del> <ins> if let Some(t) = trait_ { render_default_items(w, cx, t, &i.inner_impl(), render_header, outer_version)?; </ins> } write!(w, "</div>")?; Ok(())
fn b_method(&self) -> usize { self.a_method() } <ins> /// Docs associated with the trait c_method definition. /// /// There is another line fn c_method(&self) -> usize { self.a_method() } </ins> } // @has manual_impl/struct.S1.html '//*[@class="trait"]' 'T' // @has  - '//*[@class="docblock"]' 'Docs associated with the S1 trait implementation.' // @has  - '//*[@class="docblock"]' 'Docs associated with the S1 trait a_method implementation.' // @!has - '//*[@class="docblock"]' 'Docs associated with the trait a_method definition.' <del> // @!has - '//*[@class="docblock"]' 'Docs associated with the trait b_method definition.' </del> <ins> // @has - '//*[@class="docblock"]' 'Docs associated with the trait b_method definition.' // @has - '//*[@class="docblock"]' 'Docs associated with the trait b_method definition.' // @has - '//*[@class="docblock"]' 'Docs associated with the trait c_method definition.' // @!has - '//*[@class="docblock"]' 'There is another line' // @has - '//*[@class="docblock"]' 'Read more' </ins> pub struct S1(usize); /// Docs associated with the S1 trait implementation.
// @has manual_impl/struct.S2.html '//*[@class="trait"]' 'T' // @has  - '//*[@class="docblock"]' 'Docs associated with the S2 trait implementation.' // @has  - '//*[@class="docblock"]' 'Docs associated with the S2 trait a_method implementation.' <del> // @has  - '//*[@class="docblock"]' 'Docs associated with the S2 trait b_method implementation.' </del> <ins> // @has  - '//*[@class="docblock"]' 'Docs associated with the S2 trait c_method implementation.' </ins> // @!has - '//*[@class="docblock"]' 'Docs associated with the trait a_method definition.' <del> // @!has - '//*[@class="docblock"]' 'Docs associated with the trait b_method definition.' </del> <ins> // @!has - '//*[@class="docblock"]' 'Docs associated with the trait c_method definition.' // @has - '//*[@class="docblock"]' 'Docs associated with the trait b_method definition.' // @!has - '//*[@class="docblock"]' 'Read more' </ins> pub struct S2(usize); /// Docs associated with the S2 trait implementation.
// @has manual_impl/struct.S3.html '//*[@class="trait"]' 'T' // @has  - '//*[@class="docblock"]' 'Docs associated with the S3 trait implementation.' // @has  - '//*[@class="docblock"]' 'Docs associated with the S3 trait b_method implementation.' <del> // @!has - '//*[@class="docblock"]' 'Docs associated with the trait a_method definition.' </del> <ins> // @has - '//*[@class="docblock"]' 'Docs associated with the trait a_method definition.' </ins> pub struct S3(usize); /// Docs associated with the S3 trait implementation.
use super::FnCtxt; use hir::def_id::DefId; <del> use rustc::ty::{Ty, TypeFoldable, PreferMutLvalue}; </del> <ins> use rustc::ty::{Ty, TypeFoldable, PreferMutLvalue, TypeVariants}; </ins> use rustc::infer::type_variable::TypeVariableOrigin; use syntax::ast; use syntax::symbol::Symbol;
"binary operation `{}` cannot be applied to type `{}`", op.node.as_str(), lhs_ty); <ins> if let TypeVariants::TyRef(_, ref ty_mut) = lhs_ty.sty { if !self.infcx.type_moves_by_default(ty_mut.ty, lhs_expr.span) && self.lookup_op_method(expr, ty_mut.ty, vec![rhs_ty_var], Symbol::intern(name), trait_def_id, lhs_expr).is_ok() { err.span_note( lhs_expr.span, &format!( "this is a reference of type that `{}` can be applied to,  you need to dereference this variable once for this  operation to work", op.node.as_str())); } } </ins> let missing_trait = match op.node { hir::BiAdd    => Some("std::ops::Add"), hir::BiSub    => Some("std::ops::Sub"),
<ins> // Copyright 2012-2016 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. fn main() { let v = vec![1, 2, 3, 4, 5, 6, 7, 8, 9]; let vr = v.iter().filter(|x| { x % 2 == 0 //~^ ERROR binary operation `%` cannot be applied to type `&&{integer}` //~| NOTE this is a reference of type that `%` can be applied to //~| NOTE an implementation of `std::ops::Rem` might be missing for `&&{integer}` }); println!("{:?}", vr); } </ins>
<ins> // Copyright 2012-2016 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. fn main() { let a: &String = &"1".to_owned(); let b: &str = &"2"; let c = a + b; //~^ ERROR binary operation `+` cannot be applied to type `&std::string::String` //~| NOTE an implementation of `std::ops::Add` might be missing for `&std::string::String` println!("{:?}", c); } </ins>
// Since this Ref exists, we know the borrow flag // is not set to WRITING. let borrow = self.borrow.get(); <del> debug_assert!(borrow != WRITING && borrow != UNUSED); </del> <ins> debug_assert!(borrow != UNUSED); // Prevent the borrow counter from overflowing. assert!(borrow != WRITING); </ins> self.borrow.set(borrow + 1); BorrowRef { borrow: self.borrow } }
the compiler. They are accessible via the `--explain` flag. Each explanation comes with an example of how to trigger it and advice on how to fix it. <ins> Please read [RFC 1567](https://github.com/rust-lang/rfcs/blob/master/text/1567-long-error-codes-explanation-normalization.md) for details on how to format and write long error codes. </ins> * All of them are accessible [online](http://doc.rust-lang.org/error-index.html), which are auto-generated from rustc source code in different places: [librustc](https://github.com/rust-lang/rust/blob/master/src/librustc/diagnostics.rs), <ins> [libsyntax](https://github.com/rust-lang/rust/blob/master/src/libsyntax/diagnostics.rs), </ins> [librustc_borrowck](https://github.com/rust-lang/rust/blob/master/src/librustc_borrowck/diagnostics.rs), [librustc_const_eval](https://github.com/rust-lang/rust/blob/master/src/librustc_const_eval/diagnostics.rs), <del> [librustc_lint](https://github.com/rust-lang/rust/blob/master/src/librustc_lint/types.rs), </del> [librustc_metadata](https://github.com/rust-lang/rust/blob/master/src/librustc_metadata/diagnostics.rs), [librustc_mir](https://github.com/rust-lang/rust/blob/master/src/librustc_mir/diagnostics.rs), [librustc_passes](https://github.com/rust-lang/rust/blob/master/src/librustc_passes/diagnostics.rs), [librustc_privacy](https://github.com/rust-lang/rust/blob/master/src/librustc_privacy/diagnostics.rs), [librustc_resolve](https://github.com/rust-lang/rust/blob/master/src/librustc_resolve/diagnostics.rs), [librustc_trans](https://github.com/rust-lang/rust/blob/master/src/librustc_trans/diagnostics.rs), <ins> [librustc_plugin](https://github.com/rust-lang/rust/blob/master/src/librustc_plugin/diagnostics.rs), </ins> [librustc_typeck](https://github.com/rust-lang/rust/blob/master/src/librustc_typeck/diagnostics.rs). * Explanations have full markdown support. Use it, especially to highlight code with backticks.
* Flags should be orthogonal to each other. For example, if we'd have a json-emitting variant of multiple actions `foo` and `bar`, an additional --json flag is better than adding `--foo-json` and `--bar-json`. <del> * Always give options a long descriptive name, if only for better </del> <ins> * Always give options a long descriptive name, if only for more </ins> understandable compiler scripts. * The `--verbose` flag is for adding verbose information to `rustc` output when not compiling a program. For example, using it with the `--version` flag
let mut base = self; let mut acc = 1; <del> let mut prev_base = self; let mut base_oflo = false; while exp > 0 { </del> <ins> while exp > 1 { </ins> if (exp & 1) == 1 { <del> if base_oflo { // ensure overflow occurs in the same manner it // would have otherwise (i.e. signal any exception // it would have otherwise). acc = acc * (prev_base * prev_base); } else { acc = acc * base; } </del> <ins> acc = acc * base; </ins> } <del> prev_base = base; let (new_base, new_base_oflo) = base.overflowing_mul(base); base = new_base; base_oflo = new_base_oflo; </del> exp /= 2; <ins> base = base * base; </ins> } <ins> // Deal with the final bit of the exponent separately, since // squaring the base afterwards is not necessary and may cause a // needless overflow. if exp == 1 { acc = acc * base; } </ins> acc }
<ins> // Copyright 2015 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. // error-pattern:thread 'main' panicked at 'attempt to multiply with overflow' // compile-flags: -C debug-assertions fn main() { let _x = 2i32.pow(1024); } </ins>
<ins> // Copyright 2016 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. // error-pattern:thread 'main' panicked at 'attempt to multiply with overflow' // compile-flags: -C debug-assertions fn main() { let _x = 2u32.pow(1024); } </ins>
<del> // Copyright 2015 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. // error-pattern:thread 'main' panicked at 'attempt to multiply with overflow' // compile-flags: -C debug-assertions fn main() { let _x = 2i32.pow(1024); } </del>
pub fn check_implementation_coherence_of(&self, trait_def_id: DefId) { // Unify pairs of polytypes. <del> self.iter_impls_of_trait(trait_def_id, |a| { </del> <ins> self.iter_impls_of_trait_local(trait_def_id, |a| { </ins> let implementation_a = a; let polytype_a = self.get_self_type_for_implementation(implementation_a);
if self.polytypes_unify(polytype_a.clone(), polytype_b) { let session = self.crate_context.tcx.sess; session.span_err( <del> self.span_of_impl(implementation_b), </del> <ins> self.span_of_impl(implementation_a), </ins> format!("conflicting implementations for trait `{}`", ty::item_path_str(self.crate_context.tcx, trait_def_id))); <del> session.span_note(self.span_of_impl(implementation_a), "note conflicting implementation here"); </del> <ins> if implementation_b.did.crate == LOCAL_CRATE { session.span_note(self.span_of_impl(implementation_b), "note conflicting implementation here"); } else { let crate_store = self.crate_context.tcx.sess.cstore; let cdata = crate_store.get_crate_data(implementation_b.did.crate); session.note( "conflicting implementation in crate `" + cdata.name + "`"); } </ins> } } })
} pub fn iter_impls_of_trait(&self, trait_def_id: DefId, f: |@Impl|) { <ins> self.iter_impls_of_trait_local(trait_def_id, |x| f(x)); if trait_def_id.crate == LOCAL_CRATE { return; } let crate_store = self.crate_context.tcx.sess.cstore; csearch::each_implementation_for_trait(crate_store, trait_def_id, |impl_def_id| { let implementation = @csearch::get_impl(self.crate_context.tcx, impl_def_id); let _ = lookup_item_type(self.crate_context.tcx, implementation.did); f(implementation); }); } pub fn iter_impls_of_trait_local(&self, trait_def_id: DefId, f: |@Impl|) { </ins> let trait_impls = self.crate_context.tcx.trait_impls.borrow(); match trait_impls.get().find(&trait_def_id) { Some(impls) => {
<ins> // Copyright 2012 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. pub trait Foo { } impl Foo for int { } </ins>