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

Validate rustc_layout_scalar_valid_range_{start,end} attributes #83054

Merged
merged 2 commits into from
Mar 15, 2021

Conversation

tmiasko
Copy link
Contributor

@tmiasko tmiasko commented Mar 12, 2021

Fixes #82251, fixes #82981.

@rust-highfive
Copy link
Collaborator

r? @davidtwco

(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 Mar 12, 2021
@davidtwco
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Mar 14, 2021

📌 Commit 4943190 has been approved by davidtwco

@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 Mar 14, 2021
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Mar 14, 2021
…ange, r=davidtwco

Validate rustc_layout_scalar_valid_range_{start,end} attributes

Fixes rust-lang#82251, rust-lang#82981.
@bors
Copy link
Contributor

bors commented Mar 14, 2021

⌛ Testing commit 4943190 with merge e5ecd3cecf528276fc85b8a9920861154f4e8643...

@rust-log-analyzer
Copy link
Collaborator

The job x86_64-gnu-nopt failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
test [ui] ui/invalid/invalid-inline.rs ... ok
test [ui] ui/invalid/invalid-no-sanitize.rs ... ok
test [ui] ui/invalid/invalid-plugin-attr.rs ... ok
test [ui] ui/invalid/invalid-rustc_legacy_const_generics-arguments.rs ... ok
test [ui] ui/invalid/invalid_rustc_layout_scalar_valid_range.rs ... ok
test [ui] ui/intrinsics/intrinsic-volatile.rs ... ok
test [ui] ui/invalid_crate_type_syntax.rs ... ok
test [ui] ui/invalid/invalid-path-in-const.rs ... ok
test [ui] ui/invalid_dispatch_from_dyn_impls.rs ... ok
---
test [ui (nll)] ui/invalid/invalid-rustc_args_required_const-arguments.rs ... ok
test [ui (nll)] ui/intrinsics/intrinsic-volatile.rs ... ok
test [ui (nll)] ui/invalid_crate_type_syntax.rs ... ok
test [ui (nll)] ui/invalid/invalid-rustc_legacy_const_generics-arguments.rs ... ok
test [ui (nll)] ui/invalid/invalid_rustc_layout_scalar_valid_range.rs ... ok
test [ui (nll)] ui/invalid_dispatch_from_dyn_impls.rs ... ok
test [ui (nll)] ui/intrinsics/intrinsics-math.rs ... ok
test [ui (nll)] ui/issues/issue-10291.rs ... ok
test [ui (nll)] ui/inherent-impls-overlap-check/overlap.rs ... ok
---

58 LL |             invalid_instruction
59    |             ^^^^^^^^^^^^^^^^^^^
60 
- error: invalid instruction mnemonic 'invalid_instruction'
-   --> $DIR/srcloc.rs:38:14
-    |
- LL |         asm!(concat!("invalid", "_", "instruction"));
-    |
- note: instantiated into assembly here
- note: instantiated into assembly here
-   --> <inline asm>:2:2
- LL |     invalid_instruction
-    |     ^^^^^^^^^^^^^^^^^^^
- 
- 
- warning: scale factor without index register is ignored
-   --> $DIR/srcloc.rs:41:15
-    |
- LL |         asm!("movaps %xmm3, (%esi, 2)", options(att_syntax));
-    |
- note: instantiated into assembly here
- note: instantiated into assembly here
-   --> <inline asm>:1:23
-    |
- LL |     movaps %xmm3, (%esi, 2)
- 
- 
- error: invalid instruction mnemonic 'invalid_instruction'
-   --> $DIR/srcloc.rs:45:14
- LL |             "invalid_instruction",
-    |              ^
-    |
- note: instantiated into assembly here
- note: instantiated into assembly here
-   --> <inline asm>:2:2
- LL |     invalid_instruction
-    |     ^^^^^^^^^^^^^^^^^^^
- 
- 
- error: invalid instruction mnemonic 'invalid_instruction'
-   --> $DIR/srcloc.rs:51:14
- LL |             "invalid_instruction",
-    |              ^
-    |
- note: instantiated into assembly here
- note: instantiated into assembly here
-   --> <inline asm>:3:1
- LL | invalid_instruction
-    | ^^^^^^^^^^^^^^^^^^^
- 
- 
- error: invalid instruction mnemonic 'invalid_instruction'
-   --> $DIR/srcloc.rs:58:14
- LL |             "invalid_instruction",
-    |              ^
-    |
- note: instantiated into assembly here
- note: instantiated into assembly here
-   --> <inline asm>:4:1
- LL | invalid_instruction
-    | ^^^^^^^^^^^^^^^^^^^
- 
- 
- error: invalid instruction mnemonic 'invalid_instruction'
-   --> $DIR/srcloc.rs:65:13
-    |
- LL |             concat!("invalid", "_", "instruction"),
-    |
- note: instantiated into assembly here
- note: instantiated into assembly here
-   --> <inline asm>:3:1
- LL | invalid_instruction
-    | ^^^^^^^^^^^^^^^^^^^
- 
- 
- error: invalid instruction mnemonic 'invalid_instruction'
-   --> $DIR/srcloc.rs:72:13
-    |
- LL |             concat!("invalid", "_", "instruction"),
-    |
- note: instantiated into assembly here
- note: instantiated into assembly here
-   --> <inline asm>:3:1
- LL | invalid_instruction
-    | ^^^^^^^^^^^^^^^^^^^
- 
- 
- error: invalid instruction mnemonic 'invalid_instruction1'
-   --> $DIR/srcloc.rs:79:14
- LL |             "invalid_instruction1",
-    |              ^
-    |
- note: instantiated into assembly here
- note: instantiated into assembly here
-   --> <inline asm>:2:2
- LL |     invalid_instruction1
-    |     ^^^^^^^^^^^^^^^^^^^^
- 
- 
- error: invalid instruction mnemonic 'invalid_instruction2'
-   --> $DIR/srcloc.rs:80:14
- LL |             "invalid_instruction2",
-    |              ^
-    |
- note: instantiated into assembly here
- note: instantiated into assembly here
-   --> <inline asm>:3:1
- LL | invalid_instruction2
-    | ^^^^^^^^^^^^^^^^^^^^
- 
- 
- error: invalid instruction mnemonic 'invalid_instruction1'
-   --> $DIR/srcloc.rs:86:13
- LL |             concat!(
-    |             ^
-    |
- note: instantiated into assembly here
- note: instantiated into assembly here
-   --> <inline asm>:2:2
- LL |     invalid_instruction1
-    |     ^^^^^^^^^^^^^^^^^^^^
- 
- 
- error: invalid instruction mnemonic 'invalid_instruction2'
-   --> $DIR/srcloc.rs:86:13
- LL |             concat!(
-    |             ^
-    |
- note: instantiated into assembly here
- note: instantiated into assembly here
-   --> <inline asm>:3:1
- LL | invalid_instruction2
-    | ^^^^^^^^^^^^^^^^^^^^
- 
- 
- error: invalid instruction mnemonic 'invalid_instruction1'
-   --> $DIR/srcloc.rs:95:13
- LL |             concat!(
-    |             ^
-    |
- note: instantiated into assembly here
- note: instantiated into assembly here
-   --> <inline asm>:2:2
- LL |     invalid_instruction1
-    |     ^^^^^^^^^^^^^^^^^^^^
- 
- 
- error: invalid instruction mnemonic 'invalid_instruction2'
-   --> $DIR/srcloc.rs:95:13
- LL |             concat!(
-    |             ^
-    |
-    |
Some tests failed in compiletest suite=ui compare_mode=Nll mode=ui host=x86_64-unknown-linux-gnu target=x86_64-unknown-linux-gnu
- note: instantiated into assembly here
-   --> <inline asm>:3:1
- LL | invalid_instruction2
-    | ^^^^^^^^^^^^^^^^^^^^
- 
- 
- error: invalid instruction mnemonic 'invalid_instruction3'
-   --> $DIR/srcloc.rs:99:13
- LL |             concat!(
-    |             ^
-    |
- note: instantiated into assembly here
- note: instantiated into assembly here
-   --> <inline asm>:4:1
- LL | invalid_instruction3
-    | ^^^^^^^^^^^^^^^^^^^^
- 
- 
- error: invalid instruction mnemonic 'invalid_instruction4'
-   --> $DIR/srcloc.rs:99:13
- LL |             concat!(
-    |             ^
-    |
- note: instantiated into assembly here
- note: instantiated into assembly here
-   --> <inline asm>:5:1
- LL | invalid_instruction4
-    | ^^^^^^^^^^^^^^^^^^^^
- 
- 
- error: invalid instruction mnemonic 'invalid_instruction1'
-   --> $DIR/srcloc.rs:110:13
- LL |             concat!(
-    |             ^
-    |
- note: instantiated into assembly here
- note: instantiated into assembly here
-   --> <inline asm>:2:2
- LL |     invalid_instruction1
-    |     ^^^^^^^^^^^^^^^^^^^^
- 
- 
- error: invalid instruction mnemonic 'invalid_instruction2'
-   --> $DIR/srcloc.rs:110:13
- LL |             concat!(
-    |             ^
-    |
- note: instantiated into assembly here
- note: instantiated into assembly here
-   --> <inline asm>:3:1
- LL | invalid_instruction2
-    | ^^^^^^^^^^^^^^^^^^^^
- 
- 
- error: invalid instruction mnemonic 'invalid_instruction3'
-   --> $DIR/srcloc.rs:114:13
- LL |             concat!(
-    |             ^
-    |
- note: instantiated into assembly here
- note: instantiated into assembly here
-   --> <inline asm>:5:1
- LL | invalid_instruction3
-    | ^^^^^^^^^^^^^^^^^^^^
- 
- 
- error: invalid instruction mnemonic 'invalid_instruction4'
-   --> $DIR/srcloc.rs:114:13
- LL |             concat!(
-    |             ^
-    |
- note: instantiated into assembly here
- note: instantiated into assembly here
-   --> <inline asm>:6:1
- LL | invalid_instruction4
-    | ^^^^^^^^^^^^^^^^^^^^
- 
- error: aborting due to 23 previous errors; 1 warning emitted
- error: aborting due to 23 previous errors; 1 warning emitted
+ error: aborting due to 5 previous errors
290 
291 


The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/asm/srcloc.nll/srcloc.nll.stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args asm/srcloc.rs`
error: 1 errors occurred comparing output.
status: exit code: 1
status: exit code: 1
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/asm/srcloc.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zemit-future-incompat-report" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/asm/srcloc.nll" "-Zborrowck=mir" "-A" "unused" "-Crpath" "-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/asm/srcloc.nll/auxiliary"
------------------------------------------

------------------------------------------
stderr:
stderr:
------------------------------------------
error: invalid instruction mnemonic 'invalid_instruction'
   |
   |
LL |         asm!("invalid_instruction");
   |
note: instantiated into assembly here
note: instantiated into assembly here
  --> <inline asm>:2:2
LL |     invalid_instruction
   |     ^^^^^^^^^^^^^^^^^^^


error: invalid instruction mnemonic 'invalid_instruction'
   |
LL |             invalid_instruction
   |             ^
   |
   |
note: instantiated into assembly here
  --> <inline asm>:3:13
LL |             invalid_instruction
   |             ^^^^^^^^^^^^^^^^^^^


error: invalid instruction mnemonic 'invalid_instruction'
   |
LL |             invalid_instruction
   |             ^
   |
   |
note: instantiated into assembly here
  --> <inline asm>:3:13
LL |             invalid_instruction
   |             ^^^^^^^^^^^^^^^^^^^


error: invalid instruction mnemonic 'invalid_instruction'
   |
LL |             invalid_instruction
   |             ^
   |
   |
note: instantiated into assembly here
  --> <inline asm>:4:13
LL |             invalid_instruction
   |             ^^^^^^^^^^^^^^^^^^^


error: invalid instruction mnemonic 'invalid_instruction'
   |
LL |             invalid_instruction
   |             ^
   |
   |
note: instantiated into assembly here
  --> <inline asm>:4:13
LL |             invalid_instruction
   |             ^^^^^^^^^^^^^^^^^^^

error: aborting due to 5 previous errors
---
test result: FAILED. 11434 passed; 1 failed; 123 ignored; 0 measured; 0 filtered out; finished in 102.53s



command did not execute successfully: "/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" "--suite" "ui" "--mode" "ui" "--target" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/checkout/obj/build/x86_64-unknown-linux-gnu/llvm/build/bin/FileCheck" "--host-rustcflags" "-Crpath -Cdebuginfo=0 -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--target-rustcflags" "-Crpath -Cdebuginfo=0 -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--docck-python" "/usr/bin/python3" "--lldb-python" "/usr/bin/python3" "--gdb" "/usr/bin/gdb" "--llvm-version" "12.0.0-rust-1.52.0-nightly" "--llvm-components" "aarch64 aarch64asmparser aarch64codegen aarch64desc aarch64disassembler aarch64info aarch64utils aggressiveinstcombine all all-targets analysis arm armasmparser armcodegen armdesc armdisassembler arminfo armutils asmparser asmprinter avr avrasmparser avrcodegen avrdesc avrdisassembler avrinfo binaryformat bitreader bitstreamreader bitwriter cfguard codegen core coroutines coverage debuginfocodeview debuginfodwarf debuginfogsym debuginfomsf debuginfopdb demangle dlltooldriver dwarflinker engine executionengine extensions filecheck frontendopenacc frontendopenmp fuzzmutate globalisel hellonew hexagon hexagonasmparser hexagoncodegen hexagondesc hexagondisassembler hexagoninfo instcombine instrumentation interfacestub interpreter ipo irreader jitlink libdriver lineeditor linker lto mc mca mcdisassembler mcjit mcparser mips mipsasmparser mipscodegen mipsdesc mipsdisassembler mipsinfo mirparser msp430 msp430asmparser msp430codegen msp430desc msp430disassembler msp430info native nativecodegen nvptx nvptxcodegen nvptxdesc nvptxinfo objcarcopts object objectyaml option orcjit orcshared orctargetprocess passes powerpc powerpcasmparser powerpccodegen powerpcdesc powerpcdisassembler powerpcinfo profiledata remarks riscv riscvasmparser riscvcodegen riscvdesc riscvdisassembler riscvinfo runtimedyld scalaropts selectiondag sparc sparcasmparser sparccodegen sparcdesc sparcdisassembler sparcinfo support symbolize systemz systemzasmparser systemzcodegen systemzdesc systemzdisassembler systemzinfo tablegen target textapi transformutils vectorize webassembly webassemblyasmparser webassemblycodegen webassemblydesc webassemblydisassembler webassemblyinfo windowsmanifest x86 x86asmparser x86codegen x86desc x86disassembler x86info xray" "--cc" "" "--cxx" "" "--cflags" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always" "--compare-mode" "nll"


failed to run: /checkout/obj/build/bootstrap/debug/bootstrap --stage 2 test
Build completed unsuccessfully in 0:19:01

@bors
Copy link
Contributor

bors commented Mar 14, 2021

💔 Test failed - checks-actions

@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 Mar 14, 2021
@JohnTitor
Copy link
Member

The failure should be unrelated to this (cc #82886), @bors retry

@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 Mar 14, 2021
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Mar 15, 2021
…ange, r=davidtwco

Validate rustc_layout_scalar_valid_range_{start,end} attributes

Fixes rust-lang#82251, fixes rust-lang#82981.
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Mar 15, 2021
…ange, r=davidtwco

Validate rustc_layout_scalar_valid_range_{start,end} attributes

Fixes rust-lang#82251, fixes rust-lang#82981.
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Mar 15, 2021
…ange, r=davidtwco

Validate rustc_layout_scalar_valid_range_{start,end} attributes

Fixes rust-lang#82251, fixes rust-lang#82981.
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 15, 2021
Rollup of 10 pull requests

Successful merges:

 - rust-lang#82989 (Custom error on literal names from other languages)
 - rust-lang#83054 (Validate rustc_layout_scalar_valid_range_{start,end} attributes)
 - rust-lang#83098 (Find more invalid doc attributes)
 - rust-lang#83108 (Remove unused `opt_local_def_id_to_hir_id` function)
 - rust-lang#83110 (Fix typos in `library/core/src/ptr/mod.rs` and `library/std/src/sys_common/thread_local_dtor.rs`)
 - rust-lang#83113 (Minor refactoring in try_index_step)
 - rust-lang#83127 (Introduce `proc_macro_back_compat` lint, and emit for `time-macros-impl`)
 - rust-lang#83132 (Don't encode file information for span with a dummy location)
 - rust-lang#83141 (:arrow_up: rust-analyzer)
 - rust-lang#83144 (Introduce `rustc_interface::interface::Config::parse_sess_created` callback)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit b8622f2 into rust-lang:master Mar 15, 2021
@rustbot rustbot added this to the 1.52.0 milestone Mar 15, 2021
@tmiasko tmiasko deleted the rustc_layout_scalar_valid_range branch March 15, 2021 18:38
JohnTitor added a commit to JohnTitor/rust that referenced this pull request Mar 16, 2021
… r=oli-obk

Use delay_span_bug instead of panic in layout_scalar_valid_range

rust-lang#83054 introduced validation of scalar range attributes, but panicking
code that uses the attribute remained reachable. Use `delay_span_bug`
instead to avoid the ICE.

Fixes rust-lang#83180.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
7 participants