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

Hide niches under UnsafeCell #68491

Merged
merged 4 commits into from
Feb 11, 2020

Conversation

pnkfelix
Copy link
Member

Hide any niche of T from type-construction context of UnsafeCell<T>.

Fix #68303
Fix #68206

@rust-highfive
Copy link
Collaborator

r? @zackmdavis

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 23, 2020
@Centril
Copy link
Contributor

Centril commented Jan 23, 2020

cc @RalfJung @rkruppe

@eddyb
Copy link
Member

eddyb commented Jan 24, 2020

Was the choice of #[repr(no_niche)] discussed, as opposed to making just UnsafeCell special?
I might be missing something, but I don't think there are other planned uses for #[repr(no_niche)].

@pnkfelix
Copy link
Member Author

Was the choice of #[repr(no_niche)] discussed, as opposed to making just UnsafeCell special?

We did discuss it at the relevant lang team meeting. I think it is fair to say that no one there was a strong champion of the #[repr(no_niche)] approach.

I nonetheless went with it.

It is more readily adaptable if we discover other cases that should be treated like this.

It is also more flexible: for example, if we decide that we want Cell<T> to expose its niche, then we could rewrite the stdlib this way, without having to modify rustc:

#[lang = "unsafe_cell"]
#[repr(transparent)]
struct UnsafeCellWithExposedNiche<T: ?Sized> {
    value: T,
}

#[repr(transparent)]
#[repr(no_niche)]
pub struct UnsafeCell<T: ?Sized> {
    value: UnsafeCellWithExposedNiche<T>,
}

#[repr(transparent)]
pub struct Cell<T: ?Sized> {
    value: UnsafeCellWithExposedNiche<T>,
}

@nikomatsakis
Copy link
Contributor

I didn't give a super detailed review, but this looks good to me. I think that having repr(no_niche) seems fine, as long as it's considered a pure implementation detail of rustc for now.

src/librustc/ty/layout.rs Outdated Show resolved Hide resolved
@oli-obk
Copy link
Contributor

oli-obk commented Jan 27, 2020

@bors r+

@bors
Copy link
Contributor

bors commented Jan 27, 2020

