Skip to content

Poor error message when a subtype is not Sync as required #20965

Closed
@jdm

Description

@jdm

If you change https://github.com/servo/servo/blob/81f47344d6e121d86de368a25107415406de3c0f/components/layout/fragment.rs#L227 to read Option<Sender<CanvasMsg>>, trying to build Servo produces a ton of confusing error messages:

   Compiling layout v0.0.1 (file:///Users/jdm/src/servo/components/servo)
block.rs:1485:1: 1903:2 error: the trait `core::kinds::Sync` is not implemented for the type `core::kinds::marker::NoSync`
block.rs:1485 impl Flow for BlockFlow {
block.rs:1486     fn class(&self) -> FlowClass {
block.rs:1487         FlowClass::Block
block.rs:1488     }
block.rs:1489
block.rs:1490     fn as_block<'a>(&'a mut self) -> &'a mut BlockFlow {
              ...
block.rs:1485:1: 1903:2 note: the trait `core::kinds::Sync` must be implemented because it is required by `flow::Flow`
block.rs:1485 impl Flow for BlockFlow {
block.rs:1486     fn class(&self) -> FlowClass {
block.rs:1487         FlowClass::Block
block.rs:1488     }
block.rs:1489
block.rs:1490     fn as_block<'a>(&'a mut self) -> &'a mut BlockFlow {
              ...
inline.rs:944:1: 1253:2 error: the trait `core::kinds::Sync` is not implemented for the type `core::kinds::marker::NoSync`
inline.rs:944 impl Flow for InlineFlow {
inline.rs:945     fn class(&self) -> FlowClass {
inline.rs:946         FlowClass::Inline
inline.rs:947     }
inline.rs:948
inline.rs:949     fn as_immutable_inline<'a>(&'a self) -> &'a InlineFlow {
              ...
inline.rs:944:1: 1253:2 note: the trait `core::kinds::Sync` must be implemented because it is required by `flow::Flow`
inline.rs:944 impl Flow for InlineFlow {
inline.rs:945     fn class(&self) -> FlowClass {
inline.rs:946         FlowClass::Inline
inline.rs:947     }
inline.rs:948
inline.rs:949     fn as_immutable_inline<'a>(&'a self) -> &'a InlineFlow {
              ...
list_item.rs:48:1: 124:2 error: the trait `core::kinds::Sync` is not implemented for the type `core::kinds::marker::NoSync`
list_item.rs:48 impl Flow for ListItemFlow {
list_item.rs:49     fn class(&self) -> FlowClass {
list_item.rs:50         FlowClass::ListItem
list_item.rs:51     }
list_item.rs:52
list_item.rs:53     fn as_block<'a>(&'a mut self) -> &'a mut BlockFlow {
                ...
list_item.rs:48:1: 124:2 note: the trait `core::kinds::Sync` must be implemented because it is required by `flow::Flow`
list_item.rs:48 impl Flow for ListItemFlow {
list_item.rs:49     fn class(&self) -> FlowClass {
list_item.rs:50         FlowClass::ListItem
list_item.rs:51     }
list_item.rs:52
list_item.rs:53     fn as_block<'a>(&'a mut self) -> &'a mut BlockFlow {
                ...
table_wrapper.rs:215:1: 371:2 error: the trait `core::kinds::Sync` is not implemented for the type `core::kinds::marker::NoSync`
table_wrapper.rs:215 impl Flow for TableWrapperFlow {
table_wrapper.rs:216     fn class(&self) -> FlowClass {
table_wrapper.rs:217         FlowClass::TableWrapper
table_wrapper.rs:218     }
table_wrapper.rs:219
table_wrapper.rs:220     fn as_table_wrapper<'a>(&'a mut self) -> &'a mut TableWrapperFlow {
                     ...
table_wrapper.rs:215:1: 371:2 note: the trait `core::kinds::Sync` must be implemented because it is required by `flow::Flow`
table_wrapper.rs:215 impl Flow for TableWrapperFlow {
table_wrapper.rs:216     fn class(&self) -> FlowClass {
table_wrapper.rs:217         FlowClass::TableWrapper
table_wrapper.rs:218     }
table_wrapper.rs:219
table_wrapper.rs:220     fn as_table_wrapper<'a>(&'a mut self) -> &'a mut TableWrapperFlow {
                     ...
table.rs:205:1: 397:2 error: the trait `core::kinds::Sync` is not implemented for the type `core::kinds::marker::NoSync`
table.rs:205 impl Flow for TableFlow {
table.rs:206     fn class(&self) -> FlowClass {
table.rs:207         FlowClass::Table
table.rs:208     }
table.rs:209
table.rs:210     fn as_table<'a>(&'a mut self) -> &'a mut TableFlow {
             ...
table.rs:205:1: 397:2 note: the trait `core::kinds::Sync` must be implemented because it is required by `flow::Flow`
table.rs:205 impl Flow for TableFlow {
table.rs:206     fn class(&self) -> FlowClass {
table.rs:207         FlowClass::Table
table.rs:208     }
table.rs:209
table.rs:210     fn as_table<'a>(&'a mut self) -> &'a mut TableFlow {
             ...
table_caption.rs:37:1: 94:2 error: the trait `core::kinds::Sync` is not implemented for the type `core::kinds::marker::NoSync`
table_caption.rs:37 impl Flow for TableCaptionFlow {
table_caption.rs:38     fn class(&self) -> FlowClass {
table_caption.rs:39         FlowClass::TableCaption
table_caption.rs:40     }
table_caption.rs:41
table_caption.rs:42     fn as_table_caption<'a>(&'a mut self) -> &'a mut TableCaptionFlow {
                    ...
table_caption.rs:37:1: 94:2 note: the trait `core::kinds::Sync` must be implemented because it is required by `flow::Flow`
table_caption.rs:37 impl Flow for TableCaptionFlow {
table_caption.rs:38     fn class(&self) -> FlowClass {
table_caption.rs:39         FlowClass::TableCaption
table_caption.rs:40     }
table_caption.rs:41
table_caption.rs:42     fn as_table_caption<'a>(&'a mut self) -> &'a mut TableCaptionFlow {
                    ...
table_colgroup.rs:56:1: 107:2 error: the trait `core::kinds::Sync` is not implemented for the type `core::kinds::marker::NoSync`
table_colgroup.rs:56 impl Flow for TableColGroupFlow {
table_colgroup.rs:57     fn class(&self) -> FlowClass {
table_colgroup.rs:58         FlowClass::TableColGroup
table_colgroup.rs:59     }
table_colgroup.rs:60
table_colgroup.rs:61     fn as_table_colgroup<'a>(&'a mut self) -> &'a mut TableColGroupFlow {
                     ...
table_colgroup.rs:56:1: 107:2 note: the trait `core::kinds::Sync` must be implemented because it is required by `flow::Flow`
table_colgroup.rs:56 impl Flow for TableColGroupFlow {
table_colgroup.rs:57     fn class(&self) -> FlowClass {
table_colgroup.rs:58         FlowClass::TableColGroup
table_colgroup.rs:59     }
table_colgroup.rs:60
table_colgroup.rs:61     fn as_table_colgroup<'a>(&'a mut self) -> &'a mut TableColGroupFlow {
                     ...
table_rowgroup.rs:70:1: 163:2 error: the trait `core::kinds::Sync` is not implemented for the type `core::kinds::marker::NoSync`
table_rowgroup.rs:70 impl Flow for TableRowGroupFlow {
table_rowgroup.rs:71     fn class(&self) -> FlowClass {
table_rowgroup.rs:72         FlowClass::TableRowGroup
table_rowgroup.rs:73     }
table_rowgroup.rs:74
table_rowgroup.rs:75     fn as_table_rowgroup<'a>(&'a mut self) -> &'a mut TableRowGroupFlow {
                     ...
table_rowgroup.rs:70:1: 163:2 note: the trait `core::kinds::Sync` must be implemented because it is required by `flow::Flow`
table_rowgroup.rs:70 impl Flow for TableRowGroupFlow {
table_rowgroup.rs:71     fn class(&self) -> FlowClass {
table_rowgroup.rs:72         FlowClass::TableRowGroup
table_rowgroup.rs:73     }
table_rowgroup.rs:74
table_rowgroup.rs:75     fn as_table_rowgroup<'a>(&'a mut self) -> &'a mut TableRowGroupFlow {
                     ...
table_row.rs:151:1: 328:2 error: the trait `core::kinds::Sync` is not implemented for the type `core::kinds::marker::NoSync`
table_row.rs:151 impl Flow for TableRowFlow {
table_row.rs:152     fn class(&self) -> FlowClass {
table_row.rs:153         FlowClass::TableRow
table_row.rs:154     }
table_row.rs:155
table_row.rs:156     fn as_table_row<'a>(&'a mut self) -> &'a mut TableRowFlow {
                 ...
table_row.rs:151:1: 328:2 note: the trait `core::kinds::Sync` must be implemented because it is required by `flow::Flow`
table_row.rs:151 impl Flow for TableRowFlow {
table_row.rs:152     fn class(&self) -> FlowClass {
table_row.rs:153         FlowClass::TableRow
table_row.rs:154     }
table_row.rs:155
table_row.rs:156     fn as_table_row<'a>(&'a mut self) -> &'a mut TableRowFlow {
                 ...
table_cell.rs:69:1: 175:2 error: the trait `core::kinds::Sync` is not implemented for the type `core::kinds::marker::NoSync`
table_cell.rs:69 impl Flow for TableCellFlow {
table_cell.rs:70     fn class(&self) -> FlowClass {
table_cell.rs:71         FlowClass::TableCell
table_cell.rs:72     }
table_cell.rs:73
table_cell.rs:74     fn as_table_cell<'a>(&'a mut self) -> &'a mut TableCellFlow {
                 ...
table_cell.rs:69:1: 175:2 note: the trait `core::kinds::Sync` must be implemented because it is required by `flow::Flow`
table_cell.rs:69 impl Flow for TableCellFlow {
table_cell.rs:70     fn class(&self) -> FlowClass {
table_cell.rs:71         FlowClass::TableCell
table_cell.rs:72     }
table_cell.rs:73
table_cell.rs:74     fn as_table_cell<'a>(&'a mut self) -> &'a mut TableCellFlow {
                 ...
error: aborting due to 10 previous errors
Could not compile `layout`.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lints

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions