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

Rollup of 16 pull requests #47900

Merged
merged 40 commits into from
Jan 31, 2018
Merged

Rollup of 16 pull requests #47900

merged 40 commits into from
Jan 31, 2018

Conversation

oberien and others added 30 commits January 18, 2018 20:49
While testing rust-lang#47655 I was able to make the compiler panic
when it's compiled with debug assertions:

```shell
> rustc /dev/null --crate-type proc-macro

error: internal compiler error: unexpected panic

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports

note: rustc 1.25.0-dev running on x86_64-apple-darwin

note: run with `RUST_BACKTRACE=1` for a backtrace

thread 'rustc' panicked at 'attempt to subtract with overflow', librustc_errors/emitter.rs:287:49
```

Without debug assertions the following warning is emitted:

```shell
> rustc /dev/null --crate-type proc-macro

warning: unused variable: `registrar`
 --> /dev/null:0:1
  |
  |
  = note: #[warn(unused_variables)] on by default
  = note: to avoid this warning, consider using `_registrar` instead
```

The panic is due to the unused variable warning being spanned to
`/dev/null:0:1`. When `render_source_line` subtracts 1 from the line
number to look up the source line it panics due to underflow. Without
debug assertions this would wrap and cause us to return a blank string
instead.

Fix by explicitly testing for 0 and exiting early. I'm unsure how to
automatically test this now that rust-lang#46655 has been approved.
If the original name is uppercase, use camel case. Otherwise, use snake
case.
On MIPS, error number 98 is not EADDRINUSE (it is EPROTOTYPE). To fix the
resulting test failure this causes, use a more portable error number in
the example documentation. EINVAL shold be more reliable because it was
defined in the original Unix as 22 so hopefully most derivatives have
defined it the same way.
This copies what clang does. There is a long explanation as to why this
is needed in the clang source (tools/clang/lib/Basic/Targets/Mips.h).
This is a test of `target_feature`, which needs a rust-specific patch to
LLVM to add `MCSubtargetInfo::getFeatureTable()`.
I was testing out the tip support to see what's going on with wasm, and this was
I believe the only issue encountered with LLVM 7 support so far.
This commit adds a new option to target specifictions to specify that symbols
should be "hidden" visibility by default in LLVM. While there are no existing
targets that take advantage of this the `wasm32-unknown-unknown` target will
soon start to use this visibility. The LLD linker currently interprets `hidden`
as "don't export this from the wasm module" which is what we want for 90% of our
functions. While the LLD linker does have a "export this symbol" argument which
is what we use for other linkers, it was also somewhat easier to do this change
instead which'll involve less arguments flying around. Additionally there's no
need for non-`hidden` visibility for most of our symbols!

This change should not immediately impact the wasm targets as-is, but rather
this is laying the foundations for soon integrating LLD as a linker for wasm
code.
Since MSP430 doesn't meaningfully support faulting on illegal
instructions, LLVM generates a call to abort() function instead
of a trap instruction. Such calls are 4 bytes long, and that is
too much overhead for such small target.
…ochenkov

use correct casing for rename suggestions

If the original name is uppercase, use camel case. Otherwise, use snake
case.
Marked Debug implementations for primitive types as #[inline]

Change for issue rust-lang#47792.
Fix regression: account for trait methods in arg count mismatch error

Fixed rust-lang#47706 (rust-lang#47706 (comment))

Original PR rust-lang#47747 missed methods on trait definitions.

This edit was done in GitHub. I think I got the signature of the variant right, going by the ICE debug output and the other cases above.
…dtolnay

std: use more portable error number in from_raw_os_error docs

On MIPS, error number 98 is not `EADDRINUSE` (it is `EPROTOTYPE`). To fix the resulting test failure this causes, use a more portable error number in the example documentation. `EINVAL` shold be more reliable because it was defined in the original Unix as 22 so hopefully most derivatives have defined it the same way.
rustc_trans: clobber $1 (aka $at) on mips

This copies what clang does. There is a long explanation as to why this is needed in the clang source (tools/clang/lib/Basic/Targets/Mips.h).
…or, r=nikomatsakis

Update associated constants error message

Fixes rust-lang#47570.
Ignore run-pass/sse2 when using system LLVM

