jiebi/CodeConvo huggingface dataset:
Code change:
The default edition is 2015, but the option to change this in the "extended" list, so it is only discoverable with , rather than just . Users should be encouraged to use 2018 where possible, but the omission of the edition from the default help list makes it less likely that it will be found for users not using Cargo.

Related discussion:
text: `expanded,identified` (fully parenthesized, AST nodes with IDs).", "TYPE", ), <del> opt::opt_s( "", "edition", "Specify which edition of the compiler to use when compiling code.", EDITION_NAME_LIST, ), </del> opt::multi_s( "", "remap-path-prefix",
Code change:
charatreverse(s, i) returns the character at i - 1 instead of s.char_len() - 1 - i.
This is actually the "correct" behaviour (at least it is the behaviour listed in the documentation of ). Also, note that and actually deal with byte positions, not unicode char positions (this is not stated in the documentation for either of these :( ). Pull request hopefully corrects both of these issues.
Closing, has been clarified in a documentation update.

Related discussion:
text: let ident = *ident; let mut path = path.clone(); for seg in &mut path.segments { <del> seg.id = self.next_node_id(); </del> <ins> // Give the cloned segment the same resolution information // as the old one (this is needed for stability checking). let new_id = self.next_node_id(); self.resolver.clone_res(seg.id, new_id); seg.id = new_id; </ins> } let span = path.span;
Code change:
charatreverse(s, i) returns the character at i - 1 instead of s.char_len() - 1 - i.
This is actually the "correct" behaviour (at least it is the behaviour listed in the documentation of ). Also, note that and actually deal with byte positions, not unicode char positions (this is not stated in the documentation for either of these :( ). Pull request hopefully corrects both of these issues.
Closing, has been clarified in a documentation update.

Related discussion:
text: // Give the segments new node-ids since they are being cloned. for seg in &mut prefix.segments { <del> seg.id = self.next_node_id(); </del> <ins> // Give the cloned segment the same resolution information // as the old one (this is needed for stability checking). let new_id = self.next_node_id(); self.resolver.clone_res(seg.id, new_id); seg.id = new_id; </ins> } // Each `use` import is an item and thus are owners of the
Code change:
charatreverse(s, i) returns the character at i - 1 instead of s.char_len() - 1 - i.
This is actually the "correct" behaviour (at least it is the behaviour listed in the documentation of ). Also, note that and actually deal with byte positions, not unicode char positions (this is not stated in the documentation for either of these :( ). Pull request hopefully corrects both of these issues.
Closing, has been clarified in a documentation update.

Related discussion:
text: fn legacy_const_generic_args(&self, expr: &Expr) -> Option<Vec<usize>>; fn get_partial_res(&self, id: NodeId) -> Option<PartialRes>; fn get_import_res(&self, id: NodeId) -> PerNS<Option<Res<NodeId>>>; <ins> // Clones the resolution (if any) on 'source' and applies it // to 'target'. Used when desugaring a `UseTreeKind::Nested` to // multiple `UseTreeKind::Simple`s fn clone_res(&mut self, source: NodeId, target: NodeId); </ins> fn get_label_res(&self, id: NodeId) -> Option<NodeId>; fn get_lifetime_res(&self, id: NodeId) -> Option<LifetimeRes>; fn take_extra_lifetime_params(&mut self, id: NodeId) -> Vec<(Ident, NodeId, LifetimeRes)>;
Code change:
charatreverse(s, i) returns the character at i - 1 instead of s.char_len() - 1 - i.
This is actually the "correct" behaviour (at least it is the behaviour listed in the documentation of ). Also, note that and actually deal with byte positions, not unicode char positions (this is not stated in the documentation for either of these :( ). Pull request hopefully corrects both of these issues.
Closing, has been clarified in a documentation update.

Related discussion:
text: None } <ins> fn clone_res(&mut self, source: NodeId, target: NodeId) { if let Some(res) = self.partial_res_map.get(&source) { self.partial_res_map.insert(target, *res); } } </ins> /// Obtains resolution for a `NodeId` with a single resolution. fn get_partial_res(&self, id: NodeId) -> Option<PartialRes> { self.partial_res_map.get(&id).copied()
Code change:
charatreverse(s, i) returns the character at i - 1 instead of s.char_len() - 1 - i.
This is actually the "correct" behaviour (at least it is the behaviour listed in the documentation of ). Also, note that and actually deal with byte positions, not unicode char positions (this is not stated in the documentation for either of these :( ). Pull request hopefully corrects both of these issues.
Closing, has been clarified in a documentation update.

Related discussion:
text: extern crate lint_output_format; //~ ERROR use of unstable library feature use lint_output_format::{foo, bar}; //~ ERROR use of unstable library feature <ins> //~| ERROR use of unstable library feature </ins> fn main() { let _x = foo();
Code change:
charatreverse(s, i) returns the character at i - 1 instead of s.char_len() - 1 - i.
This is actually the "correct" behaviour (at least it is the behaviour listed in the documentation of ). Also, note that and actually deal with byte positions, not unicode char positions (this is not stated in the documentation for either of these :( ). Pull request hopefully corrects both of these issues.
Closing, has been clarified in a documentation update.

Related discussion:
text: = help: add `#![feature(unstable_test_feature)]` to the crate attributes to enable error[E0658]: use of unstable library feature 'unstable_test_feature' <ins> --> $DIR/lint-output-format.rs:7:26 | LL | use lint_output_format::{foo, bar}; |                          ^^^ | = help: add `#![feature(unstable_test_feature)]` to the crate attributes to enable error[E0658]: use of unstable library feature 'unstable_test_feature' </ins> --> $DIR/lint-output-format.rs:7:31 | LL | use lint_output_format::{foo, bar};
Code change:
charatreverse(s, i) returns the character at i - 1 instead of s.char_len() - 1 - i.
This is actually the "correct" behaviour (at least it is the behaviour listed in the documentation of ). Also, note that and actually deal with byte positions, not unicode char positions (this is not stated in the documentation for either of these :( ). Pull request hopefully corrects both of these issues.
Closing, has been clarified in a documentation update.

Related discussion:
text: = help: add `#![feature(unstable_test_feature)]` to the crate attributes to enable error[E0658]: use of unstable library feature 'unstable_test_feature' <del> --> $DIR/lint-output-format.rs:11:14 </del> <ins> --> $DIR/lint-output-format.rs:12:14 </ins> | LL |     let _y = bar(); |              ^^^ | = help: add `#![feature(unstable_test_feature)]` to the crate attributes to enable <del> error: aborting due to 3 previous errors </del> <ins> error: aborting due to 4 previous errors </ins> For more information about this error, try `rustc --explain E0658`.
Code change:
charatreverse(s, i) returns the character at i - 1 instead of s.char_len() - 1 - i.
This is actually the "correct" behaviour (at least it is the behaviour listed in the documentation of ). Also, note that and actually deal with byte positions, not unicode char positions (this is not stated in the documentation for either of these :( ). Pull request hopefully corrects both of these issues.
Closing, has been clarified in a documentation update.

Related discussion:
text: impl stable_in_unstable_std::old_stable_module::OldTrait for LocalType {} } <ins> mod isolated6 { use stable_in_unstable_core::new_unstable_module::{OldTrait}; //~ ERROR use of unstable library feature 'unstable_test_feature' } mod isolated7 { use stable_in_unstable_core::new_unstable_module::*; //~ ERROR use of unstable library feature 'unstable_test_feature' } </ins>
Code change:
charatreverse(s, i) returns the character at i - 1 instead of s.char_len() - 1 - i.
This is actually the "correct" behaviour (at least it is the behaviour listed in the documentation of ). Also, note that and actually deal with byte positions, not unicode char positions (this is not stated in the documentation for either of these :( ). Pull request hopefully corrects both of these issues.
Closing, has been clarified in a documentation update.

Related discussion:
text: = note: see issue #1 <https://github.com/rust-lang/rust/issues/1> for more information = help: add `#![feature(unstable_test_feature)]` to the crate attributes to enable <del> error: aborting due to 4 previous errors </del> <ins> error[E0658]: use of unstable library feature 'unstable_test_feature' --> $DIR/stable-in-unstable.rs:49:56 | LL |     use stable_in_unstable_core::new_unstable_module::{OldTrait}; |                                                        ^^^^^^^^ | = note: see issue #1 <https://github.com/rust-lang/rust/issues/1> for more information = help: add `#![feature(unstable_test_feature)]` to the crate attributes to enable error[E0658]: use of unstable library feature 'unstable_test_feature' --> $DIR/stable-in-unstable.rs:53:9 | LL |     use stable_in_unstable_core::new_unstable_module::*; |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: see issue #1 <https://github.com/rust-lang/rust/issues/1> for more information = help: add `#![feature(unstable_test_feature)]` to the crate attributes to enable error: aborting due to 6 previous errors </ins> For more information about this error, try `rustc --explain E0658`.
Code change:
First of all, it now returns an Err with "not available on this platform currently". But I found that there is a system call  available in Linux kernel 4.11, which can get the birth time. As the , the function uses on Unix platforms. But the just never contains . Shouldn't it try when available?

Related discussion:
text: /// Returns the creation time listed in this metadata. /// <del> /// The returned value corresponds to the `birthtime` field of `stat` on /// Unix platforms and the `ftCreationTime` field on Windows platforms. </del> <ins> /// The returned value corresponds to the `btime` field of `statx` on /// Linux kernel starting from to 4.11, the `birthtime` field of `stat` on other /// Unix platforms, and the `ftCreationTime` field on Windows platforms. </ins> /// /// # Errors /// /// This field may not be available on all platforms, and will return an <del> /// `Err` on platforms where it is not available. </del> <ins> /// `Err` on platforms or filesystems where it is not available. </ins> /// /// # Examples ///
Code change:
First of all, it now returns an Err with "not available on this platform currently". But I found that there is a system call  available in Linux kernel 4.11, which can get the birth time. As the , the function uses on Unix platforms. But the just never contains . Shouldn't it try when available?

Related discussion:
text: ///     if let Ok(time) = metadata.created() { ///         println!("{:?}", time); ///     } else { <del> ///         println!("Not supported on this platform"); </del> <ins> ///         println!("Not supported on this platform or filesystem"); </ins> ///     } ///     Ok(()) /// }
Code change:
First of all, it now returns an Err with "not available on this platform currently". But I found that there is a system call  available in Linux kernel 4.11, which can get the birth time. As the , the function uses on Unix platforms. But the just never contains . Shouldn't it try when available?

Related discussion:
text: check!(a.created()); check!(b.created()); } <ins> if cfg!(target_os = "linux") { // Not always available match (a.created(), b.created()) { (Ok(t1), Ok(t2)) => assert!(t1 <= t2), (Err(e1), Err(e2)) if e1.kind() == ErrorKind::Other && e2.kind() == ErrorKind::Other => {} (a, b) => panic!( "creation time must be always supported or not supported: {:?} {:?}", a, b, ), } } </ins> } }
Code change:
First of all, it now returns an Err with "not available on this platform currently". But I found that there is a system call  available in Linux kernel 4.11, which can get the birth time. As the , the function uses on Unix platforms. But the just never contains . Shouldn't it try when available?

Related discussion:
text: #[derive(Debug)] pub struct DirBuilder { mode: mode_t } <ins> cfg_has_statx! {{ impl FileAttr { fn from_stat64(stat: stat64) -> Self { Self { stat, statx_extra_fields: None } } } } else { impl FileAttr { fn from_stat64(stat: stat64) -> Self { Self { stat } } } }} </ins> impl FileAttr { pub fn size(&self) -> u64 { self.stat.st_size as u64 } pub fn perm(&self) -> FilePermissions {
Code change:
First of all, it now returns an Err with "not available on this platform currently". But I found that there is a system call  available in Linux kernel 4.11, which can get the birth time. As the , the function uses on Unix platforms. But the just never contains . Shouldn't it try when available?

Related discussion:
text: target_os = "macos", target_os = "ios")))] pub fn created(&self) -> io::Result<SystemTime> { <ins> cfg_has_statx! { if let Some(ext) = &self.statx_extra_fields { return if (ext.stx_mask & libc::STATX_BTIME) != 0 { Ok(SystemTime::from(libc::timespec { tv_sec: ext.stx_btime.tv_sec as libc::time_t, tv_nsec: ext.stx_btime.tv_nsec as _, })) } else { Err(io::Error::new( io::ErrorKind::Other, "creation time is not available for the filesystem", )) }; } } </ins> Err(io::Error::new(io::ErrorKind::Other, "creation time is not available on this platform  currently"))
Code change:
First of all, it now returns an Err with "not available on this platform currently". But I found that there is a system call  available in Linux kernel 4.11, which can get the birth time. As the , the function uses on Unix platforms. But the just never contains . Shouldn't it try when available?

Related discussion:
text: #[cfg(any(target_os = "linux", target_os = "emscripten", target_os = "android"))] pub fn metadata(&self) -> io::Result<FileAttr> { <del> let fd = cvt(unsafe {dirfd(self.dir.inner.dirp.0)})?; </del> <ins> let fd = cvt(unsafe { dirfd(self.dir.inner.dirp.0) })?; let name = self.entry.d_name.as_ptr(); cfg_has_statx! { if let Some(ret) = unsafe { try_statx( fd, name, libc::AT_SYMLINK_NOFOLLOW | libc::AT_STATX_SYNC_AS_STAT, libc::STATX_ALL, ) } { return ret; } } </ins> let mut stat: stat64 = unsafe { mem::zeroed() }; cvt(unsafe { <del> fstatat64(fd, self.entry.d_name.as_ptr(), &mut stat, libc::AT_SYMLINK_NOFOLLOW) </del> <ins> fstatat64(fd, name, &mut stat, libc::AT_SYMLINK_NOFOLLOW) </ins> })?; <del> Ok(FileAttr { stat }) </del> <ins> Ok(FileAttr::from_stat64(stat)) </ins> } #[cfg(not(any(target_os = "linux", target_os = "emscripten", target_os = "android")))]
Code change:
First of all, it now returns an Err with "not available on this platform currently". But I found that there is a system call  available in Linux kernel 4.11, which can get the birth time. As the , the function uses on Unix platforms. But the just never contains . Shouldn't it try when available?

Related discussion:
text: } pub fn file_attr(&self) -> io::Result<FileAttr> { <ins> let fd = self.0.raw(); cfg_has_statx! { if let Some(ret) = unsafe { try_statx( fd, b"0" as *const _ as *const libc::c_char, libc::AT_EMPTY_PATH | libc::AT_STATX_SYNC_AS_STAT, libc::STATX_ALL, ) } { return ret; } } </ins> let mut stat: stat64 = unsafe { mem::zeroed() }; cvt(unsafe { <del> fstat64(self.0.raw(), &mut stat) </del> <ins> fstat64(fd, &mut stat) </ins> })?; <del> Ok(FileAttr { stat }) </del> <ins> Ok(FileAttr::from_stat64(stat)) </ins> } pub fn fsync(&self) -> io::Result<()> {
Code change:
First of all, it now returns an Err with "not available on this platform currently". But I found that there is a system call  available in Linux kernel 4.11, which can get the birth time. As the , the function uses on Unix platforms. But the just never contains . Shouldn't it try when available?

Related discussion:
text: pub fn stat(p: &Path) -> io::Result<FileAttr> { let p = cstr(p)?; <ins> cfg_has_statx! { if let Some(ret) = unsafe { try_statx( libc::AT_FDCWD, p.as_ptr(), libc::AT_STATX_SYNC_AS_STAT, libc::STATX_ALL, ) } { return ret; } } </ins> let mut stat: stat64 = unsafe { mem::zeroed() }; cvt(unsafe { stat64(p.as_ptr(), &mut stat) })?; <del> Ok(FileAttr { stat }) </del> <ins> Ok(FileAttr::from_stat64(stat)) </ins> } pub fn lstat(p: &Path) -> io::Result<FileAttr> { let p = cstr(p)?; <ins> cfg_has_statx! { if let Some(ret) = unsafe { try_statx( libc::AT_FDCWD, p.as_ptr(), libc::AT_SYMLINK_NOFOLLOW | libc::AT_STATX_SYNC_AS_STAT, libc::STATX_ALL, ) } { return ret; } } </ins> let mut stat: stat64 = unsafe { mem::zeroed() }; cvt(unsafe { lstat64(p.as_ptr(), &mut stat) })?; <del> Ok(FileAttr { stat }) </del> <ins> Ok(FileAttr::from_stat64(stat)) </ins> } pub fn canonicalize(p: &Path) -> io::Result<PathBuf> {
Code change:
Hello, this is your friendly neighborhood mergebot. After merging PR rust-lang/rust, I observed that the tool rls no longer builds. A follow-up PR to the repository is needed to fix the fallout. cc do you think you would have time to do the follow-up work? If so, that would be great! cc the PR reviewer, and -- nominating for prioritization.

Related discussion:
text: <del> Subproject commit cafbe7f2d9bdf9e94946e3f6f62b781b05b7d556 </del> <ins> Subproject commit d420589e1a8208c85368d07c1644c6725367650b </ins>
Code change:
While I was trying to make a general impl, I came across this ICE. Note that inlining makes this ICE go away.
thanks for putting the stack-trace, I forgot about that This also works
Small repro: I'll try to have a PR up for this next week.
Another repro from

Related discussion:
text: borrow_region: RegionVid, outlived_region: RegionVid, ) -> (ConstraintCategory, bool, Span, Option<RegionName>) { <del> let (category, from_closure, span) = self.best_blame_constraint(mir, borrow_region, |r| r == outlived_region); </del> <ins> let (category, from_closure, span) = self.best_blame_constraint( mir, borrow_region, |r| self.provides_universal_region(r, borrow_region, outlived_region) ); </ins> let outlived_fr_name = self.give_region_a_name(infcx, mir, upvars, mir_def_id, outlived_region, &mut 1); (category, from_closure, span, outlived_fr_name)
Code change:
While I was trying to make a general impl, I came across this ICE. Note that inlining makes this ICE go away.
thanks for putting the stack-trace, I forgot about that This also works
Small repro: I'll try to have a PR up for this next week.
Another repro from

Related discussion:
text: <ins> // Test that we handle the case when a local variable is borrowed for `'static` // due to an outlives constraint involving a region in an incompatible universe pub trait Outlives<'this> {} impl<'this, T> Outlives<'this> for T where T: 'this {} trait Reference { type AssociatedType; } impl<'a, T: 'a> Reference for &'a T { type AssociatedType = &'a (); } fn assert_static_via_hrtb<G>(_: G) where for<'a> G: Outlives<'a> {} fn assert_static_via_hrtb_with_assoc_type<T>(_: &'_ T) where for<'a> &'a T: Reference<AssociatedType = &'a ()>, {} fn main() { let local = 0; assert_static_via_hrtb(&local); //~ ERROR `local` does not live long enough assert_static_via_hrtb_with_assoc_type(&&local); //~ ERROR `local` does not live long enough } </ins>
Code change:
While I was trying to make a general impl, I came across this ICE. Note that inlining makes this ICE go away.
thanks for putting the stack-trace, I forgot about that This also works
Small repro: I'll try to have a PR up for this next week.
Another repro from

Related discussion:
text: <ins> error[E0597]: `local` does not live long enough --> $DIR/local-outlives-static-via-hrtb.rs:24:28 | LL |     assert_static_via_hrtb(&local); |     -----------------------^^^^^^- |     |                      | |     |                      borrowed value does not live long enough |     argument requires that `local` is borrowed for `'static` LL |     assert_static_via_hrtb_with_assoc_type(&&local); LL | } | - `local` dropped here while still borrowed error[E0597]: `local` does not live long enough --> $DIR/local-outlives-static-via-hrtb.rs:25:45 | LL |     assert_static_via_hrtb_with_assoc_type(&&local); |     ----------------------------------------^^^^^^- |     |                                       | |     |                                       borrowed value does not live long enough |     argument requires that `local` is borrowed for `'static` LL | } | - `local` dropped here while still borrowed error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0597`. </ins>
Code change:
Run tests for and you'll get the following diagnostic: But to be as helpful as possible the diagnostic should, if possible, point to the start of the invalid code block.
This error was removed in because I didn't think it could actually be produced. Looks like it was possible to trigger by writing an empty doc test. The error message is misleading, though. It's a valid code block, just empty. On master, this code produces a passing doc test now. IMO, that is the correct behavior. There should probably be a test for it.
I agree completely. Would this mean re-introducing this message but improving the message (replacing invalid with empty or something similar)? I believe that is the best course of action as warning on an empty code block is completely valid and desired IMO.
The original code only caught this incidentally. I think this check would make more sense as a rustdoc lint instead of a hard warning. Could be to or a new pass entirely.
could you edit this issue to reflect the current status? It should be something like "Empty doc tests should be linted".
I'd like to take this issue - should have a PR this week for review.

Related discussion:
text: dox[code_block.code].to_owned(), ); <del> let has_errors = { let mut has_errors = false; </del> <ins> let validation_status = { let mut has_syntax_errors = false; let mut only_whitespace = true; // even if there is a syntax error, we need to run the lexer over the whole file </ins> let mut lexer = Lexer::new(&sess, source_file, None); loop  { match lexer.next_token().kind { token::Eof => break, <del> token::Unknown(..) => has_errors = true, _ => (), </del> <ins> token::Whitespace => (), token::Unknown(..) => has_syntax_errors = true, _ => only_whitespace = false, </ins> } } <del> has_errors </del> <ins> if has_syntax_errors { Some(CodeBlockInvalid::SyntaxError) } else if only_whitespace { Some(CodeBlockInvalid::Empty) } else { None } </ins> }; <del> if has_errors { </del> <ins> if let Some(code_block_invalid) = validation_status { </ins> let mut diag = if let Some(sp) = super::source_span_for_markdown_range(self.cx, &dox, &code_block.range, &item.attrs) { <del> let mut diag = self .cx .sess() .struct_span_warn(sp, "could not parse code block as Rust code"); </del> <ins> let warning_message = match code_block_invalid { CodeBlockInvalid::SyntaxError => "could not parse code block as Rust code", CodeBlockInvalid::Empty => "Rust code block is empty", }; let mut diag = self.cx.sess().struct_span_warn(sp, warning_message); </ins> if code_block.syntax.is_none() && code_block.is_fenced { let sp = sp.from_inner(InnerSpan::new(0, 3));