Stop exporting TypeckRootCtxt and FnCtxt.#123625
Conversation
|
r? @davidtwco rustbot has assigned @davidtwco. Use |
|
Some changes occurred in src/tools/clippy cc @rust-lang/clippy |
| /// whether the cast is made in a const context or not. | ||
| pub constness: hir::Constness, |
There was a problem hiding this comment.
Also helps with the compiler telling us about unused things
fee1-dead
left a comment
There was a problem hiding this comment.
I hope you don't mind the comment nits. r=me afterwards :)
| /// If a cast from `from_ty` to `to_ty` is valid, returns an Ok containing the kind of | ||
| /// the cast. In certain cases, including some invalid casts from array references | ||
| /// to pointers, this may cause additional errors to be emitted and/or ICE error |
There was a problem hiding this comment.
| /// If a cast from `from_ty` to `to_ty` is valid, returns an Ok containing the kind of | |
| /// the cast. In certain cases, including some invalid casts from array references | |
| /// to pointers, this may cause additional errors to be emitted and/or ICE error | |
| /// If a cast from `from_ty` to `to_ty` is valid, returns a `Some` containing the kind | |
| /// of the cast. In certain cases, including some invalid casts from array references | |
| /// to pointers, this may cause additional errors to be emitted and/or ICE error |
This returns an Option, not a Result.
|
|
||
| if let Ok(check) = CastCheck::new( | ||
| &fn_ctxt, e, from_ty, to_ty, | ||
| // We won't show any error to the user, so we don't care what the span is here. |
There was a problem hiding this comment.
| // We won't show any error to the user, so we don't care what the span is here. | |
| // We won't show any errors to the user, so the span is irrelevant here. |
Would probably read better (I know you didn't write these but seems nice to do a drive-by)
| /// If a cast from `from_ty` to `to_ty` is valid, returns an Ok containing the kind of | ||
| /// the cast. In certain cases, including some invalid casts from array references | ||
| /// to pointers, this may cause additional errors to be emitted and/or ICE error | ||
| /// messages. This function will panic if that occurs. |
There was a problem hiding this comment.
Is this really true? I don't see any panicking done in the body of this function, but I assume CastCheck wouldn't do that.
There was a problem hiding this comment.
Oh heh. I didn't read the comment at all and just copied over the function
While they have many convenient APIs, it is better to expose dedicated functions for them
|
@bors r=fee1-dead |
…iaskrgr Rollup of 6 pull requests Successful merges: - rust-lang#115984 (extending filesystem support for Hermit) - rust-lang#120144 (privacy: Stabilize lint `unnameable_types`) - rust-lang#122807 (Add consistency with phrases "meantime" and "mean time") - rust-lang#123089 (Add invariant to VecDeque::pop_* that len < cap if pop successful) - rust-lang#123595 (Documentation fix) - rust-lang#123625 (Stop exporting `TypeckRootCtxt` and `FnCtxt`.) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#123625 - oli-obk:private_fnctxt, r=fee1-dead Stop exporting `TypeckRootCtxt` and `FnCtxt`. While they have many convenient APIs, it is better to expose dedicated functions for them noticed in rust-lang#122213
Stop exporting `TypeckRootCtxt` and `FnCtxt`. While they have many convenient APIs, it is better to expose dedicated functions for them noticed in rust-lang#122213
While they have many convenient APIs, it is better to expose dedicated functions for them
noticed in #122213