stability lint: ignore code from macro expansion

This small patch causes the stability lint to bail out when traversing
any AST produced via a macro expansion. Ultimately, we would like to
lint the contents of the macro at the place where the macro is defined,
but regardless we should not be linting it at the use site.

Closes #15703
btree: use pattern matching instead of unwrap
syntax: Add ToTokens for Option<T>
syntax: Add ToTokens for Attribute_
syntax: Generalize ToTokens impl for Vec<T>

It will now `flat_map` over the elements of a `Vec<T>` if
`T: ToTokens`
Disallow importing from types when reexport is involved
syntax: Add quote_method!
lint: add method to get level of a specific lint.

This allows lint traversals to emit more information (when a lint is
non-allow), or avoid doing expensive computations (when a lint is
allow).
syntax: Add ToTokens impl for Method
auto merge of #15726 : aturon/rust/macro-stability, r=alexcrichton

This small patch causes the stability lint to bail out when traversing
any AST produced via a macro expansion. Ultimately, we would like to
lint the contents of the macro at the place where the macro is defined,
but regardless we should not be linting it at the use site.

Closes #15703
auto merge of #15727 : fhahn/rust/remove-some-unwraps, r=alexcrichton

When looking through the `btree` code, I stumbled over a couple of `unwraps` that could be avoided.
auto merge of #15732 : bgamari/rust/to-tokens, r=alexcrichton

Here I add a `ToTokens` impl for `Attribute_` and `Option<T>`, as well as generalize the impl for `Vec<T>`
auto merge of #15733 : sanxiyn/rust/use-from-type, r=alexcrichton

Importing from types was disallowed in #6462. Flag was set for paths whether it is a module or a type. Type flag was set when impl was seen. The problem is, for cross-crate situations, when reexport is involved, it is possible that impl is seen too late because metadata is loaded lazily.

Fix #15664.
auto merge of #15737 : huonw/rust/lint-level-here, r=pnkfelix

This allows lint traversals to emit more information (when a lint is
non-allow), or avoid doing expensive computations (when a lint is
allow).
Add support for patterns referencing non-trivial statics

This is accomplished by rewriting static expressions into equivalent patterns.
This way, patterns referencing static variables can both participate
in exhaustiveness analysis as well as be compiled down into the appropriate
branch of the decision trees that match expressions are codegened to.

Fixes #6533.
Fixes #13626.
Fixes #13731.
Fixes #14576.
Fixes #15393.