📌 Commit c29be616278e583b76d8aa2d486585ae8112c1c2 has been approved by oli-obk

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 27, 2020
@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-7 of your PR failed (pretty log, raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
2020-01-27T16:18:02.7224755Z ========================== Starting Command Output ===========================
2020-01-27T16:18:02.7226774Z [command]/bin/bash --noprofile --norc /home/vsts/work/_temp/c62da082-4795-464a-881b-42917ccfb3e6.sh
2020-01-27T16:18:02.7226894Z 
2020-01-27T16:18:02.7229467Z ##[section]Finishing: Disable git automatic line ending conversion
2020-01-27T16:18:02.7235409Z ##[section]Starting: Checkout rust-lang/rust@refs/pull/68491/merge to s
2020-01-27T16:18:02.7237017Z Task         : Get sources
2020-01-27T16:18:02.7237052Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
2020-01-27T16:18:02.7237087Z Version      : 1.0.0
2020-01-27T16:18:02.7237171Z Author       : Microsoft
---
2020-01-27T16:18:03.4886235Z ##[command]git remote add origin https://github.com/rust-lang/rust
2020-01-27T16:18:03.4898004Z ##[command]git config gc.auto 0
2020-01-27T16:18:03.4900328Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2020-01-27T16:18:03.4902199Z ##[command]git config --get-all http.proxy
2020-01-27T16:18:03.4908342Z ##[command]git -c http.extraheader="AUTHORIZATION: basic ***" fetch --force --tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/*:refs/remotes/origin/* +refs/pull/68491/merge:refs/remotes/pull/68491/merge
---
2020-01-27T17:01:11.7137876Z .................................................................................................... 1700/9560
2020-01-27T17:01:16.3011378Z .................................................................................................... 1800/9560
2020-01-27T17:01:27.2484351Z ........................i........................................................................... 1900/9560
2020-01-27T17:01:33.4646877Z .................................................................................................... 2000/9560
2020-01-27T17:01:46.0753314Z ..............iiiii................................................................................. 2100/9560
2020-01-27T17:01:54.8512412Z .................................................................................................... 2300/9560
2020-01-27T17:01:57.0980845Z .................................................................................................... 2400/9560
2020-01-27T17:02:01.9563456Z .................................................................................................... 2500/9560
2020-01-27T17:02:19.3669053Z .................................................................................................... 2600/9560
---
2020-01-27T17:04:39.4055561Z .................................................................................................... 4800/9560
2020-01-27T17:04:44.0167922Z ..........................................................i...............i......................... 4900/9560
2020-01-27T17:04:51.2962145Z .................................................................................................... 5000/9560
2020-01-27T17:04:58.4533008Z .................................................................................................... 5100/9560
2020-01-27T17:05:02.9121015Z .i.................................................................................................. 5200/9560
2020-01-27T17:05:12.6488662Z ..........................................................................ii.ii........i...i........ 5300/9560
2020-01-27T17:05:20.3739680Z .............i...................................................................................... 5500/9560
2020-01-27T17:05:29.3072897Z .................................................................................................... 5600/9560
2020-01-27T17:05:35.0751212Z ..............................................................i..................................... 5700/9560
2020-01-27T17:05:41.5915015Z .................................................................................................... 5800/9560
2020-01-27T17:05:41.5915015Z .................................................................................................... 5800/9560
2020-01-27T17:05:48.6309701Z .................................................................................................... 5900/9560
2020-01-27T17:05:56.6681243Z .....................................................ii...i..ii...........i......................... 6000/9560
2020-01-27T17:06:18.0268278Z .................................................................................................... 6200/9560
2020-01-27T17:06:23.0355227Z .................................................................................................... 6300/9560
2020-01-27T17:06:27.4226841Z .................................................................................i...ii............. 6400/9560
2020-01-27T17:06:40.9643738Z .................................................................................................... 6500/9560
---
2020-01-27T17:08:40.8846379Z ............................................................................................F....... 7600/9560
2020-01-27T17:08:46.0099752Z .................................................................................................... 7700/9560
2020-01-27T17:08:52.6019469Z .................................................................................................... 7800/9560
2020-01-27T17:09:02.8818595Z .................................................................................................... 7900/9560
2020-01-27T17:09:08.8567243Z ...............iiiiiii.............................................................................. 8000/9560
2020-01-27T17:09:22.3896133Z .................................................................................................... 8200/9560
2020-01-27T17:09:32.0886770Z .................................................................................................... 8300/9560
2020-01-27T17:09:43.9008666Z .................................................................................................... 8400/9560
2020-01-27T17:09:50.0924184Z .................................................................................................... 8500/9560
---
2020-01-27T17:11:37.0714291Z 
2020-01-27T17:11:37.0714332Z 
2020-01-27T17:11:37.0714359Z 
2020-01-27T17:11:37.0714416Z The actual stderr differed from the expected stderr.
2020-01-27T17:11:37.0714725Z Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/repr/repr-no-niche/repr-no-niche.stderr
2020-01-27T17:11:37.0714988Z To update references, rerun the tests and pass the `--bless` flag
2020-01-27T17:11:37.0715245Z To only update this specific test, also pass `--test-args repr/repr-no-niche.rs`
2020-01-27T17:11:37.0715345Z error: 1 errors occurred comparing output.
2020-01-27T17:11:37.0715394Z status: exit code: 0
2020-01-27T17:11:37.0715394Z status: exit code: 0
2020-01-27T17:11:37.0716340Z command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/repr/repr-no-niche.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/repr/repr-no-niche/a" "-Crpath" "-O" "-Cdebuginfo=0" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/repr/repr-no-niche/auxiliary"
2020-01-27T17:11:37.0716711Z ------------------------------------------
2020-01-27T17:11:37.0716745Z 
2020-01-27T17:11:37.0716978Z ------------------------------------------
2020-01-27T17:11:37.0717023Z stderr:
---
2020-01-27T17:11:37.0740893Z thread 'main' panicked at 'Some tests failed', src/tools/compiletest/src/main.rs:349:22
2020-01-27T17:11:37.0741071Z note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
2020-01-27T17:11:37.0756566Z 
2020-01-27T17:11:37.0756664Z 
2020-01-27T17:11:37.0758556Z command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/compiletest" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/compiletest" "--compile-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib" "--run-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "--rustc-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "--src-base" "/checkout/src/test/ui" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui" "--stage-id" "stage2-x86_64-unknown-linux-gnu" "--mode" "ui" "--target" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/usr/lib/llvm-7/bin/FileCheck" "--host-rustcflags" "-Crpath -O -Cdebuginfo=0 -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--target-rustcflags" "-Crpath -O -Cdebuginfo=0 -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--docck-python" "/usr/bin/python2.7" "--lldb-python" "/usr/bin/python2.7" "--gdb" "/usr/bin/gdb" "--quiet" "--llvm-version" "7.0.0\n" "--system-llvm" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--llvm-cxxflags" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"
2020-01-27T17:11:37.0758833Z 
2020-01-27T17:11:37.0758879Z 
2020-01-27T17:11:37.0764764Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
2020-01-27T17:11:37.0764838Z Build completed unsuccessfully in 0:49:01
2020-01-27T17:11:37.0764838Z Build completed unsuccessfully in 0:49:01
2020-01-27T17:11:37.0825109Z == clock drift check ==
2020-01-27T17:11:37.0848604Z   local time: Mon Jan 27 17:11:37 UTC 2020
2020-01-27T17:11:37.6381938Z   network time: Mon, 27 Jan 2020 17:11:37 GMT
2020-01-27T17:11:37.6382175Z == end clock drift check ==
2020-01-27T17:11:38.2799560Z 
2020-01-27T17:11:38.2891564Z ##[error]Bash exited with code '1'.
2020-01-27T17:11:38.2904106Z ##[section]Finishing: Run build
2020-01-27T17:11:38.2923648Z ##[section]Starting: Checkout rust-lang/rust@refs/pull/68491/merge to s
2020-01-27T17:11:38.2925631Z Task         : Get sources
2020-01-27T17:11:38.2925698Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
2020-01-27T17:11:38.2925748Z Version      : 1.0.0
2020-01-27T17:11:38.2925793Z Author       : Microsoft
2020-01-27T17:11:38.2925793Z Author       : Microsoft
2020-01-27T17:11:38.2925858Z Help         : [More Information](https://go.microsoft.com/fwlink/?LinkId=798199)
2020-01-27T17:11:38.2925911Z ==============================================================================
2020-01-27T17:11:38.7224103Z Cleaning any cached credential from repository: rust-lang/rust (GitHub)
2020-01-27T17:11:38.7265003Z ##[section]Finishing: Checkout rust-lang/rust@refs/pull/68491/merge to s
2020-01-27T17:11:38.7389205Z Cleaning up task key
2020-01-27T17:11:38.7390593Z Start cleaning up orphan processes.
2020-01-27T17:11:38.7493116Z Terminate orphan process: pid (3613) (python)
2020-01-27T17:11:38.7776714Z ##[section]Finishing: Finalize Job

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@oli-obk
Copy link
Contributor

oli-obk commented Jan 27, 2020

@bors r-

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jan 27, 2020
@pnkfelix
Copy link
Member Author

(I lost the race with PR #68122; I'll rebase atop current master and update the test to remove #![feature(transparent_enums)])

@pnkfelix pnkfelix force-pushed the hide-niches-under-unsafe-cell branch 2 times, most recently from 64e541b to 5649128 Compare January 28, 2020 02:50
@pnkfelix
Copy link
Member Author

@bors r=oli

@bors
Copy link
Contributor

bors commented Jan 28, 2020

📌 Commit 56491287a37cbd684c341c8c0d982ac215ff9dfc has been approved by oli

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jan 28, 2020
@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-7 of your PR failed (pretty log, raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
2020-01-28T02:50:46.8117781Z ========================== Starting Command Output ===========================
2020-01-28T02:50:46.8121494Z [command]/bin/bash --noprofile --norc /home/vsts/work/_temp/91596910-63bc-4168-9e17-62d03d9c6cb3.sh
2020-01-28T02:50:46.8952355Z 
2020-01-28T02:50:46.9031384Z ##[section]Finishing: Disable git automatic line ending conversion
2020-01-28T02:50:46.9037215Z ##[section]Starting: Checkout rust-lang/rust@refs/pull/68491/merge to s
2020-01-28T02:50:46.9038785Z Task         : Get sources
2020-01-28T02:50:46.9038822Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
2020-01-28T02:50:46.9038902Z Version      : 1.0.0
2020-01-28T02:50:46.9038938Z Author       : Microsoft
---
2020-01-28T02:50:51.9835491Z ##[command]git remote add origin https://github.com/rust-lang/rust
2020-01-28T02:50:52.0091384Z ##[command]git config gc.auto 0
2020-01-28T02:50:52.0175660Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2020-01-28T02:50:52.0230339Z ##[command]git config --get-all http.proxy
2020-01-28T02:50:52.0358153Z ##[command]git -c http.extraheader="AUTHORIZATION: basic ***" fetch --force --tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/*:refs/remotes/origin/* +refs/pull/68491/merge:refs/remotes/pull/68491/merge
---
2020-01-28T02:56:53.0717845Z     Finished release [optimized] target(s) in 1m 10s
2020-01-28T02:56:53.0850225Z tidy check
2020-01-28T02:56:54.4871956Z * 589 error codes
2020-01-28T02:56:54.4872986Z * highest error code: E0746
2020-01-28T02:56:54.5270073Z tidy error: /checkout/src/librustc_feature/active.rs:194: feature compiler_builtins is not sorted by "since" (version number)
2020-01-28T02:56:55.6930770Z some tidy checks failed
2020-01-28T02:56:55.6963400Z Found 487 error codes
2020-01-28T02:56:55.6963734Z Found 0 error codes with no tests
2020-01-28T02:56:55.6963899Z Done!
2020-01-28T02:56:55.6963899Z Done!
2020-01-28T02:56:55.6964027Z 
2020-01-28T02:56:55.6964171Z 
2020-01-28T02:56:55.6965246Z command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/tidy" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/tidy" "/checkout/src" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "--no-vendor"
2020-01-28T02:56:55.6965775Z 
2020-01-28T02:56:55.6965896Z 
2020-01-28T02:56:55.6966059Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test src/tools/tidy
2020-01-28T02:56:55.6966212Z Build completed unsuccessfully in 0:01:20
2020-01-28T02:56:55.6966212Z Build completed unsuccessfully in 0:01:20
2020-01-28T02:56:55.6991702Z == clock drift check ==
2020-01-28T02:56:55.7005084Z   local time: Tue Jan 28 02:56:55 UTC 2020
2020-01-28T02:56:55.8657110Z   network time: Tue, 28 Jan 2020 02:56:55 GMT
2020-01-28T02:56:55.8663758Z == end clock drift check ==
2020-01-28T02:56:56.7325129Z 
2020-01-28T02:56:56.7390247Z ##[error]Bash exited with code '1'.
2020-01-28T02:56:56.7401547Z ##[section]Finishing: Run build
2020-01-28T02:56:56.7415630Z ##[section]Starting: Checkout rust-lang/rust@refs/pull/68491/merge to s
2020-01-28T02:56:56.7417389Z Task         : Get sources
2020-01-28T02:56:56.7417441Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
2020-01-28T02:56:56.7417507Z Version      : 1.0.0
2020-01-28T02:56:56.7417551Z Author       : Microsoft
2020-01-28T02:56:56.7417551Z Author       : Microsoft
2020-01-28T02:56:56.7417599Z Help         : [More Information](https://go.microsoft.com/fwlink/?LinkId=798199)
2020-01-28T02:56:56.7417667Z ==============================================================================
2020-01-28T02:56:57.1222336Z Cleaning any cached credential from repository: rust-lang/rust (GitHub)
2020-01-28T02:56:57.1262197Z ##[section]Finishing: Checkout rust-lang/rust@refs/pull/68491/merge to s
2020-01-28T02:56:57.1370699Z Cleaning up task key
2020-01-28T02:56:57.1371489Z Start cleaning up orphan processes.
2020-01-28T02:56:57.2323758Z Terminate orphan process: pid (4042) (python)
2020-01-28T02:56:57.2341992Z ##[section]Finishing: Finalize Job

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@pnkfelix
Copy link
Member Author

pnkfelix commented Jan 28, 2020

👉 "who's got two thumbs and thought 'surely nothing bad could happen if I just change the issue number in the feature meta-data to point at this PR rather than the issue, and move the meta-data record to a more appropriate spot in the list!' ...? This guy!" 👈

@nikomatsakis
Copy link
Contributor

@pnkfelix I think I would prefer to have a true tracking issue, myself, versus pointing to this PR. It'd be great to link to (e.g.) the write-up that I did, the original issue, and to give some context about how this mechanism is rustc-internal and not expected to be stabilized.

@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-7 of your PR failed (pretty log, raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
2020-01-28T07:01:13.7861333Z ========================== Starting Command Output ===========================
2020-01-28T07:01:13.7862832Z [command]/bin/bash --noprofile --norc /home/vsts/work/_temp/a39617b3-95a0-4a18-9202-11101aba45b8.sh
2020-01-28T07:01:13.7862867Z 
2020-01-28T07:01:13.7866318Z ##[section]Finishing: Disable git automatic line ending conversion
2020-01-28T07:01:13.7872036Z ##[section]Starting: Checkout rust-lang/rust@refs/pull/68491/merge to s
2020-01-28T07:01:13.7873589Z Task         : Get sources
2020-01-28T07:01:13.7873623Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
2020-01-28T07:01:13.7873697Z Version      : 1.0.0
2020-01-28T07:01:13.7873730Z Author       : Microsoft
---
2020-01-28T07:01:14.5748009Z ##[command]git remote add origin https://github.com/rust-lang/rust
2020-01-28T07:01:14.5844616Z ##[command]git config gc.auto 0
2020-01-28T07:01:14.5901556Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2020-01-28T07:01:14.5950277Z ##[command]git config --get-all http.proxy
2020-01-28T07:01:14.6079538Z ##[command]git -c http.extraheader="AUTHORIZATION: basic ***" fetch --force --tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/*:refs/remotes/origin/* +refs/pull/68491/merge:refs/remotes/pull/68491/merge
---
2020-01-28T07:50:39.5379938Z .................................................................................................... 1700/9561
2020-01-28T07:50:44.0220500Z .................................................................................................... 1800/9561
2020-01-28T07:50:55.3498834Z .........................i.......................................................................... 1900/9561
2020-01-28T07:51:01.7578122Z .................................................................................................... 2000/9561
2020-01-28T07:51:14.6130540Z ...............iiiii................................................................................ 2100/9561
2020-01-28T07:51:23.5054133Z .................................................................................................... 2300/9561
2020-01-28T07:51:25.6495661Z .................................................................................................... 2400/9561
2020-01-28T07:51:30.2016408Z .................................................................................................... 2500/9561
2020-01-28T07:51:48.4933088Z .................................................................................................... 2600/9561
---
2020-01-28T07:54:11.5007038Z .................................................................................................... 4800/9561
2020-01-28T07:54:16.3691860Z ...........................................................i...............i........................ 4900/9561
2020-01-28T07:54:23.6910496Z .................................................................................................... 5000/9561
2020-01-28T07:54:30.9799698Z .................................................................................................... 5100/9561
2020-01-28T07:54:35.4939996Z ..i................................................................................................. 5200/9561
2020-01-28T07:54:45.6422767Z ...........................................................................ii.ii........i...i....... 5300/9561
2020-01-28T07:54:53.7096120Z ..............i..................................................................................... 5500/9561
2020-01-28T07:55:02.4195236Z .................................................................................................... 5600/9561
2020-01-28T07:55:08.6918018Z ...............................................................i.................................... 5700/9561
2020-01-28T07:55:15.3534133Z .................................................................................................... 5800/9561
2020-01-28T07:55:15.3534133Z .................................................................................................... 5800/9561
2020-01-28T07:55:22.4674129Z .................................................................................................... 5900/9561
2020-01-28T07:55:30.5916878Z ......................................................ii...i..ii...........i........................ 6000/9561
2020-01-28T07:55:49.9409435Z .................................................................................................... 6200/9561
2020-01-28T07:55:53.6237435Z .................................................................................................... 6300/9561
2020-01-28T07:55:53.6237435Z .................................................................................................... 6300/9561
2020-01-28T07:55:57.5666147Z ..................................................................................i..ii............. 6400/9561
2020-01-28T07:56:19.0044100Z .................................................................................................... 6600/9561
2020-01-28T07:56:26.7610292Z ..........................................................i......................................... 6700/9561
2020-01-28T07:56:28.7172322Z .................................................................................................... 6800/9561
2020-01-28T07:56:30.8026595Z .........................................................i.......................................... 6900/9561
---
2020-01-28T07:58:02.6163108Z ...................................................................F................................ 7600/9561
2020-01-28T07:58:07.6732299Z .................................................................................................... 7700/9561
2020-01-28T07:58:13.8579282Z .................................................................................................... 7800/9561
2020-01-28T07:58:24.0203403Z .................................................................................................... 7900/9561
2020-01-28T07:58:29.6773611Z ................iiiiiii............................................................................. 8000/9561
2020-01-28T07:58:42.8516188Z .................................................................................................... 8200/9561
2020-01-28T07:58:52.0990259Z .................................................................................................... 8300/9561
2020-01-28T07:59:04.3705817Z .................................................................................................... 8400/9561
2020-01-28T07:59:10.6603478Z .................................................................................................... 8500/9561
---
2020-01-28T08:00:51.6543321Z 
2020-01-28T08:00:51.6544023Z ---- [ui] ui/repr/feature-gate-no-niche.rs stdout ----
2020-01-28T08:00:51.6544220Z diff of stderr:
2020-01-28T08:00:51.6544341Z 
2020-01-28T08:00:51.6544471Z 4 LL | #[repr(no_niche)]
2020-01-28T08:00:51.6544729Z 6    |
2020-01-28T08:00:51.6544729Z 6    |
2020-01-28T08:00:51.6545251Z -    = note: for more information, see ***/issues/68303
2020-01-28T08:00:51.6545822Z +    = note: for more information, see ***/issues/68491
2020-01-28T08:00:51.6545992Z 8    = help: add `#![feature(no_niche)]` to the crate attributes to enable
2020-01-28T08:00:51.6546130Z 9 
2020-01-28T08:00:51.6546260Z 10 error[E0658]: the attribute `repr(no_niche)` is currently unstable
2020-01-28T08:00:51.6546381Z 
2020-01-28T08:00:51.6546520Z 13 LL | #[repr(transparent, no_niche)]
2020-01-28T08:00:51.6546779Z 15    |
2020-01-28T08:00:51.6546779Z 15    |
2020-01-28T08:00:51.6547151Z -    = note: for more information, see ***/issues/68303
2020-01-28T08:00:51.6547547Z +    = note: for more information, see ***/issues/68491
2020-01-28T08:00:51.6547696Z 17    = help: add `#![feature(no_niche)]` to the crate attributes to enable
2020-01-28T08:00:51.6547821Z 18 
2020-01-28T08:00:51.6547963Z 19 error[E0658]: the attribute `repr(no_niche)` is currently unstable
2020-01-28T08:00:51.6548067Z 
2020-01-28T08:00:51.6548188Z 22 LL | #[repr(no_niche)]
2020-01-28T08:00:51.6548450Z 24    |
2020-01-28T08:00:51.6548450Z 24    |
2020-01-28T08:00:51.6548821Z -    = note: for more information, see ***/issues/68303
2020-01-28T08:00:51.6549203Z +    = note: for more information, see ***/issues/68491
2020-01-28T08:00:51.6549351Z 26    = help: add `#![feature(no_niche)]` to the crate attributes to enable
2020-01-28T08:00:51.6549488Z 27 
2020-01-28T08:00:51.6549610Z 28 error[E0658]: the attribute `repr(no_niche)` is currently unstable
2020-01-28T08:00:51.6549714Z 
2020-01-28T08:00:51.6549849Z 31 LL | #[repr(no_niche)]
2020-01-28T08:00:51.6550085Z 33    |
2020-01-28T08:00:51.6550085Z 33    |
2020-01-28T08:00:51.6550460Z -    = note: for more information, see ***/issues/68303
2020-01-28T08:00:51.6550833Z +    = note: for more information, see ***/issues/68491
2020-01-28T08:00:51.6550994Z 35    = help: add `#![feature(no_niche)]` to the crate attributes to enable
2020-01-28T08:00:51.6551257Z 37 error: aborting due to 4 previous errors
2020-01-28T08:00:51.6551362Z 
2020-01-28T08:00:51.6551461Z 
2020-01-28T08:00:51.6551584Z The actual stderr differed from the expected stderr.
2020-01-28T08:00:51.6551584Z The actual stderr differed from the expected stderr.
2020-01-28T08:00:51.6551995Z Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/repr/feature-gate-no-niche/feature-gate-no-niche.stderr
2020-01-28T08:00:51.6552340Z To update references, rerun the tests and pass the `--bless` flag
2020-01-28T08:00:51.6552712Z To only update this specific test, also pass `--test-args repr/feature-gate-no-niche.rs`
2020-01-28T08:00:51.6552958Z error: 1 errors occurred comparing output.
2020-01-28T08:00:51.6553092Z status: exit code: 1
2020-01-28T08:00:51.6553092Z status: exit code: 1
2020-01-28T08:00:51.6554021Z command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/repr/feature-gate-no-niche.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/repr/feature-gate-no-niche" "-Crpath" "-O" "-Cdebuginfo=0" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/repr/feature-gate-no-niche/auxiliary" "-A" "unused"
2020-01-28T08:00:51.6554550Z ------------------------------------------
2020-01-28T08:00:51.6554669Z 
2020-01-28T08:00:51.6555002Z ------------------------------------------
2020-01-28T08:00:51.6555139Z stderr:
2020-01-28T08:00:51.6555139Z stderr:
2020-01-28T08:00:51.6555436Z ------------------------------------------
2020-01-28T08:00:51.6555597Z error[E0658]: the attribute `repr(no_niche)` is currently unstable
2020-01-28T08:00:51.6555921Z   --> /checkout/src/test/ui/repr/feature-gate-no-niche.rs:4:8
2020-01-28T08:00:51.6556072Z    |
2020-01-28T08:00:51.6556193Z LL | #[repr(no_niche)]
2020-01-28T08:00:51.6556443Z    |
2020-01-28T08:00:51.6556443Z    |
2020-01-28T08:00:51.6556884Z    = note: for more information, see ***/issues/68491
2020-01-28T08:00:51.6557046Z    = help: add `#![feature(no_niche)]` to the crate attributes to enable
2020-01-28T08:00:51.6557152Z 
2020-01-28T08:00:51.6557286Z error[E0658]: the attribute `repr(no_niche)` is currently unstable
2020-01-28T08:00:51.6557624Z   --> /checkout/src/test/ui/repr/feature-gate-no-niche.rs:8:21
2020-01-28T08:00:51.6557760Z    |
2020-01-28T08:00:51.6557881Z LL | #[repr(transparent, no_niche)]
2020-01-28T08:00:51.6558132Z    |
2020-01-28T08:00:51.6558132Z    |
2020-01-28T08:00:51.6558484Z    = note: for more information, see ***/issues/68491
2020-01-28T08:00:51.6558647Z    = help: add `#![feature(no_niche)]` to the crate attributes to enable
2020-01-28T08:00:51.6558751Z 
2020-01-28T08:00:51.6558875Z error[E0658]: the attribute `repr(no_niche)` is currently unstable
2020-01-28T08:00:51.6559215Z   --> /checkout/src/test/ui/repr/feature-gate-no-niche.rs:12:8
2020-01-28T08:00:51.6559357Z    |
2020-01-28T08:00:51.6559476Z LL | #[repr(no_niche)]
2020-01-28T08:00:51.6559725Z    |
2020-01-28T08:00:51.6559725Z    |
2020-01-28T08:00:51.6560103Z    = note: for more information, see ***/issues/68491
2020-01-28T08:00:51.6560252Z    = help: add `#![feature(no_niche)]` to the crate attributes to enable
2020-01-28T08:00:51.6560356Z 
2020-01-28T08:00:51.6560495Z error[E0658]: the attribute `repr(no_niche)` is currently unstable
2020-01-28T08:00:51.6560821Z   --> /checkout/src/test/ui/repr/feature-gate-no-niche.rs:16:8
2020-01-28T08:00:51.6560955Z    |
2020-01-28T08:00:51.6561088Z LL | #[repr(no_niche)]
2020-01-28T08:00:51.6561320Z    |
2020-01-28T08:00:51.6561320Z    |
2020-01-28T08:00:51.6561685Z    = note: for more information, see ***/issues/68491
2020-01-28T08:00:51.6561876Z    = help: add `#![feature(no_niche)]` to the crate attributes to enable
2020-01-28T08:00:51.6562221Z error: aborting due to 4 previous errors
2020-01-28T08:00:51.6562587Z 
2020-01-28T08:00:51.6562970Z For more information about this error, try `rustc --explain E0658`.
2020-01-28T08:00:51.6563486Z 
---
2020-01-28T08:00:51.6585242Z test result: FAILED. 9509 passed; 1 failed; 51 ignored; 0 measured; 0 filtered out
2020-01-28T08:00:51.6585336Z 
2020-01-28T08:00:51.6589356Z 
2020-01-28T08:00:51.6589424Z 
2020-01-28T08:00:51.6591299Z command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/compiletest" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/compiletest" "--compile-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib" "--run-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "--rustc-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "--src-base" "/checkout/src/test/ui" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui" "--stage-id" "stage2-x86_64-unknown-linux-gnu" "--mode" "ui" "--target" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/usr/lib/llvm-7/bin/FileCheck" "--host-rustcflags" "-Crpath -O -Cdebuginfo=0 -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--target-rustcflags" "-Crpath -O -Cdebuginfo=0 -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--docck-python" "/usr/bin/python2.7" "--lldb-python" "/usr/bin/python2.7" "--gdb" "/usr/bin/gdb" "--quiet" "--llvm-version" "7.0.0\n" "--system-llvm" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--llvm-cxxflags" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"
2020-01-28T08:00:51.6591602Z 
2020-01-28T08:00:51.6591643Z 
2020-01-28T08:00:51.6591942Z thread 'main' panicked at 'Some tests failed', src/tools/compiletest/src/main.rs:349:22
2020-01-28T08:00:51.6592003Z note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
2020-01-28T08:00:51.6592003Z note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
2020-01-28T08:00:51.6594714Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
2020-01-28T08:00:51.6594776Z Build completed unsuccessfully in 0:54:09
2020-01-28T08:00:51.6646691Z == clock drift check ==
2020-01-28T08:00:52.4629068Z   local time: Tue Jan 28 08:00:51 UTC 2020
2020-01-28T08:00:52.4643224Z   network time: Tue, 28 Jan 2020 08:00:52 GMT
2020-01-28T08:00:52.4643335Z == end clock drift check ==
2020-01-28T08:00:52.6214252Z 
2020-01-28T08:00:52.6296627Z ##[error]Bash exited with code '1'.
2020-01-28T08:00:52.6307412Z ##[section]Finishing: Run build
2020-01-28T08:00:52.6326509Z ##[section]Starting: Checkout rust-lang/rust@refs/pull/68491/merge to s
2020-01-28T08:00:52.6328304Z Task         : Get sources
2020-01-28T08:00:52.6328350Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
2020-01-28T08:00:52.6328396Z Version      : 1.0.0
2020-01-28T08:00:52.6328452Z Author       : Microsoft
2020-01-28T08:00:52.6328452Z Author       : Microsoft
2020-01-28T08:00:52.6328498Z Help         : [More Information](https://go.microsoft.com/fwlink/?LinkId=798199)
2020-01-28T08:00:52.6328550Z ==============================================================================
2020-01-28T08:00:53.0152238Z Cleaning any cached credential from repository: rust-lang/rust (GitHub)
2020-01-28T08:00:53.0192739Z ##[section]Finishing: Checkout rust-lang/rust@refs/pull/68491/merge to s
2020-01-28T08:00:53.0328128Z Cleaning up task key
2020-01-28T08:00:53.0329248Z Start cleaning up orphan processes.
2020-01-28T08:00:53.0426914Z Terminate orphan process: pid (4219) (python)
2020-01-28T08:00:53.0620426Z ##[section]Finishing: Finalize Job

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@Centril
Copy link
Contributor

Centril commented Jan 28, 2020

@nikomatsakis The standard approach to internal feature gates is to put them in the "internal feature gates" section without a tracking issue:

// -------------------------------------------------------------------------
// feature-group-start: internal feature gates
// -------------------------------------------------------------------------

@bors
Copy link
Contributor

bors commented Feb 6, 2020

⌛ Testing commit ea11b244d9793c9c7a2bcf61e95ea0f7e9aed6ec with merge 483c481cc8cd6bad32fedc84cd407fbf72f60149...

@bors
Copy link
Contributor

bors commented Feb 6, 2020

💥 Test timed out

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Feb 6, 2020
@bors
Copy link
Contributor

bors commented Feb 7, 2020

☔ The latest upstream changes (presumably #68933) made this pull request unmergeable. Please resolve the merge conflicts.

@pnkfelix pnkfelix added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 10, 2020
pnkfelix and others added 4 commits February 10, 2020 14:44
This repr-hint makes a struct/enum hide any niche within from its
surrounding type-construction context.

It is meant (at least initially) as an implementation detail for
resolving issue 68303. We will not stabilize the repr-hint unless
someone finds motivation for doing so.

(So, declaration of `no_niche` feature lives in section of file
where other internal implementation details are grouped, and
deliberately leaves out the tracking issue number.)

incorporated review feedback, and fixed post-rebase.
@pnkfelix pnkfelix force-pushed the hide-niches-under-unsafe-cell branch from ea11b24 to 1b12232 Compare February 10, 2020 19:44
@pnkfelix
Copy link
Member Author

@bors r=oli

@bors
Copy link
Contributor

bors commented Feb 11, 2020

📌 Commit 1b12232 has been approved by oli

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Feb 11, 2020
@jonas-schievink
Copy link
Contributor

@bors p=1

@bors
Copy link
Contributor

bors commented Feb 11, 2020

⌛ Testing commit 1b12232 with merge fc23a81...

bors added a commit that referenced this pull request Feb 11, 2020
Hide niches under UnsafeCell

Hide any niche of T from type-construction context of `UnsafeCell<T>`.

Fix #68303
Fix #68206
@bors
Copy link
Contributor

bors commented Feb 11, 2020

☀️ Test successful - checks-azure
Approved by: oli
Pushing fc23a81 to master...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet