diagnostics: avoid ICE for undeclared generic parameter in impl#154182
diagnostics: avoid ICE for undeclared generic parameter in impl#154182Unique-Usman wants to merge 1 commit intorust-lang:mainfrom
Conversation
|
rustbot has assigned @petrochenkov. Use Why was this reviewer chosen?The reviewer was selected based on:
|
This comment has been minimized.
This comment has been minimized.
b88bcb8 to
20d63f9
Compare
This comment has been minimized.
This comment has been minimized.
Avoid an ICE for:
struct A;
impl A<B> {}
The compiler no longer panics and can proceed to emit existing diagnostics.
Adds `tests/ui/missing/undeclared-generic-parameter.rs`.
Signed-off-by: Usman Akinyemi <usmanakinyemi202@gmail.com>
20d63f9 to
b31dc4a
Compare
|
|
|
Please, don't assign Matthias r? compiler |
|
@bors r+ rollup |
| error[E0425]: cannot find type `B` in this scope | ||
| --> $DIR/undeclared-generic-parameter.rs:2:8 | ||
| | | ||
| LL | struct A; | ||
| | --------- similarly named struct `A` defined here | ||
| LL | impl A<B> {} | ||
| | ^ | ||
| | | ||
| help: a struct with a similar name exists | ||
| | | ||
| LL - impl A<B> {} | ||
| LL + impl A<A> {} | ||
| | | ||
| help: you might be missing a type parameter | ||
| | | ||
| LL | impl<B> A<B> {} | ||
| | +++ |
There was a problem hiding this comment.
(Not for this PR) It'd be nice if we didn't provide any suggestion in this case and instead mentioned that A takes no parameter (at this place, same thing for struct A<T> and impl<T> A<T, K> {} so that we emit a single error instead of two, but this is [p-low].
…tebank
diagnostics: avoid ICE for undeclared generic parameter in impl
Avoid an ICE for:
struct A;
impl A<B> {}
The compiler no longer panics and can proceed to emit existing diagnostics.
Adds `tests/ui/missing/undeclared-generic-parameter.rs`.
Fixes rust-lang#154165 and introduced by rust-lang#152913
…tebank
diagnostics: avoid ICE for undeclared generic parameter in impl
Avoid an ICE for:
struct A;
impl A<B> {}
The compiler no longer panics and can proceed to emit existing diagnostics.
Adds `tests/ui/missing/undeclared-generic-parameter.rs`.
Fixes rust-lang#154165 and introduced by rust-lang#152913
…tebank
diagnostics: avoid ICE for undeclared generic parameter in impl
Avoid an ICE for:
struct A;
impl A<B> {}
The compiler no longer panics and can proceed to emit existing diagnostics.
Adds `tests/ui/missing/undeclared-generic-parameter.rs`.
Fixes rust-lang#154165 and introduced by rust-lang#152913
…uwer Rollup of 7 pull requests Successful merges: - #122668 (Add APIs for dealing with titlecase) - #153312 (Packages as namespaces part 1) - #153534 (Remove a flaky `got_timeout` assert from two channel tests) - #154094 (add neon load/store assembly test) - #154175 (Add new alias for Guillaume Gomez email address) - #154182 (diagnostics: avoid ICE for undeclared generic parameter in impl) - #154188 (Update the tracking issue for #[diagnostic::on_move])
…tebank
diagnostics: avoid ICE for undeclared generic parameter in impl
Avoid an ICE for:
struct A;
impl A<B> {}
The compiler no longer panics and can proceed to emit existing diagnostics.
Adds `tests/ui/missing/undeclared-generic-parameter.rs`.
Fixes rust-lang#154165 and introduced by rust-lang#152913
Rollup of 6 pull requests Successful merges: - #122668 (Add APIs for dealing with titlecase) - #153312 (Packages as namespaces part 1) - #153534 (Remove a flaky `got_timeout` assert from two channel tests) - #154175 (Add new alias for Guillaume Gomez email address) - #154182 (diagnostics: avoid ICE for undeclared generic parameter in impl) - #154188 (Update the tracking issue for #[diagnostic::on_move])
…tebank
diagnostics: avoid ICE for undeclared generic parameter in impl
Avoid an ICE for:
struct A;
impl A<B> {}
The compiler no longer panics and can proceed to emit existing diagnostics.
Adds `tests/ui/missing/undeclared-generic-parameter.rs`.
Fixes rust-lang#154165 and introduced by rust-lang#152913
Rollup of 7 pull requests Successful merges: - #122668 (Add APIs for dealing with titlecase) - #153312 (Packages as namespaces part 1) - #153534 (Remove a flaky `got_timeout` assert from two channel tests) - #154175 (Add new alias for Guillaume Gomez email address) - #154182 (diagnostics: avoid ICE for undeclared generic parameter in impl) - #154188 (Update the tracking issue for #[diagnostic::on_move]) - #154201 (Use enums to clarify `DepNodeColorMap` color marking )
…tebank
diagnostics: avoid ICE for undeclared generic parameter in impl
Avoid an ICE for:
struct A;
impl A<B> {}
The compiler no longer panics and can proceed to emit existing diagnostics.
Adds `tests/ui/missing/undeclared-generic-parameter.rs`.
Fixes rust-lang#154165 and introduced by rust-lang#152913
Rollup of 9 pull requests Successful merges: - #122668 (Add APIs for dealing with titlecase) - #153312 (Packages as namespaces part 1) - #153534 (Remove a flaky `got_timeout` assert from two channel tests) - #153582 (Simplify find_attr! for HirId usage) - #154174 (allow `incomplete_features` in most UI tests) - #154175 (Add new alias for Guillaume Gomez email address) - #154182 (diagnostics: avoid ICE for undeclared generic parameter in impl) - #154188 (Update the tracking issue for #[diagnostic::on_move]) - #154201 (Use enums to clarify `DepNodeColorMap` color marking )
…tebank
diagnostics: avoid ICE for undeclared generic parameter in impl
Avoid an ICE for:
struct A;
impl A<B> {}
The compiler no longer panics and can proceed to emit existing diagnostics.
Adds `tests/ui/missing/undeclared-generic-parameter.rs`.
Fixes rust-lang#154165 and introduced by rust-lang#152913
|
@bors try jobs=x86_64-gnu-aux |
This comment has been minimized.
This comment has been minimized.
diagnostics: avoid ICE for undeclared generic parameter in impl try-job: x86_64-gnu-aux
…tebank
diagnostics: avoid ICE for undeclared generic parameter in impl
Avoid an ICE for:
struct A;
impl A<B> {}
The compiler no longer panics and can proceed to emit existing diagnostics.
Adds `tests/ui/missing/undeclared-generic-parameter.rs`.
Fixes rust-lang#154165 and introduced by rust-lang#152913
…tebank
diagnostics: avoid ICE for undeclared generic parameter in impl
Avoid an ICE for:
struct A;
impl A<B> {}
The compiler no longer panics and can proceed to emit existing diagnostics.
Adds `tests/ui/missing/undeclared-generic-parameter.rs`.
Fixes rust-lang#154165 and introduced by rust-lang#152913
…uwer Rollup of 22 pull requests Successful merges: - #122668 (Add APIs for dealing with titlecase) - #152543 (privacy: Fix type privacy holes in RPITITs) - #153107 (Optimize BTreeMap::append() using CursorMut) - #153312 (Packages as namespaces part 1) - #153534 (Remove a flaky `got_timeout` assert from two channel tests) - #153718 (Fix environ on FreeBSD with cdylib targets that use -Wl,--no-undefined .) - #153857 (Rename `target.abi` to `target.cfg_abi` and enum-ify llvm_abiname) - #153880 (Lifted intersperse and intersperse_with Fused transformation and updated documentation + tests) - #153931 (remove usages of to-be-deprecated numeric constants) - #150630 (Unknown -> Unsupported compression algorithm) - #153491 (Move `freeze_*` methods to `OpenOptionsExt2`) - #153582 (Simplify find_attr! for HirId usage) - #153623 (std: move `sys::pal::os` to `sys::paths`) - #153647 (docs(fs): Clarify That File::lock Coordinates Across Processes) - #153936 (Skip stack_start_aligned for immediate-abort) - #154011 (implement `BinaryHeap::as_mut_slice`) - #154167 (ui/lto: move and rename two tests from issues/) - #154174 (allow `incomplete_features` in most UI tests) - #154175 (Add new alias for Guillaume Gomez email address) - #154182 (diagnostics: avoid ICE for undeclared generic parameter in impl) - #154188 (Update the tracking issue for #[diagnostic::on_move]) - #154201 (Use enums to clarify `DepNodeColorMap` color marking )
Avoid an ICE for:
The compiler no longer panics and can proceed to emit existing diagnostics.
Adds
tests/ui/missing/undeclared-generic-parameter.rs.Fixes #154165 and introduced by #152913