Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should the literal 128i8 be valid? #6958

Closed
bstrie opened this issue Jun 5, 2013 · 1 comment
Closed

Should the literal 128i8 be valid? #6958

bstrie opened this issue Jun 5, 2013 · 1 comment

Comments

@bstrie
Copy link
Contributor

bstrie commented Jun 5, 2013

Not necessarily unprecedented, but can still be surprising:

fn main() {
    println(fmt!("%?", 128i8));  // prints "-128"
}

Do we want to allow this, along with 32768i16 and so on? See also #2438 and #6012.

@emberian
Copy link
Member

emberian commented Aug 1, 2013

Closing as dup of #4220

@emberian emberian closed this as completed Aug 1, 2013
flip1995 pushed a commit to flip1995/rust that referenced this issue Apr 8, 2021
`len_without_is_empty` improvements

fixes: rust-lang#6958
fixes: rust-lang#6972

changelog: Check the return type of `len`. Only integral types, or an `Option` or `Result` wrapping one.
changelog: Ensure the return type of `is_empty` matches. e.g. `Option<usize>` -> `Option<bool>`
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

No branches or pull requests

2 participants