-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Don't use guess_head_span
in predicates_of
for foreign span
#88414
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
include ../../run-make-fulldeps/tools.mk | ||
|
||
# ignore-none no-std is not supported | ||
# ignore-nvptx64-nvidia-cuda FIXME: can't find crate for 'std' | ||
|
||
# Ensure that modifying a crate on disk (without recompiling it) | ||
# does not cause ICEs in downstream crates. | ||
# Previously, we would call `SourceMap.guess_head_span` on a span | ||
# from an external crate, which would cause us to read an upstream | ||
# source file from disk during compilation of a downstream crate | ||
# See #86480 for more details | ||
|
||
INCR=$(TMPDIR)/incr | ||
|
||
all: | ||
cp first_crate.rs second_crate.rs $(TMPDIR) | ||
$(RUSTC) $(TMPDIR)/first_crate.rs -C incremental=$(INCR) --target $(TARGET) --crate-type lib | ||
$(RUSTC) $(TMPDIR)/second_crate.rs -C incremental=$(INCR) --target $(TARGET) --extern first-crate=$(TMPDIR) --crate-type lib | ||
rm $(TMPDIR)/first_crate.rs | ||
$(RUSTC) $(TMPDIR)/second_crate.rs -C incremental=$(INCR) --target $(TARGET) --cfg second_run --crate-type lib | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
pub trait OtherTrait {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
extern crate first_crate; | ||
use first_crate::OtherTrait; | ||
|
||
#[cfg(not(second_run))] | ||
trait Foo: OtherTrait {} | ||
|
||
#[cfg(second_run)] | ||
trait Bar: OtherTrait {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,8 +8,10 @@ LL | type C: Clone + Iterator<Item: Send + Iterator<Item: for<'a> Lam<&'a u8 | |
note: required by a bound in `Send` | ||
--> $SRC_DIR/core/src/marker.rs:LL:COL | ||
| | ||
LL | pub unsafe auto trait Send { | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Send` | ||
LL | / pub unsafe auto trait Send { | ||
LL | | // empty. | ||
LL | | } | ||
| |_^ required by this bound in `Send` | ||
help: consider further restricting the associated type | ||
| | ||
LL | trait Case1 where <<Self as Case1>::C as Iterator>::Item: Send { | ||
|
@@ -25,8 +27,14 @@ LL | type C: Clone + Iterator<Item: Send + Iterator<Item: for<'a> Lam<&'a u8 | |
note: required by a bound in `Iterator` | ||
--> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL | ||
| | ||
LL | pub trait Iterator { | ||
| ^^^^^^^^^^^^^^^^^^ required by this bound in `Iterator` | ||
LL | / pub trait Iterator { | ||
LL | | /// The type of the elements being iterated over. | ||
LL | | #[stable(feature = "rust1", since = "1.0.0")] | ||
LL | | type Item; | ||
... | | ||
LL | | } | ||
LL | | } | ||
| |_^ required by this bound in `Iterator` | ||
help: consider further restricting the associated type | ||
| | ||
LL | trait Case1 where <<Self as Case1>::C as Iterator>::Item: Iterator { | ||
|
@@ -42,8 +50,14 @@ LL | type C: Clone + Iterator<Item: Send + Iterator<Item: for<'a> Lam<&'a u8 | |
note: required by a bound in `Sync` | ||
--> $SRC_DIR/core/src/marker.rs:LL:COL | ||
| | ||
LL | pub unsafe auto trait Sync { | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Sync` | ||
LL | / pub unsafe auto trait Sync { | ||
LL | | // FIXME(estebank): once support to add notes in `rustc_on_unimplemented` | ||
LL | | // lands in beta, and it has been extended to check whether a closure is | ||
LL | | // anywhere in the requirement chain, extend it as such (#48534): | ||
Comment on lines
+54
to
+56
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh, this is... like being caught coming out of the shower 😅 |
||
... | | ||
LL | | // Empty | ||
LL | | } | ||
| |_^ required by this bound in `Sync` | ||
help: consider further restricting the associated type | ||
| | ||
LL | trait Case1 where <<Self as Case1>::C as Iterator>::Item: Sync { | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Seeing all of these I think we need to extend the metadata to have clearer wording here. We are pointing at a whole trait while saying "this bound in the trait". The trait itself is "the bound". I don't know what better wording would be.