Skip to content

Conversation

ftxqxd
Copy link
Contributor

@ftxqxd ftxqxd commented Oct 29, 2014

I’m not so sure about the way I’ve handled #17567, but at least the error message is an improvement over what it was before (albeit still not quite as good as it was before DST).

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this would be better expressed as a match:

let is_sized = match fcx.ccx.tcx.lang_item.sized_trait() {
    Some(sized_id) => sized_id == trait_ref.def_id,
    None => false
};

Or if you feel more adventurous:

let is_sized = fcx.ccx.tcx.lang_items.sized_trait()
    .map_or(false, |sized_id| sized_id == trait_ref.def_id);

…nt group

These lints are allow by default because they are sometimes too sensitive.
The error messages still aren’t as good as they were before DST, but they better
describe the actual problem, not mentioning `Sized` at all (because that bound
is normally implied, not explicitly stated).

Closes rust-lang#17567.
Closes rust-lang#18040.
Closes rust-lang#18159.
alexcrichton added a commit to alexcrichton/rust that referenced this pull request Oct 30, 2014
@bors bors merged commit 737e396 into rust-lang:master Oct 31, 2014
lnicola pushed a commit to lnicola/rust that referenced this pull request Oct 29, 2024
fix: Correctly handle `#""` in edition <2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants