public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rust/108111] New: Rust meets clang
@ 2022-12-14 19:17 dcb314 at hotmail dot com
2022-12-14 21:46 ` [Bug rust/108111] " dkm at gcc dot gnu.org
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: dcb314 at hotmail dot com @ 2022-12-14 19:17 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108111
Bug ID: 108111
Summary: Rust meets clang
Product: gcc
Version: 13.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: rust
Assignee: unassigned at gcc dot gnu.org
Reporter: dcb314 at hotmail dot com
CC: dkm at gcc dot gnu.org, gcc-rust at gcc dot gnu.org
Target Milestone: ---
Since the new Rust code landed in gcc, I thought I'd give it
compile with clang. The following 14 warning messages were produced:
./../trunk.d1/gcc/rust/ast/rust-item.h:2186:23: warning: 'as_string' overrides
a member function but is not marked 'override'
[-Winconsistent-missing-override]
../../trunk.d1/gcc/rust/ast/rust-item.h:2189:16: warning: 'accept_vis'
overrides a member function but is not marked 'override'
[-Winconsistent-missing-override]
../../trunk.d1/gcc/rust/ast/rust-item.h:2191:12: warning: 'get_locus' overrides
a member function but is not marked 'override'
[-Winconsistent-missing-override]
../../trunk.d1/gcc/rust/ast/rust-item.h:2196:8: warning: 'mark_for_strip'
overrides a member function but is not marked 'override'
[-Winconsistent-missing-override]
../../trunk.d1/gcc/rust/ast/rust-item.h:2197:8: warning: 'is_marked_for_strip'
overrides a member function but is not marked 'override'
[-Winconsistent-missing-override]
../../trunk.d1/gcc/rust/ast/rust-pattern.h:894:12: warning: 'get_locus'
overrides a member function but is not marked 'override'
[-Winconsistent-missing-override]
../../trunk.d1/gcc/rust/hir/tree/rust-hir-type.h:35:8: warning: private field
'in_parens' is not used [-Wunused-private-field]
../../trunk.d1/gcc/rust/lex/rust-lex.h:156:10: warning: explicitly defaulted
move assignment operator is implicitly deleted [-Wdefaulted-function-deleted]
../../trunk.d1/gcc/rust/parse/rust-parse-impl.h:14918:23: warning: operator
'?:' has lower precedence than '<<'; '<<' will be evaluated first
[-Wparentheses]
../../trunk.d1/gcc/rust/typecheck/rust-substitution-mapper.h:332:19: warning:
private field 'concrete' is not used [-Wunused-private-field]
../../trunk.d1/gcc/rust/typecheck/rust-tyty-call.h:140:31: warning: private
field 'context' is not used [-Wunused-private-field]
../../trunk.d1/gcc/rust/typecheck/rust-tyty-call.h:83:31: warning: private
field 'context' is not used [-Wunused-private-field]
/usr/bin/../lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/new_allocator.h:181:4:
warning: destructor called on non-final 'Rust::TyTy::TypeBoundPredicate' that
has virtual functions but non-virtual destructor
[-Wdelete-non-abstract-non-virtual-dtor]
/usr/bin/../lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/stl_construct.h:151:7:
warning: destructor called on non-final 'Rust::TyTy::TypeBoundPredicate' that
has virtual functions but non-virtual destructor
[-Wdelete-non-abstract-non-virtual-dtor]
Some, all or none of these might be worth fixing.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug rust/108111] Rust meets clang
2022-12-14 19:17 [Bug rust/108111] New: Rust meets clang dcb314 at hotmail dot com
@ 2022-12-14 21:46 ` dkm at gcc dot gnu.org
2022-12-14 22:22 ` redi at gcc dot gnu.org
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: dkm at gcc dot gnu.org @ 2022-12-14 21:46 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108111
--- Comment #1 from Marc Poulhiès <dkm at gcc dot gnu.org> ---
Hello David,
Looking at the errors, most of them are trivial to fix.
1-6: missing 'override'.
9: not present in most recent dev branch on github, can be ignored as it will
disappear when we update the gcc master branch with latest code.
13-14: class is missing a virtual dtor
7,10-12: unused variables
I'll need to read a bit more about the 8 (default move assignment op being
deleted).
I've a first patch that addresses most of the warnings, but I'm missing the
last one. If Arthur (or someone else) doesn't beat me to it, I'll have a fix
shortly
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug rust/108111] Rust meets clang
2022-12-14 19:17 [Bug rust/108111] New: Rust meets clang dcb314 at hotmail dot com
2022-12-14 21:46 ` [Bug rust/108111] " dkm at gcc dot gnu.org
@ 2022-12-14 22:22 ` redi at gcc dot gnu.org
2022-12-15 10:44 ` marxin at gcc dot gnu.org
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: redi at gcc dot gnu.org @ 2022-12-14 22:22 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108111
--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Marc Poulhiès from comment #1)
> I'll need to read a bit more about the 8 (default move assignment op being
> deleted).
Lexer has this member:
buffered_queue<int, InputSource &> input_queue;
That has a member of type InputSource& which means it is not assignable, so
Lexer is not assignable either.
Are you sure you want a reference there?
Using std::reference_wrapper<InputSource> would work without needing to change
buffered_queue.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug rust/108111] Rust meets clang
2022-12-14 19:17 [Bug rust/108111] New: Rust meets clang dcb314 at hotmail dot com
2022-12-14 21:46 ` [Bug rust/108111] " dkm at gcc dot gnu.org
2022-12-14 22:22 ` redi at gcc dot gnu.org
@ 2022-12-15 10:44 ` marxin at gcc dot gnu.org
2022-12-15 20:22 ` dkm at gcc dot gnu.org
2024-01-16 17:24 ` cvs-commit at gcc dot gnu.org
4 siblings, 0 replies; 6+ messages in thread
From: marxin at gcc dot gnu.org @ 2022-12-15 10:44 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108111
Martin Liška <marxin at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |marxin at gcc dot gnu.org
Last reconfirmed| |2022-12-15
Ever confirmed|0 |1
Status|UNCONFIRMED |NEW
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug rust/108111] Rust meets clang
2022-12-14 19:17 [Bug rust/108111] New: Rust meets clang dcb314 at hotmail dot com
` (2 preceding siblings ...)
2022-12-15 10:44 ` marxin at gcc dot gnu.org
@ 2022-12-15 20:22 ` dkm at gcc dot gnu.org
2024-01-16 17:24 ` cvs-commit at gcc dot gnu.org
4 siblings, 0 replies; 6+ messages in thread
From: dkm at gcc dot gnu.org @ 2022-12-15 20:22 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108111
--- Comment #3 from Marc Poulhiès <dkm at gcc dot gnu.org> ---
Thanks Jonathan for the suggestion.
The lexer code still need some refactor because the Source type (2nd template
argument to buffered_queue) is expected to have a next() method and is used
with both a InputSource& and a TokenSource. I have a local patch but still need
to use clang to check the fix first :)
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug rust/108111] Rust meets clang
2022-12-14 19:17 [Bug rust/108111] New: Rust meets clang dcb314 at hotmail dot com
` (3 preceding siblings ...)
2022-12-15 20:22 ` dkm at gcc dot gnu.org
@ 2024-01-16 17:24 ` cvs-commit at gcc dot gnu.org
4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-01-16 17:24 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108111
--- Comment #4 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The trunk branch has been updated by Arthur Cohen <cohenarthur@gcc.gnu.org>:
https://gcc.gnu.org/g:2046aec032f743023a5e353735255d951e2e54d6
commit r14-7347-g2046aec032f743023a5e353735255d951e2e54d6
Author: Marc Poulhiès <dkm@kataplop.net>
Date: Sat Dec 17 16:23:05 2022 +0100
gccrs: fix some clang warnings
This fixes some extra warnings reported by clang.
gcc/rust/ChangeLog:
PR rust/108111
* ast/rust-ast-full-decls.h (StructPatternElements): Declare as a
class.
* ast/rust-item.h (EnumItem): Mark several method as being
overrides.
* ast/rust-pattern.h (StructPattern::get_locus): Add override.
* lex/rust-lex.h (BufferInputSource): Use reference_wrapper
instead of bare reference.
(TokenSource::get): Add method to implement the reference_wrapper
interface.
* typecheck/rust-tyty.h (TypeBoundPredicate): Add empty dtor.
* util/rust-buffered-queue.h (peek): Source token stream is now
using a reference_wrapper, use .get()
Signed-off-by: Marc Poulhiès <dkm@kataplop.net>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2024-01-16 17:24 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-14 19:17 [Bug rust/108111] New: Rust meets clang dcb314 at hotmail dot com
2022-12-14 21:46 ` [Bug rust/108111] " dkm at gcc dot gnu.org
2022-12-14 22:22 ` redi at gcc dot gnu.org
2022-12-15 10:44 ` marxin at gcc dot gnu.org
2022-12-15 20:22 ` dkm at gcc dot gnu.org
2024-01-16 17:24 ` cvs-commit at gcc dot gnu.org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).