Async binding for Tungstenite, the Lightweight stream-based WebSocket implementation
http-rs/async-h1 121
Asynchronous HTTP/1.1 in Rust
Common types for HTTP operations
gtk-rs/gtk4-rs 101
GTK 4 bindings and wrappers for Rust (Development)
gtk-rs/glib 94
GLib bindings for Rust
Build library for invoking pkg-config for Rust
gtk-rs/gio 39
GIO (GLib) bindings for Rust
Arduino Due Rust Example Application
.Net bindings for gtk+3 and above
Fork of the GStreamer SDK with support for building OpenWebRTC
issue commentrust-lang/rust
Exploring PGO for the Rust compiler
@andjo403 While by no means a solution, git LFS may be helpful regarding the size of the repo.
comment created time in an hour
Pull request review commentrust-lang/rust
Remove doctree::Macro and distinguish between `macro_rules!` and `pub macro`
++#![feature(decl_macro)]++// @has macros_2/macro.my_macro.html //pre 'pub macro my_macro() {'+// @has - //pre '...'+// @has - //pre '}'+pub macro my_macro() {++}++// @has macros_2/macro.my_macro_2.html //pre 'pub macro my_macro_2($($tok:tt)*) {'+// @has - //pre '...'+// @has - //pre '}'+pub macro my_macro_2($($tok:tt)*) {++}
You're very welcome! Thank you for fixing this :heart:
comment created time in 3 hours
pull request commentrust-lang/rust
Properly handle attributes on statements
@petrochenkov: I've modified the failing UI tests to avoid using println!, so that we don't try to import macros from libstd. The tests now pass for me on wasm32-unknown-unknown.
comment created time in 3 hours
Pull request review commentrust-lang/rust
Remove doctree::Macro and distinguish between `macro_rules!` and `pub macro`
++#![feature(decl_macro)]++// @has macros_2/macro.my_macro.html //pre 'pub macro my_macro() {'+// @has - //pre '...'+// @has - //pre '}'+pub macro my_macro() {++}++// @has macros_2/macro.my_macro_2.html //pre 'pub macro my_macro_2($($tok:tt)*) {'+// @has - //pre '...'+// @has - //pre '}'+pub macro my_macro_2($($tok:tt)*) {++}
Will do. Thank you for your help, and patience, in reviewing these changes.
comment created time in 3 hours
Pull request review commentrust-lang/rust
Remove doctree::Macro and distinguish between `macro_rules!` and `pub macro`
+
👍
comment created time in 3 hours
Pull request review commentrust-lang/rust
Remove doctree::Macro and distinguish between `macro_rules!` and `pub macro`
+
Can you name this file decl_macro.rs instead?
comment created time in 3 hours
Pull request review commentrust-lang/rust
Remove doctree::Macro and distinguish between `macro_rules!` and `pub macro`
++#![feature(decl_macro)]++// @has macros_2/macro.my_macro.html //pre 'pub macro my_macro() {'+// @has - //pre '...'+// @has - //pre '}'+pub macro my_macro() {++}++// @has macros_2/macro.my_macro_2.html //pre 'pub macro my_macro_2($($tok:tt)*) {'+// @has - //pre '...'+// @has - //pre '}'+pub macro my_macro_2($($tok:tt)*) {++}
Can you add a test with --document-private-items and a private macro? See https://rustc-dev-guide.rust-lang.org/tests/adding.html#header-commands-configuring-rustc.
comment created time in 3 hours
Pull request review commentrust-lang/rust
Remove doctree::Macro and distinguish between `macro_rules!` and `pub macro`
impl Clean<Item> for (&hir::MacroDef<'_>, Option<Ident>) { let tts = item.ast.body.inner_tokens().trees().collect::<Vec<_>>(); // Extract the spans of all matchers. They represent the "interface" of the macro. let matchers = tts.chunks(4).map(|arm| arm[0].span()).collect::<Vec<_>>();+ let source = if item.ast.macro_rules {+ format!(+ "macro_rules! {} {{\n{}}}",+ name,+ matchers+ .iter()+ .map(|span| { format!(" {} => {{ ... }};\n", span.to_src(cx)) })+ .collect::<String>(),+ )+ } else {+ // This code currently assumes that there will only be one or zero matchers, as syntax+ // for multiple is not currently defined.+ format!(+ "pub macro {}({}) {{\n\t...\n}}",
Sure, vis works just as well :)
comment created time in 3 hours
Pull request review commentrust-lang/rust
Use detailed and shorter fs error explaination
pub fn rename<P: AsRef<Path>, Q: AsRef<Path>>(from: P, to: Q) -> io::Result<()> /// This function will return an error in the following situations, but is not /// limited to just these cases: ///-/// * The `from` path is not a file.-/// * The `from` file does not exist.-/// * The current process does not have the permission rights to access+/// * `from` is not a regular file.
/// * `from` is neither a regular file nor a symlink to a regular file.
comment created time in 3 hours
pull request commentrust-lang/rust
WIP Generic associated types in trait paths
:umbrella: The latest upstream changes (presumably #79266) made this pull request unmergeable. Please resolve the merge conflicts.
Note that reviewers usually do not review pull requests until merge conflicts are resolved! Once you resolve the conflicts, you should change the labels applied by bors to indicate that your PR is ready for review. Post this as a comment to change the labels:
@rustbot modify labels: +S-waiting-on-review -S-waiting-on-author
comment created time in 3 hours
Pull request review commentrust-lang/rust
Add `has_default` to `GenericParamDefKind::Const`
impl<'a, 'hir> LoweringContext<'a, 'hir> { this.lower_param_bounds_mut(¶m.bounds, itctx.reborrow()).collect() }); + // lower here so const-defaults can be lowered+ let hir_id = self.allocate_hir_id_counter(param.id);
do you mean just remove that specific line and see if it works?
comment created time in 3 hours
Pull request review commentrust-lang/rust
Remove doctree::Macro and distinguish between `macro_rules!` and `pub macro`
impl Clean<Item> for (&hir::MacroDef<'_>, Option<Ident>) { let tts = item.ast.body.inner_tokens().trees().collect::<Vec<_>>(); // Extract the spans of all matchers. They represent the "interface" of the macro. let matchers = tts.chunks(4).map(|arm| arm[0].span()).collect::<Vec<_>>();+ let source = if item.ast.macro_rules {+ format!(+ "macro_rules! {} {{\n{}}}",+ name,+ matchers+ .iter()+ .map(|span| { format!(" {} => {{ ... }};\n", span.to_src(cx)) })+ .collect::<String>(),+ )+ } else {+ // This code currently assumes that there will only be one or zero matchers, as syntax+ // for multiple is not currently defined.+ format!(+ "pub macro {}({}) {{\n\t...\n}}",
There appears to be a 'vis' item on MacroDef, would that work, or do we need to get the visibility from the context?
comment created time in 4 hours
pull request commentrust-lang/rust
:hourglass: Testing commit 09a3bc10ca289c8649f942908855224da034ecb6 with merge 77f09bb854d585c24f0e2bc98e35d7db33a6a293... <!-- homu: {"type":"BuildStarted","head_sha":"09a3bc10ca289c8649f942908855224da034ecb6","merge_sha":"77f09bb854d585c24f0e2bc98e35d7db33a6a293"} -->
comment created time in 4 hours
PR merged rust-lang/rust
The Ast part of https://github.com/rust-lang/rust/pull/78978
r? @petrochenkov
pr closed time in 4 hours
push eventrust-lang/rust
commit sha 823dbb38e4402b15ff543e615d560d7fb8626ff7
ast and parser
commit sha 37d103f3cfb7be39a1a7d4d1b6d289601d59bfdb
insert span_fatal call in ast lowering to indicate that generic arguments in AssocTyConstraints haven't been fully implemented
commit sha 5c4568d08b00dbd437aa7f4e572b41b598ee9734
add tests
commit sha cfed9184f44cbd02662eb7715d6226ae885ef5c3
Auto merge of #79266 - b-naber:gat_trait_path_parser, r=petrochenkov Generic Associated Types in Trait Paths - Ast part The Ast part of https://github.com/rust-lang/rust/pull/78978 r? `@petrochenkov`
push time in 4 hours
pull request commentrust-lang/rust
Generic Associated Types in Trait Paths - Ast part
:sunny: Test successful - checks-actions Approved by: petrochenkov Pushing cfed9184f44cbd02662eb7715d6226ae885ef5c3 to master... <!-- homu: {"type":"BuildCompleted","approved_by":"petrochenkov","base_ref":"master","builders":{"checks-actions":"https://github.com/rust-lang-ci/rust/runs/1461755646"},"merge_sha":"cfed9184f44cbd02662eb7715d6226ae885ef5c3"} -->
comment created time in 4 hours
Pull request review commentrust-lang/rust
impl Clean<Item> for (&hir::MacroDef<'_>, Option<Ident>) { let tts = item.ast.body.inner_tokens().trees().collect::<Vec<_>>(); // Extract the spans of all matchers. They represent the "interface" of the macro. let matchers = tts.chunks(4).map(|arm| arm[0].span()).collect::<Vec<_>>();+ let source = if item.ast.macro_rules {+ format!(+ "macro_rules! {} {{\n{}}}",+ name,+ matchers+ .iter()+ .map(|span| { format!(" {} => {{ ... }};\n", span.to_src(cx)) })+ .collect::<String>(),+ )+ } else {+ // This code currently assumes that there will only be one or zero matchers, as syntax+ // for multiple is not currently defined.+ format!(+ "pub macro {}({}) {{\n\t...\n}}",
Should this also check the visibility in case --document-private-items was passed? You can do that with cx.tcx.visibility(def_id) (which I guess means there was no point to using from_hir_id, oops).
comment created time in 4 hours
Pull request review commentrust-lang/rust
Separate out a `hir::Impl` struct
impl<'a, 'tcx> RustdocVisitor<'a, 'tcx> { }; om.traits.push(t); }- hir::ItemKind::Impl {- unsafety,- polarity,- defaultness,- constness,- defaultness_span: _,- ref generics,- ref of_trait,- self_ty,- ref items,- } => {+ hir::ItemKind::Impl(ref impl_) => { // Don't duplicate impls when inlining or if it's implementing a trait, we'll pick // them up regardless of where they're located.- if !self.inlining && of_trait.is_none() {- let items =- items.iter().map(|item| self.cx.tcx.hir().impl_item(item.id)).collect();+ if !self.inlining && impl_.of_trait.is_none() {+ let items = impl_+ .items+ .iter()+ .map(|item| self.cx.tcx.hir().impl_item(item.id))+ .collect(); let i = Impl {- unsafety,- polarity,- defaultness,- constness,- generics,- trait_: of_trait,- for_: self_ty,+ unsafety: impl_.unsafety,+ polarity: impl_.polarity,+ defaultness: impl_.defaultness,+ constness: impl_.constness,+ generics: &impl_.generics,+ trait_: &impl_.of_trait,+ for_: &impl_.self_ty,
This whole block of code disappeared when rebasing over https://github.com/rust-lang/rust/pull/79312; the new changes are in https://github.com/rust-lang/rust/pull/79322/files#diff-384affc1b4190940f114f3fcebbf969e7e18657a71ef9001da6b223a036687d9R2037. I think you'll agree the new code is a lot nicer :)
comment created time in 4 hours
Pull request review commentrust-lang/rust
impl Clean<Item> for (&hir::ForeignItem<'_>, Option<Ident>) { } } -impl Clean<Item> for doctree::Macro {+impl Clean<Item> for (&hir::MacroDef<'_>, Option<Ident>) { fn clean(&self, cx: &DocContext<'_>) -> Item {+ let (item, renamed) = self;+ let name = renamed.unwrap_or(item.ident).name;+ let tts = item.ast.body.inner_tokens().trees().collect::<Vec<_>>();+ // Extract the spans of all matchers. They represent the "interface" of the macro.+ let matchers = tts.chunks(4).map(|arm| arm[0].span()).collect::<Vec<_>>();+ Item::from_def_id_and_parts(- self.def_id,- Some(self.name.clean(cx)),+ cx.tcx.hir().local_def_id(item.hir_id).to_def_id(),+ Some(name.clean(cx)), MacroItem(Macro {+ // FIXME(#76761): Make this respect `macro_rules!` vs `pub macro` source: format!( "macro_rules! {} {{\n{}}}",
I'm fine adding it now, just wasn't sure if you minded the scope
comment created time in 4 hours
pull request commentrust-lang/rust
WIP: Accept additional user-defined classes in fenced code blocks
cc @GuillaumeGomez - do you have opinons on highlight.js?
comment created time in 4 hours
pull request commentrust-lang/rust
WIP: Accept additional user-defined classes in fenced code blocks
I'm not sure I understand what this is actually getting us. There's no more rust syntax highlighting, yes - but there's no C source highlighting either, which was kind of the point. And the C highlighting can't use the same mechanism, because rust highlighting uses rustc_lexer directly and I do not want to tie rustdoc into clang, nor have to do something similar for each language. That means highlight.js or something like it, but that seems somewhat complicated ...
Anyway, I think we should have this feature actually do something before we accept the syntax, especially since the new feature is insta-stable currently.
comment created time in 4 hours
push eventgtk-rs/gtk4-rs
commit sha 7f09b8d8ce26bb9011b3dd3b12cc4836dd554ae6
gtk: add GLArea subclassing support
push time in 4 hours
issue openedrust-lang/rust
Negative trait impls show as "found implementations" in error messages
(Spotted in https://users.rust-lang.org/t/the-trait-clone-is-not-implemented-for-mut-t/51989?u=scottmcm)
I tried this code https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=6862c5bd66f1fcdf55fd725a93baffcd:
#[derive(Clone)]
struct Foo<'a, T> {
x: &'a mut T,
}
Which of course fails to compile, but it gives the following confusing help:
= help: the following implementations were found:
<&T as Clone>
<&mut T as Clone>
The library now has impl<'_, T> !Clone for &'_ mut T, so it looks like this error-generation code path needs to be updated to account for that.
Ideally it'd take advantage of the explicit negative here to say that it's not clone and has been promised that it never will be, but at the very least is shouldn't be showing <&mut T as Clone> which makes it look like it's actually Clone.
cc https://github.com/rust-lang/rust/issues/68318
created time in 4 hours
pull request commentrust-lang/rust
Switch x64 windows msvc target to use `lld` by default.
r? @Mark-Simulacrum
comment created time in 4 hours
PR opened gtk-rs/gtk4-rs
Add subclassing support of the following types:
- GtkMediaStream
- GtkShortcutManager
- GtkFrame
- GtkGLArea
part of #56
pr created time in 4 hours
Pull request review commentrust-lang/rust
rustdoc: Sort negative impls to the top
fn compare_impl<'a, 'b>(lhs: &'a &&Impl, rhs: &'b &&Impl) -> Ordering { compare_names(&lhs, &rhs) } +fn compare_impl_polarity(a: &Impl, b: &Impl) -> Ordering {+ match (a.inner_impl().polarity, b.inner_impl().polarity) {+ (Some(ImplPolarity::Positive), Some(ImplPolarity::Negative)) => Ordering::Greater,+ (Some(ImplPolarity::Negative), Some(ImplPolarity::Positive)) => Ordering::Less,+ (Some(ImplPolarity::Positive), Some(ImplPolarity::Positive))+ | (Some(ImplPolarity::Negative), Some(ImplPolarity::Negative)) => Ordering::Equal,+ (None, _) | (_, None) => Ordering::Equal,
$ rg polarity.*None src/librustdoc/
src/librustdoc/clean/blanket_impl.rs
136: polarity: None,
src/librustdoc/clean/auto_trait.rs
90: polarity = None;
I'm not sure what it means, but apparently it only happens for blanket impls and auto traits: https://github.com/rust-lang/rust/blob/cb56a4420c8d41aab5c569c0fb6e51098d3a4745/src/librustdoc/clean/blanket_impl.rs#L136 https://github.com/rust-lang/rust/blob/cb56a4420c8d41aab5c569c0fb6e51098d3a4745/src/librustdoc/clean/auto_trait.rs#L89-L90
comment created time in 4 hours
Pull request review commentrust-lang/rust
impl Clean<Item> for (&hir::ForeignItem<'_>, Option<Ident>) { } } -impl Clean<Item> for doctree::Macro {+impl Clean<Item> for (&hir::MacroDef<'_>, Option<Ident>) { fn clean(&self, cx: &DocContext<'_>) -> Item {+ let (item, renamed) = self;+ let name = renamed.unwrap_or(item.ident).name;+ let tts = item.ast.body.inner_tokens().trees().collect::<Vec<_>>();+ // Extract the spans of all matchers. They represent the "interface" of the macro.+ let matchers = tts.chunks(4).map(|arm| arm[0].span()).collect::<Vec<_>>();+ Item::from_def_id_and_parts(- self.def_id,- Some(self.name.clean(cx)),+ cx.tcx.hir().local_def_id(item.hir_id).to_def_id(),
Item::from_hir_id_and_parts(
item.hir_id,
comment created time in 4 hours
Pull request review commentrust-lang/rust
impl Clean<Item> for (&hir::ForeignItem<'_>, Option<Ident>) { } } -impl Clean<Item> for doctree::Macro {+impl Clean<Item> for (&hir::MacroDef<'_>, Option<Ident>) { fn clean(&self, cx: &DocContext<'_>) -> Item {+ let (item, renamed) = self;+ let name = renamed.unwrap_or(item.ident).name;+ let tts = item.ast.body.inner_tokens().trees().collect::<Vec<_>>();+ // Extract the spans of all matchers. They represent the "interface" of the macro.+ let matchers = tts.chunks(4).map(|arm| arm[0].span()).collect::<Vec<_>>();+ Item::from_def_id_and_parts(- self.def_id,- Some(self.name.clean(cx)),+ cx.tcx.hir().local_def_id(item.hir_id).to_def_id(),+ Some(name.clean(cx)), MacroItem(Macro {+ // FIXME(#76761): Make this respect `macro_rules!` vs `pub macro` source: format!( "macro_rules! {} {{\n{}}}",
If you want, I think this would be pretty easy to add now by looking at ast.macro_rules: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_ast/ast/struct.MacroDef.html. Feel free to make that change in a later PR if you don't feel confident changing multiple things at once, though.
comment created time in 4 hours
startedsdroege/gstreamer-rs
started time in 4 hours