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

Stability checker prevents return-position impl trait in the standard library #54283

Closed
scottmcm opened this issue Sep 17, 2018 · 9 comments
Closed
Labels
A-impl-trait Area: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch. A-stability Area: `#[stable]`, `#[unstable]` etc. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@scottmcm
Copy link
Member

scottmcm commented Sep 17, 2018

Previously hit here: #52896 (comment) (thanks, eddyb)

The way I hit this in a change I was trying:

   Compiling core v0.0.0 (file:///C:/src/rust/src/libcore)
←[0m←[1m←[38;5;9merror←[0m←[0m←[1m←[38;5;15m: This node does not have a stability attribute←[0m
←[0m   ←[0m←[0m←[1m←[38;5;14m--> ←[0m←[0mlibcore\num\f32.rs:604:35←[0m
←[0m    ←[0m←[0m←[1m←[38;5;14m|←[0m
←[0m←[1m←[38;5;14m604←[0m←[0m ←[0m←[0m←[1m←[38;5;14m| ←[0m←[0m    pub fn total_ordered(self) -> impl Ord {←[0m
←[0m    ←[0m←[0m←[1m←[38;5;14m| ←[0m←[0m                                  ←[0m←[0m←[1m←[38;5;9m^^^^^^^^←[0m

Instructions from oli-obk in #52896 (comment) :

Should be enough to add an arm to

hir::ItemKind::Impl(.., None, _, _) | hir::ItemKind::ForeignMod(..) => {}

for ItemExistential(ExistTy { parent_fn_id: Some(_) }) which also skips the check_missing_stability call

@hellow554
Copy link
Contributor

Your bash seems to use some fancy-dancy colors. Sadly github does not support control-sequences. Can you please edit your post and remove them? :)

@scottmcm
Copy link
Member Author

@hellow554 Sadly that's what I literally get on windows these days, from x.py:

image

@varkor varkor added the E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. label Oct 3, 2018
@ZerothLaw
Copy link

This looks like it is resolved - ran the exact same command @scottmcm used. Should this be closed?

@scottmcm
Copy link
Member Author

@ZerothLaw Had you added an impl Trait to core when testing? I hit it with this extra change: scottmcm@af0afa9#diff-14f327fd5e3b91eb2e9af0690596d156R604

@ZerothLaw
Copy link

Okay, made the change to f32, and the suggested fix in stability.rs (with some changes) ran the command, getting this error:

error[E0460]: found possibly newer version of crate std which rand depends on
--> libcore../libcore/tests/lib.rs:46:1
|
46 | extern crate rand;
| ^^^^^^^^^^^^^^^^^^
|
= note: perhaps that crate needs to be recompiled?
= note: the following crate versions were found:
crate std: \?\C:\Users\z\source\repos\rust\build\x86_64-pc-windows-msvc\stage1-std\x86_64-pc-windows-msvc\release\deps\libstd-d0b1266efb775c6b.rlib
crate std: \?\C:\Users\z\source\repos\rust\build\x86_64-pc-windows-msvc\stage1\lib\rustlib\x86_64-pc-windows-msvc\lib\libstd-d0b1266efb775c6b.rlib
crate std: \?\C:\Users\z\source\repos\rust\build\x86_64-pc-windows-msvc\stage1-std\x86_64-pc-windows-msvc\release\deps\std-d0b1266efb775c6b.dll
crate std: \?\C:\Users\z\source\repos\rust\build\x86_64-pc-windows-msvc\stage1\lib\rustlib\x86_64-pc-windows-msvc\lib\std-d0b1266efb775c6b.dll
crate rand: \?\C:\Users\z\source\repos\rust\build\x86_64-pc-windows-msvc\stage1-std\x86_64-pc-windows-msvc\release\deps\librand-7403067dcfff573d.rlib

error: aborting due to previous error

For more information about this error, try rustc --explain E0460.
error: Could not compile core.

To learn more, run the command again with --verbose.

command did not execute successfully: "C:\Users\z\source\repos\rust\build\x86_64-pc-windows-msvc\stage0\bin\cargo.exe" "test" "--target" "x86_64-pc-windows-msvc" "-j" "4" "--release" "--features" "panic-unwind backtrace" "--manifest-path" "C:\Users\z\source\repos\rust\src/libstd/Cargo.toml" "-p" "core" "--" "total" "--quiet"
expected success, got: exit code: 101

failed to run: C:\Users\z\source\repos\rust\build\bootstrap\debug\bootstrap test --incremental --keep-stage 0 --stage 1 src\libcore --test-args total
Build completed unsuccessfully in 0:00:41

@ZerothLaw
Copy link

This seems to now be resolved on latest master branch.

@TheSirC
Copy link

TheSirC commented Dec 5, 2018

Should this issue be closed @scottmcm ?

@jonas-schievink jonas-schievink added A-impl-trait Area: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch. A-stability Area: `#[stable]`, `#[unstable]` etc. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Feb 20, 2020
@workingjubilee
Copy link
Member

There appear to be many instances of -> impl FnMut and others in core, this issue should be closed.

@Florian-Schoenherr
Copy link

found this randomly on codetribute lol
@scottmcm can you close this? 😄

@jyn514 jyn514 closed this as completed Dec 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-impl-trait Area: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch. A-stability Area: `#[stable]`, `#[unstable]` etc. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

9 participants