This is a test of `target_feature`, which needs a rust-specific patch to
LLVM to add `MCSubtargetInfo::getFeatureTable()`.
rustc: Add some defines for LLVM 7 compat

I was testing out the tip support to see what's going on with wasm, and this was
I believe the only issue encountered with LLVM 7 support so far.
…, r=cramertj

rustc: Add an option to default hidden visibility

This commit adds a new option to target specifictions to specify that symbols
should be "hidden" visibility by default in LLVM. While there are no existing
targets that take advantage of this the `wasm32-unknown-unknown` target will
soon start to use this visibility. The LLD linker currently interprets `hidden`
as "don't export this from the wasm module" which is what we want for 90% of our
functions. While the LLD linker does have a "export this symbol" argument which
is what we use for other linkers, it was also somewhat easier to do this change
instead which'll involve less arguments flying around. Additionally there's no
need for non-`hidden` visibility for most of our symbols!

This change should not immediately impact the wasm targets as-is, but rather
this is laying the foundations for soon integrating LLD as a linker for wasm
code.
@bors
Copy link
Contributor

bors commented Jan 31, 2018

⌛ Testing commit 2eb04352bf93e990e349e45fc26068c0bdcec3ca with merge 8077b54247313632e74573cbd0ff1ff630860fbe...

@bors
Copy link
Contributor

bors commented Jan 31, 2018

💔 Test failed - status-appveyor

@kennytm
Copy link
Member Author

kennytm commented Jan 31, 2018

Hmm what? dist x86_64-pc-windows-msvc failed. I guess #47893 is responsible.

