Buildbot failure in Wildebeest Builder on whole buildset

2021-08-22 Thread buildbot
The Buildbot has detected a new failure on builder gccrust-debian-arm64 while 
building gccrust.
Full details are available at:
https://builder.wildebeest.org/buildbot/#builders/58/builds/355

Buildbot URL: https://builder.wildebeest.org/buildbot/

Worker for this Build: debian-arm64

Build Reason: 
Blamelist: Philip Herron 

BUILD FAILED: failed compile (failure)

Sincerely,
 -The BuildbotThe Buildbot has detected a new failure on builder 
gccrust-fedora-x86_64 while building gccrust.
Full details are available at:
https://builder.wildebeest.org/buildbot/#builders/59/builds/354

Buildbot URL: https://builder.wildebeest.org/buildbot/

Worker for this Build: fedora-x86_64

Build Reason: 
Blamelist: Philip Herron 

BUILD FAILED: failed compile (failure)

Sincerely,
 -The BuildbotThe Buildbot has detected a new failure on builder 
gccrust-fedora-ppc64le while building gccrust.
Full details are available at:
https://builder.wildebeest.org/buildbot/#builders/60/builds/347

Buildbot URL: https://builder.wildebeest.org/buildbot/

Worker for this Build: fedora-ppc64le

Build Reason: 
Blamelist: Philip Herron 

BUILD FAILED: failed compile (failure)

Sincerely,
 -The BuildbotThe Buildbot has detected a new failure on builder 
gccrust-fedora-ppc64 while building gccrust.
Full details are available at:
https://builder.wildebeest.org/buildbot/#builders/61/builds/332

Buildbot URL: https://builder.wildebeest.org/buildbot/

Worker for this Build: fedora-ppc64

Build Reason: 
Blamelist: Philip Herron 

BUILD FAILED: failed compile (failure)

Sincerely,
 -The BuildbotThe Buildbot has detected a new failure on builder 
gccrust-debian-i386 while building gccrust.
Full details are available at:
https://builder.wildebeest.org/buildbot/#builders/62/builds/70

Buildbot URL: https://builder.wildebeest.org/buildbot/

Worker for this Build: debian-i386

Build Reason: 
Blamelist: Philip Herron 

BUILD FAILED: failed compile (failure)

Sincerely,
 -The BuildbotThe Buildbot has detected a new failure on builder 
gccrust-fedora-s390x while building gccrust.
Full details are available at:
https://builder.wildebeest.org/buildbot/#builders/63/builds/65

Buildbot URL: https://builder.wildebeest.org/buildbot/

Worker for this Build: fedora-s390x

Build Reason: 
Blamelist: Philip Herron 

BUILD FAILED: failed compile (failure)

Sincerely,
 -The Buildbot

-- 
Gcc-rust mailing list
Gcc-rust@gcc.gnu.org
https://gcc.gnu.org/mailman/listinfo/gcc-rust


Re: Buildbot failure in Wildebeest Builder on whole buildset

2021-08-22 Thread Mark Wielaard
Hi,

On Sun, Aug 22, 2021 at 03:55:47PM +, build...@builder.wildebeest.org wrote:
> The Buildbot has detected a new failure on builder gccrust-debian-arm64 while 
> building gccrust.
> Full details are available at:
> https://builder.wildebeest.org/buildbot/#builders/58/builds/355

This seems to have been a transient build failure caused by:

commit d5dd96322b588ffcf5bdd2fe0e3a14eb217d75b2
Author: Philip Herron 
Date:   Sun Aug 22 13:42:14 2021 +0100

Add Trait Resolver simple type-path lookup

Post type checking we need to be able to lookup trait references, but do
not need to resolve the trait with error messages. We simple want to look
it up if it exists.

../../gccrs/gcc/rust/typecheck/rust-hir-trait-resolve.cc:233:1: error: 
‘PathProbeImplTrait’ has not been declared
 PathProbeImplTrait::process_trait_impl_items_for_candidates ()
 ^~
