-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Don't import integer and float modules, use assoc consts 2 #70857
Conversation
Some(*ordinal as usize) | ||
} else { | ||
let msg = format!("ordinal value in `link_ordinal` is too large: `{}`", &ordinal); | ||
tcx.sess | ||
.struct_span_err(attr.span, &msg) | ||
.note("the value may not exceed `std::usize::MAX`") | ||
.note("the value may not exceed `usize::MAX`") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a user facing change and not just an internal code update. And since we want new code to use the new assoc consts this is important to update to have a consistent message to users.
999bab6
to
029f0ba
Compare
This still fails an |
029f0ba
to
f7778d3
Compare
Hopefully fixed now. The result of that test came in far sooner than I thought. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
@bors r+ |
📌 Commit f7778d3 has been approved by |
…=dtolnay Don't import integer and float modules, use assoc consts 2 Follow up to rust-lang#70777. I missed quite a lot of places. Partially because I wanted to keep the size of the last PR down, and partially because my regexes were not good enough :) r? @dtolnay
…ievink Rollup of 5 pull requests Successful merges: - rust-lang#70201 (Small tweaks in ToOwned::clone_into) - rust-lang#70762 (Miri leak check: memory reachable through globals is not leaked) - rust-lang#70846 (Keep codegen units unmerged when building compiler builtins) - rust-lang#70854 (Use assoc int submodules) - rust-lang#70857 (Don't import integer and float modules, use assoc consts 2) Failed merges: r? @ghost
Use assoc int consts3 Define module level int consts with associated constants instead of `min_value()` and `max_value()`. So the code become consistent with what the docs recommend etc. Seems natural. Also remove the last usages of the int module constants from this repo (except src/test/ directory which I have still not really done anything in). Some places were missed in the previous PRs because the code uses `crate::<IntTy>` to reach the constants. This is a continuation of rust-lang#70857 r? @dtolnay
Use assoc int consts3 Define module level int consts with associated constants instead of `min_value()` and `max_value()`. So the code become consistent with what the docs recommend etc. Seems natural. Also remove the last usages of the int module constants from this repo (except src/test/ directory which I have still not really done anything in). Some places were missed in the previous PRs because the code uses `crate::<IntTy>` to reach the constants. This is a continuation of rust-lang#70857 r? @dtolnay
Use assoc int consts3 Define module level int consts with associated constants instead of `min_value()` and `max_value()`. So the code become consistent with what the docs recommend etc. Seems natural. Also remove the last usages of the int module constants from this repo (except src/test/ directory which I have still not really done anything in). Some places were missed in the previous PRs because the code uses `crate::<IntTy>` to reach the constants. This is a continuation of rust-lang#70857 r? @dtolnay
Use associated constants directly on primitive types instead of modules This PR is in no way critical. It's more of a code cleanup. It comes as a result of me making rust-lang/rust#70857 and search-and-replacing all usage of the soft-deprecated ways of reaching primitive type constants. It makes the code slightly shorter, that's basically it. And showcases the recommended way of reaching these consts on new code :)
Follow up to #70777. I missed quite a lot of places. Partially because I wanted to keep the size of the last PR down, and partially because my regexes were not good enough :)
r? @dtolnay