C:\projects\rust\build\tmp\dist\exe\StdGroup.wxs(10) : error LGHT0204 : ICE30: The target file 'uhhlm_qu.dll|rustc_trans-emscripten.dll' is installed in '[ProgramFiles64Folder]\Rust\lib\rustlib\x86_64-pc-windows-msvc\codegen-backends\' by two different components on an LFN system: 'cmpFFDB7B5AC07F21031D8C07488402ED89' and 'cmp7302F887E802D31A39328313834D30FC'. This breaks component reference counting.
C:\projects\rust\build\tmp\dist\exe\RustcGroup.wxs(131) : error LGHT0204 : ICE30: The target file 'uhhlm_qu.dll|rustc_trans-emscripten.dll' is installed in '[ProgramFiles64Folder]\Rust\lib\rustlib\x86_64-pc-windows-msvc\codegen-backends\' by two different components on an LFN system: 'cmpFFDB7B5AC07F21031D8C07488402ED89' and 'cmp7302F887E802D31A39328313834D30FC'. This breaks component reference counting.
C:\projects\rust\build\tmp\dist\exe\StdGroup.wxs(13) : error LGHT0204 : ICE30: The target file 'sndd9otd.dll|rustc_trans-llvm.dll' is installed in '[ProgramFiles64Folder]\Rust\lib\rustlib\x86_64-pc-windows-msvc\codegen-backends\' by two different components on an LFN system: 'cmpACAD1E9248A80DB0D61999347793BE25' and 'cmp4E1ED49F110474C56F3DF22F4B64AB89'. This breaks component reference counting.
C:\projects\rust\build\tmp\dist\exe\RustcGroup.wxs(134) : error LGHT0204 : ICE30: The target file 'sndd9otd.dll|rustc_trans-llvm.dll' is installed in '[ProgramFiles64Folder]\Rust\lib\rustlib\x86_64-pc-windows-msvc\codegen-backends\' by two different components on an LFN system: 'cmpACAD1E9248A80DB0D61999347793BE25' and 'cmp4E1ED49F110474C56F3DF22F4B64AB89'. This breaks component reference counting.
C:\projects\rust\build\tmp\dist\exe\DocsGroup.wxs(686) : warning LGHT1076 : ICE60: The file fil226E8B8CBF0DA974B254794A2434D350 is not a Font, and its version is not a companion file reference. It should have a language specified in the Language column.
C:\projects\rust\build\tmp\dist\exe\DocsGroup.wxs(689) : warning LGHT1076 : ICE60: The file filC8EDDF8BBCDDCB1566ECA98618B8A9A9 is not a Font, and its version is not a companion file reference. It should have a language specified in the Language column.
C:\projects\rust\build\tmp\dist\exe\DocsGroup.wxs(838) : warning LGHT1076 : ICE60: The file filC8D08EAE1AB96E61AA9FF40FD50497D7 is not a Font, and its version is not a companion file reference. It should have a language specified in the Language column.
C:\projects\rust\build\tmp\dist\exe\DocsGroup.wxs(841) : warning LGHT1076 : ICE60: The file fil419C9D8E8AC892A6F68D0CB20928632A is not a Font, and its version is not a companion file reference. It should have a language specified in the Language column.
C:\projects\rust\build\tmp\dist\exe\DocsGroup.wxs(915) : warning LGHT1076 : ICE60: The file fil6481BD8CC4D103A2BDAA882EA1F5300D is not a Font, and its version is not a companion file reference. It should have a language specified in the Language column.
C:\projects\rust\build\tmp\dist\exe\DocsGroup.wxs(918) : warning LGHT1076 : ICE60: The file fil584BB8753856CFE325700E03AA8FEDE9 is not a Font, and its version is not a companion file reference. It should have a language specified in the Language column.
C:\projects\rust\build\tmp\dist\exe\DocsGroup.wxs(3290) : warning LGHT1076 : ICE60: The file fil9312029DB39C049F45E0FEDEA6D1D7BD is not a Font, and its version is not a companion file reference. It should have a language specified in the Language column.
C:\projects\rust\build\tmp\dist\exe\DocsGroup.wxs(3293) : warning LGHT1076 : ICE60: The file fil1E0F5048A20F94A89DB672BCE13B811B is not a Font, and its version is not a companion file reference. It should have a language specified in the Language column.
C:\projects\rust\build\tmp\dist\exe\DocsGroup.wxs(3456) : warning LGHT1076 : ICE60: The file fil409B9064BB26F3A3FDB3DA9744F17EAD is not a Font, and its version is not a companion file reference. It should have a language specified in the Language column.
C:\projects\rust\build\tmp\dist\exe\DocsGroup.wxs(3459) : warning LGHT1076 : ICE60: The file filEEA069C3F84AF806770B1E6899E5F9B6 is not a Font, and its version is not a companion file reference. It should have a language specified in the Language column.
C:\projects\rust\build\tmp\dist\exe\DocsGroup.wxs(3849) : warning LGHT1076 : ICE60: The file fil0068B26876A44E997E9DF9810FA092B6 is not a Font, and its version is not a companion file reference. It should have a language specified in the Language column.
C:\projects\rust\build\tmp\dist\exe\DocsGroup.wxs(3852) : warning LGHT1076 : ICE60: The file fil45B8857D7B1CE4EED9B410878E085073 is not a Font, and its version is not a companion file reference. It should have a language specified in the Language column.
C:\projects\rust\build\tmp\dist\exe\DocsGroup.wxs(3887) : warning LGHT1076 : ICE60: The file filB57A50D769B0B33A48EE3EDE513FCECA is not a Font, and its version is not a companion file reference. It should have a language specified in the Language column.
C:\projects\rust\build\tmp\dist\exe\DocsGroup.wxs(3890) : warning LGHT1076 : ICE60: The file fil3AA1A4647885FE46F12C6EECDDA39E00 is not a Font, and its version is not a companion file reference. It should have a language specified in the Language column.
C:\projects\rust\build\tmp\dist\exe\DocsGroup.wxs(7984) : warning LGHT1076 : ICE60: The file fil3777BACD6096F2EF6B8685026785C5DE is not a Font, and its version is not a companion file reference. It should have a language specified in the Language column.
C:\projects\rust\build\tmp\dist\exe\DocsGroup.wxs(7987) : warning LGHT1076 : ICE60: The file filC499383B93441B5F5DE551472954AADD is not a Font, and its version is not a companion file reference. It should have a language specified in the Language column.
C:\projects\rust\build\tmp\dist\rust.wxs(144) : warning LGHT1076 : ICE61: This product should remove only older versions of itself. The Maximum version is not less than the current product. (1.25.65535 1.25.0.0)
command did not execute successfully: "C:\\Program Files (x86)\\WiX Toolset v3.11\\bin/light.exe" "-nologo" "-ext" "WixUIExtension" "-ext" "WixUtilExtension" "-out" "C:\\projects\\rust\\build\\tmp/dist\\exe\\rust-nightly-x86_64-pc-windows-msvc.msi" "rust.wixobj" "ui.wixobj" "rustwelcomedlg.wixobj" "RustcGroup.wixobj" "DocsGroup.wixobj" "CargoGroup.wixobj" "StdGroup.wixobj" "AnalysisGroup.wixobj" "RlsGroup.wixobj" "-sice:ICE57"
expected success, got: exit code: 204

