Skip to content

Commit

Permalink
reverted tests to cope with "regression" back to printing leading `co…
Browse files Browse the repository at this point in the history
…re::`

The reason we see `core::` even after visiting the `std` crate first
is the special case code that looks like this:

```rust
    Entry::Occupied(mut entry) => {
        // If `child` is defined in crate `cnum`, ensure
        // that it is mapped to a parent in `cnum`.
        if child.krate == cnum && entry.get().krate != cnum {
            entry.insert(parent);
        }
    }
```

This causes items to be associated with the crates they were
originally defined in, even if we had encountered them during the
traversal of an earlier crate.

(Having said that, I am not clear on why this same logic does not
apply when both rust-lang#46708 and rust-lang#46838 have been applied. But at this
point, I am just happy to have a plausible explanation for why we see
`core::foo::bar` in the output for these tests, and want to focus on
getting this fix for rust-lang#46112 backported to beta.)
  • Loading branch information
pnkfelix committed Dec 21, 2017
1 parent 7db6372 commit 5f85764
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/test/compile-fail/issue-17959.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ struct G<T: ?Sized> {
}

impl<T> Drop for G<T> {
//~^ ERROR: The requirement `T: std::marker::Sized` is added only by the Drop impl. [E0367]
//~^ ERROR: The requirement `T: core::marker::Sized` is added only by the Drop impl. [E0367]
fn drop(&mut self) {
if !self._ptr.is_null() {
}
Expand Down
2 changes: 1 addition & 1 deletion src/test/compile-fail/kindck-send-unsafe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ fn assert_send<T:Send>() { }

fn test71<'a>() {
assert_send::<*mut &'a isize>();
//~^ ERROR `*mut &'a isize: std::marker::Send` is not satisfied
//~^ ERROR `*mut &'a isize: core::marker::Send` is not satisfied
}

fn main() {
Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/print_type_sizes/niche-filling.stdout
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,11 @@ print-type-size type: `MyOption<bool>`: 1 bytes, alignment: 1 bytes
print-type-size variant `None`: 0 bytes
print-type-size variant `Some`: 1 bytes
print-type-size field `.0`: 1 bytes
print-type-size type: `MyOption<std::cmp::Ordering>`: 1 bytes, alignment: 1 bytes
print-type-size type: `MyOption<core::cmp::Ordering>`: 1 bytes, alignment: 1 bytes
print-type-size variant `None`: 0 bytes
print-type-size variant `Some`: 1 bytes
print-type-size field `.0`: 1 bytes
print-type-size type: `std::cmp::Ordering`: 1 bytes, alignment: 1 bytes
print-type-size type: `core::cmp::Ordering`: 1 bytes, alignment: 1 bytes
print-type-size discriminant: 1 bytes
print-type-size variant `Less`: 0 bytes
print-type-size variant `Equal`: 0 bytes
Expand Down

0 comments on commit 5f85764

Please sign in to comment.