Commit Graph

15 Commits

Author SHA1 Message Date
Sergio Benitez
7a7cd83783 Use proper span in responder codegen output. 2020-02-27 16:14:23 -08:00
Jeb Rosen
b29b2db35e Adjust '#[catch]' codegen output to fix a UI test regression in latest nightly. 2020-02-27 16:03:54 -08:00
Sergio Benitez
3a8e23f7f2 Make references to core types absolute in codegen.
Prior to this commit, codegen emitted tokens containing bare types like
'Result' and 'Box' as well as presumed imported variants such as 'None'
and 'Ok'.  However, users are free to shadow these, and if they do, the
generated code will fail to compile, or worse, be incorrect. To avoid
this, this commit makes all references to these core types and imports
absolute.
2020-02-27 16:00:57 -08:00
Sergio Benitez
fe4ac8e74d Hide generated macro docs. 2020-02-09 01:53:09 -08:00
Jeb Rosen
b7afade412 Allow 'non_snake_case' for generated query params.
Also adds '#[deny(non_snake_case)]' to the complete route generation
test for regressions.

Fixes #1003.
2019-06-28 12:20:13 -07:00
Oliver Scherer
c86f4312fb Always produce a valid, if conservative, subspan. 2019-02-08 18:03:53 -08:00
Sergio Benitez
ca5623c641 Type encoding to fix encoding issues once and for all.
Fixes #849.
2018-12-12 17:38:36 -08:00
Sergio Benitez
ac823861c8 Systematically name and span codegen variables.
Fixes #839.
2018-11-30 08:43:31 -08:00
Sergio Benitez
b7db74144f Parameterize 'UriDisplay' with 'Path' or 'Query'.
This commit introduces the sealed `UriPart` marker trait as well as the
implementing `Path` and `Query` marker types, allowing for parts of a
URI to be distinguished at the type level. Consequently, `UriDisplay`
has been parameterized with `P: UriPart`, creating `UriDisplay<Path>`
and `UriDisplay<Query>`. The effect of this change is improved type
safely for URI rendering as well as the ability to omit rendering values
in query parts via `Option` and `Result`.

The `UriDisplay` derive was replaced by `UriDisplayQuery` and
`UriDisplayPath` which derive implementations for `UriDisplay<Path>`
and `UriDisplay<Query>`, respectively.

This commit also works around a rustdoc visibility issue by creating a
hidden `http::private` module.

Finally, this commit also removes the now vestigial use of the
`rustc_private` feature in codegen.

Fixes #827.
2018-11-27 10:01:47 -06:00
Sergio Benitez
543b07a4ba Use upstream 'Literal::subspan()'. 2018-11-23 19:15:13 -06:00
Sergio Benitez
3b6c4d2a5f Prefix codegen imports to avoid name collisions.
Fixes #817.
2018-11-12 13:08:39 -08:00
jeb
328bf4b32e Support 'uri' macro in 2018 edition crates. 2018-10-30 02:44:22 -07:00
Sergio Benitez
4ef179cc59 Migrate from 'derive_utils' to published 'devise'.
Resolves #800.
2018-10-29 04:58:56 -07:00
Sergio Benitez
7090e2a1ee Use 'unreachable' to silence clippy on route codegen.
Closes #794.
2018-10-29 01:33:30 -07:00
Sergio Benitez
9ef0b731c8 Rename 'codegen_next' to 'codegen'. 2018-10-22 00:01:41 -07:00