@kennytm
Copy link
Member Author

kennytm commented Jan 31, 2018

@bors r+

Added #47795, removed #47893.

@bors
Copy link
Contributor

bors commented Jan 31, 2018

📌 Commit 64fc9d2 has been approved by kennytm

@bors
Copy link
Contributor

bors commented Jan 31, 2018

⌛ Testing commit 64fc9d2 with merge dc136553be02e5f20643e9239c2ef98fef252273...

@bors
Copy link
Contributor

bors commented Jan 31, 2018

💔 Test failed - status-appveyor

Right now this directory is located under:

  $sysroot/lib/rustlib/$target/lib/codegen-backends

but after seeing what we do in a few other places it seems that a more
appropriate location would be:

  $sysroot/lib/rustlib/$target/codegen-backends

so this commit moves it!
@kennytm
Copy link
Member Author

kennytm commented Jan 31, 2018

🤔 I don't see why there would be many timed out jobs. Assuming spurious.

…source-line, r=estebank

Avoid underflow in render_source_line

While testing rust-lang#47655 I was able to make the compiler panic when it's compiled with debug assertions:

```shell
> rustc /dev/null --crate-type proc-macro

error: internal compiler error: unexpected panic

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports

note: rustc 1.25.0-dev running on x86_64-apple-darwin

note: run with `RUST_BACKTRACE=1` for a backtrace

thread 'rustc' panicked at 'attempt to subtract with overflow', librustc_errors/emitter.rs:287:49
```

Without debug assertions the following warning is emitted:

```shell
> rustc /dev/null --crate-type proc-macro

warning: unused variable: `registrar`
 --> /dev/null:0:1
  |
  |
  = note: #[warn(unused_variables)] on by default
  = note: to avoid this warning, consider using `_registrar` instead
```

The panic is due to the unused variable warning being spanned to `/dev/null:0:1`. When `render_source_line` subtracts 1 from the line number to look up the source line it panics due to underflow. Without debug assertions this would wrap and cause us to return a blank string instead.

Fix by explicitly testing for 0 and exiting early. I'm unsure how to automatically test this now that rust-lang#46655 has been approved.
… r=alexcrichton

rustc: Move location of `codegen-backends` dir

Right now this directory is located under:

```
$sysroot/lib/rustlib/$target/lib/codegen-backends
```

but after seeing what we do in a few other places it seems that a more
appropriate location would be:

```
$sysroot/lib/rustlib/$target/codegen-backends
```

so this commit moves it!
@kennytm kennytm changed the title Rollup of 12 pull requests Rollup of 14 pull requests Jan 31, 2018
Fix ICE when reading non-UTF-8 input from stdin

Fixes rust-lang#22387.
Specialize StepBy::nth

This allows optimizations of implementations of the inner iterator's `.nth` method.
@kennytm kennytm changed the title Rollup of 14 pull requests Rollup of 16 pull requests Jan 31, 2018
@kennytm
Copy link
Member Author

kennytm commented Jan 31, 2018

@bors r+

Added #47677, #47893, #47895, #47552.

@bors
Copy link
Contributor

bors commented Jan 31, 2018

📌 Commit af95302 has been approved by kennytm

@bors
Copy link
Contributor

bors commented Jan 31, 2018

⌛ Testing commit af95302 with merge 8ccab7e...

bors added a commit that referenced this pull request Jan 31, 2018
Rollup of 16 pull requests

- Successful merges: #47838, #47840, #47844, #47874, #47875, #47876, #47884, #47886, #47889, #47890, #47891, #47795, #47677, #47893, #47895, #47552
- Failed merges:
@bors
Copy link
Contributor

bors commented Jan 31, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: kennytm
Pushing 8ccab7e to master...

@bors bors merged commit af95302 into rust-lang:master Jan 31, 2018
@Centril Centril added the rollup A PR which is a rollup label Oct 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rollup A PR which is a rollup S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.