../../gccrs/gcc/rust/typecheck/rust-hir-trait-resolve.cc: In function ‘void 
Rust::Resolver::process_trait_impl_items_for_candidates()’:
../../gccrs/gcc/rust/typecheck/rust-hir-trait-resolve.cc:235:3: error: 
‘mappings’ was not declared in this scope
   mappings->iterate_impl_items (
   ^~~~
../../gccrs/gcc/rust/typecheck/rust-hir-trait-resolve.cc:235:3: note: suggested 
alternative: ‘warning’
   mappings->iterate_impl_items (
   ^~~~
   warning
../../gccrs/gcc/rust/typecheck/rust-hir-trait-resolve.cc: In lambda function:
../../gccrs/gcc/rust/typecheck/rust-hir-trait-resolve.cc:244:12: error: 
‘trait_reference’ was not declared in this scope
   if (!trait_reference->is_equal (*resolved))
^~~
../../gccrs/gcc/rust/typecheck/rust-hir-trait-resolve.cc:244:12: note: 
suggested alternative: ‘TraitReference’
   if (!trait_reference->is_equal (*resolved))
^~~
TraitReference
../../gccrs/gcc/rust/typecheck/rust-hir-trait-resolve.cc:247:7: error: 
‘process_impl_item_candidate’ was not declared in this scope
   process_impl_item_candidate (id, item, impl);
   ^~~
../../gccrs/gcc/rust/typecheck/rust-hir-trait-resolve.cc:247:7: note: suggested 
alternative: ‘process_trait_impl_items_for_candidates’
   process_impl_item_candidate (id, item, impl);
   ^~~
   process_trait_impl_items_for_candidates
make[2]: *** [../../gccrs/gcc/rust/Make-lang.in:301: 
rust/rust-hir-trait-resolve.o] Error 1

But resolved by the next commit:

commit a6c8bd136dd4e89752eaec6415ba651f3cd73b9e
Author: Philip Herron 
Date:   Sun Aug 22 13:44:46 2021 +0100

Add impl-trait path probe helper

This adds a probe to lookup candidates for a segment for any impl block
for this receiver and trait. This simplifies some query based compilation
code. When the item is resolved to a trait item but might be overriden by
a reciever impl block instead.

Not all buildbot workers have finished building all the latest commits though.

Cheers,

Mark
-- 
Gcc-rust mailing list
Gcc-rust@gcc.gnu.org
https://gcc.gnu.org/mailman/listinfo/gcc-rust


Re: [PATCH] Reject duplicate field names in structs and unions.

2021-08-22 Thread Philip Herron
Nice work once again, just to let you know about the little bit of
duplication I think the name resolver needs a little bit of thought to
handle forward declared items within a block like this:
https://github.com/Rust-GCC/gccrs/issues/531. It might be as simple as
calling ResolveToplevelItems when doing block expr resolution. Depending on
how we fix this it might feed back a way to avoid this little bit of
duplication.

Thanks

--Phil

On Sun, 22 Aug 2021 at 00:48, Mark Wielaard  wrote:

> Odd things happen if structs or unions have duplicate field names.
> Emit an error when lowering an struct/union item or declaration
> statement and a duplicate field name is detected.  A new testcase
> 'dup_fields.rs' checks an error is actually produced.
> ---
>
> https://code.wildebeest.org/git/user/mjw/gccrs/commit/?h=dup_fields
>
>  gcc/rust/hir/rust-ast-lower-item.h   | 27 
>  gcc/rust/hir/rust-ast-lower-stmt.h   | 27 
>  gcc/testsuite/rust/compile/dup_fields.rs | 23 
>  3 files changed, 77 insertions(+)
>  create mode 100644 gcc/testsuite/rust/compile/dup_fields.rs
>
> diff --git a/gcc/rust/hir/rust-ast-lower-item.h
> b/gcc/rust/hir/rust-ast-lower-item.h
> index bcf83ee63b6..b324d0b5b8b 100644
> --- a/gcc/rust/hir/rust-ast-lower-item.h
> +++ b/gcc/rust/hir/rust-ast-lower-item.h
> @@ -176,6 +176,25 @@ public:
>struct_decl.get_locus ());
>}
>
> +  /* Checks whether the name of a field already exists.  Returns true
> + and produces an error if so.  */
> +  static bool struct_field_name_exists (std::vector
> &fields,
> +   HIR::StructField &new_field)
> +  {
> +for (auto &field : fields)
> +  {
> +   if (field.get_field_name ().compare (new_field.get_field_name ())
> == 0)
> + {
> +   RichLocation r (new_field.get_locus ());
> +   r.add_range (field.get_locus ());
> +   rust_error_at (r, "duplicate field name %qs",
> +  field.get_field_name ().c_str ());
> +   return true;
> + }
> +  }
> +return false;
> +  }
> +
>void visit (AST::StructStruct &struct_decl) override
>{
>  std::vector > generic_params;
> @@ -206,6 +225,10 @@ public:
>  std::unique_ptr
> (type), vis,
>  field.get_locus (),
>  field.get_outer_attrs ());
> +
> +  if (struct_field_name_exists (fields, translated_field))
> +   return false;
> +
>fields.push_back (std::move (translated_field));
>return true;
>  });
> @@ -258,6 +281,10 @@ public:
>std::unique_ptr
> (type),
>vis, variant.get_locus (),
>variant.get_outer_attrs ());
> +
> +  if (struct_field_name_exists (variants, translated_variant))
> +   return false;
> +
>variants.push_back (std::move (translated_variant));
>return true;
>  });
> diff --git a/gcc/rust/hir/rust-ast-lower-stmt.h
> b/gcc/rust/hir/rust-ast-lower-stmt.h
> index c4c00ac0bee..1e72c8a2023 100644
> --- a/gcc/rust/hir/rust-ast-lower-stmt.h
> +++ b/gcc/rust/hir/rust-ast-lower-stmt.h
> @@ -161,6 +161,25 @@ public:
>struct_decl.get_locus ());
>}
>
> +  /* Checks whether the name of a field already exists.  Returns true
> + and produces an error if so.  */
> +  static bool struct_field_name_exists (std::vector
> &fields,
> +   HIR::StructField &new_field)
> +  {
> +for (auto &field : fields)
> +  {
> +   if (field.get_field_name ().compare (new_field.get_field_name ())
> == 0)
> + {
> +   RichLocation r (new_field.get_locus ());
> +   r.add_range (field.get_locus ());
> +   rust_error_at (r, "duplicate field name %qs",
> +  field.get_field_name ().c_str ());
> +   return true;
> + }
> +  }
> +return false;
> +  }
> +
>void visit (AST::StructStruct &struct_decl) override
>{
>  std::vector > generic_params;
> @@ -191,6 +210,10 @@ public:
>  std::unique_ptr
> (type), vis,
>  field.get_locus (),
>  field.get_outer_attrs ());
> +
> +  if (struct_field_name_exists (fields, translated_field))
> +   return false;
> +
>fields.push_back (std::move (translated_field));
>return true;
>  });
> @@ -242,6 +265,10 @@ public:
>std::unique_ptr
> (type),
>vis, variant.get_locus (),
>variant.get_outer_attrs ());
> +
> +  if (struct_field_name_exists