Skip to content
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

Trait not imported with super::*; #112831

Closed
octavonce opened this issue Jun 20, 2023 · 9 comments · Fixed by #112847
Closed

Trait not imported with super::*; #112831

octavonce opened this issue Jun 20, 2023 · 9 comments · Fixed by #112847
Assignees
Labels
A-resolve Area: Name resolution C-bug Category: This is a bug. P-critical Critical priority regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@octavonce
Copy link

octavonce commented Jun 20, 2023

With the latest nightly, the bytemuck crate fails to compile. This was compiling yesterday and the issue seems to be traits are not imported with super::*. Please see the issue in the bytemuck repository: Lokathor/bytemuck#197

Meta

rustc --version --verbose:

rustc 1.72.0-nightly (fe7454bf4 2023-06-19)
binary: rustc
commit-hash: fe7454bf439c93cbe9ac8a8f7fcfacd5a40244c2
commit-date: 2023-06-19
host: x86_64-apple-darwin
release: 1.72.0-nightly
LLVM version: 16.0.5

Error output

error[E0404]: expected trait, found derive macro `NoUninit`
  --> /Users/octavonce/Projects/purple_coin/vendor/crates/bytemuck-1.13.1/src/allocation.rs:25:20
   |
25 | pub fn cast_box<A: NoUninit, B: AnyBitPattern>(input: Box<A>) -> Box<B> {
   |                    ^^^^^^^^ not a trait
   |
help: consider importing this trait instead
   |
12 + use crate::NoUninit;

@octavonce octavonce added C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jun 20, 2023
@Noratrieb
Copy link
Member

Regression in rust-lang-ci@bede4c2
searched nightlies: from nightly-2023-06-10 to nightly-2023-06-20
regressed nightly: nightly-2023-06-20
searched commit range: 2d0aa57...fe7454b
regressed commit: f217411

bisected with cargo-bisect-rustc v0.6.6

Host triple: x86_64-unknown-linux-gnu
Reproduce with:

cargo bisect-rustc 2023-06-10 --access github

#112758

cc @bvanjoi @petrochenkov

@Noratrieb Noratrieb added A-resolve Area: Name resolution regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. and removed I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ labels Jun 20, 2023
@rustbot rustbot added the I-prioritize Issue: Indicates that prioritization has been requested for this issue. label Jun 20, 2023
@Noratrieb
Copy link
Member

Noratrieb commented Jun 20, 2023

i made a mistake making the example, see below ```rust mod x { use std::fmt::Debug; }

use x::*;
impl Debug for () {}

This should error in coherence, but instead errors with

error[E0404]: expected trait, found derive macro Debug
--> src/main.rs:6:6
|
6 | impl Debug for () {}
| ^^^^^ not a trait
|
help: consider importing one of these items instead
|
5 + use core::fmt::Debug;
|
5 + use std::fmt::Debug;


It looks like if there is a derive macro and trait with the same name, glob imports don't resolve the trait anymore.

Note that
```rust
use std::fmt::*;

impl Debug for () {}

works correctly

@bvanjoi
Copy link
Contributor

bvanjoi commented Jun 20, 2023

Maybe the reduced it incorrect? I found that it also throw an error for 1.70?

https://godbolt.org/z/4zYfvMxaz

@lqd lqd changed the title ICE: Trait not imported with super::*; Trait not imported with super::*; Jun 20, 2023
@Noratrieb
Copy link
Member

hm, maybe your change simply exposed an existing bug in more cases

@bvanjoi
Copy link
Contributor

bvanjoi commented Jun 20, 2023

I will check it later @rustbot claim

@Noratrieb
Copy link
Member

ah no, I made a stupid mistake, i should have used pub use :D, my example only got Debug from the prelude which only contains the macro.

@bors bors closed this as completed in a34cead Jun 20, 2023
mmarx added a commit to knowsys/nemo that referenced this issue Jun 20, 2023
Work around a bug in `rustc-2023-06-19`:
rust-lang/rust#112831
mmarx added a commit to knowsys/nemo that referenced this issue Jun 20, 2023
Work around a bug in `rustc-2023-06-19`:
rust-lang/rust#112831
mmarx added a commit to knowsys/nemo that referenced this issue Jun 20, 2023
With rust-lang/rust#112831 fixed, we can
unpin the nightly toolchain again
@workingjubilee workingjubilee added P-critical Critical priority and removed I-prioritize Issue: Indicates that prioritization has been requested for this issue. labels Jun 20, 2023
@workingjubilee
Copy link
Member

This is resolved, of course. Only tagging this with Nilstrieb's estimated priority for historical analysis later.

@Pr0methean
Copy link

Now that this fix is merged, what time tonight should we expect a new nightly release?

@workingjubilee
Copy link
Member

0:00 according to a server somewhere. In practice, usually UTC 0:00. So it should be being cut sometime soon. Or 24 hours from now. Either one.

mmarx added a commit to knowsys/nemo that referenced this issue Jun 21, 2023
With rust-lang/rust#112831 fixed, we can
unpin the nightly toolchain again
mmarx added a commit to knowsys/nemo that referenced this issue Jun 21, 2023
With rust-lang/rust#112831 fixed, we can
unpin the nightly toolchain again
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-resolve Area: Name resolution C-bug Category: This is a bug. P-critical Critical priority regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants