Skip to content

Rollup of 10 pull requests #100593

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

Closed
wants to merge 27 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
374d4d8
Fix error message with non-tupled bare fn trait
compiler-errors Jul 30, 2022
9e52d22
Correct meaning of two UI tests
compiler-errors Jul 30, 2022
3fb249b
improve "try ignoring the field" diagnostic
GoldsteinE Aug 1, 2022
9b0edd0
Adjust span of fn arguments
compiler-errors Aug 12, 2022
cc6cff5
Replace - with _ in ftl slugs for better grepability
est31 Aug 10, 2022
6c4fc85
Update rustdoc to new slug style
est31 Aug 10, 2022
75d78b9
Fix tests
est31 Aug 10, 2022
ca16a8d
Change fluent_messages macro to expect _ slugs instead of - slugs
est31 Aug 10, 2022
3e0df4b
fix span_extend_to_next_char docs
GoldsteinE Aug 13, 2022
c436930
Delay span bug when failing to normalize negative coherence impl subj…
compiler-errors Aug 13, 2022
1e84973
Streamline `parse_path_start_expr`.
nnethercote Aug 14, 2022
2ef0479
Simplify attribute handling in `parse_bottom_expr`.
nnethercote Aug 14, 2022
84a0da6
Fix STD build for ESP-IDF
ivmarkov Aug 15, 2022
8453122
Revert "Revert "Remove num_cpus dependency from bootstrap, build-mani…
the8472 Aug 15, 2022
c4a5ac2
Handle correctly stripped enum variant fields
GuillaumeGomez Aug 15, 2022
36758a2
Add regression test for stripped enum variant fields
GuillaumeGomez Aug 15, 2022
44b489f
rustdoc: Mark imported items as retained
aDotInTheVoid Aug 9, 2022
337aec6
Rollup merge of #99942 - compiler-errors:nonsense-un-tupled-fn-trait-…
matthiaskrgr Aug 15, 2022
4c65cf7
Rollup merge of #100031 - GoldsteinE:try-removing-the-field, r=michae…
matthiaskrgr Aug 15, 2022
969f8af
Rollup merge of #100325 - aDotInTheVoid:rdj-import-impl, r=GuillaumeG…
matthiaskrgr Aug 15, 2022
117085f
Rollup merge of #100377 - est31:fluent_grepability, r=davidtwco
matthiaskrgr Aug 15, 2022
a71d2a9
Rollup merge of #100458 - compiler-errors:fn-argument-span, r=estebank
matthiaskrgr Aug 15, 2022
2968a75
Rollup merge of #100514 - compiler-errors:issue-100191, r=spastorino
matthiaskrgr Aug 15, 2022
526e8c1
Rollup merge of #100559 - nnethercote:parser-simplifications, r=compi…
matthiaskrgr Aug 15, 2022
eadb874
Rollup merge of #100568 - ivmarkov:master, r=Mark-Simulacrum
matthiaskrgr Aug 15, 2022
dacc4cd
Rollup merge of #100582 - GuillaumeGomez:rustdoc-json-stripped-enum-v…
matthiaskrgr Aug 15, 2022
cdfab3a
Rollup merge of #100586 - the8472:available_parallelism_2, r=jyn514
matthiaskrgr Aug 15, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Delay span bug when failing to normalize negative coherence impl subj…
…ect due to other malformed impls
  • Loading branch information
compiler-errors committed Aug 13, 2022
commit c436930f91a4befefa602f2d64d06fc9613d507b
8 changes: 7 additions & 1 deletion compiler/rustc_trait_selection/src/traits/coherence.rs
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,13 @@ fn negative_impl<'cx, 'tcx>(
tcx.impl_subject(impl1_def_id),
) {
Ok(s) => s,
Err(err) => bug!("failed to fully normalize {:?}: {:?}", impl1_def_id, err),
Err(err) => {
tcx.sess.delay_span_bug(
tcx.def_span(impl1_def_id),
format!("failed to fully normalize {:?}: {:?}", impl1_def_id, err),
);
return false;
}
};

// Attempt to prove that impl2 applies, given all of the above.
Expand Down
12 changes: 12 additions & 0 deletions src/test/ui/coherence/issue-100191-2.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
//~ ERROR overflow evaluating the requirement `T: Trait<_>`

#![feature(specialization, with_negative_coherence)]
#![allow(incomplete_features)]

pub trait Trait<T> {}

default impl<T, U> Trait<T> for U {}

impl<T> Trait<<T as Iterator>::Item> for T {}

fn main() {}
14 changes: 14 additions & 0 deletions src/test/ui/coherence/issue-100191-2.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
error[E0275]: overflow evaluating the requirement `T: Trait<_>`
|
= help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`issue_100191_2`)
note: required because of the requirements on the impl of `Trait<_>` for `T`
--> $DIR/issue-100191-2.rs:8:20
|
LL | default impl<T, U> Trait<T> for U {}
| ^^^^^^^^ ^
= note: 128 redundant requirements hidden
= note: required because of the requirements on the impl of `Trait<_>` for `T`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0275`.
21 changes: 21 additions & 0 deletions src/test/ui/coherence/issue-100191.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#![crate_type = "lib"]
#![feature(specialization, with_negative_coherence)]
#![allow(incomplete_features)]

trait X {}
trait Y: X {}
trait Z {
type Assoc: Y;
}
struct A<T>(T);

impl<T> Y for T where T: X {}
impl<T: X> Z for A<T> {
type Assoc = T;
}

// this impl is invalid, but causes an ICE anyway
impl<T> From<<A<T> as Z>::Assoc> for T {}
//~^ ERROR type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct<T>`)

fn main() {}
12 changes: 12 additions & 0 deletions src/test/ui/coherence/issue-100191.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct<T>`)
--> $DIR/issue-100191.rs:18:6
|
LL | impl<T> From<<A<T> as Z>::Assoc> for T {}
| ^ type parameter `T` must be used as the type parameter for some local type
|
= note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local
= note: only traits defined in the current crate can be implemented for a type parameter

error: aborting due to previous error

For more information about this error, try `rustc --explain E0210`.