Auto merge of #51426 - kennytm:rollup, r=kennytm
Rollup of 9 pull requests Successful merges: - #51186 (Remove two redundant .nll.stderr files) - #51283 (Deny #[cfg] and #[cfg_attr] on generic parameters.) - #51368 (Fix the use of closures within #[panic_implementation]) - #51380 (Remove dependency on fmt_macros from typeck) - #51389 (rustdoc: Fix missing stability and src links for inlined external macros) - #51399 (NLL performance boost) - #51407 (Update RLS and Rustfmt) - #51417 (Revert #49719) - #51420 (Tries to address the recent network issues) Failed merges:
This commit is contained in:
commit
1b4c921103
@ -301,7 +301,6 @@ before_deploy:
|
||||
rm -rf obj/build/dist/doc &&
|
||||
cp -r obj/build/dist/* deploy/$TRAVIS_COMMIT;
|
||||
fi
|
||||
- travis_retry gem update --system
|
||||
- ls -la deploy/$TRAVIS_COMMIT
|
||||
|
||||
deploy:
|
||||
|
203
src/Cargo.lock
203
src/Cargo.lock
@ -1688,6 +1688,7 @@ dependencies = [
|
||||
"clippy_lints 0.0.205 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"env_logger 0.5.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"failure 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"itertools 0.7.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"json 0.11.13 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"jsonrpc-core 8.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"languageserver-types 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@ -1699,10 +1700,10 @@ dependencies = [
|
||||
"rls-analysis 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rls-blacklist 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rls-data 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rls-rustc 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rls-rustc 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rls-span 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rls-vfs 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rustfmt-nightly 0.8.2",
|
||||
"rustfmt-nightly 0.8.2 (git+https://github.com/rust-lang-nursery/rustfmt?rev=f3906267)",
|
||||
"serde 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde_derive 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde_json 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@ -1741,7 +1742,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "rls-rustc"
|
||||
version = "0.3.0"
|
||||
version = "0.4.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
@ -1804,15 +1805,32 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "rustc-ap-arena"
|
||||
version = "147.0.0"
|
||||
version = "149.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"rustc-ap-rustc_data_structures 147.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rustc-ap-rustc_data_structures 149.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rustc-ap-arena"
|
||||
version = "156.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"rustc-ap-rustc_data_structures 156.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rustc-ap-rustc_cratesio_shim"
|
||||
version = "147.0.0"
|
||||
version = "149.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"bitflags 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rustc-ap-rustc_cratesio_shim"
|
||||
version = "156.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"bitflags 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@ -1821,7 +1839,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "rustc-ap-rustc_data_structures"
|
||||
version = "147.0.0"
|
||||
version = "149.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@ -1829,65 +1847,139 @@ dependencies = [
|
||||
"log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parking_lot 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parking_lot_core 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rustc-ap-rustc_cratesio_shim 147.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rustc-ap-serialize 147.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rustc-ap-rustc_cratesio_shim 149.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rustc-ap-serialize 149.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rustc-hash 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rustc-rayon 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"stable_deref_trait 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rustc-ap-rustc_data_structures"
|
||||
version = "156.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ena 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parking_lot 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parking_lot_core 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rustc-ap-rustc_cratesio_shim 156.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rustc-ap-serialize 156.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rustc-hash 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rustc-rayon 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rustc-rayon-core 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"stable_deref_trait 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rustc-ap-rustc_errors"
|
||||
version = "147.0.0"
|
||||
version = "149.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"atty 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rustc-ap-rustc_data_structures 147.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rustc-ap-serialize 147.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rustc-ap-syntax_pos 147.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rustc-ap-rustc_data_structures 149.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rustc-ap-serialize 149.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rustc-ap-syntax_pos 149.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"termcolor 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"unicode-width 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rustc-ap-rustc_errors"
|
||||
version = "156.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"atty 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rustc-ap-rustc_data_structures 156.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rustc-ap-serialize 156.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rustc-ap-syntax_pos 156.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"termcolor 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"unicode-width 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rustc-ap-rustc_target"
|
||||
version = "147.0.0"
|
||||
version = "149.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"bitflags 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rustc-ap-rustc_cratesio_shim 147.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rustc-ap-serialize 147.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rustc-ap-rustc_cratesio_shim 149.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rustc-ap-serialize 149.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rustc-ap-rustc_target"
|
||||
version = "156.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"bitflags 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rustc-ap-rustc_cratesio_shim 156.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rustc-ap-serialize 156.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rustc-ap-serialize"
|
||||
version = "147.0.0"
|
||||
version = "149.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "rustc-ap-serialize"
|
||||
version = "156.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "rustc-ap-syntax"
|
||||
version = "147.0.0"
|
||||
version = "149.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"bitflags 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rustc-ap-rustc_data_structures 147.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rustc-ap-rustc_errors 147.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rustc-ap-rustc_target 147.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rustc-ap-serialize 147.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rustc-ap-syntax_pos 147.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rustc-ap-rustc_data_structures 149.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rustc-ap-rustc_errors 149.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rustc-ap-rustc_target 149.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rustc-ap-serialize 149.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rustc-ap-syntax_pos 149.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"scoped-tls 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rustc-ap-syntax"
|
||||
version = "156.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"bitflags 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rustc-ap-rustc_data_structures 156.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rustc-ap-rustc_errors 156.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rustc-ap-rustc_target 156.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rustc-ap-serialize 156.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rustc-ap-syntax_pos 156.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"scoped-tls 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rustc-ap-syntax_pos"
|
||||
version = "147.0.0"
|
||||
version = "149.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"rustc-ap-arena 147.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rustc-ap-rustc_data_structures 147.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rustc-ap-serialize 147.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rustc-ap-arena 149.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rustc-ap-rustc_data_structures 149.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rustc-ap-serialize 149.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"scoped-tls 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"unicode-width 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rustc-ap-syntax_pos"
|
||||
version = "156.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"rustc-ap-arena 156.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rustc-ap-rustc_data_structures 156.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rustc-ap-serialize 156.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"scoped-tls 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"unicode-width 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
@ -2311,7 +2403,6 @@ name = "rustc_typeck"
|
||||
version = "0.0.0"
|
||||
dependencies = [
|
||||
"arena 0.0.0",
|
||||
"fmt_macros 0.0.0",
|
||||
"log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rustc 0.0.0",
|
||||
"rustc_data_structures 0.0.0",
|
||||
@ -2362,6 +2453,31 @@ dependencies = [
|
||||
"serde_json 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rustfmt-nightly"
|
||||
version = "0.8.2"
|
||||
source = "git+https://github.com/rust-lang-nursery/rustfmt?rev=f3906267#f390626778c1bbb13911556d585850eb2fa67923"
|
||||
dependencies = [
|
||||
"cargo_metadata 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"derive-new 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"diff 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"env_logger 0.5.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"failure 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"getopts 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"isatty 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"itertools 0.7.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"regex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rustc-ap-rustc_target 149.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rustc-ap-syntax 149.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde_derive 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde_json 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"term 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"toml 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"unicode-segmentation 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rustfmt-nightly"
|
||||
version = "0.8.2"
|
||||
@ -2378,8 +2494,8 @@ dependencies = [
|
||||
"lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"regex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rustc-ap-rustc_target 147.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rustc-ap-syntax 147.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rustc-ap-rustc_target 156.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rustc-ap-syntax 156.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde_derive 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde_json 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@ -3206,17 +3322,25 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
"checksum rls-analysis 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)" = "da9794cd1f80f2cb888c00641a32f9855d0226c954ee31cef145784914c7142e"
|
||||
"checksum rls-blacklist 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e4a9cc2545ccb7e05b355bfe047b8039a6ec12270d5f3c996b766b340a50f7d2"
|
||||
"checksum rls-data 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3dd20763e1c60ae8945384c8a8fa4ac44f8afa7b0a817511f5e8927e5d24f988"
|
||||
"checksum rls-rustc 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8ed5342b2bbbe8663c04600af506c8902b6b4d3e627b006eb1bd65aa14805f4d"
|
||||
"checksum rls-rustc 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2c8c09117ae2887baaa4b17fe1cb572f9b22e4d2c6a5cda04093d8b366b0be99"
|
||||
"checksum rls-span 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5d7c7046dc6a92f2ae02ed302746db4382e75131b9ce20ce967259f6b5867a6a"
|
||||
"checksum rls-vfs 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "be231e1e559c315bc60ced5ad2cc2d7a9c208ed7d4e2c126500149836fda19bb"
|
||||
"checksum rustc-ap-arena 147.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1304956fbbdd070e4478672d040f0453374604a12a0938aaba4b38a2bd124667"
|
||||
"checksum rustc-ap-rustc_cratesio_shim 147.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6d1dcd0fafa3c7875b76e33feaf69b332870180475ba3eb8dd003bcc2a2dc069"
|
||||
"checksum rustc-ap-rustc_data_structures 147.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "76c1a3fe4a0104b922ffc8080bd7c703dc20f2874b7c982638f6adb6c378b77a"
|
||||
"checksum rustc-ap-rustc_errors 147.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2812e295d2930bf3b3c22dbe8ef0bb8ae98a497ae6ad379d0709434387a9004b"
|
||||
"checksum rustc-ap-rustc_target 147.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5bd371121f16da666f6d6d5e6ff57cd972cc8206cc80377ba411b99607d49cbd"
|
||||
"checksum rustc-ap-serialize 147.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bde493c1c16d724e42536117c385b69f2eae9b2ec38bab841c45373bce4a9d8f"
|
||||
"checksum rustc-ap-syntax 147.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "402c1f402e6d47defcd884d3f715aaa8c6f2cbdd5f13cb06fea70486d512426b"
|
||||
"checksum rustc-ap-syntax_pos 147.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fb707a229093791dc3fc35aca61d9bf0e3708f23da4536683527857bc624b061"
|
||||
"checksum rustc-ap-arena 149.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e794b25832224eea9252ebfa9f94ab7070d0a60c977793112c611501cb56b48d"
|
||||
"checksum rustc-ap-arena 156.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "83e91a01cd6c5a9e4f68c2b5c81b62b172aa9e00fc2fec862c0899e3fac1fd32"
|
||||
"checksum rustc-ap-rustc_cratesio_shim 149.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a78241b2ecb82ebb9221b4b7d37c024ff1f2e43f1b099f38a997f030fc7894b0"
|
||||
"checksum rustc-ap-rustc_cratesio_shim 156.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1e8ea8fadc5d66c1527771816e83f7e7599543bd2e1583e279855370ab2f18e5"
|
||||
"checksum rustc-ap-rustc_data_structures 149.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5529c3927f32b0b56d1f6449a34f2218dc2160c6a6dde0cf47954d83a9a45764"
|
||||
"checksum rustc-ap-rustc_data_structures 156.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "742ba74bc7d0f3ded56148329650f137fa5b90f7f0ecc4b4952150f32c66b147"
|
||||
"checksum rustc-ap-rustc_errors 149.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fb1fef44a7d63f5d204c981adb26a14e85fe7ee5962050a4f664df6f425f9b48"
|
||||
"checksum rustc-ap-rustc_errors 156.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3714046c6f8c1c259822aefcca21b1862710a6cec24fd34c0796117f074c6769"
|
||||
"checksum rustc-ap-rustc_target 149.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a3939a9f7bf063536dd646894ca43b1378ec6a56ac5b2698cc6ba0b42bfadbdc"
|
||||
"checksum rustc-ap-rustc_target 156.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b982c4517c18080895b06149ce8aa8279fd013f629030bb7a179bfcff6d74ef2"
|
||||
"checksum rustc-ap-serialize 149.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "692169d0bac8a4547f9778039460799e162664477a1eaec15d31507705f8c736"
|
||||
"checksum rustc-ap-serialize 156.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "27c7700595bff1a64ddb6f593c69db3f6d66b76b059b26137236c7e21e36db70"
|
||||
"checksum rustc-ap-syntax 149.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "22e93ee3817b007d56b5c5b151e6cd7c7063455a1facaf9e0ca01f9d9365b716"
|
||||
"checksum rustc-ap-syntax 156.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e6482d98c8be57d3cfe55dab744dd1a87f8462dc2ea0a8a4960f7bb1565be049"
|
||||
"checksum rustc-ap-syntax_pos 149.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fe5d24a137d6e202cd6eb96cb74f8cb4a2b257c42b74dd624e136b4e19f0a47d"
|
||||
"checksum rustc-ap-syntax_pos 156.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "20af5e200b61a3e5ba4f58ed3cbd7593569faf8f0956d5233f4f27fee51b4c81"
|
||||
"checksum rustc-demangle 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "11fb43a206a04116ffd7cfcf9bcb941f8eb6cc7ff667272246b0a1c74259a3cb"
|
||||
"checksum rustc-hash 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7540fc8b0c49f096ee9c961cda096467dce8084bec6bdca2fc83895fd9b28cb8"
|
||||
"checksum rustc-rayon 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8c6d5a683c6ba4ed37959097e88d71c9e8e26659a3cb5be8b389078e7ad45306"
|
||||
@ -3224,6 +3348,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
"checksum rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)" = "dcf128d1287d2ea9d80910b5f1120d0b8eede3fbf1abe91c40d39ea7d51e6fda"
|
||||
"checksum rustc_version 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a54aa04a10c68c1c4eacb4337fd883b435997ede17a9385784b990777686b09a"
|
||||
"checksum rustfix 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9da3cf9b79dc889a2c9879643f26d7a53e37e9361c7566b7d2787d5ace0d8396"
|
||||
"checksum rustfmt-nightly 0.8.2 (git+https://github.com/rust-lang-nursery/rustfmt?rev=f3906267)" = "<none>"
|
||||
"checksum same-file 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "cfb6eded0b06a0b512c8ddbcf04089138c9b4362c2f696f3c3d76039d68f3637"
|
||||
"checksum schannel 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "85fd9df495640643ad2d00443b3d78aae69802ad488debab4f1dd52fc1806ade"
|
||||
"checksum scoped-tls 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8674d439c964889e2476f474a3bf198cc9e199e77499960893bac5de7e9218a4"
|
||||
|
@ -118,6 +118,10 @@ fi
|
||||
# goes ahead and sets it for all builders.
|
||||
args="$args --privileged"
|
||||
|
||||
if [ "$CI" != "" ]; then
|
||||
args="$args --dns 8.8.8.8 --dns 8.8.4.4 --dns 1.1.1.1 --dns 1.0.0.1"
|
||||
fi
|
||||
|
||||
exec docker \
|
||||
run \
|
||||
--volume "$root_dir:/checkout:ro" \
|
||||
|
@ -104,13 +104,15 @@ impl<'gen, 'typeck, 'flow, 'gcx, 'tcx> TypeLivenessGenerator<'gen, 'typeck, 'flo
|
||||
location, live_local
|
||||
);
|
||||
|
||||
self.flow_inits.each_state_bit(|mpi_init| {
|
||||
debug!(
|
||||
"add_liveness_constraints: location={:?} initialized={:?}",
|
||||
location,
|
||||
&self.flow_inits.operator().move_data().move_paths[mpi_init]
|
||||
);
|
||||
});
|
||||
if log_enabled!(::log::Level::Debug) {
|
||||
self.flow_inits.each_state_bit(|mpi_init| {
|
||||
debug!(
|
||||
"add_liveness_constraints: location={:?} initialized={:?}",
|
||||
location,
|
||||
&self.flow_inits.operator().move_data().move_paths[mpi_init]
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
let mpi = self.move_data.rev_lookup.find_local(live_local);
|
||||
if let Some(initialized_child) = self.flow_inits.has_any_child_of(mpi) {
|
||||
|
@ -13,7 +13,6 @@ test = false
|
||||
log = "0.4"
|
||||
syntax = { path = "../libsyntax" }
|
||||
arena = { path = "../libarena" }
|
||||
fmt_macros = { path = "../libfmt_macros" }
|
||||
rustc = { path = "../librustc" }
|
||||
rustc_data_structures = { path = "../librustc_data_structures" }
|
||||
rustc_platform_intrinsics = { path = "../librustc_platform_intrinsics" }
|
||||
|
@ -1131,7 +1131,7 @@ fn check_fn<'a, 'gcx, 'tcx>(inherited: &'a Inherited<'a, 'gcx, 'tcx>,
|
||||
|
||||
// Check that a function marked as `#[panic_implementation]` has signature `fn(&PanicInfo) -> !`
|
||||
if let Some(panic_impl_did) = fcx.tcx.lang_items().panic_impl() {
|
||||
if panic_impl_did == fn_hir_id.owner_def_id() {
|
||||
if panic_impl_did == fcx.tcx.hir.local_def_id(fn_id) {
|
||||
if let Some(panic_info_did) = fcx.tcx.lang_items().panic_info() {
|
||||
if declared_ret_ty.sty != ty::TyNever {
|
||||
fcx.tcx.sess.span_err(
|
||||
|
@ -244,10 +244,10 @@ impl<'a, 'tcx, 'rcx> RustdocVisitor<'a, 'tcx, 'rcx> {
|
||||
def_id,
|
||||
attrs: def.attrs.clone().into(),
|
||||
name: def.ident.name,
|
||||
whence: def.span,
|
||||
whence: self.cx.tcx.def_span(def_id),
|
||||
matchers,
|
||||
stab: self.stability(def.id),
|
||||
depr: self.deprecation(def.id),
|
||||
stab: self.cx.tcx.lookup_stability(def_id).cloned(),
|
||||
depr: self.cx.tcx.lookup_deprecation(def_id),
|
||||
imported_from: Some(imported_from),
|
||||
})
|
||||
}
|
||||
|
@ -17,7 +17,7 @@ pub use self::IntType::*;
|
||||
use ast;
|
||||
use ast::{AttrId, Attribute, Name, Ident, Path, PathSegment};
|
||||
use ast::{MetaItem, MetaItemKind, NestedMetaItem, NestedMetaItemKind};
|
||||
use ast::{Lit, LitKind, Expr, ExprKind, Item, Local, Stmt, StmtKind};
|
||||
use ast::{Lit, LitKind, Expr, ExprKind, Item, Local, Stmt, StmtKind, GenericParam};
|
||||
use codemap::{BytePos, Spanned, respan, dummy_spanned};
|
||||
use syntax_pos::Span;
|
||||
use errors::{Applicability, Handler};
|
||||
@ -1444,6 +1444,22 @@ impl HasAttrs for Stmt {
|
||||
}
|
||||
}
|
||||
|
||||
impl HasAttrs for GenericParam {
|
||||
fn attrs(&self) -> &[ast::Attribute] {
|
||||
match self {
|
||||
GenericParam::Lifetime(lifetime) => lifetime.attrs(),
|
||||
GenericParam::Type(ty) => ty.attrs(),
|
||||
}
|
||||
}
|
||||
|
||||
fn map_attrs<F: FnOnce(Vec<Attribute>) -> Vec<Attribute>>(self, f: F) -> Self {
|
||||
match self {
|
||||
GenericParam::Lifetime(lifetime) => GenericParam::Lifetime(lifetime.map_attrs(f)),
|
||||
GenericParam::Type(ty) => GenericParam::Type(ty.map_attrs(f)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
macro_rules! derive_has_attrs {
|
||||
($($ty:path),*) => { $(
|
||||
impl HasAttrs for $ty {
|
||||
@ -1463,5 +1479,5 @@ macro_rules! derive_has_attrs {
|
||||
|
||||
derive_has_attrs! {
|
||||
Item, Expr, Local, ast::ForeignItem, ast::StructField, ast::ImplItem, ast::TraitItem, ast::Arm,
|
||||
ast::Field, ast::FieldPat, ast::Variant_
|
||||
ast::Field, ast::FieldPat, ast::Variant_, ast::LifetimeDef, ast::TyParam
|
||||
}
|
||||
|
@ -278,6 +278,22 @@ impl<'a> StripUnconfigured<'a> {
|
||||
pattern
|
||||
})
|
||||
}
|
||||
|
||||
// deny #[cfg] on generic parameters until we decide what to do with it.
|
||||
// see issue #51279.
|
||||
pub fn disallow_cfg_on_generic_param(&mut self, param: &ast::GenericParam) {
|
||||
for attr in param.attrs() {
|
||||
let offending_attr = if attr.check_name("cfg") {
|
||||
"cfg"
|
||||
} else if attr.check_name("cfg_attr") {
|
||||
"cfg_attr"
|
||||
} else {
|
||||
continue;
|
||||
};
|
||||
let msg = format!("#[{}] cannot be applied on a generic parameter", offending_attr);
|
||||
self.sess.span_diagnostic.span_err(attr.span, &msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> fold::Folder for StripUnconfigured<'a> {
|
||||
|
@ -1412,6 +1412,11 @@ impl<'a, 'b> Folder for InvocationCollector<'a, 'b> {
|
||||
}
|
||||
}
|
||||
|
||||
fn fold_generic_param(&mut self, param: ast::GenericParam) -> ast::GenericParam {
|
||||
self.cfg.disallow_cfg_on_generic_param(¶m);
|
||||
noop_fold_generic_param(param, self)
|
||||
}
|
||||
|
||||
fn fold_attribute(&mut self, at: ast::Attribute) -> Option<ast::Attribute> {
|
||||
// turn `#[doc(include="filename")]` attributes into `#[doc(include(file="filename",
|
||||
// contents="file contents")]` attributes
|
||||
|
@ -386,25 +386,71 @@ where
|
||||
{
|
||||
// We basically look at two token trees here, denoted as #1 and #2 below
|
||||
let span = match parse_kleene_op(input, span) {
|
||||
// #1 is any KleeneOp (`?`)
|
||||
Ok(Ok(op)) if op == KleeneOp::ZeroOrOne => {
|
||||
if !features.macro_at_most_once_rep
|
||||
&& !attr::contains_name(attrs, "allow_internal_unstable")
|
||||
{
|
||||
let explain = feature_gate::EXPLAIN_MACRO_AT_MOST_ONCE_REP;
|
||||
emit_feature_err(
|
||||
sess,
|
||||
"macro_at_most_once_rep",
|
||||
span,
|
||||
GateIssue::Language,
|
||||
explain,
|
||||
);
|
||||
}
|
||||
return (None, op);
|
||||
}
|
||||
// #1 is a `+` or `*` KleeneOp
|
||||
//
|
||||
// `?` is ambiguous: it could be a separator or a Kleene::ZeroOrOne, so we need to look
|
||||
// ahead one more token to be sure.
|
||||
Ok(Ok(op)) if op != KleeneOp::ZeroOrOne => return (None, op),
|
||||
|
||||
// #1 is any KleeneOp (`+`, `*`)
|
||||
Ok(Ok(op)) => return (None, op),
|
||||
// #1 is `?` token, but it could be a Kleene::ZeroOrOne without a separator or it could
|
||||
// be a `?` separator followed by any Kleene operator. We need to look ahead 1 token to
|
||||
// find out which.
|
||||
Ok(Ok(op)) => {
|
||||
assert_eq!(op, KleeneOp::ZeroOrOne);
|
||||
|
||||
// Lookahead at #2. If it is a KleenOp, then #1 is a separator.
|
||||
let is_1_sep = if let Some(&tokenstream::TokenTree::Token(_, ref tok2)) = input.peek() {
|
||||
kleene_op(tok2).is_some()
|
||||
} else {
|
||||
false
|
||||
};
|
||||
|
||||
if is_1_sep {
|
||||
// #1 is a separator and #2 should be a KleepeOp::*
|
||||
// (N.B. We need to advance the input iterator.)
|
||||
match parse_kleene_op(input, span) {
|
||||
// #2 is a KleeneOp (this is the only valid option) :)
|
||||
Ok(Ok(op)) if op == KleeneOp::ZeroOrOne => {
|
||||
if !features.macro_at_most_once_rep
|
||||
&& !attr::contains_name(attrs, "allow_internal_unstable")
|
||||
{
|
||||
let explain = feature_gate::EXPLAIN_MACRO_AT_MOST_ONCE_REP;
|
||||
emit_feature_err(
|
||||
sess,
|
||||
"macro_at_most_once_rep",
|
||||
span,
|
||||
GateIssue::Language,
|
||||
explain,
|
||||
);
|
||||
}
|
||||
return (Some(token::Question), op);
|
||||
}
|
||||
Ok(Ok(op)) => return (Some(token::Question), op),
|
||||
|
||||
// #2 is a random token (this is an error) :(
|
||||
Ok(Err((_, span))) => span,
|
||||
|
||||
// #2 is not even a token at all :(
|
||||
Err(span) => span,
|
||||
}
|
||||
} else {
|
||||
if !features.macro_at_most_once_rep
|
||||
&& !attr::contains_name(attrs, "allow_internal_unstable")
|
||||
{
|
||||
let explain = feature_gate::EXPLAIN_MACRO_AT_MOST_ONCE_REP;
|
||||
emit_feature_err(
|
||||
sess,
|
||||
"macro_at_most_once_rep",
|
||||
span,
|
||||
GateIssue::Language,
|
||||
explain,
|
||||
);
|
||||
}
|
||||
|
||||
// #2 is a random tree and #1 is KleeneOp::ZeroOrOne
|
||||
return (None, op);
|
||||
}
|
||||
}
|
||||
|
||||
// #1 is a separator followed by #2, a KleeneOp
|
||||
Ok(Err((tok, span))) => match parse_kleene_op(input, span) {
|
||||
@ -421,11 +467,8 @@ where
|
||||
GateIssue::Language,
|
||||
explain,
|
||||
);
|
||||
} else {
|
||||
sess.span_diagnostic
|
||||
.span_err(span, "`?` macro repetition does not allow a separator");
|
||||
}
|
||||
return (None, op);
|
||||
return (Some(tok), op);
|
||||
}
|
||||
Ok(Ok(op)) => return (Some(tok), op),
|
||||
|
||||
@ -440,7 +483,9 @@ where
|
||||
Err(span) => span,
|
||||
};
|
||||
|
||||
if !features.macro_at_most_once_rep && !attr::contains_name(attrs, "allow_internal_unstable") {
|
||||
if !features.macro_at_most_once_rep
|
||||
&& !attr::contains_name(attrs, "allow_internal_unstable")
|
||||
{
|
||||
sess.span_diagnostic
|
||||
.span_err(span, "expected one of: `*`, `+`, or `?`");
|
||||
} else {
|
||||
|
@ -605,7 +605,7 @@ declare_features! (
|
||||
// allow `'_` placeholder lifetimes
|
||||
(accepted, underscore_lifetimes, "1.26.0", Some(44524), None),
|
||||
// Allows attributes on lifetime/type formal parameters in generics (RFC 1327)
|
||||
(accepted, generic_param_attrs, "1.26.0", Some(48848), None),
|
||||
(accepted, generic_param_attrs, "1.27.0", Some(48848), None),
|
||||
// Allows cfg(target_feature = "...").
|
||||
(accepted, cfg_target_feature, "1.27.0", Some(29717), None),
|
||||
// Allows #[target_feature(...)]
|
||||
|
21
src/test/compile-fail/panic_implementation-closures.rs
Normal file
21
src/test/compile-fail/panic_implementation-closures.rs
Normal file
@ -0,0 +1,21 @@
|
||||
// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// compile-pass
|
||||
|
||||
#![crate_type = "rlib"]
|
||||
#![no_std]
|
||||
#![feature(panic_implementation)]
|
||||
|
||||
#[panic_implementation]
|
||||
pub fn panic_fmt(_: &::core::panic::PanicInfo) -> ! {
|
||||
|x: u8| x;
|
||||
loop {}
|
||||
}
|
@ -32,13 +32,25 @@ macro_rules! foo {
|
||||
} }
|
||||
}
|
||||
|
||||
macro_rules! baz {
|
||||
($($a:ident),? ; $num:expr) => { { // comma separator is meaningless for `?`
|
||||
let mut x = 0;
|
||||
|
||||
$(
|
||||
x += $a;
|
||||
)?
|
||||
|
||||
assert_eq!(x, $num);
|
||||
} }
|
||||
}
|
||||
|
||||
macro_rules! barplus {
|
||||
($($a:ident)?+ ; $num:expr) => { {
|
||||
let mut x = 0;
|
||||
|
||||
$(
|
||||
x += $a;
|
||||
)?
|
||||
)+
|
||||
|
||||
assert_eq!(x, $num);
|
||||
} }
|
||||
@ -50,7 +62,7 @@ macro_rules! barstar {
|
||||
|
||||
$(
|
||||
x += $a;
|
||||
)?
|
||||
)*
|
||||
|
||||
assert_eq!(x, $num);
|
||||
} }
|
||||
@ -62,10 +74,15 @@ pub fn main() {
|
||||
// accept 0 or 1 repetitions
|
||||
foo!( ; 0);
|
||||
foo!(a ; 1);
|
||||
baz!( ; 0);
|
||||
baz!(a ; 1);
|
||||
|
||||
// Make sure using ? as a separator works as before
|
||||
barplus!(+ ; 0);
|
||||
barplus!(a + ; 1);
|
||||
barstar!(* ; 0);
|
||||
barstar!(a * ; 1);
|
||||
barplus!(a ; 1);
|
||||
barplus!(a?a ; 2);
|
||||
barplus!(a?a?a ; 3);
|
||||
barstar!( ; 0);
|
||||
barstar!(a ; 1);
|
||||
barstar!(a?a ; 2);
|
||||
barstar!(a?a?a ; 3);
|
||||
}
|
||||
|
21
src/test/rustdoc/inline_cross/auxiliary/macros.rs
Normal file
21
src/test/rustdoc/inline_cross/auxiliary/macros.rs
Normal file
@ -0,0 +1,21 @@
|
||||
// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
#![feature(staged_api)]
|
||||
|
||||
#![stable(feature = "rust1", since = "1.0.0")]
|
||||
|
||||
/// docs for my_macro
|
||||
#[unstable(feature = "macro_test", issue = "0")]
|
||||
#[rustc_deprecated(since = "1.2.3", reason = "text")]
|
||||
#[macro_export]
|
||||
macro_rules! my_macro {
|
||||
() => ()
|
||||
}
|
28
src/test/rustdoc/inline_cross/macros.rs
Normal file
28
src/test/rustdoc/inline_cross/macros.rs
Normal file
@ -0,0 +1,28 @@
|
||||
// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// aux-build:macros.rs
|
||||
// build-aux-docs
|
||||
|
||||
#![feature(macro_test)]
|
||||
#![feature(use_extern_macros)]
|
||||
|
||||
#![crate_name = "foo"]
|
||||
|
||||
extern crate macros;
|
||||
|
||||
// @has foo/index.html '//*[@class="docblock-short"]' '[Deprecated] [Experimental]'
|
||||
|
||||
// @has foo/macro.my_macro.html
|
||||
// @has - '//*[@class="docblock"]' 'docs for my_macro'
|
||||
// @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.2.3: text'
|
||||
// @has - '//*[@class="stab unstable"]' 'macro_test'
|
||||
// @has - '//a/@href' '../src/macros/macros.rs.html#19-21'
|
||||
pub use macros::my_macro;
|
@ -1,11 +0,0 @@
|
||||
error[E0626]: borrow may still be in use when generator yields
|
||||
--> $DIR/pattern-borrow.rs:19:24
|
||||
|
|
||||
LL | if let Test::A(ref _a) = test { //~ ERROR borrow may still be in use when generator yields
|
||||
| ^^^^^^
|
||||
LL | yield ();
|
||||
| -------- possible yield occurs here
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0626`.
|
@ -1,34 +0,0 @@
|
||||
error[E0506]: cannot assign to `*y.pointer` because it is borrowed (Ast)
|
||||
--> $DIR/issue-45697.rs:30:9
|
||||
|
|
||||
LL | let z = copy_borrowed_ptr(&mut y);
|
||||
| - borrow of `*y.pointer` occurs here
|
||||
LL | *y.pointer += 1;
|
||||
| ^^^^^^^^^^^^^^^ assignment to borrowed `*y.pointer` occurs here
|
||||
|
||||
error[E0503]: cannot use `*y.pointer` because it was mutably borrowed (Mir)
|
||||
--> $DIR/issue-45697.rs:30:9
|
||||
|
|
||||
LL | let z = copy_borrowed_ptr(&mut y);
|
||||
| ------ borrow of `y` occurs here
|
||||
LL | *y.pointer += 1;
|
||||
| ^^^^^^^^^^^^^^^ use of borrowed `y`
|
||||
...
|
||||
LL | *z.pointer += 1;
|
||||
| --------------- borrow later used here
|
||||
|
||||
error[E0506]: cannot assign to `*y.pointer` because it is borrowed (Mir)
|
||||
--> $DIR/issue-45697.rs:30:9
|
||||
|
|
||||
LL | let z = copy_borrowed_ptr(&mut y);
|
||||
| ------ borrow of `*y.pointer` occurs here
|
||||
LL | *y.pointer += 1;
|
||||
| ^^^^^^^^^^^^^^^ assignment to borrowed `*y.pointer` occurs here
|
||||
...
|
||||
LL | *z.pointer += 1;
|
||||
| --------------- borrow later used here
|
||||
|
||||
error: aborting due to 3 previous errors
|
||||
|
||||
Some errors occurred: E0503, E0506.
|
||||
For more information about an error, try `rustc --explain E0503`.
|
34
src/test/ui/issue-51279.rs
Normal file
34
src/test/ui/issue-51279.rs
Normal file
@ -0,0 +1,34 @@
|
||||
// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
pub struct X<#[cfg(none)] 'a, #[cfg(none)] T>(&'a T);
|
||||
//~^ ERROR #[cfg] cannot be applied on a generic parameter
|
||||
//~^^ ERROR #[cfg] cannot be applied on a generic parameter
|
||||
|
||||
impl<#[cfg(none)] 'a, #[cfg(none)] T> X<'a, T> {}
|
||||
//~^ ERROR #[cfg] cannot be applied on a generic parameter
|
||||
//~^^ ERROR #[cfg] cannot be applied on a generic parameter
|
||||
|
||||
pub fn f<#[cfg(none)] 'a, #[cfg(none)] T>(_: &'a T) {}
|
||||
//~^ ERROR #[cfg] cannot be applied on a generic parameter
|
||||
//~^^ ERROR #[cfg] cannot be applied on a generic parameter
|
||||
|
||||
#[cfg(none)]
|
||||
pub struct Y<#[cfg(none)] T>(T); // shouldn't care when the entire item is stripped out
|
||||
|
||||
struct M<T>(*const T);
|
||||
|
||||
unsafe impl<#[cfg_attr(none, may_dangle)] T> Drop for M<T> {
|
||||
//~^ ERROR #[cfg_attr] cannot be applied on a generic parameter
|
||||
fn drop(&mut self) {}
|
||||
}
|
||||
|
||||
type Z<#[ignored] 'a, #[cfg(none)] T> = X<'a, T>;
|
||||
//~^ ERROR #[cfg] cannot be applied on a generic parameter
|
50
src/test/ui/issue-51279.stderr
Normal file
50
src/test/ui/issue-51279.stderr
Normal file
@ -0,0 +1,50 @@
|
||||
error: #[cfg] cannot be applied on a generic parameter
|
||||
--> $DIR/issue-51279.rs:11:14
|
||||
|
|
||||
LL | pub struct X<#[cfg(none)] 'a, #[cfg(none)] T>(&'a T);
|
||||
| ^^^^^^^^^^^^
|
||||
|
||||
error: #[cfg] cannot be applied on a generic parameter
|
||||
--> $DIR/issue-51279.rs:11:31
|
||||
|
|
||||
LL | pub struct X<#[cfg(none)] 'a, #[cfg(none)] T>(&'a T);
|
||||
| ^^^^^^^^^^^^
|
||||
|
||||
error: #[cfg] cannot be applied on a generic parameter
|
||||
--> $DIR/issue-51279.rs:15:6
|
||||
|
|
||||
LL | impl<#[cfg(none)] 'a, #[cfg(none)] T> X<'a, T> {}
|
||||
| ^^^^^^^^^^^^
|
||||
|
||||
error: #[cfg] cannot be applied on a generic parameter
|
||||
--> $DIR/issue-51279.rs:15:23
|
||||
|
|
||||
LL | impl<#[cfg(none)] 'a, #[cfg(none)] T> X<'a, T> {}
|
||||
| ^^^^^^^^^^^^
|
||||
|
||||
error: #[cfg] cannot be applied on a generic parameter
|
||||
--> $DIR/issue-51279.rs:19:10
|
||||
|
|
||||
LL | pub fn f<#[cfg(none)] 'a, #[cfg(none)] T>(_: &'a T) {}
|
||||
| ^^^^^^^^^^^^
|
||||
|
||||
error: #[cfg] cannot be applied on a generic parameter
|
||||
--> $DIR/issue-51279.rs:19:27
|
||||
|
|
||||
LL | pub fn f<#[cfg(none)] 'a, #[cfg(none)] T>(_: &'a T) {}
|
||||
| ^^^^^^^^^^^^
|
||||
|
||||
error: #[cfg_attr] cannot be applied on a generic parameter
|
||||
--> $DIR/issue-51279.rs:28:13
|
||||
|
|
||||
LL | unsafe impl<#[cfg_attr(none, may_dangle)] T> Drop for M<T> {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: #[cfg] cannot be applied on a generic parameter
|
||||
--> $DIR/issue-51279.rs:33:23
|
||||
|
|
||||
LL | type Z<#[ignored] 'a, #[cfg(none)] T> = X<'a, T>;
|
||||
| ^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to 8 previous errors
|
||||
|
@ -8,26 +8,30 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// Tests the behavior of various Kleene operators in macros with respect to `?` terminals. In
|
||||
// particular, `?` in the position of a separator and of a Kleene operator is tested.
|
||||
// The logic for parsing Kleene operators in macros has a special case to disambiguate `?`.
|
||||
// Specifically, `$(pat)?` is the ZeroOrOne operator whereas `$(pat)?+` or `$(pat)?*` are the
|
||||
// ZeroOrMore and OneOrMore operators using `?` as a separator. These tests are intended to
|
||||
// exercise that logic in the macro parser.
|
||||
//
|
||||
// Moreover, we also throw in some tests for using a separator with `?`, which is meaningless but
|
||||
// included for consistency with `+` and `*`.
|
||||
//
|
||||
// This test focuses on error cases.
|
||||
|
||||
#![feature(macro_at_most_once_rep)]
|
||||
|
||||
// should match `` and `a`
|
||||
macro_rules! foo {
|
||||
($(a)?) => {}
|
||||
}
|
||||
|
||||
macro_rules! baz {
|
||||
($(a),?) => {} //~ ERROR `?` macro repetition does not allow a separator
|
||||
($(a),?) => {} // comma separator is meaningless for `?`
|
||||
}
|
||||
|
||||
// should match `+` and `a+`
|
||||
macro_rules! barplus {
|
||||
($(a)?+) => {}
|
||||
}
|
||||
|
||||
// should match `*` and `a*`
|
||||
macro_rules! barstar {
|
||||
($(a)?*) => {}
|
||||
}
|
||||
@ -36,14 +40,14 @@ pub fn main() {
|
||||
foo!(a?a?a); //~ ERROR no rules expected the token `?`
|
||||
foo!(a?a); //~ ERROR no rules expected the token `?`
|
||||
foo!(a?); //~ ERROR no rules expected the token `?`
|
||||
baz!(a?a?a); //~ ERROR no rules expected the token `?`
|
||||
baz!(a?a); //~ ERROR no rules expected the token `?`
|
||||
baz!(a?); //~ ERROR no rules expected the token `?`
|
||||
baz!(a,); //~ ERROR unexpected end of macro invocation
|
||||
baz!(a?a?a,); //~ ERROR no rules expected the token `?`
|
||||
baz!(a?a,); //~ ERROR no rules expected the token `?`
|
||||
baz!(a?,); //~ ERROR no rules expected the token `?`
|
||||
barplus!(); //~ ERROR unexpected end of macro invocation
|
||||
barstar!(); //~ ERROR unexpected end of macro invocation
|
||||
barplus!(a?); //~ ERROR no rules expected the token `?`
|
||||
barplus!(a); //~ ERROR unexpected end of macro invocation
|
||||
barstar!(a?); //~ ERROR no rules expected the token `?`
|
||||
barstar!(a); //~ ERROR unexpected end of macro invocation
|
||||
barplus!(+); // ok
|
||||
barstar!(*); // ok
|
||||
barplus!(a+); // ok
|
||||
barstar!(a*); // ok
|
||||
barplus!(a?); //~ ERROR unexpected end of macro invocation
|
||||
barstar!(a?); //~ ERROR unexpected end of macro invocation
|
||||
}
|
||||
|
@ -1,62 +1,80 @@
|
||||
error: `?` macro repetition does not allow a separator
|
||||
--> $DIR/macro-at-most-once-rep-ambig.rs:22:10
|
||||
|
|
||||
LL | ($(a),?) => {} //~ ERROR `?` macro repetition does not allow a separator
|
||||
| ^
|
||||
|
||||
error: no rules expected the token `?`
|
||||
--> $DIR/macro-at-most-once-rep-ambig.rs:36:11
|
||||
--> $DIR/macro-at-most-once-rep-ambig.rs:40:11
|
||||
|
|
||||
LL | foo!(a?a?a); //~ ERROR no rules expected the token `?`
|
||||
| ^
|
||||
|
||||
error: no rules expected the token `?`
|
||||
--> $DIR/macro-at-most-once-rep-ambig.rs:37:11
|
||||
--> $DIR/macro-at-most-once-rep-ambig.rs:41:11
|
||||
|
|
||||
LL | foo!(a?a); //~ ERROR no rules expected the token `?`
|
||||
| ^
|
||||
|
||||
error: no rules expected the token `?`
|
||||
--> $DIR/macro-at-most-once-rep-ambig.rs:38:11
|
||||
--> $DIR/macro-at-most-once-rep-ambig.rs:42:11
|
||||
|
|
||||
LL | foo!(a?); //~ ERROR no rules expected the token `?`
|
||||
| ^
|
||||
|
||||
error: no rules expected the token `?`
|
||||
--> $DIR/macro-at-most-once-rep-ambig.rs:43:11
|
||||
|
|
||||
LL | baz!(a?a?a); //~ ERROR no rules expected the token `?`
|
||||
| ^
|
||||
|
||||
error: no rules expected the token `?`
|
||||
--> $DIR/macro-at-most-once-rep-ambig.rs:44:11
|
||||
|
|
||||
LL | baz!(a?a); //~ ERROR no rules expected the token `?`
|
||||
| ^
|
||||
|
||||
error: no rules expected the token `?`
|
||||
--> $DIR/macro-at-most-once-rep-ambig.rs:45:11
|
||||
|
|
||||
LL | baz!(a?); //~ ERROR no rules expected the token `?`
|
||||
| ^
|
||||
|
||||
error: unexpected end of macro invocation
|
||||
--> $DIR/macro-at-most-once-rep-ambig.rs:39:5
|
||||
--> $DIR/macro-at-most-once-rep-ambig.rs:46:11
|
||||
|
|
||||
LL | baz!(a,); //~ ERROR unexpected end of macro invocation
|
||||
| ^
|
||||
|
||||
error: no rules expected the token `?`
|
||||
--> $DIR/macro-at-most-once-rep-ambig.rs:47:11
|
||||
|
|
||||
LL | baz!(a?a?a,); //~ ERROR no rules expected the token `?`
|
||||
| ^
|
||||
|
||||
error: no rules expected the token `?`
|
||||
--> $DIR/macro-at-most-once-rep-ambig.rs:48:11
|
||||
|
|
||||
LL | baz!(a?a,); //~ ERROR no rules expected the token `?`
|
||||
| ^
|
||||
|
||||
error: no rules expected the token `?`
|
||||
--> $DIR/macro-at-most-once-rep-ambig.rs:49:11
|
||||
|
|
||||
LL | baz!(a?,); //~ ERROR no rules expected the token `?`
|
||||
| ^
|
||||
|
||||
error: unexpected end of macro invocation
|
||||
--> $DIR/macro-at-most-once-rep-ambig.rs:50:5
|
||||
|
|
||||
LL | barplus!(); //~ ERROR unexpected end of macro invocation
|
||||
| ^^^^^^^^^^^
|
||||
|
||||
error: unexpected end of macro invocation
|
||||
--> $DIR/macro-at-most-once-rep-ambig.rs:40:5
|
||||
--> $DIR/macro-at-most-once-rep-ambig.rs:51:15
|
||||
|
|
||||
LL | barstar!(); //~ ERROR unexpected end of macro invocation
|
||||
| ^^^^^^^^^^^
|
||||
|
||||
error: no rules expected the token `?`
|
||||
--> $DIR/macro-at-most-once-rep-ambig.rs:41:15
|
||||
|
|
||||
LL | barplus!(a?); //~ ERROR no rules expected the token `?`
|
||||
LL | barplus!(a?); //~ ERROR unexpected end of macro invocation
|
||||
| ^
|
||||
|
||||
error: unexpected end of macro invocation
|
||||
--> $DIR/macro-at-most-once-rep-ambig.rs:42:14
|
||||
--> $DIR/macro-at-most-once-rep-ambig.rs:52:15
|
||||
|
|
||||
LL | barplus!(a); //~ ERROR unexpected end of macro invocation
|
||||
| ^
|
||||
|
||||
error: no rules expected the token `?`
|
||||
--> $DIR/macro-at-most-once-rep-ambig.rs:43:15
|
||||
|
|
||||
LL | barstar!(a?); //~ ERROR no rules expected the token `?`
|
||||
LL | barstar!(a?); //~ ERROR unexpected end of macro invocation
|
||||
| ^
|
||||
|
||||
error: unexpected end of macro invocation
|
||||
--> $DIR/macro-at-most-once-rep-ambig.rs:44:14
|
||||
|
|
||||
LL | barstar!(a); //~ ERROR unexpected end of macro invocation
|
||||
| ^
|
||||
|
||||
error: aborting due to 10 previous errors
|
||||
error: aborting due to 13 previous errors
|
||||
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit 453f5e4dec279167aed825b7ad043d06aa17c667
|
||||
Subproject commit 7d0bc550b0899a13a56c81eb2d5064abd0bcf385
|
@ -1 +1 @@
|
||||
Subproject commit 173ae0d7b92227c7fec4bce67c944dce953256dc
|
||||
Subproject commit 08da30d72c9abfff4d41f6f081e31fd2929b820d
|
Loading…
Reference in New Issue
Block a user